@izara_project/izara-market-library-service-schemas 1.0.83 → 1.0.85
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 +0 -1
- package/package.json +3 -4
- package/src/GenerateCodeLibs/index.js +3 -8
- package/src/GenerateCodeLibs/src/Consts.js +73 -75
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +341 -1918
- package/src/MainLibs/index.js +4 -10
- package/src/MainLibs/src/Consts.js +765 -312
- package/src/MainLibs/src/GenerateCodeUtils.js +25 -15
- package/src/MainLibs/src/Utils.js +16 -12
- package/src/SourceManager/index.js +3 -7
- package/src/SourceManager/src/CreateSource.js +113 -54
- package/src/SourceManager/src/Utils.js +26 -23
- package/src/reStructure/GenerateCode.js +47 -28
- package/src/reStructure/GenerateResources.js +11 -17
- package/src/reStructure/GenerateSchema.js +44 -30
- package/src/reStructure/GenerateTests.js +23 -24
- package/src/reStructure/IntTestConfig.js +3 -7
- package/src/reStructure/SchemaConfig.js +3 -7
- package/src/reStructure/TemplateConfig.js +11 -12
- package/src/reStructure/TemplateData/Auth/generateAuthYml/data.js +4 -10
- package/src/reStructure/TemplateData/Auth/generateTemplateData.js +6 -5
- package/src/reStructure/TemplateData/EndpointPerService/generateTemplateData.js +40 -30
- package/src/reStructure/TemplateData/EndpointPerService/handler/api/data.js +14 -15
- package/src/reStructure/TemplateData/EndpointPerService/handler/api/template.ejs +1 -1
- package/src/reStructure/TemplateData/EndpointPerService/handler/dsq/data.js +12 -12
- package/src/reStructure/TemplateData/EndpointPerService/handler/dsq/template.ejs +3 -3
- package/src/reStructure/TemplateData/EndpointPerService/handler/inv/data.js +21 -13
- package/src/reStructure/TemplateData/EndpointPerService/handler/inv/template.ejs +1 -1
- package/src/reStructure/TemplateData/EndpointPerService/handler/sqs/data.js +24 -16
- package/src/reStructure/TemplateData/EndpointPerService/handler/sqs/template.ejs +3 -3
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/backupTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/data.js +8 -12
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +17 -4
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/data.js +11 -15
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +3 -3
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/data.js +9 -13
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/template.ejs +3 -3
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/data.js +8 -12
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +19 -6
- package/src/reStructure/TemplateData/EndpointPerService/yaml/data.js +128 -79
- package/src/reStructure/TemplateData/IntTest/generateResources/generateResources.js +49 -36
- package/src/reStructure/TemplateData/IntTest/generateTests/events/data.js +50 -25
- package/src/reStructure/TemplateData/IntTest/generateTests/generateTemplate.js +21 -18
- package/src/reStructure/TemplateData/IntTest/generateTests/pathIntTest/data.js +20 -10
- package/src/reStructure/TemplateData/IntTest/generateTests/pathIntTest/template.ejs +4 -4
- package/src/reStructure/TemplateData/IntTest/generateTests/tests/data.js +66 -38
- package/src/reStructure/TemplateData/IntTest/libs/libs.js +1 -1
- package/src/reStructure/TemplateData/IntTest/upload/uploadIntTest.js +26 -23
- package/src/reStructure/TemplateData/externalService/functionNameConfig/data.js +41 -41
- package/src/reStructure/TemplateData/externalService/functionNameConfig/templateIntTesting.ejs +2 -2
- package/src/reStructure/TemplateData/externalService/generateTemplateData.js +27 -8
- package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +190 -75
- package/src/reStructure/TemplateData/externalService/lambdaRole/template.ejs +2 -2
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +111 -63
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/template.ejs +7 -3
- package/src/reStructure/TemplateData/findData/findDataYaml/data.js +51 -37
- package/src/reStructure/TemplateData/findData/generateTemplateData.js +16 -9
- package/src/reStructure/TemplateData/findData/handler/data.js +9 -15
- package/src/reStructure/TemplateData/findData/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/findData/mainFunction/data.js +99 -76
- package/src/reStructure/TemplateData/findData/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/functionYaml/data.js +22 -20
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/handler/data.js +19 -14
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/mainFunction/data.js +20 -18
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/queue/data.js +14 -15
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/data.js +24 -19
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/handler/data.js +17 -16
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/data.js +14 -13
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/queue/data.js +13 -20
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js +23 -28
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/data.js +18 -18
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/data.js +17 -16
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/data.js +21 -21
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/handler/data.js +18 -18
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/data.js +17 -16
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/data.js +16 -22
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/data.js +26 -21
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/handler/data.js +16 -14
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/data.js +18 -16
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/queue/data.js +11 -16
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/data.js +39 -25
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/data.js +16 -14
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/data.js +14 -13
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/data.js +17 -20
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/data.js +25 -23
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/data.js +15 -15
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/ProcessCsvtemplate.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/data.js +12 -12
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/queue/data.js +19 -26
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/S3/data.js +12 -15
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/data.js +11 -12
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/sns-out/data.js +12 -13
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +20 -24
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/data.js +10 -13
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/websocket/dynamoDb/ReservedTableData.js +25 -27
- package/src/reStructure/TemplateData/flowSchema/components/websocket/dynamoDb/WebSocketTaskData.js +25 -27
- package/src/reStructure/TemplateData/flowSchema/components/websocket/dynamoDb/userUploadRecords.js +19 -24
- package/src/reStructure/TemplateData/flowSchema/dynamoDb/data.js +43 -34
- package/src/reStructure/TemplateData/flowSchema/eventBridge/functionYaml/data.js +31 -24
- package/src/reStructure/TemplateData/flowSchema/eventBridge/handler/inv/data.js +27 -26
- package/src/reStructure/TemplateData/flowSchema/eventBridge/handler/inv/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/eventBridge/mainFunction/data.js +25 -24
- package/src/reStructure/TemplateData/flowSchema/eventBridge/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/functionYaml/data.js +22 -22
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/handler/data.js +16 -12
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/mainFunction/data.js +15 -14
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/functionYaml/data.js +42 -35
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/handler/data.js +14 -13
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +12 -20
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/data.js +14 -21
- package/src/reStructure/TemplateData/flowSchema/flowSchemaMainFunction/data.js +52 -22
- package/src/reStructure/TemplateData/flowSchema/flowSchemaMainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/data.js +25 -19
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/data.js +18 -17
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/data.js +17 -16
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +36 -26
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +17 -16
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +22 -29
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/data.js +15 -11
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data.js +14 -14
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +17 -20
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +16 -17
- package/src/reStructure/TemplateData/flowSchema/flowStep/functionYaml/data.js +53 -25
- package/src/reStructure/TemplateData/flowSchema/flowStep/handler/data.js +38 -21
- package/src/reStructure/TemplateData/flowSchema/flowStep/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowStep/mainFunction/data.js +34 -21
- package/src/reStructure/TemplateData/flowSchema/flowStep/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowStep/sns-in/data.js +24 -25
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +444 -143
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Api/functionYaml/data.js +14 -11
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Api/handler/data.js +15 -15
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Api/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Inv/functionYaml/data.js +15 -11
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Inv/handler/data.js +15 -15
- package/src/reStructure/TemplateData/flowSchema/lambdaSync/Inv/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/register/complete/functionYaml/data.js +34 -36
- package/src/reStructure/TemplateData/flowSchema/register/complete/handler/data.js +22 -26
- package/src/reStructure/TemplateData/flowSchema/register/complete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/register/complete/mainFunction/data.js +17 -17
- package/src/reStructure/TemplateData/flowSchema/register/complete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/register/dynamoDB/register.js +35 -32
- package/src/reStructure/TemplateData/flowSchema/register/sns-in/data.js +21 -20
- package/src/reStructure/TemplateData/flowSchema/register/subscriptionOutAll/data.js +21 -18
- package/src/reStructure/TemplateData/flowSchema/register/wbs/functionYaml/data.js +33 -39
- package/src/reStructure/TemplateData/flowSchema/register/wbs/handler/data.js +10 -12
- package/src/reStructure/TemplateData/flowSchema/register/wbs/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/register/wbs/mainFunction/data.js +9 -12
- package/src/reStructure/TemplateData/flowSchema/register/wbs/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/FunctionYaml/data.js +44 -26
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/Handler/data.js +18 -15
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/Handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/MainFunction/data.js +16 -14
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/MainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/sns/data.js +13 -17
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/functionYaml/data.js +40 -24
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/data.js +23 -18
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/mainFunction/data.js +22 -16
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/functionYaml/data.js +42 -26
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/data.js +18 -15
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/template.ejs +2 -1
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/mainFunction/data.js +17 -12
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/functionYaml/data.js +38 -25
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/data.js +23 -15
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/data.js +19 -18
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheQueue/data.js +24 -18
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/functionYaml/data.js +35 -29
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/handler/data.js +12 -16
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/mainFunction/data.js +9 -13
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/sqs/data.js +20 -30
- package/src/reStructure/TemplateData/generateRole/createSharedResource.js +193 -79
- package/src/reStructure/TemplateData/generateRole/data.js +26 -24
- package/src/reStructure/TemplateData/perActionComplete/create/handler/data.js +10 -18
- package/src/reStructure/TemplateData/perActionComplete/create/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/createObjectComplete_main.js +88 -64
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/data.js +10 -17
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionComplete/create/sns-in-sqs/data.js +11 -20
- package/src/reStructure/TemplateData/perActionComplete/create/sns-out/data.js +14 -19
- package/src/reStructure/TemplateData/perActionComplete/create/yaml/data.js +18 -24
- package/src/reStructure/TemplateData/perActionComplete/delete/handler/data.js +11 -20
- package/src/reStructure/TemplateData/perActionComplete/delete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/data.js +10 -17
- package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionComplete/delete/sns-in-sqs/data.js +11 -19
- package/src/reStructure/TemplateData/perActionComplete/delete/sns-out/data.js +14 -20
- package/src/reStructure/TemplateData/perActionComplete/delete/yaml/data.js +18 -24
- package/src/reStructure/TemplateData/perActionComplete/generateTemplateData.js +63 -56
- package/src/reStructure/TemplateData/perActionComplete/get/handler/data.js +11 -18
- package/src/reStructure/TemplateData/perActionComplete/get/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/data.js +11 -16
- package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionComplete/get/sns-in-sqs/data.js +11 -19
- package/src/reStructure/TemplateData/perActionComplete/get/sns-out/data.js +14 -18
- package/src/reStructure/TemplateData/perActionComplete/get/yaml/data.js +19 -25
- package/src/reStructure/TemplateData/perActionComplete/update/handler/data.js +11 -19
- package/src/reStructure/TemplateData/perActionComplete/update/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionComplete/update/mainFunction/data.js +10 -18
- package/src/reStructure/TemplateData/perActionComplete/update/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionComplete/update/sns-in-sqs/data.js +11 -20
- package/src/reStructure/TemplateData/perActionComplete/update/sns-out/data.js +14 -18
- package/src/reStructure/TemplateData/perActionComplete/update/yaml/data.js +19 -26
- package/src/reStructure/TemplateData/perActionEndpoint/generateTemplateData.js +34 -18
- package/src/reStructure/TemplateData/perActionEndpoint/handler/api/data.js +32 -16
- package/src/reStructure/TemplateData/perActionEndpoint/handler/api/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/handler/dsq/data.js +44 -21
- package/src/reStructure/TemplateData/perActionEndpoint/handler/dsq/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/handler/inv/data.js +42 -18
- package/src/reStructure/TemplateData/perActionEndpoint/handler/inv/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/handler/sqs/data.js +40 -18
- package/src/reStructure/TemplateData/perActionEndpoint/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocket/data.js +32 -13
- package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocket/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocketConnect/data.js +9 -10
- package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocketConnect/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/libs/data.js +13 -13
- package/src/reStructure/TemplateData/perActionEndpoint/libs/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/create/data.js +31 -14
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/create/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/delete/data.js +30 -13
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/delete/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/get/data.js +30 -14
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/update/data.js +33 -18
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/api/data.js +61 -38
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/dsq/data.js +72 -46
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/inv/data.js +56 -38
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/sqs/data.js +76 -48
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/wbs/data.js +53 -34
- package/src/reStructure/TemplateData/perActionEndpoint/yaml/webSocketConnect/data.js +9 -10
- package/src/reStructure/TemplateData/processLogical/generateTemplateData.js +10 -5
- package/src/reStructure/TemplateData/processLogical/handler/data.js +9 -15
- package/src/reStructure/TemplateData/processLogical/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/processLogical/mainFunction/data.js +5 -11
- package/src/reStructure/TemplateData/processLogical/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/processLogical/yaml/data.js +39 -31
- package/src/reStructure/TemplateData/processLogicalPagination/DsqYaml/data.js +6 -10
- package/src/reStructure/TemplateData/processLogicalPagination/generateTemplateData.js +15 -6
- package/src/reStructure/TemplateData/processLogicalPagination/handler/dsq/data.js +3 -7
- package/src/reStructure/TemplateData/processLogicalPagination/handler/dsq/template.ejs +1 -1
- package/src/reStructure/TemplateData/processLogicalPagination/handler/sqs/data.js +3 -7
- package/src/reStructure/TemplateData/processLogicalPagination/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/processLogicalPagination/mainFunction/data.js +4 -8
- package/src/reStructure/TemplateData/processLogicalPagination/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/dsq/data.js +40 -38
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/sqs/data.js +42 -35
- package/src/reStructure/TemplateData/propertyValueSchema/generateTemplateData.js +7 -7
- package/src/reStructure/TemplateData/propertyValueSchema/objectPropertyValueSchema/data.js +89 -49
- package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/data.js +65 -47
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/api/data.js +46 -26
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/data.js +57 -33
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/dsq/data.js +46 -25
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/inv/data.js +46 -26
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/sqs/data.js +47 -26
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/data.js +14 -12
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/data.js +17 -24
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/data.js +16 -14
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/data.js +15 -13
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/data.js +15 -13
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/apiTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/dsqTemplate.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/invTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/sqsTemplate.ejs +3 -4
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/data.js +8 -14
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/data.js +18 -27
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/functionYaml/data.js +20 -28
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/data.js +11 -17
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/data.js +10 -15
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/sns-in-sqs/data.js +11 -16
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/sns-out/data.js +10 -15
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/api/data.js +61 -30
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/data.js +77 -38
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +61 -29
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +61 -31
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +62 -30
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/api/data.js +14 -12
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/api/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/data.js +17 -24
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/dsq/data.js +16 -14
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/dsq/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/inv/data.js +15 -13
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/inv/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/sqs/data.js +15 -13
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/apiTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/invTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/data.js +10 -16
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/sns-in-sqs/data.js +18 -27
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js +21 -26
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/data.js +8 -10
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/data.js +7 -9
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/data.js +9 -12
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-out/data.js +8 -9
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js +62 -31
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/data.js +75 -37
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +62 -30
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +62 -32
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +62 -32
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/api/data.js +14 -12
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/api/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/data.js +16 -19
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/dsq/data.js +16 -14
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/dsq/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/inv/data.js +15 -13
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/inv/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/sqs/data.js +15 -13
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/apiTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/invTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/data.js +12 -12
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/data.js +18 -22
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js +20 -21
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/data.js +10 -12
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/data.js +9 -12
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/data.js +9 -10
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-out/data.js +8 -9
- package/src/reStructure/TemplateData/relationshipPerAction/generateTemplateData.js +218 -63
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/api/data.js +53 -28
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/data.js +75 -37
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/data.js +62 -30
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/inv/data.js +53 -29
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/data.js +53 -27
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/api/data.js +14 -12
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/api/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/data.js +16 -19
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/dsq/data.js +16 -14
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/dsq/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/inv/data.js +15 -13
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/inv/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/sqs/data.js +15 -13
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/apiTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/invTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/data.js +8 -11
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/sns-in-sqs/data.js +18 -22
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +18 -19
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/data.js +9 -11
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/data.js +8 -10
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/data.js +10 -11
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/sns-out/data.js +8 -9
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/data.js +60 -32
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/data.js +16 -19
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/apiTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/invTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/data.js +9 -12
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/data.js +19 -23
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/functionYaml/data.js +22 -27
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/data.js +7 -9
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/data.js +6 -7
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/sns-in-sqs/data.js +10 -11
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/sns-out/data.js +7 -8
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/api/data.js +54 -34
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/data.js +69 -37
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +62 -34
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js +53 -34
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js +54 -33
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/api/data.js +13 -15
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/api/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/data.js +14 -17
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/dsq/data.js +13 -12
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/dsq/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/inv/data.js +13 -13
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/inv/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/sqs/data.js +13 -11
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/apiTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/invTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/data.js +10 -20
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-in-sqs/data.js +13 -14
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-out/data.js +15 -10
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +20 -22
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/handler/sqs/data.js +10 -12
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/handler/sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/data.js +10 -18
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/data.js +9 -11
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-out/data.js +8 -9
- package/src/reStructure/TemplateData/resourceYaml/CreateSourceData.js +24 -17
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/defaultDynamoDbTable.js +48 -51
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/generateDynamoPerLink.js +31 -19
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +55 -66
- package/src/reStructure/TemplateData/resourceYaml/filterGenerateResource/data.js +72 -31
- package/src/reStructure/TemplateData/resourceYaml/generateTemplateData.js +58 -24
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +14 -14
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/snsAndSqsPerActionData.js +29 -23
- package/src/reStructure/TemplateData/resourceYaml/sns-out/data.js +24 -21
- package/src/reStructure/TemplateData/resourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +8 -11
- package/src/reStructure/libs/GenerateCodeLibs.js +8 -12
- package/src/reStructure/libs/ValidateAddOnDataStructure.js +33 -22
- package/src/CheckPermission/CheckPermission.js +0 -142
- package/src/TemplateManager/index.js +0 -23
- package/src/TemplateManager/src/FindData/FindDataYaml/data.js +0 -183
- package/src/TemplateManager/src/FindData/FindDataYaml/template.ejs +0 -14
- package/src/TemplateManager/src/FindData/GetByStorage/getByDynamo.ejs +0 -53
- package/src/TemplateManager/src/FindData/GetByStorage/getByGraph.ejs +0 -100
- package/src/TemplateManager/src/FindData/Handler/data.js +0 -47
- package/src/TemplateManager/src/FindData/Handler/template.ejs +0 -140
- package/src/TemplateManager/src/FindData/mainFunction/data.js +0 -280
- package/src/TemplateManager/src/FindData/mainFunction/template.ejs +0 -151
- package/src/TemplateManager/src/GenerateCode(Old).js +0 -135
- package/src/TemplateManager/src/GenerateCode.js +0 -670
- package/src/TemplateManager/src/GenerateSchema.js +0 -103
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +0 -106
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/template.ejs +0 -20
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/data.js +0 -59
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/template.ejs +0 -130
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/createObjectComplete_main.js +0 -172
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/data.js +0 -53
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/template.ejs +0 -170
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-in-sqs/data.js +0 -58
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-in-sqs/template.ejs +0 -47
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-out/data.js +0 -62
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-out/template.ejs +0 -10
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/data.js +0 -102
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/template.ejs +0 -20
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/handler/data.js +0 -59
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/handler/template.ejs +0 -129
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/mainFunction/data.js +0 -53
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/mainFunction/template.ejs +0 -93
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/sns-out/data.js +0 -62
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/sqs-in-sns/data.js +0 -58
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/sqs-in-sns/template.ejs +0 -47
- package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/functionYaml/data.js +0 -106
- package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/functionYaml/template.ejs +0 -20
- package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/handler/data.js +0 -59
- package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/handler/template.ejs +0 -129
- package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/mainFunction/data.js +0 -53
- package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/mainFunction/template.ejs +0 -130
- package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/sns-out/data.js +0 -62
- package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/sqs-in-sns/data.js +0 -58
- package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/sqs-in-sns/template.ejs +0 -47
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/data.js +0 -106
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/template.ejs +0 -20
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/handler/data.js +0 -59
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/handler/template.ejs +0 -129
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/data.js +0 -53
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/template.ejs +0 -130
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/sns-out/data.js +0 -62
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/sqs-in-sns/data.js +0 -58
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/sqs-in-sns/template.ejs +0 -47
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/data.js +0 -179
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/request.json +0 -14
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/template.ejs +0 -20
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/data.js +0 -188
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/request.json +0 -19
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/template.ejs +0 -17
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/data.js +0 -172
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/example req.js +0 -15
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/request.json +0 -14
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/template.ejs +0 -13
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/data.js +0 -189
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/request.json +0 -19
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/template.ejs +0 -17
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrWbs/data.js +0 -171
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrWbs/request.json +0 -19
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrWbs/template.ejs +0 -29
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/webSocketConnect/data.js +0 -60
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/webSocketConnect/template.ejs +0 -10
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/data.js +0 -86
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/request.json +0 -7
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/template.ejs +0 -36
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/data.js +0 -88
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/request.json +0 -7
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/template.ejs +0 -55
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/data.js +0 -87
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/request.json +0 -7
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/template.ejs +0 -37
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/data.js +0 -87
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/request.json +0 -7
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/template.ejs +0 -57
- package/src/TemplateManager/src/PerActionEndpoint/Handler/WebSocket/data.js +0 -76
- package/src/TemplateManager/src/PerActionEndpoint/Handler/WebSocket/template.ejs +0 -60
- package/src/TemplateManager/src/PerActionEndpoint/Handler/WebSocketConnect/data.js +0 -56
- package/src/TemplateManager/src/PerActionEndpoint/Handler/WebSocketConnect/template.ejs +0 -55
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/data.js +0 -69
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/request.json +0 -0
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/template.ejs +0 -337
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/data.js +0 -69
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/template.ejs +0 -98
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/data.js +0 -69
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/request.json +0 -5
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/template.ejs +0 -114
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/testParam.json +0 -5
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/data.js +0 -63
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/request.json +0 -0
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/template.ejs +0 -164
- package/src/TemplateManager/src/PerActionEndpoint/libs/data.js +0 -48
- package/src/TemplateManager/src/PerActionEndpoint/libs/template.ejs +0 -46
- package/src/TemplateManager/src/ProcessLogical/Handler/data.js +0 -50
- package/src/TemplateManager/src/ProcessLogical/Handler/template.ejs +0 -129
- package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/data.js +0 -160
- package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/template.ejs +0 -12
- package/src/TemplateManager/src/ProcessLogical/mainFunction/data.js +0 -47
- package/src/TemplateManager/src/ProcessLogical/mainFunction/template.ejs +0 -429
- package/src/TemplateManager/src/ProcessLogicalPagination/DsqYaml/data.js +0 -50
- package/src/TemplateManager/src/ProcessLogicalPagination/DsqYaml/template.ejs +0 -32
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/data.js +0 -154
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/template.ejs +0 -12
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/data.js +0 -157
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/template.ejs +0 -12
- package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrDsq/data.js +0 -48
- package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrDsq/template.ejs +0 -163
- package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrSqs/data.js +0 -48
- package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrSqs/template.ejs +0 -146
- package/src/TemplateManager/src/ProcessLogicalPagination/mainFunction/data.js +0 -48
- package/src/TemplateManager/src/ProcessLogicalPagination/mainFunction/template.ejs +0 -212
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js +0 -99
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/template.ejs +0 -20
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/data.js +0 -112
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/template.ejs +0 -17
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/data.js +0 -98
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/template.ejs +0 -13
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/data.js +0 -111
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/template.ejs +0 -17
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/mainFunction/data.js +0 -60
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/mainFunction/template.ejs +0 -380
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrApi/data.js +0 -58
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrApi/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrApi/template.ejs +0 -57
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrDsq/data.js +0 -59
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrDsq/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrDsq/template.ejs +0 -184
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrInv/data.js +0 -60
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrInv/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrInv/template.ejs +0 -126
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrSqs/data.js +0 -60
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrSqs/template.ejs +0 -75
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/request.json +0 -30
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/sns-in-sqs/data.js +0 -78
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/sns-in-sqs/snsTemplate.ejs +0 -59
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/sns-in-sqs/sqsTemplate.ejs +0 -43
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/functionYaml/data.js +0 -111
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/functionYaml/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/functionYaml/template.ejs +0 -20
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/handler/HdrSqs/data.js +0 -61
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/handler/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/handler/HdrSqs/template.ejs +0 -125
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/mainFunction/data.js +0 -56
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/mainFunction/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/mainFunction/template.ejs +0 -141
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-in-sqs/data.js +0 -72
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-in-sqs/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-in-sqs/template.ejs +0 -47
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-out/data.js +0 -72
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-out/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-out/template.ejs +0 -10
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/data.js +0 -99
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/template.ejs +0 -20
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/data.js +0 -112
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/template.ejs +0 -17
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/data.js +0 -98
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/template.ejs +0 -13
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/data.js +0 -112
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/template.ejs +0 -17
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction/data.js +0 -60
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction/template.ejs +0 -337
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/data.js +0 -58
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/template.ejs +0 -56
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq/data.js +0 -59
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq/template.ejs +0 -184
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv/data.js +0 -60
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv/template.ejs +0 -126
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs/data.js +0 -60
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs/template.ejs +0 -74
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/request.json +0 -30
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/data.js +0 -78
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/snsTemplate.ejs +0 -59
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/sqsTemplate.ejs +0 -43
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/data.js +0 -111
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/template.ejs +0 -20
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler/HdrSqs/data.js +0 -61
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler/HdrSqs/template.ejs +0 -125
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/data.js +0 -56
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/template.ejs +0 -140
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/data.js +0 -72
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/template.ejs +0 -47
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/data.js +0 -72
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/template.ejs +0 -10
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/data.js +0 -111
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/request.json +0 -3
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/template.ejs +0 -20
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/data.js +0 -62
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/template.ejs +0 -127
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/mainFunction/data.js +0 -56
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/mainFunction/request.json +0 -1
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/mainFunction/template.ejs +0 -143
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-in-sqs/data.js +0 -72
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-in-sqs/request.json +0 -3
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-in-sqs/template.ejs +0 -46
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-out/data.js +0 -71
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-out/request.json +0 -3
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-out/template.ejs +0 -10
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/data.js +0 -100
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/template.ejs +0 -20
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/data.js +0 -111
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/template.ejs +0 -17
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/data.js +0 -103
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/template.ejs +0 -13
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/data.js +0 -115
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/template.ejs +0 -17
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/mainFunction/data.js +0 -64
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/mainFunction/request.json +0 -1
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/mainFunction/template.ejs +0 -340
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi/data.js +0 -59
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi/request.json +0 -7
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi/template.ejs +0 -57
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrDsq/data.js +0 -59
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrDsq/request.json +0 -7
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrDsq/template.ejs +0 -184
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrInv/data.js +0 -62
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrInv/request.json +0 -5
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrInv/template.ejs +0 -145
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/data.js +0 -59
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/request.json +0 -7
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/template.ejs +0 -72
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/request.json +0 -30
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/data.js +0 -90
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/request.json +0 -3
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/snsTemplate.ejs +0 -59
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/sqsTemplate.ejs +0 -43
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-out/data.js +0 -70
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-out/request.json +0 -3
- package/src/TemplateManager/src/ResourceYaml/CreateSourceData.js +0 -76
- package/src/TemplateManager/src/ResourceYaml/dynamodb/defaultDynamoDbTable.js +0 -146
- package/src/TemplateManager/src/ResourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +0 -178
- package/src/TemplateManager/src/ResourceYaml/dynamodb/request.json +0 -7
- package/src/TemplateManager/src/ResourceYaml/dynamodb/template.ejs +0 -31
- package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +0 -96
- package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/request.json +0 -4
- package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/snsAndSqsPerActiondata.js +0 -108
- package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/snsTemplate.ejs +0 -59
- package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/sqsTemplate.ejs +0 -43
- package/src/TemplateManager/src/ResourceYaml/sns-out/data.js +0 -89
- package/src/TemplateManager/src/ResourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +0 -75
- package/src/TemplateManager/src/ResourceYaml/sns-out/request.json +0 -3
- package/src/TemplateManager/src/ResourceYaml/sns-out/template.ejs +0 -10
- package/src/TemplateManager/src/Role/createSharedResource.js +0 -272
- package/src/TemplateManager/src/Role/sharedResourceTemplate.ejs +0 -58
- package/src/TemplateManager/src/attributeTree/objectSchema/data.js +0 -128
- package/src/TemplateManager/src/attributeTree/objectSchema/template.ejs +0 -21
- package/src/TemplateManager/src/attributeTree/refRelationshipSchema/data.js +0 -36
- package/src/TemplateManager/src/attributeTree/refRelationshipSchema/template.ejs +0 -0
- package/src/TemplateManager/src/attributeTree/relationshipSchema/data.js +0 -206
- package/src/TemplateManager/src/attributeTree/relationshipSchema/template.ejs +0 -7
- package/src/TemplateManager/src/attributeTreeSchema/generateTemplateData.js +0 -103
- package/src/TemplateManager/src/attributeTreeSchema/mainAttributeTree/attributeLinkTemplate.ejs +0 -17
- package/src/TemplateManager/src/attributeTreeSchema/mainAttributeTree/data.js +0 -134
- package/src/TemplateManager/src/attributeTreeSchema/mainAttributeTree/request.json +0 -11
- package/src/TemplateManager/src/attributeTreeSchema/referenceRelationshipSchema/data.js +0 -84
- package/src/TemplateManager/src/attributeTreeSchema/referenceRelationshipSchema/tempReferenceRelationshipSchema.ejs +0 -9
- package/src/TemplateManager/src/attributeTreeSchema/relationshipSchema/data.js +0 -172
- package/src/TemplateManager/src/attributeTreeSchema/relationshipSchema/template.ejs +0 -7
- package/src/TemplateManager/src/externalService/FunctionNameConfig/data.js +0 -163
- package/src/TemplateManager/src/externalService/FunctionNameConfig/template.ejs +0 -14
- package/src/TemplateManager/src/externalService/FunctionNameConfig/templateIntTesting.ejs +0 -31
- package/src/TemplateManager/src/externalService/FunctionNameConfig/templateYaml.ejs +0 -10
- package/src/TemplateManager/src/externalService/LambdaRole/data.js +0 -420
- package/src/TemplateManager/src/externalService/LambdaRole/request.json +0 -18
- package/src/TemplateManager/src/externalService/LambdaRole/template.ejs +0 -57
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +0 -160
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/request.json +0 -12
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/template.ejs +0 -28
- package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/dynamoDb/ReservedTableData.js +0 -65
- package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/dynamoDb/WebSocketTaskData.js +0 -65
- package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/webSocketConnect/functionYaml/data.js +0 -74
- package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/webSocketConnect/functionYaml/template.ejs +0 -29
- package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/webSocketConnect/handler/data.js +0 -55
- package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/webSocketConnect/handler/template.ejs +0 -68
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/functionYaml/data.js +0 -77
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/functionYaml/template.ejs +0 -37
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/handler/data.js +0 -47
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/handler/template.ejs +0 -103
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/mainFunction/data.js +0 -46
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/mainFunction/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/data.js +0 -36
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/data.js +0 -35
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/data.js +0 -35
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/data.js +0 -35
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/data.js +0 -35
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/functionYaml/data.js +0 -102
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/functionYaml/template.ejs +0 -30
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/handler/data.js +0 -58
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/handler/template.ejs +0 -126
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/mainFunction/data.js +0 -51
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/mainFunction/template.ejs +0 -121
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/queue/data.js +0 -64
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/queue/template.ejs +0 -45
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/functionYaml/data.js +0 -128
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/functionYaml/template.ejs +0 -37
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/data.js +0 -75
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/template.ejs +0 -120
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/mainFunction/data.js +0 -55
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/mainFunction/template.ejs +0 -133
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/functionYaml/data.js +0 -102
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/functionYaml/template.ejs +0 -30
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/handler/data.js +0 -58
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/handler/template.ejs +0 -103
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/mainFunction/data.js +0 -55
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/mainFunction/template.ejs +0 -86
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/sns-sqs/data.js +0 -72
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/sns-sqs/template.ejs +0 -49
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/functionYaml/data.js +0 -85
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/functionYaml/template.ejs +0 -27
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/handler/data.js +0 -57
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/handler/template.ejs +0 -120
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/data.js +0 -51
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/template.ejs +0 -164
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/sqs/data.js +0 -65
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/sqs/template.ejs +0 -53
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/functionYaml/data.js +0 -112
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/functionYaml/template.ejs +0 -30
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/handler/data.js +0 -57
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/handler/template.ejs +0 -126
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/data.js +0 -54
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/template.ejs +0 -254
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/queue/data.js +0 -64
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/queue/template.ejs +0 -45
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/data.js +0 -94
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/templateAsyncHandler.ejs +0 -110
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/templateSyncHandler.ejs +0 -49
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/hookLogic/data.js +0 -44
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/mainFunction/data.js +0 -66
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/mainFunction/template.ejs +0 -7
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/data.js +0 -73
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/snsTemplate.ejs +0 -59
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/sqsTemplate.ejs +0 -43
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/functionYaml/data.js +0 -102
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/functionYaml/template.ejs +0 -43
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/data.js +0 -94
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/templateAsyncHandler.ejs +0 -110
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/templateSyncHandler.ejs +0 -49
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/hookLogic/data.js +0 -65
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/mainFunction/data.js +0 -67
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/mainFunction/template.ejs +0 -30
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/queue/data.js +0 -125
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/queue/snsTemplate.ejs +0 -59
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/queue/sqsTemplate.ejs +0 -43
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrDsq/data.js +0 -87
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrDsq/template.ejs +0 -30
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrS3/data.js +0 -112
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrS3/template.ejs +0 -38
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerDsq/data.js +0 -45
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerDsq/template.ejs +0 -151
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerS3/data.js +0 -43
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerS3/template.ejs +0 -68
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/data.js +0 -43
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/template.ejs +0 -392
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/data.js +0 -77
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/dsqTemplatePath.ejs +0 -32
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/s3Template.ejs +0 -59
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/S3/data.js +0 -51
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/S3/template.ejs +0 -13
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/data.js +0 -42
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/template.ejs +0 -137
- package/src/TemplateManager/src/libs/Consts.js +0 -485
- package/src/TemplateManager/src/libs/GenerateCodeUtils.js +0 -59
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/request.json +0 -0
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/request.json +0 -0
|
@@ -15,971 +15,28 @@ You should have received a copy of the GNU Affero General Public License
|
|
|
15
15
|
along with this program.If not, see < http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
'use strict';
|
|
19
|
-
|
|
20
18
|
import lodash from 'lodash';
|
|
21
19
|
import { objectHash as hash } from '@izara_project/izara-shared-core';
|
|
22
|
-
|
|
20
|
+
|
|
23
21
|
import { sns, sqs } from '@izara_project/izara-core-library-external-request';
|
|
24
|
-
import {
|
|
25
|
-
|
|
22
|
+
import {
|
|
23
|
+
getObjectSchema,
|
|
24
|
+
consts as coreConsts,
|
|
25
|
+
} from '@izara_project/izara-core-library-service-schemas';
|
|
26
26
|
|
|
27
27
|
import { validateObjType } from '@izara_project/izara-shared-service-schemas';
|
|
28
28
|
|
|
29
29
|
// core libs
|
|
30
30
|
import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
|
|
31
|
-
import asyncFlowSharedLib from '@izara_project/izara-core-library-asynchronous-flow'
|
|
31
|
+
import asyncFlowSharedLib from '@izara_project/izara-core-library-asynchronous-flow';
|
|
32
32
|
import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
|
|
33
|
-
import sqsSharedLib from '@izara_project/izara-core-library-sqs';
|
|
34
33
|
import snsSharedLib from '@izara_project/izara-core-library-sns';
|
|
35
34
|
import graphSharedLibs from '@izara_project/izara-core-library-graph-service';
|
|
36
35
|
import lambdaSharedLib from '@izara_project/izara-core-library-lambda';
|
|
37
|
-
import consts from './Consts.js'
|
|
38
|
-
const { TOPIC_NAME_GENERATE_CODE, TOPIC_NAME_GRAPH_HANDLER, PREFIX } = consts
|
|
39
|
-
|
|
40
|
-
const nodeLabelRegexPattern = "^[a-zA-Z0-9_-]+(?:\:[a-zA-Z0-9_-]+)?$"
|
|
41
|
-
|
|
42
|
-
const schemaFunctionPerAction = {
|
|
43
|
-
[coreConsts.ACTIONS.create]: validatorSchema.generateValidatorSchemaForCreate,
|
|
44
|
-
[coreConsts.ACTIONS.update]: validatorSchema.generateValidatorSchemaForUpdate,
|
|
45
|
-
[coreConsts.ACTIONS.get]: validatorSchema.generateValidatorSchemaForIdentifier,
|
|
46
|
-
[coreConsts.ACTIONS.delete]: validatorSchema.generateValidatorSchemaForIdentifier,
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const explodeDataPerAction = {
|
|
50
|
-
[coreConsts.ACTIONS.create]: explodedReqParams.explodedDataForCreate,
|
|
51
|
-
[coreConsts.ACTIONS.get]: explodedReqParams.explodedDataForIdentifiers,
|
|
52
|
-
[coreConsts.ACTIONS.update]: explodedReqParams.explodedDataForUpdate,
|
|
53
|
-
[coreConsts.ACTIONS.delete]: explodedReqParams.explodedDataForIdentifiers
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
/*
|
|
58
|
-
---------- Contain function use for generated code ----------
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
*
|
|
63
|
-
* @param {middleware} middleware
|
|
64
|
-
* @param {string} objectType - name of ObjectType
|
|
65
|
-
* @param {string} action - action type of Lambda create | update | get | delete
|
|
66
|
-
*/
|
|
67
|
-
function validateSchemaMiddleware(
|
|
68
|
-
middleware,
|
|
69
|
-
// objectType,
|
|
70
|
-
action,
|
|
71
|
-
bucketName = process.env.iz_serviceSchemaBucketName
|
|
72
|
-
// setting = {}
|
|
73
|
-
) {
|
|
74
|
-
|
|
75
|
-
if (!schemaFunctionPerAction[action] || !explodeDataPerAction[action]) {
|
|
76
|
-
throw new NoRetryError(`Not found function for generateValidatorSchema or explodeDataPerAction of action:${action}`);
|
|
77
|
-
}
|
|
78
|
-
// Logger.debug("setting in generateCodeLibs", setting)
|
|
79
|
-
middleware.setServiceSchema(
|
|
80
|
-
schemaFunctionPerAction[action],
|
|
81
|
-
explodeDataPerAction[action],
|
|
82
|
-
{
|
|
83
|
-
// objectType: objectType,
|
|
84
|
-
// specificFieldNames: setting?.specificFieldNames ? setting.specificFieldNames : [],
|
|
85
|
-
action: action,
|
|
86
|
-
bucketName: bucketName
|
|
87
|
-
},
|
|
88
|
-
);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* use to validate record for Lambda handler hdrSqs/hdrDsq
|
|
93
|
-
* Note!: cannot throw error when use this function outside recordHandler
|
|
94
|
-
*
|
|
95
|
-
* @param {object} record - one record from sqs
|
|
96
|
-
* @param {string} lambdaFunctionName - name of Lambda used to build SQS/DLQ // QueueName
|
|
97
|
-
* @param {string} objectType - name of ObjectType
|
|
98
|
-
* @param {string} action - action type of Lambda create | update | get | delete
|
|
99
|
-
* @param {object} [setting]
|
|
100
|
-
* @param {string[]} [setting.specificFieldNames] - optional - specific fieldNames use as param in generateValidatorFunction
|
|
101
|
-
*/
|
|
102
|
-
async function validateSchemaPerRecord(
|
|
103
|
-
record,
|
|
104
|
-
lambdaFunctionName,
|
|
105
|
-
objType,
|
|
106
|
-
action,
|
|
107
|
-
setting = { bucketName: process.env.iz_serviceSchemaBucketName, specificFieldNames: [] }
|
|
108
|
-
) {
|
|
109
|
-
try {
|
|
110
|
-
record._izContext.logger.debug("validateSchemaPerRecord: ",
|
|
111
|
-
record,
|
|
112
|
-
lambdaFunctionName,
|
|
113
|
-
objType,
|
|
114
|
-
action,
|
|
115
|
-
setting
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
if (!schemaFunctionPerAction[action] || !explodeDataPerAction[action]) {
|
|
119
|
-
throw new Error(`Not found function for generateValidatorSchema or function for explodeData of action:${action}`);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const objectSchema = await getObjectSchema.getObjSchemaS3WithHierarchy(record._izContext, objType);
|
|
123
|
-
|
|
124
|
-
if (!objectSchema) {
|
|
125
|
-
throw new Error("not have objectSchema in service");
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const generateValidatorFunction = schemaFunctionPerAction[action];
|
|
129
|
-
const explodeDataFunction = explodeDataPerAction[action]
|
|
130
|
-
|
|
131
|
-
const generatedSchema = await generateValidatorFunction(record._izContext, objType, setting);
|
|
132
|
-
record._izContext.logger.debug(`generatedSchema in validateSchemaPerRecord : `, generatedSchema);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const explodedDataRequestParams = await explodeDataFunction(
|
|
136
|
-
record._izContext,
|
|
137
|
-
record.body.Message,
|
|
138
|
-
objectSchema,
|
|
139
|
-
setting
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
record._izContext.logger.debug('explodedDataRequestParams in validateSchemaPerRecord : ', JSON.stringify(explodedDataRequestParams));
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
let validateStatus = validateObject(generatedSchema, explodedDataRequestParams);
|
|
147
|
-
record._izContext.logger.debug('validateStatus : ', validateStatus);
|
|
148
|
-
|
|
149
|
-
// if not pass validate will sent message to dlq and throw NoRetryError
|
|
150
|
-
if (!validateStatus.pass) {
|
|
151
|
-
await messageToDlq(record, `Invalid: ${validateStatus.error}`, await sqsSharedLib.sqsQueueUrlDLQ(record._izContext, lambdaFunctionName));
|
|
152
|
-
record._izError = new Error(validateStatus.error)
|
|
153
|
-
}
|
|
154
|
-
} catch (error) {
|
|
155
|
-
record._izContext.logger.debug("validate PerSchema Record error", error)
|
|
156
|
-
await messageToDlq(record, error.message, await sqsSharedLib.sqsQueueUrlDLQ(record._izContext, lambdaFunctionName));
|
|
157
|
-
record._izError = new Error(error)
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* use to create validation for initialize request
|
|
164
|
-
*
|
|
165
|
-
* @param {object} _izContext
|
|
166
|
-
* @param {object} flowType
|
|
167
|
-
* @param {object} flowType.flowTag
|
|
168
|
-
* @param {object} flowType.serviceTag
|
|
169
|
-
* @returns {object}
|
|
170
|
-
*/
|
|
171
|
-
|
|
172
|
-
async function validationForWebSocket(
|
|
173
|
-
_izContext,
|
|
174
|
-
flowType
|
|
175
|
-
) {
|
|
176
|
-
_izContext.logger.debug("validator schema for flowTag", {
|
|
177
|
-
flowType
|
|
178
|
-
})
|
|
179
|
-
let flowSchema = await getObjectSchema.getFlowSchemaS3(_izContext, flowType)
|
|
180
|
-
|
|
181
|
-
let validatorSchemaForFlowSchema = flowSchema.initializeRequest.initializeRequestProperties
|
|
182
|
-
_izContext.logger.debug("validatorSchemaForFlowSchema:", validatorSchemaForFlowSchema)
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
*
|
|
189
|
-
* @param {middleware} middleware
|
|
190
|
-
* @param {string} objectType - name of ObjectType
|
|
191
|
-
* @param {string} action - action type of Lambda create | update | get | delete
|
|
192
|
-
*/
|
|
193
|
-
function validatorSchemaMiddlewareByAction(
|
|
194
|
-
middleware,
|
|
195
|
-
// objectType,
|
|
196
|
-
action,
|
|
197
|
-
setting = {}
|
|
198
|
-
) {
|
|
199
|
-
|
|
200
|
-
// if (!schemaFunctionPerAction[action] || !explodeDataPerAction[action]) {
|
|
201
|
-
// throw new NoRetryError(`Not found function for generateValidatorSchema or explodeDataPerAction of action:${action}`);
|
|
202
|
-
// }
|
|
203
|
-
console.log("before send to middleware", {
|
|
204
|
-
middleware,
|
|
205
|
-
// objectType,
|
|
206
|
-
action,
|
|
207
|
-
setting
|
|
208
|
-
})
|
|
209
|
-
Logger.debug("setting in generateCodeLibs", setting)
|
|
210
|
-
middleware.setServiceSchema(
|
|
211
|
-
// schemaFunctionPerAction[action],
|
|
212
|
-
// explodeDataPerAction[action],
|
|
213
|
-
{
|
|
214
|
-
// objectType: objectType,
|
|
215
|
-
specificFieldNames: setting?.specificFieldNames ? setting.specificFieldNames : [],
|
|
216
|
-
action: action
|
|
217
|
-
},
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
// /**
|
|
221
|
-
// * use to validate record for Lambda handler hdrSqs/hdrDsq
|
|
222
|
-
// * Note!: cannot throw error when use this function outside recordHandler
|
|
223
|
-
|
|
224
|
-
// * @param {string} objectType - name of ObjectType
|
|
225
|
-
// * @param {string} action - action type of Lambda create | update | get | delete
|
|
226
|
-
// * @param {object} [setting]
|
|
227
|
-
// */
|
|
228
|
-
// async function validateSchemaPerWebSocket(
|
|
229
|
-
// _izContext,
|
|
230
|
-
// requestParams,
|
|
231
|
-
// objectType,
|
|
232
|
-
// action,
|
|
233
|
-
// setting = {}
|
|
234
|
-
// ) {
|
|
235
|
-
// _izContext.logger.debug("validateSchema Per WebSocketFunction", {
|
|
236
|
-
// objectType,
|
|
237
|
-
// requestParams,
|
|
238
|
-
// action,
|
|
239
|
-
// setting
|
|
240
|
-
// })
|
|
241
|
-
// try {
|
|
242
|
-
// if (action === "update") {
|
|
243
|
-
// setting.updateScenario = "versionedData"
|
|
244
|
-
// }
|
|
245
|
-
|
|
246
|
-
// const objType = utils.createObjType(objectType)
|
|
247
|
-
// _izContext.logger.debug("objType in validatorSchema per WebSocket", objType)
|
|
248
|
-
|
|
249
|
-
// const objectSchema = await getObjectSchema.getObjSchemaS3WithHierarchy(_izContext, objType);
|
|
250
|
-
// _izContext.logger.debug("objectSchema", objectSchema)
|
|
251
|
-
// const generateValidatorSchema = schemaFunctionPerAction[action];
|
|
252
|
-
// const explodeDataFunction = explodeDataPerAction[action];
|
|
253
|
-
|
|
254
|
-
// const generateValidatorSchemaPerWebSocket = await generateValidatorSchema(_izContext, objType, setting);
|
|
255
|
-
// _izContext.logger.debug("Generate Validator Schema For WebSocket :", generateValidatorSchemaPerWebSocket);
|
|
256
|
-
|
|
257
|
-
// const explodedDataPerWebSocket = await explodeDataFunction(_izContext, requestParams, objectSchema, setting);
|
|
258
|
-
|
|
259
|
-
// _izContext.logger.debug("exploded RequestParams Data in GeneratorValidatorSchema :", explodedDataPerWebSocket);
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
// let validateStatus = validateObject(_izContext, generateValidatorSchemaPerWebSocket, explodedDataPerWebSocket);
|
|
263
|
-
// _izContext.logger.debug('validateStatus : ', validateStatus);
|
|
264
|
-
|
|
265
|
-
// if (!validateStatus.pass) {
|
|
266
|
-
// const validatorError = new Error(`validation failed: ${validateStatus.error}`)
|
|
267
|
-
// throw validatorError;
|
|
268
|
-
// }
|
|
269
|
-
// } catch (err) {
|
|
270
|
-
// _izContext.logger.error("Error in validateSchemaPerWebSocket:", err);
|
|
271
|
-
// throw err;
|
|
272
|
-
// }
|
|
273
|
-
// }
|
|
274
|
-
|
|
275
|
-
async function sendMsgOutComplete(_izContext, topicName, messageObj, callingFlowConfig) {
|
|
276
|
-
|
|
277
|
-
try {
|
|
278
|
-
// add callingFlow to message
|
|
279
|
-
messageObj = callingFlowSharedLib.addPassBackPropertiesToSnsResponseMessageObject(callingFlowConfig, messageObj);
|
|
280
|
-
let messageAttributes = callingFlowSharedLib.addCallingFlowToSnsResponseMessageAttributes(callingFlowConfig, {});
|
|
281
|
-
|
|
282
|
-
let sendMessageOutComplete = {
|
|
283
|
-
Message: JSON.stringify(messageObj),
|
|
284
|
-
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
285
|
-
TopicArn: await snsSharedLib.snsTopicArn(_izContext, topicName),
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
_izContext.logger.debug(`Send message to ${topicName} :`, sendMessageOutComplete);
|
|
289
|
-
await sns.publishAsync(_izContext, sendMessageOutComplete);
|
|
290
|
-
return;
|
|
291
|
-
} catch (error) {
|
|
292
|
-
throw error;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* @param {object} record - One record from sqs.
|
|
302
|
-
* @param {string} messageFailError - The message error.
|
|
303
|
-
* @param {object} lambdaFunctionName - Queue anme what to send to dlq./name of Lambda being invoked, used to build SQS/DLQ
|
|
304
|
-
*
|
|
305
|
-
*/
|
|
306
|
-
async function messageToDlq(record, messageFailError, queueUrl) {
|
|
307
|
-
|
|
308
|
-
let messageBody = record.body
|
|
309
|
-
|
|
310
|
-
let params = {
|
|
311
|
-
QueueUrl: queueUrl,
|
|
312
|
-
MessageAttributes: {
|
|
313
|
-
messageFailError: {
|
|
314
|
-
DataType: "String",
|
|
315
|
-
StringValue: messageFailError
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
MessageBody: JSON.stringify(messageBody),
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
record._izContext.logger.debug('messageToDlq, params before sending DLQ', params);
|
|
322
|
-
|
|
323
|
-
await sqs.sendMessage(record._izContext, params);
|
|
324
|
-
record._izContext.logger.debug("----- messageToDlq sendMessage success -----");
|
|
325
|
-
};
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
// {
|
|
329
|
-
// [storageTag]: {
|
|
330
|
-
// storageType: 'graph',
|
|
331
|
-
// graphServiceTag: 'GraphHandler',
|
|
332
|
-
// fieldNames: [ 'companyName', 'companyId' ],
|
|
333
|
-
// versionedDatas: {
|
|
334
|
-
// ceo: [ 'name', 'ceoAddress', 'salary' ],
|
|
335
|
-
// branch: [ 'branchAddress', 'branchId' ]
|
|
336
|
-
// }
|
|
337
|
-
// versionedDataLabels:[],
|
|
338
|
-
// }
|
|
339
|
-
// }
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* helper function for get endpoint
|
|
344
|
-
* create get data detail for each storageTag
|
|
345
|
-
*
|
|
346
|
-
* @param {Object} _izContext
|
|
347
|
-
* @param {Object} objectSchema
|
|
348
|
-
*/
|
|
349
|
-
async function createGetDataDetails(_izContext, objectSchema, settings = { bucketName: process.env.iz_serviceSchemaBucketName }) {
|
|
350
|
-
|
|
351
|
-
// group versionedData per storageTag
|
|
352
|
-
// or should group versionedData per graph serviceTag
|
|
353
|
-
let versionedDataPerStorageTag = {}
|
|
354
|
-
if (objectSchema?.addOnDataStructure?.length) {
|
|
355
|
-
for (let addOn of objectSchema.addOnDataStructure) {
|
|
356
|
-
if (addOn.type !== "versionedData") {
|
|
357
|
-
continue;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
if (!versionedDataPerStorageTag.hasOwnProperty(addOn.storageResourceTag)) {
|
|
361
|
-
versionedDataPerStorageTag[addOn.storageResourceTag] = [];
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
versionedDataPerStorageTag[addOn.storageResourceTag].push(addOn);
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
_izContext.logger.debug("versionedDataPerStorageTag: ", versionedDataPerStorageTag);
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
let getGraphDataDetails = {};
|
|
372
|
-
let getDynamoDbDataDetails = {};
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
// reference to graph serviceTag that already used
|
|
376
|
-
let graphStorageTagPerGraphServiceTag = {} // {serviceTag:storageTag,... }
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
for (let [storageTag, storageData] of Object.entries(objectSchema.storageResources)) {
|
|
380
|
-
|
|
381
|
-
// collect fieldNames per storageTag
|
|
382
|
-
let storageTagFieldNames = [];
|
|
383
|
-
for (let [fieldName, fieldNameData] of Object.entries(objectSchema.fieldNames)) {
|
|
384
|
-
// if (fieldName.startsWith("versionedDataField")) {
|
|
385
|
-
// continue;
|
|
386
|
-
// }
|
|
387
|
-
|
|
388
|
-
if (fieldNameData.storageResourceTags.includes(storageTag)) {
|
|
389
|
-
storageTagFieldNames.push(fieldName);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
if (storageData.storageType === coreConsts.STORAGE_TYPES.graph) {
|
|
394
|
-
|
|
395
|
-
let useStorageTag = storageTag;
|
|
396
|
-
let graphServiceTag = await serviceConfig.getGraphServiceTagWithCache(_izContext, storageData.graphServerTag, settings.bucketName);
|
|
397
|
-
|
|
398
|
-
// check duplicate graph serviceTag
|
|
399
|
-
if (!graphStorageTagPerGraphServiceTag.hasOwnProperty(graphServiceTag)) {
|
|
400
|
-
graphStorageTagPerGraphServiceTag[graphServiceTag] = storageTag;
|
|
401
|
-
} else {
|
|
402
|
-
// overwrite useStorageTag if graphServiceTag already used
|
|
403
|
-
_izContext.logger.debug("current storageTag: ", storageTag);
|
|
404
|
-
_izContext.logger.debug("use storageTag: ", useStorageTag);
|
|
405
|
-
|
|
406
|
-
useStorageTag = graphStorageTagPerGraphServiceTag[graphServiceTag];
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
if (!getGraphDataDetails.hasOwnProperty(useStorageTag)) {
|
|
411
|
-
getGraphDataDetails[useStorageTag] = {
|
|
412
|
-
storageType: storageData.storageType,
|
|
413
|
-
graphServiceTag: graphServiceTag,
|
|
414
|
-
fieldNames: storageTagFieldNames
|
|
415
|
-
}
|
|
416
|
-
} else {
|
|
417
|
-
getGraphDataDetails[useStorageTag].fieldNames =
|
|
418
|
-
[...new Set(getGraphDataDetails[useStorageTag].fieldNames.concat(storageTagFieldNames))];
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
// add versionedData fieldNames
|
|
423
|
-
if (versionedDataPerStorageTag.hasOwnProperty(storageTag)) {
|
|
424
|
-
if (!getGraphDataDetails[useStorageTag].hasOwnProperty("versionedDatas")) {
|
|
425
|
-
getGraphDataDetails[useStorageTag].versionedDatas = {};
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
for (let versionedData of versionedDataPerStorageTag[storageTag]) {
|
|
429
|
-
_izContext.logger.debug("versionedData.fieldNames", versionedData.fieldNames)
|
|
430
|
-
let versionedDataFieldNames = Object.keys(versionedData.fieldNames);
|
|
431
|
-
Object.assign(
|
|
432
|
-
getGraphDataDetails[useStorageTag].versionedDatas,
|
|
433
|
-
{ [versionedData.versionedDataLabel]: versionedDataFieldNames }
|
|
434
|
-
)
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
} else if (storageData.storageType === coreConsts.STORAGE_TYPES.dynamoDB) {
|
|
439
|
-
let serviceTag = storageData.serviceTag || process.env.iz_serviceTag
|
|
440
|
-
Object.assign(getDynamoDbDataDetails, {
|
|
441
|
-
[storageTag]: {
|
|
442
|
-
storageType: storageData.storageType,
|
|
443
|
-
tableName: storageData.tableName,
|
|
444
|
-
serviceTag: serviceTag,
|
|
445
|
-
fieldNames: storageTagFieldNames
|
|
446
|
-
}
|
|
447
|
-
})
|
|
448
|
-
|
|
449
|
-
if (storageData.groupByPartitionKeyField) {
|
|
450
|
-
Object.assign(
|
|
451
|
-
getDynamoDbDataDetails[storageTag],
|
|
452
|
-
{
|
|
453
|
-
groupByPartitionKeyField: storageData.groupByPartitionKeyField
|
|
454
|
-
}
|
|
455
|
-
)
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
} else {
|
|
460
|
-
throw new NoRetryError("Unhanled storageType");
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
_izContext.logger.debug("getGraphDataDetail: ", getGraphDataDetails);
|
|
465
|
-
_izContext.logger.debug("getDynamoDbData: ", getDynamoDbDataDetails);
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
//-------- sort descending order of fieldNames.length --------
|
|
469
|
-
let sortedGetGraphWithVersionedData = Object.entries(getGraphDataDetails)
|
|
470
|
-
.filter((getGraphDetail) => getGraphDetail[1].hasOwnProperty("versionedDatas"))
|
|
471
|
-
.sort((storageDataA, storageDataB) =>
|
|
472
|
-
storageDataB[1].fieldNames.length - storageDataA[1].fieldNames.length
|
|
473
|
-
);
|
|
474
|
-
|
|
475
|
-
_izContext.logger.debug("sortedGetGraphWithVersionedData: ", sortedGetGraphWithVersionedData);
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
let sortedGetGraphWithoutVersionedData = Object.entries(getGraphDataDetails)
|
|
479
|
-
.filter((getGraphDetail) => !getGraphDetail[1].hasOwnProperty("versionedDatas"))
|
|
480
|
-
.sort((storageDataA, storageDataB) =>
|
|
481
|
-
storageDataB[1].fieldNames.length - storageDataA[1].fieldNames.length
|
|
482
|
-
);
|
|
483
|
-
|
|
484
|
-
_izContext.logger.debug("sortedGetGraphWithoutVersionedData: ", sortedGetGraphWithoutVersionedData);
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
let sortedGetDynamoDbData = Object.entries(getDynamoDbDataDetails).sort((storageDataA, storageDataB) =>
|
|
488
|
-
storageDataB[1].fieldNames.length - storageDataA[1].fieldNames.length
|
|
489
|
-
);
|
|
490
|
-
|
|
491
|
-
_izContext.logger.debug("sortedGetDynamoDbData: ", sortedGetDynamoDbData);
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
// after sort data then filter duplicate fieldName
|
|
495
|
-
let allSortedGetDataDetails = [...sortedGetGraphWithVersionedData, ...sortedGetDynamoDbData, ...sortedGetGraphWithoutVersionedData];
|
|
496
|
-
_izContext.logger.debug("allSortedGetDataDetails: ", allSortedGetDataDetails);
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
let usedFieldName = [];
|
|
500
|
-
for (let [storageTag, getDataDetail] of allSortedGetDataDetails) {
|
|
501
|
-
let remainsFieldNames = [];
|
|
502
|
-
while (getDataDetail.fieldNames.length) {
|
|
503
|
-
let checkedFiedName = getDataDetail.fieldNames.pop();
|
|
504
|
-
if (!usedFieldName.includes(checkedFiedName)) {
|
|
505
|
-
usedFieldName.push(checkedFiedName);
|
|
506
|
-
remainsFieldNames.push(checkedFiedName);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
getDataDetail.fieldNames = remainsFieldNames;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
_izContext.logger.debug("newSortedArray after: ", allSortedGetDataDetails);
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
let getDataDetailResults = Object.fromEntries(
|
|
517
|
-
allSortedGetDataDetails.filter(([storageTag, getDataDetail]) => {
|
|
518
|
-
return (getDataDetail.fieldNames.length || getDataDetail.hasOwnProperty("versionedDatas"));
|
|
519
|
-
})
|
|
520
|
-
);
|
|
521
|
-
|
|
522
|
-
_izContext.logger.debug("getDataDetailResults: ", getDataDetailResults);
|
|
523
|
-
|
|
524
|
-
for (const getDataDetail of Object.values(getDataDetailResults)) {
|
|
525
|
-
if (getDataDetail.hasOwnProperty("versionedDatas")) {
|
|
526
|
-
getDataDetail.versionedDataLabels = [];
|
|
527
|
-
for (let [versionedDataLabel, fieldNames] of Object.entries(getDataDetail.versionedDatas)) {
|
|
528
|
-
getDataDetail.versionedDataLabels.push(versionedDataLabel)
|
|
529
|
-
getDataDetail.fieldNames.push(...fieldNames);
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
return getDataDetailResults;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
/**
|
|
539
|
-
* create dynamoDb identifiers using request param and objectSchema
|
|
540
|
-
*
|
|
541
|
-
* @param {Object} _izContext
|
|
542
|
-
* @param {Object} objectSchema
|
|
543
|
-
* @param {Object} reqIdentifiers - input identifier from calling function
|
|
544
|
-
*/
|
|
545
|
-
async function generateDynamoDbIdentifiers(_izContext, objectSchema, reqIdentifiers, bucketName = process.env.iz_serviceSchemaBucketName) {
|
|
546
|
-
|
|
547
|
-
// start create identifiers for dynamo
|
|
548
|
-
let dynamoIdentifiers = {};
|
|
549
|
-
|
|
550
|
-
for (let identifier of objectSchema.identifiers) {
|
|
551
|
-
if (identifier.name) {
|
|
552
|
-
let deliminator = identifier.deliminator || coreConsts.DEFAULT_IDENTIFIER_DELIMINATOR;
|
|
553
|
-
let currentDeliminatorAmount = 0;
|
|
554
|
-
|
|
555
|
-
let concatenateValue = [];
|
|
556
|
-
for (let fieldName of identifier.fieldNames) {
|
|
557
|
-
concatenateValue.push(reqIdentifiers[fieldName]);
|
|
558
|
-
|
|
559
|
-
let deliminatorTreeFieldName = await deliminatorTree.generateDeliminatorTreePerFieldName(_izContext, fieldName, objectSchema.fieldNames[fieldName], {}, bucketName);
|
|
560
|
-
_izContext.logger.debug("deliminatorTreeFieldName: ", deliminatorTreeFieldName);
|
|
561
|
-
|
|
562
|
-
if (deliminatorTreeFieldName[fieldName]?.deliminatorList?.[deliminator]) {
|
|
563
|
-
currentDeliminatorAmount = Math.max(
|
|
564
|
-
currentDeliminatorAmount,
|
|
565
|
-
deliminatorTreeFieldName[fieldName].deliminatorList[deliminator]
|
|
566
|
-
);
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
Object.assign(
|
|
571
|
-
dynamoIdentifiers,
|
|
572
|
-
{
|
|
573
|
-
[identifier.name]: concatenateValue.join(deliminator.repeat(currentDeliminatorAmount + 1))
|
|
574
|
-
}
|
|
575
|
-
);
|
|
576
|
-
} else {
|
|
577
|
-
Object.assign(
|
|
578
|
-
dynamoIdentifiers,
|
|
579
|
-
{
|
|
580
|
-
[identifier.fieldName]: reqIdentifiers[identifier.fieldName]
|
|
581
|
-
}
|
|
582
|
-
)
|
|
583
|
-
}
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
_izContext.logger.debug("dynamoIdentifiers: ", dynamoIdentifiers);
|
|
587
|
-
|
|
588
|
-
return dynamoIdentifiers;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* create dynamoDb identifiers using request param and objectSchema
|
|
594
|
-
*
|
|
595
|
-
* @param {Object} _izContext
|
|
596
|
-
* @param {Object} objectSchema
|
|
597
|
-
* @param {Object} reqIdentifiers - input identifier from calling function
|
|
598
|
-
*/
|
|
599
|
-
const generateDynamoDbIdentifiersWithCache = inMemoryCacheLib(
|
|
600
|
-
generateDynamoDbIdentifiers, // fn
|
|
601
|
-
{ // setting
|
|
602
|
-
max: 20, maxAge: 86400000, promise: true, profileName: 'generateDynamoDbIdentifiers',
|
|
603
|
-
normalizer: function (args) {
|
|
604
|
-
return hash([args[1], args[2]])
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
)
|
|
608
|
-
|
|
609
|
-
/**
|
|
610
|
-
*
|
|
611
|
-
* @param {Object} _izContext
|
|
612
|
-
* @param {Object} objectSchema
|
|
613
|
-
* @param {Object} dynamoStorageResource
|
|
614
|
-
* @param {Object} reqIdentifiers
|
|
615
|
-
*/
|
|
616
|
-
async function dynamoDbIdentifiersByStorageResource(_izContext, objectSchema, dynamoStorageResource, reqIdentifiers, bucketName = process.env.iz_serviceSchemaBucketName) {
|
|
617
|
-
|
|
618
|
-
let dynamoIdentifiers = await generateDynamoDbIdentifiersWithCache(_izContext, objectSchema, reqIdentifiers, bucketName)
|
|
619
|
-
|
|
620
|
-
let identifiersByStorageResource = {};
|
|
621
|
-
|
|
622
|
-
if (dynamoStorageResource.groupByPartitionKeyField) {
|
|
623
|
-
|
|
624
|
-
let deliminatorTreeIdentifiers = await deliminatorTree.generateDeliminatorTreeIdentifier(_izContext, objectSchema, bucketName);
|
|
625
|
-
_izContext.logger.debug("deliminatorTree: ", deliminatorTreeIdentifiers);
|
|
626
|
-
|
|
627
|
-
let compositeKeyDeliminator = objectSchema.compositeKeyDeliminator || coreConsts.DEFAULT_IDENTIFIER_DELIMINATOR;
|
|
628
|
-
|
|
629
|
-
let currentDeliminatorAmount = 0;
|
|
630
|
-
|
|
631
|
-
for (let currentDeliminator of Object.values(deliminatorTreeIdentifiers)) {
|
|
632
|
-
if (currentDeliminator.deliminator === compositeKeyDeliminator) {
|
|
633
|
-
if (currentDeliminatorAmount < currentDeliminator.deliminatorList[compositeKeyDeliminator]) {
|
|
634
|
-
currentDeliminatorAmount = currentDeliminator.deliminatorList[compositeKeyDeliminator];
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
// sort dynamoDbIdentifiers data by objectSchema
|
|
640
|
-
let sortedIdentifiersValue = [];
|
|
641
|
-
for (let identifier of objectSchema.identifiers) {
|
|
642
|
-
let identifierName = identifier.fieldName || identifier.name;
|
|
643
|
-
sortedIdentifiersValue.push(dynamoIdentifiers[identifierName]);
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
let newIdentifierValue = sortedIdentifiersValue.join(compositeKeyDeliminator.repeat(currentDeliminatorAmount + 1));
|
|
647
|
-
|
|
648
|
-
identifiersByStorageResource = {
|
|
649
|
-
[dynamoStorageResource.groupByPartitionKeyField]: newIdentifierValue
|
|
650
|
-
};
|
|
651
|
-
|
|
652
|
-
} else {
|
|
653
|
-
identifiersByStorageResource = dynamoIdentifiers;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
return identifiersByStorageResource;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
/**
|
|
661
|
-
* receive result from multiple database and create data format depend on returnFormat setting
|
|
662
|
-
*
|
|
663
|
-
* @param {object} _izContext
|
|
664
|
-
* @param {object[]} getResults
|
|
665
|
-
* @param {object} objectSchema
|
|
666
|
-
* @returns
|
|
667
|
-
*/
|
|
668
|
-
function collectGetData(_izContext, getResults, objectSchema, returnSystemFieldsName) {
|
|
669
|
-
_izContext.logger.debug("collectGetData: ", {
|
|
670
|
-
getResults,
|
|
671
|
-
objectSchema,
|
|
672
|
-
returnSystemFieldsName
|
|
673
|
-
});
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
let collectedData = {
|
|
677
|
-
identifiers: {},
|
|
678
|
-
fields: {}
|
|
679
|
-
}
|
|
680
|
-
|
|
681
|
-
if (returnSystemFieldsName) {
|
|
682
|
-
Object.assign(collectedData, { versionDataSystemFields: {} })
|
|
683
|
-
}
|
|
684
|
-
const identifierFieldNames = new Set(utils.getUsedFieldNamesOfIdentifiers(_izContext, objectSchema.identifiers));
|
|
685
|
-
|
|
686
|
-
let addedFieldNames = new Set();
|
|
687
|
-
|
|
688
|
-
// if isFound === true then return null from this function
|
|
689
|
-
let isFound = false;
|
|
690
|
-
|
|
691
|
-
for (const [getData, getDataDetail] of getResults) {
|
|
692
|
-
if (!getData || !Object.keys(getData).length) {
|
|
693
|
-
continue;
|
|
694
|
-
}
|
|
695
|
-
|
|
696
|
-
// this process will add result from graph and dynamo to collectedData object by add identifiers and fieldName from getData
|
|
697
|
-
if (getDataDetail.storageType === coreConsts.STORAGE_TYPES.graph) {
|
|
698
|
-
if (getData.returnValue.queryResults.refactoredNodes.objInstanceFull && Object.keys(getData.returnValue.queryResults.refactoredNodes.objInstanceFull).length) {
|
|
699
|
-
for (const getDetailFieldName of getDataDetail.fieldNames) {
|
|
700
|
-
if (addedFieldNames.has(getDetailFieldName)) {
|
|
701
|
-
continue;
|
|
702
|
-
}
|
|
703
|
-
|
|
704
|
-
if (getData.returnValue.queryResults.refactoredNodes.objInstanceFull.identifiers.hasOwnProperty(getDetailFieldName)) {
|
|
705
|
-
Object.assign(
|
|
706
|
-
collectedData.identifiers,
|
|
707
|
-
{ [getDetailFieldName]: getData.returnValue.queryResults.refactoredNodes.objInstanceFull.identifiers[getDetailFieldName] }
|
|
708
|
-
);
|
|
709
|
-
addedFieldNames.add(getDetailFieldName);
|
|
710
|
-
isFound = true;
|
|
711
|
-
} else if (getData.returnValue.queryResults.refactoredNodes.objInstanceFull.fields.hasOwnProperty(getDetailFieldName)) {
|
|
712
|
-
Object.assign(
|
|
713
|
-
collectedData.fields,
|
|
714
|
-
{ [getDetailFieldName]: getData.returnValue.queryResults.refactoredNodes.objInstanceFull.fields[getDetailFieldName] }
|
|
715
|
-
);
|
|
716
|
-
addedFieldNames.add(getDetailFieldName);
|
|
717
|
-
isFound = true;
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
if (getData.returnValue.queryResults.refactoredNodes.versionDataSystemFields || returnSystemFieldsName == true) {
|
|
722
|
-
Object.assign(collectedData.versionDataSystemFields, getData.returnValue.queryResults.refactoredNodes.versionDataSystemFields)
|
|
723
|
-
}
|
|
724
|
-
} else if (getDataDetail.storageType === coreConsts.STORAGE_TYPES.dynamoDB) {
|
|
725
|
-
for (const getDetailFieldName of getDataDetail.fieldNames) {
|
|
726
|
-
if (addedFieldNames.has(getDetailFieldName)) {
|
|
727
|
-
continue;
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
if (getData.hasOwnProperty(getDetailFieldName)) {
|
|
731
|
-
if (identifierFieldNames.has(getDetailFieldName)) {
|
|
732
|
-
Object.assign(
|
|
733
|
-
collectedData.identifiers,
|
|
734
|
-
{ [getDetailFieldName]: getData[getDetailFieldName] }
|
|
735
|
-
);
|
|
736
|
-
addedFieldNames.add(getDetailFieldName);
|
|
737
|
-
isFound = true;
|
|
738
|
-
} else {
|
|
739
|
-
Object.assign(
|
|
740
|
-
collectedData.fields,
|
|
741
|
-
{ [getDetailFieldName]: getData[getDetailFieldName] }
|
|
742
|
-
);
|
|
743
|
-
addedFieldNames.add(getDetailFieldName);
|
|
744
|
-
isFound = true;
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
} else {
|
|
749
|
-
throw new NoRetryError("collectGetData unhandled storageType");
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
if (isFound) {
|
|
754
|
-
return collectedData;
|
|
755
|
-
} else {
|
|
756
|
-
return null;
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
async function createUpdateDataDetail(_izContext, objectSchema, settings = { bucketName: process.env.iz_serviceSchemaBucketName }) {
|
|
762
|
-
let getGraphDataDetails = {};
|
|
763
|
-
let getDynamoDbDataDetails = {};
|
|
764
|
-
let allUpdateDataDetail = {};
|
|
765
|
-
for (let [storageTag, storageProperties] of Object.entries(objectSchema.storageResources)) {
|
|
766
|
-
let storageFieldNames = [];
|
|
767
|
-
for (let [fieldName, fieldNameProperties] of Object.entries(objectSchema.fieldNames)) {
|
|
768
|
-
if (fieldNameProperties.storageResourceTags.includes(storageTag)) {
|
|
769
|
-
let versionedDataLabel = fieldNameProperties.versionedDataLabel
|
|
770
|
-
if (!fieldName.includes(versionedDataLabel)) { // not get fieldNames VersionedData_VersionedDataLabel_VersionedDataFieldNames
|
|
771
|
-
storageFieldNames.push(fieldName)
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
if (storageProperties.storageType === coreConsts.STORAGE_TYPES.graph) {
|
|
776
|
-
let graphStorageTagPerGraphServiceTag = {}
|
|
777
|
-
let useStorageTag = storageTag;
|
|
778
|
-
let graphServiceName = await serviceConfig.getGraphServiceTagWithCache(_izContext, storageProperties.graphServerTag, settings.bucketName)
|
|
779
|
-
if (!graphStorageTagPerGraphServiceTag.hasOwnProperty(graphServiceName)) {
|
|
780
|
-
graphStorageTagPerGraphServiceTag[graphServiceName] = storageTag;
|
|
781
|
-
_izContext.logger.debug("graphStorageTagPerGraphServiceTag", graphStorageTagPerGraphServiceTag)
|
|
782
|
-
} else {
|
|
783
|
-
_izContext.logger.debug("current storageTag", storageTag)
|
|
784
|
-
_izContext.logger.debug("used storageTag", useStorageTag)
|
|
785
|
-
useStorageTag = graphStorageTagPerGraphServiceTag[graphServiceName]
|
|
786
|
-
}
|
|
787
|
-
if (!getGraphDataDetails.hasOwnProperty(useStorageTag)) {
|
|
788
|
-
getGraphDataDetails[graphServiceName] =
|
|
789
|
-
{
|
|
790
|
-
storageType: storageProperties.storageType,
|
|
791
|
-
fieldNames: storageFieldNames
|
|
792
|
-
}
|
|
793
|
-
} else {
|
|
794
|
-
getGraphDataDetails[graphServiceName].fieldNames = [...new Set(getGraphDataDetails[useStorageTag].fieldNames.concat(storageFieldNames))]
|
|
795
|
-
}
|
|
796
|
-
} else if (storageProperties.storageType === coreConsts.STORAGE_TYPES.dynamoDB) {
|
|
797
|
-
let serviceTag = storageProperties.serviceTag || process.env.iz_serviceTag;
|
|
798
|
-
Object.assign(getDynamoDbDataDetails, {
|
|
799
|
-
[storageTag]: {
|
|
800
|
-
storageType: storageProperties.storageType,
|
|
801
|
-
tableName: storageProperties.tableName,
|
|
802
|
-
serviceTag: serviceTag,
|
|
803
|
-
fieldNames: storageFieldNames
|
|
804
|
-
}
|
|
805
|
-
})
|
|
806
|
-
|
|
807
|
-
if (storageTag.groupByPartitionKeyField) {
|
|
808
|
-
Object.assign(
|
|
809
|
-
getDynamoDbDataDetails[storageTag],
|
|
810
|
-
{
|
|
811
|
-
groupByPartitionKeyField: storageProperties.groupByPartitionKeyField
|
|
812
|
-
}
|
|
813
|
-
)
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
_izContext.logger.debug("getGraphDataDetails", getGraphDataDetails);
|
|
819
|
-
_izContext.logger.debug("getDynamoDataDetail", getDynamoDbDataDetails);
|
|
820
|
-
|
|
821
|
-
Object.assign(allUpdateDataDetail, getDynamoDbDataDetails, getGraphDataDetails);
|
|
822
|
-
return allUpdateDataDetail
|
|
823
|
-
}
|
|
824
|
-
|
|
825
|
-
async function createDataDetailsLib(_izContext, objectSchemas, settings = { bucketName: process.env.iz_serviceSchemaBucketName }) {
|
|
826
|
-
_izContext.logger.debug("Lib: createDataDetailsLib:", { objectSchemas: objectSchemas });
|
|
827
|
-
/**
|
|
828
|
-
* TODO: crate DataDetail now will get parent objectSchema if have extendObjType
|
|
829
|
-
* will split fieldNames for each serviceTag and storageREsourceTags
|
|
830
|
-
* */
|
|
831
|
-
|
|
832
|
-
let createDataDetails = {};
|
|
833
|
-
|
|
834
|
-
let storageResources = objectSchemas.storageResources;
|
|
835
|
-
_izContext.logger.debug("storageResources:", storageResources);
|
|
836
|
-
|
|
837
|
-
for (let [keyFieldName, settingFieldName] of Object.entries(objectSchemas.fieldNames)) {
|
|
838
|
-
// _izContext.logger.debug("Loop fieldNamesObjectSchemas", { keyFieldName });
|
|
839
|
-
|
|
840
|
-
for (let eachStorageResourceTag of settingFieldName.storageResourceTags) {
|
|
841
|
-
// _izContext.logger.debug("Loop eachStorageResourceTags", eachStorageResourceTag);
|
|
842
|
-
|
|
843
|
-
if (!storageResources.hasOwnProperty(eachStorageResourceTag)) {
|
|
844
|
-
throw new Error("storageResources is'n exist"); // should be validate in step upload in s3
|
|
845
|
-
} else {
|
|
846
|
-
if (storageResources[eachStorageResourceTag].storageType == coreConsts.STORAGE_TYPES.dynamoDB) {
|
|
847
|
-
if (createDataDetails.hasOwnProperty(eachStorageResourceTag)) {
|
|
848
|
-
// _izContext.logger.debug("SAME STG DB", eachStorageResourceTag);
|
|
849
|
-
createDataDetails[eachStorageResourceTag].fieldNames.push(keyFieldName);
|
|
850
|
-
|
|
851
|
-
} else {
|
|
852
|
-
Object.assign(createDataDetails, {
|
|
853
|
-
[eachStorageResourceTag]: {
|
|
854
|
-
storageType: coreConsts.STORAGE_TYPES.dynamoDB,
|
|
855
|
-
tableName: storageResources[eachStorageResourceTag].tableName,
|
|
856
|
-
serviceTag: storageResources[eachStorageResourceTag].serviceTag || process.env.iz_serviceTag,
|
|
857
|
-
fieldNames: [keyFieldName]
|
|
858
|
-
}
|
|
859
|
-
});
|
|
860
|
-
|
|
861
|
-
if (storageResources[eachStorageResourceTag].hasOwnProperty("groupByPartitionKeyField")) {
|
|
862
|
-
Object.assign(createDataDetails[eachStorageResourceTag], {
|
|
863
|
-
groupByPartitionKeyField: storageResources[eachStorageResourceTag].groupByPartitionKeyField
|
|
864
|
-
});
|
|
865
|
-
}
|
|
866
|
-
}
|
|
867
|
-
} else if (storageResources[eachStorageResourceTag].storageType == coreConsts.STORAGE_TYPES.graph) {
|
|
868
|
-
let checkGraphServerTags = await serviceConfig.getGraphServiceTagWithCache(
|
|
869
|
-
_izContext,
|
|
870
|
-
storageResources[eachStorageResourceTag].graphServerTag,
|
|
871
|
-
settings.bucketName
|
|
872
|
-
);
|
|
873
|
-
if (checkGraphServerTags) {
|
|
874
|
-
if (createDataDetails.hasOwnProperty(checkGraphServerTags)) {
|
|
875
|
-
// _izContext.logger.debug("SAME STG", checkGraphServerTags);
|
|
876
|
-
createDataDetails[checkGraphServerTags].fieldNames.push(keyFieldName)
|
|
877
|
-
|
|
878
|
-
} else {
|
|
879
|
-
// _izContext.logger.debug("NEW STG", checkGraphServerTags);
|
|
880
|
-
Object.assign(createDataDetails, {
|
|
881
|
-
[checkGraphServerTags]: {
|
|
882
|
-
storageType: coreConsts.STORAGE_TYPES.graph,
|
|
883
|
-
fieldNames: [keyFieldName]
|
|
884
|
-
}
|
|
885
|
-
});
|
|
886
|
-
};
|
|
887
|
-
};
|
|
888
|
-
} else if (storageResources[eachStorageResourceTag].storageType === coreConsts.STORAGE_TYPES.externalTopic) {
|
|
889
|
-
let topicName = storageResources[eachStorageResourceTag].serviceTag + storageResources[eachStorageResourceTag].stage + storageResources[eachStorageResourceTag].topicName
|
|
890
|
-
Object.assign(createDataDetails, {
|
|
891
|
-
[topicName]: {
|
|
892
|
-
storageType: coreConsts.STORAGE_TYPES.externalTopic,
|
|
893
|
-
fieldNames: [keyFieldName],
|
|
894
|
-
accountId: storageResources[eachStorageResourceTag].accountId,
|
|
895
|
-
region: storageResources[eachStorageResourceTag].region,
|
|
896
|
-
serviceTag: storageResources[eachStorageResourceTag].serviceTag,
|
|
897
|
-
stage: storageResources[eachStorageResourceTag].stage
|
|
898
|
-
}
|
|
899
|
-
});
|
|
900
|
-
}
|
|
901
|
-
};
|
|
902
|
-
}; // end loop storageResourceTags
|
|
903
|
-
}; // end loop
|
|
904
|
-
|
|
905
|
-
return createDataDetails;
|
|
906
|
-
};
|
|
907
|
-
|
|
908
|
-
async function createDeleteDataDetail(_izContext, objectSchema, settings = { bucketName: process.env.iz_serviceSchemaBucketName }) {
|
|
909
|
-
let deleteDynamoDataDetail = {};
|
|
910
|
-
let deleteGraphDataDetail = {};
|
|
911
|
-
let allDeleteDataDetail = {};
|
|
912
|
-
|
|
913
|
-
for (let [storageTag, storageProperties] of Object.entries(objectSchema.storageResources)) {
|
|
914
|
-
if (storageProperties.storageType === coreConsts.STORAGE_TYPES.dynamoDB) {
|
|
915
|
-
let serviceTag = storageProperties.serviceTag || process.env.iz_serviceTag;
|
|
916
|
-
Object.assign(deleteDynamoDataDetail, {
|
|
917
|
-
[storageTag]: {
|
|
918
|
-
storageType: storageProperties.storageType,
|
|
919
|
-
serviceTag: serviceTag,
|
|
920
|
-
tableName: storageProperties.tableName
|
|
921
|
-
}
|
|
922
|
-
})
|
|
923
|
-
if (storageProperties.groupByPartitionKeyField) {
|
|
924
|
-
Object.assign(
|
|
925
|
-
deleteDynamoDataDetail[storageTag],
|
|
926
|
-
{
|
|
927
|
-
groupByPartitionKeyField: storageProperties.groupByPartitionKeyField
|
|
928
|
-
}
|
|
929
|
-
)
|
|
930
|
-
}
|
|
931
|
-
} else if (storageProperties.storageType === coreConsts.STORAGE_TYPES.graph) {
|
|
932
|
-
let dataDetailPerGraphStorage = {};
|
|
933
|
-
let useStorageTag = storageTag
|
|
934
|
-
let graphServiceName = await serviceConfig.getGraphServiceTagWithCache(_izContext, storageProperties.graphServerTag, settings.bucketName);
|
|
935
|
-
if (!dataDetailPerGraphStorage.hasOwnProperty(graphServiceName)) {
|
|
936
|
-
dataDetailPerGraphStorage[graphServiceName] = storageTag;
|
|
937
|
-
} else {
|
|
938
|
-
useStorageTag = dataDetailPerGraphStorage[graphServiceName]
|
|
939
|
-
}
|
|
940
|
-
if (!deleteGraphDataDetail.hasOwnProperty(useStorageTag)) {
|
|
941
|
-
deleteGraphDataDetail[graphServiceName] =
|
|
942
|
-
{
|
|
943
|
-
storageType: storageProperties.storageType,
|
|
944
|
-
}
|
|
945
|
-
}
|
|
946
|
-
}
|
|
947
|
-
}
|
|
948
|
-
_izContext.logger.debug("deleteGraphDataDetail", deleteGraphDataDetail);
|
|
949
|
-
_izContext.logger.debug("deleteDynamoDataDetail", deleteDynamoDataDetail);
|
|
950
|
-
Object.assign(allDeleteDataDetail, deleteGraphDataDetail, deleteDynamoDataDetail)
|
|
951
|
-
|
|
952
|
-
_izContext.logger.debug("allDeleteDataDetail", allDeleteDataDetail)
|
|
953
|
-
return allDeleteDataDetail
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
function createFieldForUpdateDynamoDb(_izContext, objectSchema, dynamoDataDetail, fields) {
|
|
957
|
-
_izContext.logger.debug("createFieldForUpdateDynamoDb", {
|
|
958
|
-
objectSchema,
|
|
959
|
-
dynamoDataDetail,
|
|
960
|
-
fields
|
|
961
|
-
})
|
|
962
|
-
|
|
963
|
-
let fieldsForUpdateDynamo = {};
|
|
964
|
-
|
|
965
|
-
for (let [fieldName, fieldSetting] of Object.entries(objectSchema.fieldNames)) {
|
|
966
|
-
if (fieldSetting.canUpdate == true || !fieldSetting.hasOwnProperty("canUpdate")) {
|
|
967
|
-
if (dynamoDataDetail.fieldNames.includes(fieldName)) {
|
|
968
|
-
if (fields[fieldName]) {
|
|
969
|
-
if (!fieldsForUpdateDynamo.hasOwnProperty(fields[fieldName])) {
|
|
970
|
-
_izContext.logger.debug("assign new fieldName", (fields[fieldName]))
|
|
971
|
-
Object.assign(fieldsForUpdateDynamo, {
|
|
972
|
-
[fieldName]: fields[fieldName]
|
|
973
|
-
}
|
|
974
|
-
)
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
return fieldsForUpdateDynamo
|
|
981
|
-
}
|
|
36
|
+
import consts from './Consts.js';
|
|
37
|
+
const { TOPIC_NAME_GENERATE_CODE, TOPIC_NAME_GRAPH_HANDLER, PREFIX } = consts;
|
|
982
38
|
|
|
39
|
+
const nodeLabelRegexPattern = '^[a-zA-Z0-9_-]+(?:\:[a-zA-Z0-9_-]+)?$';
|
|
983
40
|
|
|
984
41
|
/**
|
|
985
42
|
*
|
|
@@ -996,15 +53,27 @@ function createFieldForUpdateDynamoDb(_izContext, objectSchema, dynamoDataDetail
|
|
|
996
53
|
* @param {Object} storageResources
|
|
997
54
|
* @param {Boolean} topLevelParent
|
|
998
55
|
*/
|
|
999
|
-
function createBasicRelationshipsProperties(
|
|
1000
|
-
|
|
1001
|
-
|
|
56
|
+
function createBasicRelationshipsProperties(
|
|
57
|
+
from,
|
|
58
|
+
to,
|
|
59
|
+
storageResources,
|
|
60
|
+
baseDirection,
|
|
61
|
+
topLevelParent = false
|
|
62
|
+
) {
|
|
63
|
+
validateObjType.validateObjType({
|
|
64
|
+
objectType: from.objectType,
|
|
65
|
+
serviceTag: from.serviceTag
|
|
66
|
+
});
|
|
67
|
+
validateObjType.validateObjType({
|
|
68
|
+
objectType: to.objectType,
|
|
69
|
+
serviceTag: to.serviceTag
|
|
70
|
+
});
|
|
1002
71
|
|
|
1003
72
|
let otherDirection;
|
|
1004
|
-
if (baseDirection ===
|
|
1005
|
-
otherDirection =
|
|
1006
|
-
} else if (baseDirection ===
|
|
1007
|
-
otherDirection =
|
|
73
|
+
if (baseDirection === 'to') {
|
|
74
|
+
otherDirection = 'from';
|
|
75
|
+
} else if (baseDirection === 'from') {
|
|
76
|
+
otherDirection = 'to';
|
|
1008
77
|
}
|
|
1009
78
|
|
|
1010
79
|
let relationshipProperties = {
|
|
@@ -1042,51 +111,66 @@ function createBasicRelationshipsProperties(from, to, storageResources, baseDire
|
|
|
1042
111
|
requiredOnCreate: to.requiredOnCreate
|
|
1043
112
|
}
|
|
1044
113
|
}
|
|
1045
|
-
]
|
|
1046
|
-
}
|
|
114
|
+
]
|
|
115
|
+
};
|
|
1047
116
|
|
|
1048
117
|
if (topLevelParent === true) {
|
|
1049
|
-
relationshipProperties.links.push(
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
objectType: to.objectType
|
|
1056
|
-
},
|
|
1057
|
-
linkType: "one",
|
|
1058
|
-
direction: "from",
|
|
1059
|
-
requiredOnCreate: false
|
|
118
|
+
relationshipProperties.links.push({
|
|
119
|
+
storageResourceTags: Object.keys(storageResources),
|
|
120
|
+
from: {
|
|
121
|
+
objType: {
|
|
122
|
+
serviceTag: to.serviceTag,
|
|
123
|
+
objectType: to.objectType
|
|
1060
124
|
},
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
}
|
|
125
|
+
linkType: 'one',
|
|
126
|
+
direction: 'from',
|
|
127
|
+
requiredOnCreate: false
|
|
128
|
+
},
|
|
129
|
+
to: {
|
|
130
|
+
objType: {
|
|
131
|
+
serviceTag: to.serviceTag,
|
|
132
|
+
objectType: to.objectType
|
|
133
|
+
},
|
|
134
|
+
linkType: 'many',
|
|
135
|
+
direction: 'to',
|
|
136
|
+
requiredOnCreate: false
|
|
1070
137
|
}
|
|
1071
|
-
)
|
|
138
|
+
});
|
|
1072
139
|
}
|
|
1073
|
-
return relationshipProperties
|
|
140
|
+
return relationshipProperties;
|
|
1074
141
|
}
|
|
1075
142
|
|
|
1076
|
-
function createFieldNamesFromRequestParamsByObjectSchema(
|
|
143
|
+
function createFieldNamesFromRequestParamsByObjectSchema(
|
|
144
|
+
_izContext,
|
|
145
|
+
requestParams,
|
|
146
|
+
objectSchema
|
|
147
|
+
) {
|
|
1077
148
|
let createFieldNameParams = {};
|
|
1078
|
-
_izContext.logger.debug(
|
|
149
|
+
_izContext.logger.debug(
|
|
150
|
+
'createFieldNamesFromRequestParamsByObjectSchema ::',
|
|
151
|
+
{ requestParams, objectSchema }
|
|
152
|
+
);
|
|
1079
153
|
for (const fieldName of Object.keys(objectSchema.fieldNames)) {
|
|
1080
154
|
if (Object.keys(requestParams).includes(fieldName)) {
|
|
1081
155
|
if (!createFieldNameParams.hasOwnProperty(fieldName)) {
|
|
1082
|
-
Object.assign(createFieldNameParams, {
|
|
156
|
+
Object.assign(createFieldNameParams, {
|
|
157
|
+
[fieldName]: requestParams[fieldName]
|
|
158
|
+
});
|
|
1083
159
|
}
|
|
1084
160
|
}
|
|
1085
161
|
}
|
|
1086
|
-
return createFieldNameParams
|
|
162
|
+
return createFieldNameParams;
|
|
1087
163
|
}
|
|
1088
164
|
|
|
1089
|
-
async function sharedCreateEndpoint(_izContext,
|
|
165
|
+
async function sharedCreateEndpoint(_izContext,
|
|
166
|
+
objType,
|
|
167
|
+
requestParams,
|
|
168
|
+
callingFlowConfig,
|
|
169
|
+
settings = {
|
|
170
|
+
userAgent: false,
|
|
171
|
+
directInvoke: false,
|
|
172
|
+
parentObject: {}
|
|
173
|
+
}) {
|
|
1090
174
|
let objectSchemas = await getObjectSchema.getObjectSchemaCombineFieldNamesWithCache(_izContext, objType)
|
|
1091
175
|
let createDataDetails = await createDataDetailsLib(_izContext, objectSchemas)
|
|
1092
176
|
_izContext.logger.debug("createDataDetails is =", createDataDetails);
|
|
@@ -1096,44 +180,66 @@ async function sharedCreateEndpoint(_izContext, objType, requestParams, callingF
|
|
|
1096
180
|
let objInstanceFull = {
|
|
1097
181
|
identifiers: {},
|
|
1098
182
|
fields: {}
|
|
1099
|
-
}
|
|
183
|
+
};
|
|
1100
184
|
|
|
1101
185
|
for (let fieldName of Object.keys(requestParams.fieldNames)) {
|
|
1102
186
|
if (objectSchemas.identifierFieldNames.includes(fieldName)) {
|
|
1103
|
-
_izContext.logger.debug(
|
|
187
|
+
_izContext.logger.debug('identifiers is', fieldName);
|
|
1104
188
|
Object.assign(objInstanceFull.identifiers, {
|
|
1105
189
|
[fieldName]: requestParams.fieldNames[fieldName]
|
|
1106
190
|
});
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
1109
193
|
|
|
1110
194
|
let objInstanceFullForDynamoDb = lodash.cloneDeep(objInstanceFull);
|
|
1111
195
|
let objInstanceFullForGraph = lodash.cloneDeep(objInstanceFull);
|
|
1112
196
|
let objInstanceFullForExternalTopic = lodash.cloneDeep(objInstanceFull);
|
|
1113
197
|
|
|
1114
|
-
for (const [storageTag, createDataDetail] of Object.entries(
|
|
198
|
+
for (const [storageTag, createDataDetail] of Object.entries(
|
|
199
|
+
createDataDetails
|
|
200
|
+
)) {
|
|
1115
201
|
if (createDataDetail.storageType == coreConsts.STORAGE_TYPES.dynamoDB) {
|
|
1116
|
-
_izContext.logger.debug(
|
|
202
|
+
_izContext.logger.debug('::::::DynamoDB::::::', {
|
|
203
|
+
storageTag,
|
|
204
|
+
objInstanceFull
|
|
205
|
+
});
|
|
1117
206
|
|
|
1118
207
|
if (settings.parentObject) {
|
|
1119
|
-
if (
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
208
|
+
if (
|
|
209
|
+
createDataDetail.tableName.includes(
|
|
210
|
+
firstLetterUpperCase(`${parentObject.objectType}Records`)
|
|
211
|
+
)
|
|
212
|
+
) {
|
|
213
|
+
Object.assign(objInstanceFullForDynamoDb.fields, {
|
|
214
|
+
[`${settings.parentObject.objectType}HandlerServiceTag`]:
|
|
215
|
+
process.env.iz_serviceTag
|
|
216
|
+
});
|
|
1124
217
|
}
|
|
1125
218
|
}
|
|
1126
219
|
|
|
1127
|
-
Object.assign(
|
|
1128
|
-
|
|
220
|
+
Object.assign(
|
|
221
|
+
objInstanceFullForDynamoDb.fields,
|
|
222
|
+
createObjInstanceFullFieldsByStorageTag(
|
|
223
|
+
_izContext,
|
|
224
|
+
storageTag,
|
|
225
|
+
createDataDetail
|
|
226
|
+
)
|
|
227
|
+
);
|
|
228
|
+
_izContext.logger.debug(
|
|
229
|
+
'objInstanceFull before create item in dynamoDB',
|
|
230
|
+
objInstanceFullForDynamoDb
|
|
231
|
+
);
|
|
1129
232
|
|
|
1130
233
|
let identifiersForCreateData = await dynamoDbIdentifiersByStorageResource(
|
|
1131
234
|
_izContext,
|
|
1132
235
|
objectSchemas,
|
|
1133
236
|
createDataDetail,
|
|
1134
237
|
objInstanceFullForDynamoDb.identifiers
|
|
1135
|
-
)
|
|
1136
|
-
_izContext.logger.debug(
|
|
238
|
+
);
|
|
239
|
+
_izContext.logger.debug(
|
|
240
|
+
'identifiersForCreateData',
|
|
241
|
+
identifiersForCreateData
|
|
242
|
+
);
|
|
1137
243
|
|
|
1138
244
|
await dynamodbSharedLib.putItem(
|
|
1139
245
|
_izContext,
|
|
@@ -1148,7 +254,7 @@ async function sharedCreateEndpoint(_izContext, objType, requestParams, callingF
|
|
|
1148
254
|
}
|
|
1149
255
|
);
|
|
1150
256
|
|
|
1151
|
-
objInstanceFullForDynamoDb.fields = {} // prevent using fieldNames from other tableName
|
|
257
|
+
objInstanceFullForDynamoDb.fields = {}; // prevent using fieldNames from other tableName
|
|
1152
258
|
if (allAwaitingStepsId.length == 0) {
|
|
1153
259
|
let messageObject = {
|
|
1154
260
|
objType: objType,
|
|
@@ -1156,49 +262,85 @@ async function sharedCreateEndpoint(_izContext, objType, requestParams, callingF
|
|
|
1156
262
|
identifiers: objInstanceFullForDynamoDb.identifiers,
|
|
1157
263
|
fields: objInstanceFullForDynamoDb.fields
|
|
1158
264
|
}
|
|
1159
|
-
}
|
|
265
|
+
};
|
|
1160
266
|
|
|
1161
|
-
if (
|
|
267
|
+
if (
|
|
268
|
+
callingFlowConfig[
|
|
269
|
+
callingFlowSharedLib.consts.CALLINGFLOW_PROPERTYNAME
|
|
270
|
+
]
|
|
271
|
+
) {
|
|
1162
272
|
// send message to SNS OutCreateNodeComplete
|
|
1163
|
-
_izContext.logger.debug(
|
|
1164
|
-
messageObject =
|
|
273
|
+
_izContext.logger.debug('HAVE CallingFlow');
|
|
274
|
+
messageObject =
|
|
275
|
+
callingFlowSharedLib.addPassBackPropertiesToSnsResponseMessageObject(
|
|
276
|
+
callingFlowConfig,
|
|
277
|
+
messageObject
|
|
278
|
+
);
|
|
1165
279
|
|
|
1166
|
-
let messageAttributes =
|
|
1167
|
-
|
|
280
|
+
let messageAttributes =
|
|
281
|
+
callingFlowSharedLib.addCallingFlowToSnsResponseMessageAttributes(
|
|
282
|
+
callingFlowConfig,
|
|
283
|
+
{}
|
|
284
|
+
);
|
|
285
|
+
let outCreateNodeCompleteTopic =
|
|
286
|
+
await snsSharedLib.snsTopicArnByFlowSchema(
|
|
287
|
+
_izContext,
|
|
288
|
+
TOPIC_NAME_GENERATE_CODE.outCreateNodeComplete
|
|
289
|
+
);
|
|
1168
290
|
let messageParams = {
|
|
1169
291
|
Message: JSON.stringify(messageObject),
|
|
1170
|
-
MessageAttributes: sns.createStringMessageAttributes(
|
|
1171
|
-
|
|
292
|
+
MessageAttributes: sns.createStringMessageAttributes(
|
|
293
|
+
_izContext,
|
|
294
|
+
messageAttributes
|
|
295
|
+
),
|
|
296
|
+
TopicArn: outCreateNodeCompleteTopic
|
|
1172
297
|
};
|
|
1173
298
|
|
|
1174
|
-
_izContext.logger.debug(
|
|
299
|
+
_izContext.logger.debug(
|
|
300
|
+
'messageParams OutCreateNode ::::::: ',
|
|
301
|
+
messageParams
|
|
302
|
+
);
|
|
1175
303
|
await sns.publishAsync(_izContext, messageParams);
|
|
1176
304
|
}
|
|
1177
305
|
return {
|
|
1178
306
|
objType: objType,
|
|
1179
307
|
objInstanceFull: objInstanceFullForDynamoDb,
|
|
1180
308
|
relationships: requestParams.relationships || [],
|
|
1181
|
-
status:
|
|
309
|
+
status: 'complete',
|
|
1182
310
|
errorsFound: []
|
|
1183
|
-
}
|
|
311
|
+
};
|
|
1184
312
|
}
|
|
1185
|
-
|
|
1186
313
|
} else if (createDataDetail.storageType == coreConsts.STORAGE_TYPES.graph) {
|
|
1187
|
-
_izContext.logger.debug(
|
|
314
|
+
_izContext.logger.debug('::::::Graph::::::', {
|
|
315
|
+
storageTag,
|
|
316
|
+
objInstanceFull
|
|
317
|
+
});
|
|
1188
318
|
|
|
1189
|
-
Object.assign(
|
|
1190
|
-
|
|
319
|
+
Object.assign(
|
|
320
|
+
objInstanceFullForGraph.fields,
|
|
321
|
+
createObjInstanceFullFieldsByStorageTag(
|
|
322
|
+
_izContext,
|
|
323
|
+
storageTag,
|
|
324
|
+
createDataDetail
|
|
325
|
+
)
|
|
326
|
+
);
|
|
327
|
+
_izContext.logger.debug(
|
|
328
|
+
'objInstanceFull before send to Graph',
|
|
329
|
+
objInstanceFullForGraph
|
|
330
|
+
);
|
|
1191
331
|
|
|
1192
332
|
// allStorageTagComplete = false;
|
|
1193
|
-
allAwaitingStepsId.push(
|
|
1194
|
-
(
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
333
|
+
allAwaitingStepsId.push(
|
|
334
|
+
await asyncFlowSharedLib.createAwaitingStepId(
|
|
335
|
+
hash({
|
|
336
|
+
objType: objType,
|
|
337
|
+
graphServerTag: storageTag,
|
|
338
|
+
identifiers: objInstanceFullForGraph.identifiers,
|
|
339
|
+
callingFlowProperties: callingFlowConfig.callingFlowProperties || {}
|
|
340
|
+
}),
|
|
341
|
+
PREFIX.CREATE_OBJECT_ASYNC
|
|
342
|
+
)
|
|
343
|
+
);
|
|
1202
344
|
listOfObjectForCreates.push({
|
|
1203
345
|
[storageTag]: {
|
|
1204
346
|
objInstanceFull: {
|
|
@@ -1209,42 +351,71 @@ async function sharedCreateEndpoint(_izContext, objType, requestParams, callingF
|
|
|
1209
351
|
}
|
|
1210
352
|
});
|
|
1211
353
|
|
|
1212
|
-
_izContext.logger.debug(
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
354
|
+
_izContext.logger.debug('FIRST', listOfObjectForCreates);
|
|
355
|
+
} else if (
|
|
356
|
+
createDataDetail.storageType === coreConsts.STORAGE_TYPES.externalTopic
|
|
357
|
+
) {
|
|
358
|
+
_izContext.logger.debug('::::::externalTopic::::::', {
|
|
359
|
+
storageTag,
|
|
360
|
+
createDataDetail
|
|
361
|
+
});
|
|
362
|
+
Object.assign(
|
|
363
|
+
objInstanceFullForExternalTopic.fields,
|
|
364
|
+
createObjInstanceFullFieldsByStorageTag(
|
|
365
|
+
_izContext,
|
|
366
|
+
storageTag,
|
|
367
|
+
createDataDetail
|
|
368
|
+
)
|
|
369
|
+
);
|
|
370
|
+
_izContext.logger.debug(
|
|
371
|
+
'objInstanceFull before send to external topic',
|
|
372
|
+
objInstanceFullForExternalTopic
|
|
373
|
+
);
|
|
1218
374
|
|
|
1219
|
-
allAwaitingStepsId.push(
|
|
1220
|
-
(
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
375
|
+
allAwaitingStepsId.push(
|
|
376
|
+
await asyncFlowSharedLib.createAwaitingStepId(
|
|
377
|
+
hash({
|
|
378
|
+
objType: objType,
|
|
379
|
+
graphServerTag: storageTag,
|
|
380
|
+
identifiers: objInstanceFullForGraph.identifiers,
|
|
381
|
+
callingFlowProperties: callingFlowConfig.callingFlowProperties || {}
|
|
382
|
+
}),
|
|
383
|
+
PREFIX.CREATE_OBJECT_EXTERNAL_TOPIC
|
|
384
|
+
)
|
|
385
|
+
);
|
|
1228
386
|
|
|
1229
387
|
let sendToCreateExternalTopic = {
|
|
1230
|
-
Message: JSON.stringify({
|
|
388
|
+
Message: JSON.stringify({
|
|
389
|
+
objType,
|
|
390
|
+
objInstanceFull: objInstanceFullForExternalTopic,
|
|
391
|
+
relationships: requestParams.relationships
|
|
392
|
+
}),
|
|
1231
393
|
TopicArn: `arn:aws:sns:${createDataDetail.region}:${createDataDetail.accountId}:${createDataDetail.serviceTag}_${createDataDetail.stage}_Create_In`
|
|
1232
394
|
};
|
|
1233
|
-
_izContext.logger.debug(
|
|
395
|
+
_izContext.logger.debug(
|
|
396
|
+
'Request params before send to create endpoint:',
|
|
397
|
+
sendToCreateExternalTopic
|
|
398
|
+
);
|
|
1234
399
|
|
|
1235
|
-
await sns.publishAsync(_izContext, sendToCreateExternalTopic)
|
|
1236
|
-
return sendToCreateExternalTopic
|
|
400
|
+
await sns.publishAsync(_izContext, sendToCreateExternalTopic);
|
|
401
|
+
return sendToCreateExternalTopic;
|
|
1237
402
|
}
|
|
1238
|
-
}
|
|
1239
|
-
_izContext.logger.debug(
|
|
403
|
+
}
|
|
404
|
+
_izContext.logger.debug(
|
|
405
|
+
'[1]listOfObjectForCreates:::',
|
|
406
|
+
listOfObjectForCreates
|
|
407
|
+
);
|
|
1240
408
|
|
|
1241
409
|
/// step save awaitingMultipleStep of storageType graph ...........................................................
|
|
1242
410
|
if (!settings.userAgent) {
|
|
1243
|
-
_izContext.logger.debug(
|
|
411
|
+
_izContext.logger.debug('not api will create awaitingStep');
|
|
1244
412
|
await asyncFlowSharedLib.createAwaitingMultipleSteps(
|
|
1245
413
|
_izContext,
|
|
1246
414
|
allAwaitingStepsId,
|
|
1247
|
-
asyncFlowSharedLib.createPendingStepId(
|
|
415
|
+
asyncFlowSharedLib.createPendingStepId(
|
|
416
|
+
hash({ objType: objType, identifiers: objInstanceFull.identifiers }),
|
|
417
|
+
PREFIX.CREATE_OBJECT_ASYNC_COMPLETE
|
|
418
|
+
)
|
|
1248
419
|
);
|
|
1249
420
|
}
|
|
1250
421
|
//............................................................................................................
|
|
@@ -1252,28 +423,34 @@ async function sharedCreateEndpoint(_izContext, objType, requestParams, callingF
|
|
|
1252
423
|
// process storageType : graph
|
|
1253
424
|
let messageObject = {};
|
|
1254
425
|
for (let objectCreate of listOfObjectForCreates) {
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
426
|
+
for (let [graphServiceName, objectForCreate] of Object.entries(
|
|
427
|
+
objectCreate
|
|
428
|
+
)) {
|
|
429
|
+
_izContext.logger.debug('Loop each graph:', {
|
|
1258
430
|
[graphServiceName]: objectForCreate
|
|
1259
431
|
});
|
|
1260
432
|
|
|
1261
|
-
if (objectForCreate.allStorageTagComplete == false) {
|
|
433
|
+
if (objectForCreate.allStorageTagComplete == false) {
|
|
434
|
+
// needless check because in listOfObjectForCreates push case graph only!
|
|
1262
435
|
messageObject = {
|
|
1263
436
|
objType: objType,
|
|
1264
437
|
objInstanceFull: objectForCreate.objInstanceFull,
|
|
1265
438
|
relationships: requestParams.relationships || []
|
|
1266
439
|
};
|
|
1267
|
-
}
|
|
440
|
+
}
|
|
1268
441
|
|
|
1269
|
-
_izContext.logger.debug(
|
|
442
|
+
_izContext.logger.debug('SENT MESSAGE EACH GRAPH::::', {
|
|
443
|
+
graphServiceName,
|
|
444
|
+
messageObject,
|
|
445
|
+
callingFlowConfig
|
|
446
|
+
});
|
|
1270
447
|
|
|
1271
448
|
Object.assign(messageObject, {
|
|
1272
449
|
settings: { updatePropertiesOnMatch: false },
|
|
1273
|
-
originTimestamp: Date.now()
|
|
450
|
+
originTimestamp: Date.now()
|
|
1274
451
|
});
|
|
1275
452
|
if (settings.userAgent) {
|
|
1276
|
-
_izContext.logger.debug(
|
|
453
|
+
_izContext.logger.debug('have userAgent will invoke GraphHandler');
|
|
1277
454
|
let createNodeResult = await graphSharedLibs.createNodeV2(
|
|
1278
455
|
_izContext,
|
|
1279
456
|
graphServiceName,
|
|
@@ -1284,11 +461,12 @@ async function sharedCreateEndpoint(_izContext, objType, requestParams, callingF
|
|
|
1284
461
|
{
|
|
1285
462
|
updatePropertiesOnMatch: false
|
|
1286
463
|
}
|
|
1287
|
-
)
|
|
1288
|
-
return createNodeResult
|
|
1289
|
-
|
|
464
|
+
);
|
|
465
|
+
return createNodeResult;
|
|
1290
466
|
} else if (settings.directInvoke) {
|
|
1291
|
-
_izContext.logger.debug(
|
|
467
|
+
_izContext.logger.debug(
|
|
468
|
+
'Direction Invoke case will invoke GraphHandlerInv'
|
|
469
|
+
);
|
|
1292
470
|
let createNodeResult = await graphSharedLibs.createNodeV2(
|
|
1293
471
|
_izContext,
|
|
1294
472
|
graphServiceName,
|
|
@@ -1303,48 +481,76 @@ async function sharedCreateEndpoint(_izContext, objType, requestParams, callingF
|
|
|
1303
481
|
|
|
1304
482
|
return createNodeResult;
|
|
1305
483
|
} else {
|
|
1306
|
-
_izContext.logger.debug(
|
|
1307
|
-
|
|
1308
|
-
messageObject,
|
|
1309
|
-
callingFlowSharedLib.addParentCallingFlowConfig(
|
|
1310
|
-
callingFlowConfig, // receive parent callingFlowConfig.
|
|
1311
|
-
callingFlowSharedLib.createCallingFlowConfig( // calling flow own service
|
|
1312
|
-
await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.createNodeComplete), {}
|
|
1313
|
-
)
|
|
1314
|
-
)
|
|
484
|
+
_izContext.logger.debug(
|
|
485
|
+
'not have userAgent will send Message to GraphHandler'
|
|
1315
486
|
);
|
|
487
|
+
messageObject =
|
|
488
|
+
callingFlowSharedLib.addCallingFlowToSnsRequestMessageObject(
|
|
489
|
+
messageObject,
|
|
490
|
+
callingFlowSharedLib.addParentCallingFlowConfig(
|
|
491
|
+
callingFlowConfig, // receive parent callingFlowConfig.
|
|
492
|
+
callingFlowSharedLib.createCallingFlowConfig(
|
|
493
|
+
// calling flow own service
|
|
494
|
+
await lambdaSharedLib.lambdaFunctionName(
|
|
495
|
+
_izContext,
|
|
496
|
+
TOPIC_NAME_GENERATE_CODE.createNodeComplete
|
|
497
|
+
),
|
|
498
|
+
{}
|
|
499
|
+
)
|
|
500
|
+
)
|
|
501
|
+
);
|
|
1316
502
|
|
|
1317
503
|
let messageToCreateObject = {
|
|
1318
504
|
Message: JSON.stringify(messageObject),
|
|
1319
|
-
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(
|
|
505
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(
|
|
506
|
+
_izContext,
|
|
507
|
+
TOPIC_NAME_GRAPH_HANDLER.inCreateNode,
|
|
508
|
+
graphServiceName
|
|
509
|
+
)
|
|
1320
510
|
};
|
|
1321
|
-
_izContext.logger.debug(
|
|
511
|
+
_izContext.logger.debug(
|
|
512
|
+
'RequestParams before send to sqs messageToCreateObject ::::::: ',
|
|
513
|
+
messageToCreateObject
|
|
514
|
+
);
|
|
1322
515
|
await sns.publishAsync(_izContext, messageToCreateObject);
|
|
1323
516
|
|
|
1324
|
-
return messageObject
|
|
517
|
+
return messageObject;
|
|
1325
518
|
}
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
519
|
+
}
|
|
520
|
+
}
|
|
1328
521
|
|
|
1329
|
-
function createObjInstanceFullFieldsByStorageTag(
|
|
522
|
+
function createObjInstanceFullFieldsByStorageTag(
|
|
523
|
+
_izContext,
|
|
524
|
+
storageTag,
|
|
525
|
+
createDataDetail
|
|
526
|
+
) {
|
|
1330
527
|
let fields = {};
|
|
1331
528
|
for (let fieldName of Object.keys(requestParams.fieldNames)) {
|
|
1332
|
-
if (
|
|
1333
|
-
|
|
529
|
+
if (
|
|
530
|
+
createDataDetails[storageTag].fieldNames.includes(fieldName) &&
|
|
531
|
+
createDataDetail.fieldNames.includes(fieldName)
|
|
532
|
+
) {
|
|
1334
533
|
if (!objInstanceFull.identifiers.hasOwnProperty(fieldName)) {
|
|
1335
534
|
if (!fields.hasOwnProperty(fieldName)) {
|
|
1336
535
|
Object.assign(fields, {
|
|
1337
536
|
[fieldName]: requestParams.fieldNames[fieldName]
|
|
1338
|
-
})
|
|
537
|
+
});
|
|
1339
538
|
}
|
|
1340
539
|
}
|
|
1341
540
|
}
|
|
1342
541
|
}
|
|
1343
|
-
return fields
|
|
542
|
+
return fields;
|
|
1344
543
|
}
|
|
1345
544
|
}
|
|
1346
545
|
|
|
1347
|
-
async function sharedCreateCompleteEndpoint(
|
|
546
|
+
async function sharedCreateCompleteEndpoint(
|
|
547
|
+
_izContext,
|
|
548
|
+
returnValue,
|
|
549
|
+
status,
|
|
550
|
+
errorsFound,
|
|
551
|
+
graphServiceTag,
|
|
552
|
+
passBackProperties
|
|
553
|
+
) {
|
|
1348
554
|
let existsNode = null;
|
|
1349
555
|
let createNodeFinished = false;
|
|
1350
556
|
if (Object.keys(returnValue.queryResult.returnCreateNode.existsNode).length) {
|
|
@@ -1353,65 +559,88 @@ async function sharedCreateCompleteEndpoint(_izContext, returnValue, status, err
|
|
|
1353
559
|
objectType: returnValue.requestParams.objType.objectType,
|
|
1354
560
|
serviceTag: returnValue.requestParams.objType.serviceTag
|
|
1355
561
|
},
|
|
1356
|
-
objInstanceFull:
|
|
1357
|
-
|
|
562
|
+
objInstanceFull:
|
|
563
|
+
returnValue.queryResult.returnCreateNode.existsNode.objInstanceFull
|
|
564
|
+
};
|
|
1358
565
|
}
|
|
1359
566
|
|
|
1360
567
|
let awaitingStepId = await asyncFlowSharedLib.createAwaitingStepId(
|
|
1361
|
-
|
|
568
|
+
hash({
|
|
1362
569
|
objType: returnValue.requestParams.objType,
|
|
1363
570
|
graphServerTag: graphServiceTag,
|
|
1364
571
|
identifiers: returnValue.requestParams.objInstanceFull.identifiers,
|
|
1365
|
-
callingFlowProperties:
|
|
1366
|
-
|
|
572
|
+
callingFlowProperties:
|
|
573
|
+
passBackProperties.passBackProperties.parentPassBackProperties
|
|
574
|
+
.callingFlowProperties || {}
|
|
575
|
+
}),
|
|
1367
576
|
PREFIX.CREATE_OBJECT_ASYNC
|
|
1368
|
-
)
|
|
1369
|
-
_izContext.logger.debug(
|
|
577
|
+
);
|
|
578
|
+
_izContext.logger.debug('awaitingStepId:', awaitingStepId);
|
|
1370
579
|
|
|
1371
580
|
let recordAwaitingSteps = await dynamodbSharedLib.query(
|
|
1372
581
|
_izContext,
|
|
1373
|
-
await dynamodbSharedLib.tableName(_izContext,
|
|
582
|
+
await dynamodbSharedLib.tableName(_izContext, 'AwaitingMultipleSteps'),
|
|
1374
583
|
{
|
|
1375
584
|
awaitingStepId: awaitingStepId
|
|
1376
585
|
}
|
|
1377
586
|
);
|
|
1378
|
-
_izContext.logger.debug(
|
|
587
|
+
_izContext.logger.debug('record awaitingSteps::', recordAwaitingSteps);
|
|
1379
588
|
|
|
1380
589
|
await Promise.all(
|
|
1381
590
|
recordAwaitingSteps.Items.map(async ({ pendingStepId }) => {
|
|
1382
|
-
if (
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
591
|
+
if (
|
|
592
|
+
await asyncFlowSharedLib.checkAllAwaitingStepsFinished(
|
|
593
|
+
_izContext,
|
|
594
|
+
pendingStepId,
|
|
595
|
+
awaitingStepId,
|
|
596
|
+
errorsFound
|
|
597
|
+
)
|
|
598
|
+
) {
|
|
599
|
+
_izContext.logger.debug('finish all awaitingStep');
|
|
1389
600
|
|
|
1390
601
|
let messageObject = {
|
|
1391
602
|
objType: {
|
|
1392
603
|
objectType: returnValue.requestParams.objType.objectType,
|
|
1393
604
|
serviceTag: returnValue.requestParams.objType.serviceTag
|
|
1394
605
|
},
|
|
1395
|
-
objInstanceFull:
|
|
606
|
+
objInstanceFull:
|
|
607
|
+
returnValue.queryResult.returnCreateNode.objInstanceFull,
|
|
1396
608
|
relationships: returnValue.queryResult.returnCreateNode.relationships,
|
|
1397
609
|
existsNode: existsNode,
|
|
1398
610
|
status: status,
|
|
1399
611
|
errorsFound: errorsFound
|
|
1400
|
-
}
|
|
612
|
+
};
|
|
1401
613
|
|
|
1402
|
-
messageObject =
|
|
1403
|
-
|
|
614
|
+
messageObject =
|
|
615
|
+
callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(
|
|
616
|
+
passBackProperties,
|
|
617
|
+
messageObject
|
|
618
|
+
);
|
|
619
|
+
let messageAttributes =
|
|
620
|
+
callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(
|
|
621
|
+
passBackProperties,
|
|
622
|
+
{}
|
|
623
|
+
);
|
|
1404
624
|
|
|
1405
625
|
let sendMessageOutCreateObjectComplete = {
|
|
1406
626
|
Message: JSON.stringify(messageObject),
|
|
1407
|
-
MessageAttributes: sns.createStringMessageAttributes(
|
|
1408
|
-
|
|
627
|
+
MessageAttributes: sns.createStringMessageAttributes(
|
|
628
|
+
_izContext,
|
|
629
|
+
messageAttributes
|
|
630
|
+
),
|
|
631
|
+
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(
|
|
632
|
+
_izContext,
|
|
633
|
+
TOPIC_NAME_GENERATE_CODE.outCreateNodeComplete
|
|
634
|
+
)
|
|
1409
635
|
};
|
|
1410
|
-
_izContext.logger.debug(
|
|
636
|
+
_izContext.logger.debug(
|
|
637
|
+
'Send message to OutCreateObjectComplete :::>',
|
|
638
|
+
sendMessageOutCreateObjectComplete
|
|
639
|
+
);
|
|
1411
640
|
await sns.publishAsync(_izContext, sendMessageOutCreateObjectComplete);
|
|
1412
|
-
createNodeFinished = true
|
|
641
|
+
createNodeFinished = true;
|
|
1413
642
|
} else {
|
|
1414
|
-
createNodeFinished = false
|
|
643
|
+
createNodeFinished = false;
|
|
1415
644
|
}
|
|
1416
645
|
|
|
1417
646
|
await asyncFlowSharedLib.removeAwaitingMultipleStep(
|
|
@@ -1420,820 +649,14 @@ async function sharedCreateCompleteEndpoint(_izContext, returnValue, status, err
|
|
|
1420
649
|
pendingStepId,
|
|
1421
650
|
errorsFound
|
|
1422
651
|
);
|
|
1423
|
-
|
|
1424
652
|
})
|
|
1425
|
-
)
|
|
1426
|
-
return createNodeFinished
|
|
653
|
+
);
|
|
654
|
+
return createNodeFinished;
|
|
1427
655
|
}
|
|
1428
656
|
|
|
1429
657
|
export default {
|
|
1430
|
-
sendMsgOutComplete,
|
|
1431
|
-
messageToDlq,
|
|
1432
|
-
|
|
1433
|
-
validateSchemaMiddleware,
|
|
1434
|
-
validateSchemaPerRecord,
|
|
1435
|
-
validatorSchemaMiddlewareByAction,
|
|
1436
|
-
|
|
1437
|
-
createGetDataDetails,
|
|
1438
|
-
collectGetData,
|
|
1439
|
-
|
|
1440
|
-
generateDynamoDbIdentifiers,
|
|
1441
|
-
generateDynamoDbIdentifiersWithCache,
|
|
1442
|
-
dynamoDbIdentifiersByStorageResource,
|
|
1443
|
-
createUpdateDataDetail,
|
|
1444
|
-
createDataDetailsLib,
|
|
1445
|
-
createDeleteDataDetail,
|
|
1446
|
-
|
|
1447
|
-
createFieldForUpdateDynamoDb,
|
|
1448
658
|
createBasicRelationshipsProperties,
|
|
1449
659
|
createFieldNamesFromRequestParamsByObjectSchema,
|
|
1450
660
|
sharedCreateEndpoint,
|
|
1451
|
-
sharedCreateCompleteEndpoint
|
|
1452
|
-
}
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
// /**
|
|
1459
|
-
// * filter request param depend on generatedValidatorSchema function
|
|
1460
|
-
// * @param {object} _izContext
|
|
1461
|
-
// * @param {object} requestParams - requestParams that need to filter
|
|
1462
|
-
// * @param {string} action - use to match generateValidatorSchemaFunction
|
|
1463
|
-
// * @param {string} objectType - objectType for search objectSchema
|
|
1464
|
-
// * @param {string[]} specificFieldNames - setting of generateValidatorSchemaFunction
|
|
1465
|
-
// */
|
|
1466
|
-
// async function filterRequestParam(_izContext, requestParams, action, objectType, specificFieldNames) {
|
|
1467
|
-
|
|
1468
|
-
// if (!validatorSchema.schemaFunctionPerAction[action]) {
|
|
1469
|
-
// throw new NoRetryError(`Not found function for generateValidatorSchema of action:${action}`);
|
|
1470
|
-
// }
|
|
1471
|
-
|
|
1472
|
-
// // prepare variable
|
|
1473
|
-
// const generateValidatorFunction = validatorSchema.schemaFunctionPerAction[action];
|
|
1474
|
-
|
|
1475
|
-
// const generatedValidatorSchema = await generateValidatorFunction(_izContext, objectType, specificFieldNames);
|
|
1476
|
-
|
|
1477
|
-
// // prepare new requestParams depend on properties of generatedValidatorSchema
|
|
1478
|
-
// let newRequestParams = {}
|
|
1479
|
-
// for (let validatorFieldName in generatedValidatorSchema.properties) {
|
|
1480
|
-
// if (requestParams.hasOwnProperty(validatorFieldName)) {
|
|
1481
|
-
// Object.assign(newRequestParams, { [validatorFieldName]: requestParams[validatorFieldName] })
|
|
1482
|
-
// }
|
|
1483
|
-
// }
|
|
1484
|
-
|
|
1485
|
-
// // add additionalRequest to requestParams
|
|
1486
|
-
// if (requestParams.hasOwnProperty("additionalRequest") && Object.keys(requestParams.additionalRequest).length) {
|
|
1487
|
-
// Object.assign(newRequestParams, { additionalRequest: requestParams.additionalRequest });
|
|
1488
|
-
// }
|
|
1489
|
-
|
|
1490
|
-
// return newRequestParams
|
|
1491
|
-
// }
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
// /**
|
|
1495
|
-
// * reformat request for main function of each action
|
|
1496
|
-
// * @param {Object} _izContext
|
|
1497
|
-
// * @param {String} objectType
|
|
1498
|
-
// * @param {String} action
|
|
1499
|
-
// * @param {Object} requestParams
|
|
1500
|
-
// * @returns
|
|
1501
|
-
// */
|
|
1502
|
-
// async function reformattedRequestParams(_izContext, objectType, action, requestParams) {
|
|
1503
|
-
// _izContext.logger.debug("------ reformattedRequestParams ------");
|
|
1504
|
-
// _izContext.logger.debug("objectType: ", objectType);
|
|
1505
|
-
// _izContext.logger.debug("action: ", action);
|
|
1506
|
-
// _izContext.logger.debug("requestParams: ", requestParams);
|
|
1507
|
-
|
|
1508
|
-
// const objectSchema = await getObjectSchema.getLocalObjectSchemasWithHierarchy(_izContext, objectType).then(data => data.records[0]);
|
|
1509
|
-
// _izContext.logger.debug("objectSchema in reformatted: ", objectSchema);
|
|
1510
|
-
|
|
1511
|
-
// const identifierFieldNames = utils.getUsedFieldNamesOfIdentifiers(_izContext, objectSchema.identifiers);
|
|
1512
|
-
// _izContext.logger.debug("identifierFieldNames: ", identifierFieldNames);
|
|
1513
|
-
|
|
1514
|
-
// let versionedDatas = [];
|
|
1515
|
-
// if (objectSchema?.addOnDataStructure?.length) {
|
|
1516
|
-
// for (let eachAddOn of objectSchema.addOnDataStructure) {
|
|
1517
|
-
// if (eachAddOn.type === "versionedData") {
|
|
1518
|
-
// versionedDatas.push(eachAddOn);
|
|
1519
|
-
// }
|
|
1520
|
-
// }
|
|
1521
|
-
// }
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
// let reformattedReq
|
|
1526
|
-
|
|
1527
|
-
// // reformat request depend on action
|
|
1528
|
-
// switch (action) {
|
|
1529
|
-
// case coreConsts.ACTIONS.create:
|
|
1530
|
-
// _izContext.logger.debug("reformatted case create");
|
|
1531
|
-
|
|
1532
|
-
// // initial format
|
|
1533
|
-
// reformattedReq = {
|
|
1534
|
-
// identifiers: {},
|
|
1535
|
-
// createFieldNames: {},
|
|
1536
|
-
// relationships: []
|
|
1537
|
-
// };
|
|
1538
|
-
|
|
1539
|
-
// let createFieldNames = Object.entries(objectSchema.fieldNames).reduce((returnFieldNames, [fieldName, fieldNameData]) => {
|
|
1540
|
-
// if (identifierFieldNames.includes(fieldName)) {
|
|
1541
|
-
// return returnFieldNames;
|
|
1542
|
-
// }
|
|
1543
|
-
|
|
1544
|
-
// if (fieldNameData.requiredOnCreate === true || fieldNameData.optionalOnCreate === true) {
|
|
1545
|
-
// returnFieldNames.push(fieldName);
|
|
1546
|
-
// }
|
|
1547
|
-
// return returnFieldNames;
|
|
1548
|
-
// }, [])
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
// _izContext.logger.debug("createFieldNames: ", createFieldNames);
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
// for (const [reqFieldName, reqFieldData] of Object.entries(requestParams.fieldNames)) {
|
|
1556
|
-
// if (identifierFieldNames.includes(reqFieldName)) {
|
|
1557
|
-
// Object.assign(
|
|
1558
|
-
// reformattedReq.identifiers,
|
|
1559
|
-
// { [reqFieldName]: reqFieldData }
|
|
1560
|
-
// );
|
|
1561
|
-
// } else {
|
|
1562
|
-
// if (createFieldNames.includes(reqFieldName)) {
|
|
1563
|
-
// Object.assign(
|
|
1564
|
-
// reformattedReq.createFieldNames,
|
|
1565
|
-
// { [reqFieldName]: reqFieldData }
|
|
1566
|
-
// );
|
|
1567
|
-
// }
|
|
1568
|
-
// }
|
|
1569
|
-
// }
|
|
1570
|
-
|
|
1571
|
-
// if (requestParams?.relationships?.length) {
|
|
1572
|
-
// reformattedReq.relationships = reformattedReq.relationships.concat(requestParams.relationships)
|
|
1573
|
-
// }
|
|
1574
|
-
|
|
1575
|
-
// break;
|
|
1576
|
-
// case coreConsts.ACTIONS.update:
|
|
1577
|
-
// // code block
|
|
1578
|
-
// break;
|
|
1579
|
-
// case coreConsts.ACTIONS.get:
|
|
1580
|
-
// // code block
|
|
1581
|
-
// break;
|
|
1582
|
-
// case coreConsts.ACTIONS.delete:
|
|
1583
|
-
// // code block
|
|
1584
|
-
// break;
|
|
1585
|
-
// default:
|
|
1586
|
-
// throw new NoRetryError(`reformattedRequestParams:unhandled action:${action}`)
|
|
1587
|
-
// }
|
|
1588
|
-
|
|
1589
|
-
// return reformattedReq;
|
|
1590
|
-
// }
|
|
1591
|
-
|
|
1592
|
-
// const reformattedRequestParamsWithCache = inMemoryCacheLib.inMemoryCacheLib(
|
|
1593
|
-
// reformattedRequestParams, // fn
|
|
1594
|
-
// {
|
|
1595
|
-
// max: 100, maxAge: 86400000, promise: true, profileName: 'reformattedRequestParams',
|
|
1596
|
-
// normalizer: function (args) {
|
|
1597
|
-
// return hash([args[1], args[2], args[3]]);
|
|
1598
|
-
// }
|
|
1599
|
-
// }
|
|
1600
|
-
// )
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
// /**
|
|
1605
|
-
// * filter identifiers from requestParams depend on objectSchema.identifiers
|
|
1606
|
-
// * @param {object} _izContext
|
|
1607
|
-
// * @param {object} objectSchema - objectSchema of objectType
|
|
1608
|
-
// * @param {object} requestParams - requestParams from handler
|
|
1609
|
-
// * @returns
|
|
1610
|
-
// */
|
|
1611
|
-
// function saperateIdentifierRequestParams(_izContext, objectSchema, requestParams) {
|
|
1612
|
-
|
|
1613
|
-
// let usedIdentifierTypes = utils.selectIdentifierTypeByPriority(_izContext, [], objectSchema);
|
|
1614
|
-
|
|
1615
|
-
// let identifierFieldNameList = utils.getUsedFieldNamesOfIdentifiers(_izContext, objectSchema.identifiers, usedIdentifierTypes);
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
// let identifiersObj = {};
|
|
1619
|
-
|
|
1620
|
-
// for (let identifierFieldName of identifierFieldNameList) {
|
|
1621
|
-
// if (requestParams.hasOwnProperty(identifierFieldName)) {
|
|
1622
|
-
// Object.assign(identifiersObj, { [identifierFieldName]: requestParams[identifierFieldName] });
|
|
1623
|
-
// } else {
|
|
1624
|
-
// throw new NoRetryError(`missing ${identifierFieldName} in requestParams`);
|
|
1625
|
-
// }
|
|
1626
|
-
// }
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
// return identifiersObj;
|
|
1630
|
-
// }
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
// /*
|
|
1636
|
-
// Q?
|
|
1637
|
-
// - when perform action in dynamodb some table need to concatenate
|
|
1638
|
-
// - need to generate new identifier of dynamodb depend on storageResource
|
|
1639
|
-
|
|
1640
|
-
// returnValue = {
|
|
1641
|
-
// graph:{ // storageType
|
|
1642
|
-
// graphHandler:{ // graph service name
|
|
1643
|
-
// nodeLabel:"string" // generate node label here
|
|
1644
|
-
// identifier: {
|
|
1645
|
-
// prop1: value1,
|
|
1646
|
-
// prop2: value2,
|
|
1647
|
-
// },
|
|
1648
|
-
// properties:{
|
|
1649
|
-
// prop1: value1,
|
|
1650
|
-
// prop2: value2,
|
|
1651
|
-
// },
|
|
1652
|
-
// versionedDataLabel:[
|
|
1653
|
-
// // ...
|
|
1654
|
-
// ],
|
|
1655
|
-
// versionedDatas:[ // for [create | update] action
|
|
1656
|
-
// {
|
|
1657
|
-
// nodeLabel:"xxx",
|
|
1658
|
-
// nodeProperties:{
|
|
1659
|
-
// // ...versionedData node properties
|
|
1660
|
-
// }
|
|
1661
|
-
// hookProperties:["xxx", yyy]
|
|
1662
|
-
// }
|
|
1663
|
-
// ]
|
|
1664
|
-
// nodePropertyLabel:{ // addOnDataStructure: type = nodePropertyLabel | attributeTree | , not implement yet
|
|
1665
|
-
// // ...setting
|
|
1666
|
-
// }
|
|
1667
|
-
// },
|
|
1668
|
-
// mediaGraph:{ // graph service name
|
|
1669
|
-
// prop1:value1,
|
|
1670
|
-
// prop2:value2,
|
|
1671
|
-
// }
|
|
1672
|
-
// },
|
|
1673
|
-
// dynamoDb:{ // storageType
|
|
1674
|
-
// table1:{ // tableName
|
|
1675
|
-
// identifier: {
|
|
1676
|
-
// prop1: value1,
|
|
1677
|
-
// prop2: value2,
|
|
1678
|
-
// },
|
|
1679
|
-
// properties{
|
|
1680
|
-
// prop1: value1,
|
|
1681
|
-
// prop2: value2,
|
|
1682
|
-
// }
|
|
1683
|
-
// },
|
|
1684
|
-
// table2:{ // tableName
|
|
1685
|
-
// identifier: {
|
|
1686
|
-
// prop1: value1,
|
|
1687
|
-
// prop2: value2,
|
|
1688
|
-
// },
|
|
1689
|
-
// properties{
|
|
1690
|
-
// prop1: value1,
|
|
1691
|
-
// prop2: value2,
|
|
1692
|
-
// }
|
|
1693
|
-
// }
|
|
1694
|
-
// }
|
|
1695
|
-
// }
|
|
1696
|
-
// */
|
|
1697
|
-
// async function saperateRequestByStorageResources(_izContext, objectSchema, requestParams, action) {
|
|
1698
|
-
// _izContext.logger.debug("Function: saperateRequestByStorageResources :", { requestParams, action })
|
|
1699
|
-
|
|
1700
|
-
// // -------------- initial return value --------------
|
|
1701
|
-
|
|
1702
|
-
// let returnValue = {}
|
|
1703
|
-
|
|
1704
|
-
// for (let storageType of coreConsts.STORAGE_TYPE_LIST) {
|
|
1705
|
-
// if (!returnValue.hasOwnProperty(storageType)) {
|
|
1706
|
-
// returnValue[storageType] = {}
|
|
1707
|
-
// }
|
|
1708
|
-
// }
|
|
1709
|
-
|
|
1710
|
-
// _izContext.logger.debug("initial returnValue: ", returnValue);
|
|
1711
|
-
|
|
1712
|
-
// // -------------- initial return value --------------
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
// // create identifier object from requestParams
|
|
1717
|
-
// let identifierObj = saperateIdentifierRequestParams(_izContext, objectSchema, requestParams);
|
|
1718
|
-
|
|
1719
|
-
// // separate requestParams by storageType
|
|
1720
|
-
// for (let [storageTag, storageData] of Object.entries(objectSchema.storageResources)) {
|
|
1721
|
-
|
|
1722
|
-
// if (storageData.storageType === coreConsts.STORAGE_TYPES.dynamoDB) {
|
|
1723
|
-
|
|
1724
|
-
// // separate by tableName
|
|
1725
|
-
// let dynamoRequestParams = await separateRequestByDynamoDb(
|
|
1726
|
-
// _izContext,
|
|
1727
|
-
// objectSchema,
|
|
1728
|
-
// requestParams,
|
|
1729
|
-
// identifierObj,
|
|
1730
|
-
// storageTag,
|
|
1731
|
-
// storageData
|
|
1732
|
-
// );
|
|
1733
|
-
// _izContext.logger.debug("dynamoRequestParams: ", dynamoRequestParams);
|
|
1734
|
-
|
|
1735
|
-
// let tableName = storageData.tableName;
|
|
1736
|
-
// if (returnValue[coreConsts.STORAGE_TYPES.dynamoDB][tableName]) {
|
|
1737
|
-
// throw new NoRetryError(`Have duplicate tableName in storageTag:${storageTag}`);
|
|
1738
|
-
// }
|
|
1739
|
-
|
|
1740
|
-
// Object.assign(returnValue[coreConsts.STORAGE_TYPES.dynamoDB], { [tableName]: dynamoRequestParams });
|
|
1741
|
-
|
|
1742
|
-
// } else if (storageData.storageType === coreConsts.STORAGE_TYPES.graph) {
|
|
1743
|
-
|
|
1744
|
-
// // separate by GraphServiceName
|
|
1745
|
-
// let graphRequestParams = await separateRequestByGraph(
|
|
1746
|
-
// _izContext,
|
|
1747
|
-
// objectSchema,
|
|
1748
|
-
// requestParams,
|
|
1749
|
-
// identifierObj,
|
|
1750
|
-
// storageTag,
|
|
1751
|
-
// storageData,
|
|
1752
|
-
// action
|
|
1753
|
-
// );
|
|
1754
|
-
// _izContext.logger.debug("graphRequestParams: ", graphRequestParams);
|
|
1755
|
-
|
|
1756
|
-
// let graphServiceName = await serviceConfig.getGraphServiceNameFromGraphServerTagWithCache(_izContext, storageData.graphServerTag);
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
// if (returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName]) {
|
|
1760
|
-
// // have exists graphServiceName,
|
|
1761
|
-
// // need to merge properties for multiple graphServerTag to one serviceName
|
|
1762
|
-
// _izContext.logger.debug('exists serviceName');
|
|
1763
|
-
// _izContext.logger.debug('graphRequestParams : ', graphRequestParams);
|
|
1764
|
-
// _izContext.logger.debug('returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName]: ',
|
|
1765
|
-
// returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName]
|
|
1766
|
-
// );
|
|
1767
|
-
|
|
1768
|
-
// // merge node properties
|
|
1769
|
-
// for (let graphProperty in graphRequestParams.properties) {
|
|
1770
|
-
// if (!returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName].properties.hasOwnProperty(graphProperty)) {
|
|
1771
|
-
// Object.assign(
|
|
1772
|
-
// returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName].properties,
|
|
1773
|
-
// { [graphProperty]: graphRequestParams.properties[graphProperty] }
|
|
1774
|
-
// );
|
|
1775
|
-
// }
|
|
1776
|
-
// }
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
// /*
|
|
1780
|
-
// if versionedDatas exists in graphRequestParams
|
|
1781
|
-
// - check versionedDatas exists in returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName]
|
|
1782
|
-
// - if exists add versionedData in graphRequestParams to returnValue
|
|
1783
|
-
// - if not exists create and add versionedDatas
|
|
1784
|
-
// */
|
|
1785
|
-
|
|
1786
|
-
// // merge graph versionedData
|
|
1787
|
-
// if (graphRequestParams.versionedDatas?.length) {
|
|
1788
|
-
// if (Array.isArray(returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName].versionedDatas)) {
|
|
1789
|
-
// returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName].versionedDatas =
|
|
1790
|
-
// returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName].versionedDatas.concat(graphRequestParams.versionedDatas)
|
|
1791
|
-
// } else {
|
|
1792
|
-
// returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName].versionedDatas = graphRequestParams.versionedDatas
|
|
1793
|
-
// }
|
|
1794
|
-
// }
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
// } else {
|
|
1798
|
-
// // not exists graphServiceName
|
|
1799
|
-
// Object.assign(returnValue[coreConsts.STORAGE_TYPES.graph], { [graphServiceName]: graphRequestParams });
|
|
1800
|
-
// }
|
|
1801
|
-
|
|
1802
|
-
// } else {
|
|
1803
|
-
// throw new NoRetryError(`Don't know storageType:${storageData.type} in storageTag:${storageTag}`);
|
|
1804
|
-
// }
|
|
1805
|
-
// }
|
|
1806
|
-
|
|
1807
|
-
// return returnValue
|
|
1808
|
-
|
|
1809
|
-
// }
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
// /**
|
|
1816
|
-
// * helper function for separate requestParams depend on storageTag
|
|
1817
|
-
// *
|
|
1818
|
-
// * @param {Object} _izContext
|
|
1819
|
-
// * @param {Object} objectSchema -
|
|
1820
|
-
// * @param {Object} requestParams - requestParams from lambda
|
|
1821
|
-
// * @param {Object} identifierObj - identifiers
|
|
1822
|
-
// * @param {String} storageTag - storageTag of storageResource
|
|
1823
|
-
// * @param {Object} storageData - data of storageResource
|
|
1824
|
-
// * @returns {Object} - object of identifier and property for dynamodb
|
|
1825
|
-
// */
|
|
1826
|
-
// async function separateRequestByDynamoDb(_izContext, objectSchema, requestParams, identifierObj, storageTag, storageData) {
|
|
1827
|
-
// _izContext.logger.debug('separateRequestByDynamoDb: ', {
|
|
1828
|
-
// requestParams,
|
|
1829
|
-
// identifierObj,
|
|
1830
|
-
// storageTag,
|
|
1831
|
-
// storageData
|
|
1832
|
-
// });
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
// //----------------------- Filter requestParams ------------------------
|
|
1836
|
-
|
|
1837
|
-
// // filter requestParams that includes in storageTag
|
|
1838
|
-
// let filteredRequestParams = {}
|
|
1839
|
-
// for (let [fieldName, fieldNameData] of Object.entries(objectSchema.fieldNames)) {
|
|
1840
|
-
// if (fieldNameData.storageResourceTags.includes(storageTag) && requestParams.hasOwnProperty(fieldName)) {
|
|
1841
|
-
// Object.assign(filteredRequestParams, { [fieldName]: requestParams[fieldName] });
|
|
1842
|
-
// }
|
|
1843
|
-
// }
|
|
1844
|
-
|
|
1845
|
-
// //----------------------- End Filter requestParams ------------------------
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
// //----------------------- Create dynamoDb identifier object ------------------------
|
|
1849
|
-
|
|
1850
|
-
// // use identifierObj to prepare dynamodb identifiers
|
|
1851
|
-
// let usedIdentifierTypes = utils.selectIdentifierTypeByPriority(_izContext, [], objectSchema);
|
|
1852
|
-
|
|
1853
|
-
// let deliminatorTree = await serviceSchemas.generateDeliminatorTree(_izContext, objectSchema, { objectType: objectSchema.objectType, serviceTag: process.env.iz_serviceTag }, usedIdentifierTypes);
|
|
1854
|
-
// _izContext.logger.debug(`deliminatorTree objectType: ${objectSchema.objectType} : `, deliminatorTree)
|
|
1855
|
-
|
|
1856
|
-
// let dynamoDbIdentifier = {};
|
|
1857
|
-
// for (let identifier of objectSchema.identifiers) {
|
|
1858
|
-
|
|
1859
|
-
// if (!usedIdentifierTypes.includes(identifier.type)) {
|
|
1860
|
-
// continue;
|
|
1861
|
-
// }
|
|
1862
|
-
|
|
1863
|
-
// if (identifier.hasOwnProperty("fieldName")) {
|
|
1864
|
-
|
|
1865
|
-
// Object.assign(dynamoDbIdentifier, { [identifier.fieldName]: identifierObj[identifier.fieldName] });
|
|
1866
|
-
|
|
1867
|
-
// } else if (identifier.hasOwnProperty("name") && identifier.hasOwnProperty("fieldNames")) {
|
|
1868
|
-
|
|
1869
|
-
// let deliminator = identifier.deliminator ? identifier.deliminator : "_";
|
|
1870
|
-
|
|
1871
|
-
// // if deliminatorList exists overwrite deliminator
|
|
1872
|
-
// if (deliminatorTree.identifiersToProcess?.[identifier.name]?.deliminatorList?.[deliminator]) {
|
|
1873
|
-
// let deliminatorAmount = deliminatorTree[identifier.name].deliminatorList[deliminator];
|
|
1874
|
-
// deliminator = deliminator.repeat(deliminatorAmount)
|
|
1875
|
-
// }
|
|
1876
|
-
|
|
1877
|
-
// let fieldNameDataList = [];
|
|
1878
|
-
// for (let identifierFieldName of identifier.fieldNames) {
|
|
1879
|
-
// fieldNameDataList.push(identifierObj[identifierFieldName]);
|
|
1880
|
-
// }
|
|
1881
|
-
|
|
1882
|
-
// Object.assign(dynamoDbIdentifier, { [identifier.name]: fieldNameDataList.join(deliminator) });
|
|
1883
|
-
|
|
1884
|
-
// } else {
|
|
1885
|
-
// throw new NoRetryError('separateRequestByDynamoDb: invalid identifier');
|
|
1886
|
-
// }
|
|
1887
|
-
// }
|
|
1888
|
-
|
|
1889
|
-
// //----------------------- End Create dynamoDb identifier object ------------------------
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
// //----------------------- calculate composite deliminator amount ------------------------
|
|
1893
|
-
|
|
1894
|
-
// let compositeDeliminator = objectSchema.compositeKeyDeliminator ? objectSchema.compositeKeyDeliminator : "_";
|
|
1895
|
-
|
|
1896
|
-
// let compositeDeliminatorAmount = 0;
|
|
1897
|
-
// for (let deliminatorDetail of Object.values(deliminatorTree.identifiersToProcess)) {
|
|
1898
|
-
// if (deliminatorDetail?.deliminatorList?.[compositeDeliminator]) {
|
|
1899
|
-
// compositeDeliminatorAmount = Math.max(compositeDeliminatorAmount, deliminatorDetail.deliminatorList[compositeDeliminator]);
|
|
1900
|
-
// }
|
|
1901
|
-
// }
|
|
1902
|
-
|
|
1903
|
-
// compositeDeliminatorAmount + 1;
|
|
1904
|
-
|
|
1905
|
-
// //----------------------- End calculate composite deliminator amount ------------------------
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
// //----------------------- create return value ------------------------
|
|
1909
|
-
|
|
1910
|
-
// // initial returnValue
|
|
1911
|
-
// let returnValue = {
|
|
1912
|
-
// identifiers: {},
|
|
1913
|
-
// properties: {}
|
|
1914
|
-
// }
|
|
1915
|
-
|
|
1916
|
-
// if (storageData.hasOwnProperty("groupByPartitionKeyField")) {
|
|
1917
|
-
// // concatenate identifierObj
|
|
1918
|
-
// let newIdentifier = Object.values(identifierObj).join(compositeDeliminator.repeat(compositeDeliminatorAmount));
|
|
1919
|
-
|
|
1920
|
-
// Object.assign(returnValue.identifiers, { [storageData.groupByPartitionKeyField]: newIdentifier });
|
|
1921
|
-
// Object.assign(returnValue.properties, filteredRequestParams);
|
|
1922
|
-
|
|
1923
|
-
// } else {
|
|
1924
|
-
// returnValue.identifiers = identifierObj;
|
|
1925
|
-
|
|
1926
|
-
// for (let requestParamProperty in filteredRequestParams) {
|
|
1927
|
-
// if (!identifierObj.hasOwnProperty(requestParamProperty)) {
|
|
1928
|
-
// Object.assign(returnValue.properties, { [requestParamProperty]: filteredRequestParams[requestParamProperty] });
|
|
1929
|
-
// }
|
|
1930
|
-
// }
|
|
1931
|
-
|
|
1932
|
-
// }
|
|
1933
|
-
|
|
1934
|
-
// //----------------------- End create return value ------------------------
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
// return returnValue;
|
|
1938
|
-
// }
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
// // helper function for separate requestParams fieldName per storageTag
|
|
1942
|
-
// async function separateRequestByGraph(_izContext, objectSchema, requestParams, identifierObj, storageTag, storageData, action) {
|
|
1943
|
-
// _izContext.logger.debug("separateRequestByGraph: ", {
|
|
1944
|
-
// requestParams,
|
|
1945
|
-
// identifierObj,
|
|
1946
|
-
// storageTag,
|
|
1947
|
-
// storageData,
|
|
1948
|
-
// action
|
|
1949
|
-
// });
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
// //----------------------- Filter requestParams ------------------------
|
|
1953
|
-
|
|
1954
|
-
// // filter requestParams that includes in storageTag
|
|
1955
|
-
// let filteredRequestParams = {}
|
|
1956
|
-
// for (let [fieldName, fieldNameData] of Object.entries(objectSchema.fieldNames)) {
|
|
1957
|
-
// if (fieldNameData.storageResourceTags.includes(storageTag) && requestParams.hasOwnProperty(fieldName)) {
|
|
1958
|
-
// Object.assign(filteredRequestParams, { [fieldName]: requestParams[fieldName] });
|
|
1959
|
-
// }
|
|
1960
|
-
// }
|
|
1961
|
-
|
|
1962
|
-
// //----------------------- End Filter requestParams ------------------------
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
// //----------------------- standard return value ------------------------
|
|
1966
|
-
|
|
1967
|
-
// // initial returnValue
|
|
1968
|
-
// let returnValue = {
|
|
1969
|
-
// identifiers: {},
|
|
1970
|
-
// properties: {}
|
|
1971
|
-
// }
|
|
1972
|
-
|
|
1973
|
-
// // add nodeLabel
|
|
1974
|
-
// if (objectSchema.hasOwnProperty("extendObjType")) {
|
|
1975
|
-
// let nodeLabel = `${objectSchema.objectType}:${objectSchema.extendObjType.objectType}`;
|
|
1976
|
-
// Object.assign(returnValue, { nodeLabel: nodeLabel });
|
|
1977
|
-
// } else {
|
|
1978
|
-
// Object.assign(returnValue, { nodeLabel: objectSchema.objectType });
|
|
1979
|
-
// }
|
|
1980
|
-
|
|
1981
|
-
// // add identifiers
|
|
1982
|
-
// returnValue.identifiers = identifierObj;
|
|
1983
|
-
|
|
1984
|
-
// // add properties from requestParams if not exists in identifierObj
|
|
1985
|
-
// for (let requestParamProperty in filteredRequestParams) {
|
|
1986
|
-
// if (!identifierObj.hasOwnProperty(requestParamProperty)) {
|
|
1987
|
-
// Object.assign(returnValue.properties, { [requestParamProperty]: filteredRequestParams[requestParamProperty] });
|
|
1988
|
-
// }
|
|
1989
|
-
// }
|
|
1990
|
-
|
|
1991
|
-
// //----------------------- End standard return value ------------------------
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
// //----------------------- prepare additional return data per action ------------------------
|
|
1995
|
-
|
|
1996
|
-
// if (action === coreConsts.ACTIONS.get) {
|
|
1997
|
-
|
|
1998
|
-
// if (
|
|
1999
|
-
// requestParams?.additionalRequest?.versionedDataLabel
|
|
2000
|
-
// && Array.isArray(requestParams.additionalRequest.versionedDataLabel)
|
|
2001
|
-
// && requestParams.additionalRequest.versionedDataLabel.length
|
|
2002
|
-
// && objectSchema.addOnDataStructure
|
|
2003
|
-
// && Array.isArray(objectSchema.addOnDataStructure)
|
|
2004
|
-
// ) {
|
|
2005
|
-
// // if versionedDataLabel exists in requestParams
|
|
2006
|
-
// // add versionedDataLabel to returnValue if exists in storageResourceTag
|
|
2007
|
-
|
|
2008
|
-
// // get addOnDataStructure versionedData depend on storageTag
|
|
2009
|
-
// let allAddOnVersionedDataPerStorageTag = objectSchema.addOnDataStructure.filter(
|
|
2010
|
-
// addOnVersionedData => (addOnVersionedData.type === "versionedData" && addOnVersionedData.storageResourceTag === storageTag)
|
|
2011
|
-
// );
|
|
2012
|
-
|
|
2013
|
-
// for (let addOnVersionedData of allAddOnVersionedDataPerStorageTag) {
|
|
2014
|
-
// if (requestParams.additionalRequest.versionedDataLabel.includes(addOnVersionedData.versionedDataLabel)) {
|
|
2015
|
-
|
|
2016
|
-
// if (!returnValue.hasOwnProperty("versionedDataLabel")) {
|
|
2017
|
-
// returnValue.versionedDataLabel = []
|
|
2018
|
-
// }
|
|
2019
|
-
|
|
2020
|
-
// returnValue.versionedDataLabel.push(addOnVersionedData.versionedDataLabel)
|
|
2021
|
-
// }
|
|
2022
|
-
// }
|
|
2023
|
-
// }
|
|
2024
|
-
|
|
2025
|
-
// } else if (action === coreConsts.ACTIONS.create) {
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
// } else if (action === coreConsts.ACTIONS.update) {
|
|
2029
|
-
// _izContext.logger.debug("filter versionedData update")
|
|
2030
|
-
// _izContext.logger.debug("additionalReq: ", requestParams.additionalRequest.versionedDatas)
|
|
2031
|
-
// _izContext.logger.debug("addOnDataStructure: ", objectSchema.addOnDataStructure)
|
|
2032
|
-
// // {
|
|
2033
|
-
// // // ...properties
|
|
2034
|
-
// // additionalRequest: {
|
|
2035
|
-
// // versionedDatas: [
|
|
2036
|
-
// // {
|
|
2037
|
-
// // nodeLabel: "nodeLabelName",
|
|
2038
|
-
// // nodeProperties: {
|
|
2039
|
-
// // // ...properties of versionedData
|
|
2040
|
-
// // }
|
|
2041
|
-
// // }
|
|
2042
|
-
// // ]
|
|
2043
|
-
// // // ...other additional request
|
|
2044
|
-
// // }
|
|
2045
|
-
// // }
|
|
2046
|
-
|
|
2047
|
-
// // separate create versionedData request
|
|
2048
|
-
// if (
|
|
2049
|
-
// requestParams?.additionalRequest?.versionedDatas
|
|
2050
|
-
// && Array.isArray(requestParams.additionalRequest.versionedDatas)
|
|
2051
|
-
// && requestParams.additionalRequest.versionedDatas.length
|
|
2052
|
-
// && objectSchema.addOnDataStructure
|
|
2053
|
-
// && Array.isArray(objectSchema.addOnDataStructure)
|
|
2054
|
-
// ) {
|
|
2055
|
-
|
|
2056
|
-
// let versionedDataReqList = requestParams.additionalRequest.versionedDatas;
|
|
2057
|
-
|
|
2058
|
-
// // get addOnDataStructure versionedData depend on storageTag from objectSchema
|
|
2059
|
-
// let allAddOnVersionedDataPerStorageTag = objectSchema.addOnDataStructure.filter(
|
|
2060
|
-
// addOnVersionedData => (addOnVersionedData.type === "versionedData" && addOnVersionedData.storageResourceTag === storageTag)
|
|
2061
|
-
// );
|
|
2062
|
-
|
|
2063
|
-
// _izContext.logger.debug('allAddOnVersionedDataPerStorageTag update: ', allAddOnVersionedDataPerStorageTag);
|
|
2064
|
-
|
|
2065
|
-
// // check versionedData label in requestParams exists in allAddOnVersionedDataPerStorageTag
|
|
2066
|
-
// // if exists validate and add versionedData to return label
|
|
2067
|
-
// if (allAddOnVersionedDataPerStorageTag.length) {
|
|
2068
|
-
// for (let versionedDataReq of versionedDataReqList) {
|
|
2069
|
-
// // find exists versionedData Schema
|
|
2070
|
-
// let versionedDataSchema = allAddOnVersionedDataPerStorageTag.find(
|
|
2071
|
-
// addOnVersionedData => addOnVersionedData.versionedDataLabel === versionedDataReq.nodeLabel
|
|
2072
|
-
// );
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
// if (versionedDataSchema) {
|
|
2077
|
-
// _izContext.logger.debug('exists versionedDataSchema: ', versionedDataSchema);
|
|
2078
|
-
|
|
2079
|
-
// // validate versionedData
|
|
2080
|
-
|
|
2081
|
-
// let versionedDataValidatorSchema = generateValidatorSchemaForVersionedData(_izContext, versionedDataSchema, action);
|
|
2082
|
-
// _izContext.logger.debug("versionedData validator schema: ", versionedDataValidatorSchema);
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
// _izContext.logger.debug("versionedDataReq before validate: ", versionedDataReq)
|
|
2086
|
-
// let validateVersionedDataStatus = validateObject(_izContext, versionedDataValidatorSchema, versionedDataReq);
|
|
2087
|
-
// _izContext.logger.debug("versionedData validate status: ", validateVersionedDataStatus);
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
// if (validateVersionedDataStatus.pass === false) {
|
|
2091
|
-
// throw new NoRetryError("Function:separateRequestByGraph: ", validateVersionedDataStatus.error);
|
|
2092
|
-
// }
|
|
2093
|
-
|
|
2094
|
-
// if (!returnValue.hasOwnProperty("versionedDatas")) {
|
|
2095
|
-
// returnValue.versionedDatas = [];
|
|
2096
|
-
// }
|
|
2097
|
-
// // end validate versionedData
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
// let hookProperties = [];
|
|
2101
|
-
// for (let fieldNameSetting of versionedDataSchema.fieldNames) {
|
|
2102
|
-
// hookProperties.push(fieldNameSetting.fieldName);
|
|
2103
|
-
// }
|
|
2104
|
-
|
|
2105
|
-
// Object.assign(versionedDataReq, { hookProperties });
|
|
2106
|
-
|
|
2107
|
-
// returnValue.versionedDatas.push(versionedDataReq);
|
|
2108
|
-
// }
|
|
2109
|
-
// }
|
|
2110
|
-
// }
|
|
2111
|
-
|
|
2112
|
-
// }
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
// } else if (action === coreConsts.ACTIONS.delete) {
|
|
2116
|
-
|
|
2117
|
-
// } else {
|
|
2118
|
-
// throw new NoRetryError("Function:separateRequestByGraph: invalid action")
|
|
2119
|
-
// }
|
|
2120
|
-
|
|
2121
|
-
// //----------------------- End prepare additional return data per action ------------------------
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
// _izContext.logger.debug("Function:separateRequestByGraph: return value: ", returnValue);
|
|
2125
|
-
// return returnValue;
|
|
2126
|
-
// }
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
// function mergeReturnGetData(_izContext, dynamoDbData, graphData) {
|
|
2131
|
-
// let mergedData = {
|
|
2132
|
-
// properties: {}
|
|
2133
|
-
// };
|
|
2134
|
-
|
|
2135
|
-
// for (let dynamoDbDataDetail of dynamoDbData) {
|
|
2136
|
-
// for (let [dynamoDataProp, dynamoDataValue] of Object.entries(dynamoDbDataDetail)) {
|
|
2137
|
-
// if (!mergedData.properties.hasOwnProperty(dynamoDataProp)) {
|
|
2138
|
-
// Object.assign(mergedData.properties, { [dynamoDataProp]: dynamoDataValue })
|
|
2139
|
-
// }
|
|
2140
|
-
// }
|
|
2141
|
-
|
|
2142
|
-
// }
|
|
2143
|
-
|
|
2144
|
-
// for (let graphDataDetail of graphData) {
|
|
2145
|
-
// // add nodeProperties to mergedData
|
|
2146
|
-
// for (let [graphDataProp, graphDataValue] of Object.entries(graphDataDetail.nodeProperties)) {
|
|
2147
|
-
// if (!mergedData.properties.hasOwnProperty(graphDataProp)) {
|
|
2148
|
-
// Object.assign(mergedData.properties, { [graphDataProp]: graphDataValue })
|
|
2149
|
-
// }
|
|
2150
|
-
// }
|
|
2151
|
-
|
|
2152
|
-
// // add versionedData to mergedData
|
|
2153
|
-
// for (let [graphDataProp, graphDataValue] of Object.entries(graphDataDetail)) {
|
|
2154
|
-
// console.log({ graphDataProp, graphDataValue })
|
|
2155
|
-
// if (graphDataProp === "nodeLabels" || graphDataProp === "nodeProperties") {
|
|
2156
|
-
// continue;
|
|
2157
|
-
// }
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
// if (Object.keys(graphDataValue.nodeProperties).length) {
|
|
2161
|
-
|
|
2162
|
-
// if (!mergedData.versionedDataLabel) {
|
|
2163
|
-
// mergedData.versionedDataLabel = {}
|
|
2164
|
-
// }
|
|
2165
|
-
|
|
2166
|
-
// Object.assign(mergedData.versionedDataLabel, { [graphDataValue.nodeLabels.join(":")]: graphDataValue.nodeProperties })
|
|
2167
|
-
// }
|
|
2168
|
-
// }
|
|
2169
|
-
// }
|
|
2170
|
-
|
|
2171
|
-
// return mergedData
|
|
2172
|
-
// }
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
// // this function not use for new version because versionedData will not saperate from request params
|
|
2177
|
-
// function generateValidatorSchemaForVersionedData(_izContext, versionedObjDataSchema, action) {
|
|
2178
|
-
// // input form of versionedData will be the same for create and update action
|
|
2179
|
-
|
|
2180
|
-
// // initial versionedData validatorSchema
|
|
2181
|
-
// let versionedDataValidatorSchema = {
|
|
2182
|
-
// type: "object",
|
|
2183
|
-
// required: ['nodeLabel', 'nodeProperties'],
|
|
2184
|
-
// properties: {
|
|
2185
|
-
// nodeLabel: {
|
|
2186
|
-
// type: 'string',
|
|
2187
|
-
// pattern: nodeLabelRegexPattern
|
|
2188
|
-
// },
|
|
2189
|
-
// nodeProperties: {
|
|
2190
|
-
// type: 'object',
|
|
2191
|
-
// required: [], // require fieldName
|
|
2192
|
-
// additionalProperties: false,
|
|
2193
|
-
// properties: {}
|
|
2194
|
-
// }
|
|
2195
|
-
// }
|
|
2196
|
-
// }
|
|
2197
|
-
|
|
2198
|
-
// // maybe not need to validate action get and delete because
|
|
2199
|
-
// if (action === coreConsts.ACTIONS.create) {
|
|
2200
|
-
// for (let versionedFieldName of versionedObjDataSchema.fieldNames) {
|
|
2201
|
-
// if (versionedFieldName.requireOnCreate === true || versionedFieldName.optionalOnCreate === true) {
|
|
2202
|
-
// // add require fieldName to require array in validatorSchema
|
|
2203
|
-
// if (versionedFieldName.requireOnCreate === true) {
|
|
2204
|
-
// versionedDataValidatorSchema.properties.nodeProperties.required.push(versionedFieldName.fieldName)
|
|
2205
|
-
// }
|
|
2206
|
-
|
|
2207
|
-
// // add validation to properties
|
|
2208
|
-
// let versionedDataProperties = versionedDataValidatorSchema.properties.nodeProperties.properties;
|
|
2209
|
-
// Object.assign(versionedDataProperties, {
|
|
2210
|
-
// [versionedFieldName.fieldName]: {
|
|
2211
|
-
// type: versionedFieldName.type,
|
|
2212
|
-
// ...versionedFieldName.validation
|
|
2213
|
-
// }
|
|
2214
|
-
// })
|
|
2215
|
-
|
|
2216
|
-
// }
|
|
2217
|
-
// }
|
|
2218
|
-
// } else if (action === coreConsts.ACTIONS.update) {
|
|
2219
|
-
// for (let versionedFieldName of versionedObjDataSchema.fieldNames) {
|
|
2220
|
-
// if (versionedFieldName.canUpdate === true || versionedFieldName.canUpdate === undefined) {
|
|
2221
|
-
|
|
2222
|
-
// // add validation to properties
|
|
2223
|
-
// let versionedDataProperties = versionedDataValidatorSchema.properties.nodeProperties.properties;
|
|
2224
|
-
// Object.assign(versionedDataProperties, {
|
|
2225
|
-
// [versionedFieldName.fieldName]: {
|
|
2226
|
-
// type: versionedFieldName.type,
|
|
2227
|
-
// ...versionedFieldName.validation
|
|
2228
|
-
// }
|
|
2229
|
-
// })
|
|
2230
|
-
|
|
2231
|
-
// }
|
|
2232
|
-
// }
|
|
2233
|
-
// } else {
|
|
2234
|
-
// throw new NoRetryError("Function:generateValidatorSchemaForVersionedData: invalid action")
|
|
2235
|
-
// }
|
|
2236
|
-
|
|
2237
|
-
// // return validator schema of versionedData
|
|
2238
|
-
// return versionedDataValidatorSchema;
|
|
2239
|
-
// }
|
|
661
|
+
sharedCreateCompleteEndpoint,
|
|
662
|
+
};
|