@izara_project/izara-market-library-service-schemas 1.0.6 → 1.0.8
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/package.json +1 -1
- package/src/GenerateCodeLibs/src/Consts.js +21 -6
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +40 -48
- package/src/TemplateManager/src/FindData/Handler/data.js +4 -0
- package/src/TemplateManager/src/FindData/mainFunction/data.js +1 -1
- package/src/TemplateManager/src/FindData/mainFunction/template.ejs +3 -0
- package/src/TemplateManager/src/GenerateCode.js +136 -55
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +3 -16
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/data.js +61 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/template.ejs +130 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/data.js +53 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/template.ejs +170 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-in-sqs/data.js +58 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-out/data.js +62 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-out/template.ejs +10 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/data.js +82 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/handler/data.js +61 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/handler/template.ejs +129 -0
- package/src/TemplateManager/src/{CreateRelationship/createRelationship → OutPerActionComplete/OutDeleteComplete}/mainFunction/data.js +9 -15
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/mainFunction/template.ejs +90 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/sns-out/data.js +62 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/sqs-in-sns/data.js +58 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/data.js +2 -16
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/handler/data.js +3 -1
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/template.ejs +4 -4
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/data.js +31 -43
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/data.js +20 -36
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/data.js +15 -56
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/data.js +22 -39
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/data.js +9 -9
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/template.ejs +2 -2
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/data.js +9 -42
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/template.ejs +14 -11
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/data.js +14 -65
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/template.ejs +2 -2
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/data.js +11 -44
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/template.ejs +14 -18
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/data.js +1 -2
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/template.ejs +200 -248
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/data.js +66 -0
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/template.ejs +194 -0
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/data.js +1 -2
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/template.ejs +2 -3
- package/src/TemplateManager/src/ProcessLogical/Handler/data.js +3 -1
- package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/data.js +47 -79
- package/src/TemplateManager/src/ProcessLogical/mainFunction/template.ejs +10 -2
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/data.js +40 -71
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/data.js +42 -73
- package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrDsq/data.js +3 -1
- package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrSqs/data.js +3 -1
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js +84 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship → RelationshipPerAction/CreateRelationship/createRelationship}/functionYaml/HdrApi/template.ejs +2 -2
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/functionYaml/HdrDsq/data.js +4 -41
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/template.ejs +30 -0
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/functionYaml/HdrInv/data.js +4 -41
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/template.ejs +26 -0
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/functionYaml/HdrSqs/data.js +4 -41
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/template.ejs +26 -0
- package/src/TemplateManager/src/{CreateRelationship/createRelationship/perAction/HdrApi → RelationshipPerAction/CreateRelationship/createRelationship/mainFunction}/data.js +4 -4
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/mainFunction/template.ejs +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrApi/data.js +60 -0
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrDsq/data.js +5 -3
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrInv/data.js +5 -3
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrSqs/data.js +5 -3
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/sns-in-sqs/data.js +4 -4
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/functionYaml/data.js +8 -46
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/handler/HdrSqs/data.js +4 -2
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/mainFunction/data.js +2 -2
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-in-sqs/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-out/data.js +3 -3
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-out/template.ejs +10 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/data.js +85 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/template.ejs +33 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/data.js +96 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/template.ejs +30 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/data.js +83 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/template.ejs +26 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/data.js +96 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/template.ejs +26 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/perAction/HdrApi → RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction}/data.js +4 -5
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction/template.ejs +329 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/data.js +60 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/template.ejs +119 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq/data.js +61 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq/template.ejs +167 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv/data.js +62 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv/template.ejs +107 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs/data.js +62 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs/template.ejs +146 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/request.json +30 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/data.js +78 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/data.js +95 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/template.ejs +33 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/perAction → RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler}/HdrSqs/data.js +9 -5
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler/HdrSqs/template.ejs +125 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/data.js +56 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/template.ejs +137 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/data.js +72 -0
- 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 +47 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/data.js +72 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/template.ejs +10 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/functionYaml/data.js +4 -44
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/template.ejs +33 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/handler/HdrSqs/data.js +5 -3
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/mainFunction/data.js +2 -2
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-in-sqs/data.js +2 -2
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-out/data.js +3 -3
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-out/template.ejs +10 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrApi/data.js +5 -42
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/template.ejs +33 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrDsq/data.js +4 -41
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/template.ejs +30 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrInv/data.js +4 -41
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/template.ejs +26 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrSqs/data.js +5 -42
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/template.ejs +26 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/mainFunction/data.js +3 -4
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/mainFunction/template.ejs +14 -15
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi/data.js +61 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrDsq/data.js +5 -3
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrInv/data.js +5 -3
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/data.js +61 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-in-sqs/data.js +4 -4
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-out/data.js +2 -2
- package/src/TemplateManager/src/ResourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +27 -0
- package/src/TemplateManager/src/ResourceYaml/dynamodb/template.ejs +1 -1
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/functionYaml/data.js +3 -5
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/dataHdrDsq.js +3 -1
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/template.ejs +3 -5
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/mainFunction/template.ejs +42 -39
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrDsq/data.js +3 -29
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs/data.js +3 -29
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq/data.js +4 -2
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq/template.ejs +3 -5
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs/data.js +3 -1
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs/template.ejs +22 -34
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/mainFunction/template.ejs +5 -5
- package/src/TemplateManager/src/externalService/FunctionNameConfig/data.js +50 -0
- package/src/TemplateManager/src/externalService/FunctionNameConfig/template.ejs +3 -0
- package/src/TemplateManager/src/externalService/LambdaRole/data.js +78 -40
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +13 -0
- package/src/TemplateManager/src/libs/Consts.js +27 -4
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/getTemplate.ejs +0 -76
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/updateTemplate.ejs +0 -67
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/getTemplate.ejs +0 -105
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/updateTemplate.ejs +0 -109
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/createTemplate.ejs +0 -75
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/getTemplate.ejs +0 -82
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/updateTemplate.ejs +0 -75
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/getTemplate.ejs +0 -124
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/updateTemplate.ejs +0 -133
- /package/src/TemplateManager/src/{CreateRelationship/createRelationshipComplete → OutPerActionComplete/OutDeleteComplete}/functionYaml/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship/createRelationshipComplete/sns-in-sqs → OutPerActionComplete/OutDeleteComplete/sqs-in-sns}/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrApi/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrApi/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrDsq/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrDsq/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrInv/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrInv/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrSqs/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrSqs/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/functionYaml/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRalationshipComplete → RelationshipPerAction/CreateRelationship/createRelationshipComplete}/functionYaml/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/handler/HdrSqs/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/handler/HdrSqs/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/mainFunction/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/mainFunction/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-in-sqs/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-out/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi}/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq}/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv}/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs}/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs → RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml}/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/functionYaml/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/handler/HdrSqs/template.ejs +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/mainFunction/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/mainFunction/template.ejs +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-in-sqs/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-in-sqs/template.ejs +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-out/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/mainFunction/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrApi/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrApi/template.ejs +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrDsq/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrDsq/template.ejs +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrInv/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrInv/template.ejs +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrSqs/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrSqs/template.ejs +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-in-sqs/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-out/request.json +0 -0
|
@@ -25,7 +25,7 @@ const {
|
|
|
25
25
|
const Logger = require('@izara_project/izara-core-library-logger');
|
|
26
26
|
const recordHandlerSharedLib = require('@izara_project/izara-shared').recordHandlerSharedLib
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const translateIdsRequest = require('./TranslateIdsRequest_Main');
|
|
29
29
|
|
|
30
30
|
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
31
31
|
|
|
@@ -34,9 +34,7 @@ let validatorSchema = {
|
|
|
34
34
|
type: "object",
|
|
35
35
|
required: [
|
|
36
36
|
"fromObjType",
|
|
37
|
-
// "fromTypeId",
|
|
38
37
|
"toObjType",
|
|
39
|
-
// "toTypeId",
|
|
40
38
|
"relType",
|
|
41
39
|
],
|
|
42
40
|
properties: {
|
|
@@ -51,8 +49,8 @@ let validatorSchema = {
|
|
|
51
49
|
fromTypeId: {
|
|
52
50
|
type: "string",
|
|
53
51
|
},
|
|
54
|
-
|
|
55
|
-
type: "
|
|
52
|
+
identifiers: {
|
|
53
|
+
type: "array",
|
|
56
54
|
},
|
|
57
55
|
fromTable: {
|
|
58
56
|
type: "string",
|
|
@@ -117,7 +115,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
117
115
|
// --- validate message (and MessageAttributes)
|
|
118
116
|
await recordHandlerSharedLib.validateRecord(
|
|
119
117
|
record, // one record will send to mainFunction
|
|
120
|
-
"
|
|
118
|
+
"TranslateIdsRequestHdrSqs", // queue name that need to retry or send to dlq
|
|
121
119
|
validatorSchema, // schema for record.Message
|
|
122
120
|
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
123
121
|
);
|
|
@@ -125,7 +123,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
125
123
|
// add argument (to invoke lambda) to passOnProperties[]
|
|
126
124
|
passOnProperties.push(record.body.Message.fromObjType)
|
|
127
125
|
passOnProperties.push(record.body.Message.fromTypeId)
|
|
128
|
-
passOnProperties.push(record.body.Message.
|
|
126
|
+
passOnProperties.push(record.body.Message.identifiers)
|
|
129
127
|
passOnProperties.push(record.body.Message.fromTable)
|
|
130
128
|
passOnProperties.push(record.body.Message.fromPartitionKeyId)
|
|
131
129
|
passOnProperties.push(record.body.Message.fromPartitionKeyFieldName)
|
|
@@ -142,34 +140,24 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
142
140
|
// call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
|
|
143
141
|
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
144
142
|
record, // one record will send to mainFunction
|
|
145
|
-
|
|
146
|
-
"
|
|
143
|
+
translateIdsRequest.translateIdsRequest, // mainFunction that need to invoke.
|
|
144
|
+
"TranslateIdsRequestHdrSqs", // queue name that need to retry or send to dlq
|
|
147
145
|
passOnProperties, // all parameters that mainFunction needed.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
146
|
+
);
|
|
147
|
+
record._izContext.logger.debug('after recordPromise in handler');
|
|
148
|
+
recordPromises.push(recordPromise); // push promise to recordPromises
|
|
149
|
+
})) //end record
|
|
150
|
+
|
|
151
|
+
Logger.debug('before Promise.all(recordPromises) in handler');
|
|
152
|
+
try {
|
|
153
|
+
await Promise.all(recordPromises); // await all promises
|
|
154
|
+
return event.Records // return all for local test
|
|
155
|
+
} catch {
|
|
156
|
+
Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
|
|
157
|
+
}
|
|
158
|
+
Logger.debug('after Promise.all(recordPromises) in handler');
|
|
161
159
|
} catch (err) {
|
|
162
|
-
Logger.error('Unhandled Error,
|
|
160
|
+
Logger.error('Unhandled Error, TranslateIdsRequest:', err);
|
|
163
161
|
throw (err);
|
|
164
162
|
}
|
|
165
|
-
})
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<%_ function firstLetterUpperCase(text) {
|
|
171
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
172
|
-
} _%>
|
|
173
|
-
<%_ function firstLetterLowerCase(str) {
|
|
174
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
175
|
-
} _%>
|
|
163
|
+
})
|
|
@@ -39,7 +39,7 @@ const sqs = externalRequest.sqs
|
|
|
39
39
|
* translate ids from one object to another related object
|
|
40
40
|
* @param {Object} _izContext
|
|
41
41
|
* @param {object} fromObjType - the type of object we are translating ids from
|
|
42
|
-
* @param {
|
|
42
|
+
* @param {Object[]} identifiers
|
|
43
43
|
* @param {string} fromTypeId - the type of object we are translating ids from
|
|
44
44
|
* @param {string} fromTable - table name
|
|
45
45
|
* @param {string} fromPartitionKeyId - partition key value
|
|
@@ -59,7 +59,7 @@ module.exports.translateIdsRequest = async (
|
|
|
59
59
|
_izContext,
|
|
60
60
|
fromObjType,
|
|
61
61
|
fromTypeId,
|
|
62
|
-
|
|
62
|
+
identifiers,
|
|
63
63
|
fromTable,
|
|
64
64
|
fromPartitionKeyId,
|
|
65
65
|
fromPartitionKeyFieldName,
|
|
@@ -81,7 +81,7 @@ module.exports.translateIdsRequest = async (
|
|
|
81
81
|
_izContext.logger.debug("=== Function:TranslateIdsRequest ===", {
|
|
82
82
|
fromObjType: fromObjType,
|
|
83
83
|
fromTypeId: fromTypeId,
|
|
84
|
-
|
|
84
|
+
identifiers: identifiers,
|
|
85
85
|
fromTable: fromTable,
|
|
86
86
|
fromPartitionKeyId: fromPartitionKeyId,
|
|
87
87
|
fromPartitionKeyFieldName: fromPartitionKeyFieldName,
|
|
@@ -103,7 +103,7 @@ module.exports.translateIdsRequest = async (
|
|
|
103
103
|
let [translateIdsCacheMainStatus, translateIdsCacheId, translateIdsCacheMain] = await translateIdsSharedLib.translateIdsCheckCacheMain(
|
|
104
104
|
_izContext,
|
|
105
105
|
fromObjType,
|
|
106
|
-
|
|
106
|
+
identifiers,
|
|
107
107
|
fromTable,
|
|
108
108
|
fromPartitionKeyId,
|
|
109
109
|
fromPartitionKeyFieldName,
|
|
@@ -126,7 +126,7 @@ module.exports.translateIdsRequest = async (
|
|
|
126
126
|
MessageBody: JSON.stringify({
|
|
127
127
|
fromObjType: fromObjType,
|
|
128
128
|
fromTypeId: fromTypeId,
|
|
129
|
-
|
|
129
|
+
identifiers: identifiers,
|
|
130
130
|
fromTable: fromTable,
|
|
131
131
|
fromPartitionKeyId: fromPartitionKeyId,
|
|
132
132
|
fromPartitionKeyFieldName: fromPartitionKeyFieldName,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils");
|
|
23
|
+
const { SOURCE_PATH } = require('../../libs/Consts');
|
|
24
|
+
const templatePath = path.join(__dirname, "./template.ejs");
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
function data(_izContext, createSourceParams, srcPath) {
|
|
28
|
+
// console.log("createSourceParams in Data", createSourceParams);
|
|
29
|
+
const functionNameConfigs = new Set();
|
|
30
|
+
for (let { templatePath, templateData, setting } of createSourceParams) {
|
|
31
|
+
if (templateData.functionNameConfig !== undefined) {
|
|
32
|
+
functionNameConfigs.add(templateData.functionNameConfig)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
templatePath: templatePath,
|
|
38
|
+
templateData: {
|
|
39
|
+
functionNameConfigs: functionNameConfigs
|
|
40
|
+
},
|
|
41
|
+
setting: {
|
|
42
|
+
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
43
|
+
saveFileName: "FunctionNameConfig",
|
|
44
|
+
fileExtension: ".yml",
|
|
45
|
+
isAppend: true
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
module.exports = data;
|
|
@@ -59,19 +59,19 @@ const createExternalLambdaRole = async (_izContext, allObjSchemas, allRelSchemas
|
|
|
59
59
|
|
|
60
60
|
// updateRelationship external lambda role
|
|
61
61
|
for (const handler of Object.values(HANDLER)) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
externalLambdaIamRoleUpdateRelationship && externalLambdaIamRoleArray.push(externalLambdaIamRoleUpdateRelationship)
|
|
65
|
-
|
|
66
|
-
}
|
|
62
|
+
const externalLambdaIamRoleUpdateRelationship = await externalLambdaIamRoleDataUpdateRelationshipSchema(_izContext, allRelSchemas, handler);
|
|
63
|
+
externalLambdaIamRoleUpdateRelationship && externalLambdaIamRoleArray.push(externalLambdaIamRoleUpdateRelationship)
|
|
67
64
|
}
|
|
68
65
|
|
|
69
66
|
// CreateRelationship external lambda role
|
|
70
67
|
for (const handler of Object.values(HANDLER)) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
const externalLambdaIamRoleCreateRelationship = await externalLambdaIamRoleDataCreateRelationshipSchema(_izContext, allRelSchemas, handler);
|
|
69
|
+
externalLambdaIamRoleCreateRelationship && externalLambdaIamRoleArray.push(externalLambdaIamRoleCreateRelationship)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
for (const handler of Object.values(HANDLER)) {
|
|
73
|
+
const externalLambdaIamRoleDeleteRelationship = await externalLambdaIamRoleDataDeleteRelationshipSchema(_izContext, allRelSchemas, handler);
|
|
74
|
+
externalLambdaIamRoleDeleteRelationship && externalLambdaIamRoleArray.push(externalLambdaIamRoleDeleteRelationship)
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
// findData external lambda role
|
|
@@ -93,7 +93,7 @@ const createExternalLambdaRole = async (_izContext, allObjSchemas, allRelSchemas
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
console.log("createSourceArrayIamRole", JSON.stringify(externalLambdaIamRoleArray))
|
|
96
|
+
// console.log("createSourceArrayIamRole", JSON.stringify(externalLambdaIamRoleArray))
|
|
97
97
|
// return externalLambdaIamRoleArray
|
|
98
98
|
|
|
99
99
|
return {
|
|
@@ -116,7 +116,7 @@ async function externalLambdaIamRoleDataPerAction(_izContext, objectSchema, acti
|
|
|
116
116
|
if (storgaeResource.storageType === STORAGE_TYPES.graph) {
|
|
117
117
|
let getGraphServiceName = await getGraphServiceNameFromGraphServerTagWithCache(_izContext, storgaeResource.graphServerTag)
|
|
118
118
|
if (!graphServiceNames.includes(getGraphServiceName)) {
|
|
119
|
-
graphServiceNames.push(getGraphServiceName)
|
|
119
|
+
getGraphServiceName && graphServiceNames.push(getGraphServiceName)
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
}
|
|
@@ -124,45 +124,61 @@ async function externalLambdaIamRoleDataPerAction(_izContext, objectSchema, acti
|
|
|
124
124
|
let functionName = upperCase(objectType) + upperCase(action) + upperCase(handler);
|
|
125
125
|
|
|
126
126
|
if (action === ACTIONS.get) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
externalResourceName(RESOURCE_CLASSES.lambda, "GetNodeV2HdrInv", graphServiceName),
|
|
127
|
+
if (!graphServiceNames) {
|
|
128
|
+
additionalResourcePermission.push(
|
|
129
|
+
createIamRole(
|
|
130
|
+
{ [RESOURCE_CLASSES.lambda]: [LAMBDA_RESOURCE.invokeFunction] },
|
|
131
|
+
graphServiceNames.map(graphServiceName =>
|
|
132
|
+
externalResourceName(RESOURCE_CLASSES.lambda, "GetNodeV2HdrInv", graphServiceName),
|
|
133
|
+
)
|
|
135
134
|
)
|
|
136
135
|
)
|
|
137
|
-
|
|
136
|
+
}
|
|
138
137
|
|
|
139
138
|
} else if (action === ACTIONS.update) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
139
|
+
if (!graphServiceNames) {
|
|
140
|
+
return
|
|
141
|
+
} else {
|
|
142
|
+
additionalResourcePermission.push(
|
|
143
|
+
createIamRole(
|
|
144
|
+
{
|
|
145
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
146
|
+
},
|
|
147
|
+
graphServiceNames.map(graphServiceName =>
|
|
148
|
+
externalResourceSns("InUpdateNode", graphServiceName)
|
|
149
|
+
)
|
|
147
150
|
)
|
|
148
151
|
)
|
|
149
|
-
|
|
150
|
-
// } else if (action === ACTIONS.delete) {
|
|
152
|
+
}
|
|
151
153
|
|
|
152
154
|
} else if (action === ACTIONS.create) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
if (!graphServiceNames.length) {
|
|
156
|
+
return
|
|
157
|
+
} else {
|
|
158
|
+
additionalResourcePermission.push(
|
|
159
|
+
createIamRole(
|
|
160
|
+
{
|
|
161
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
162
|
+
},
|
|
163
|
+
graphServiceNames.map(graphServiceName =>
|
|
164
|
+
externalResourceSns("InCreateNodeV2", graphServiceName)
|
|
165
|
+
)
|
|
160
166
|
)
|
|
161
167
|
)
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
//
|
|
168
|
+
}
|
|
169
|
+
} else if (action === ACTIONS.delete) {
|
|
170
|
+
// additionalResourcePermission.push(
|
|
171
|
+
// createIamRole(
|
|
172
|
+
// {
|
|
173
|
+
// [RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
174
|
+
// },
|
|
175
|
+
// graphServiceNames.map(graphServiceName =>
|
|
176
|
+
// externalResourceSns("InDeleteNode", graphServiceName)
|
|
177
|
+
// )
|
|
178
|
+
// )
|
|
179
|
+
// )
|
|
180
|
+
} else {
|
|
181
|
+
throw new error("Invalid action")
|
|
166
182
|
}
|
|
167
183
|
|
|
168
184
|
|
|
@@ -222,6 +238,28 @@ async function externalLambdaIamRoleDataCreateRelationshipSchema(_izContext, all
|
|
|
222
238
|
}
|
|
223
239
|
}
|
|
224
240
|
|
|
241
|
+
// delete Relationship
|
|
242
|
+
async function externalLambdaIamRoleDataDeleteRelationshipSchema(_izContext, allRelSchemas, handler) {
|
|
243
|
+
// const functionName = upperCase(FUNCTION_NAME.deleteRel) + upperCase(handler)
|
|
244
|
+
// const additionalResourcePermission = [];
|
|
245
|
+
// const graphServiceNamesFromAllRelSchemas = await getGraphServiceNameFromAllRelSchema(_izContext, allRelSchemas);
|
|
246
|
+
|
|
247
|
+
// additionalResourcePermission.push(
|
|
248
|
+
// createIamRole(
|
|
249
|
+
// {
|
|
250
|
+
// [RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
251
|
+
// },
|
|
252
|
+
// graphServiceNamesFromAllRelSchemas.map(graphServiceName =>
|
|
253
|
+
// externalResourceSns("InDeleteRelationship", graphServiceName)
|
|
254
|
+
// )
|
|
255
|
+
// )
|
|
256
|
+
// )
|
|
257
|
+
// return {
|
|
258
|
+
// functionName,
|
|
259
|
+
// additionalResourcePermission
|
|
260
|
+
// }
|
|
261
|
+
}
|
|
262
|
+
|
|
225
263
|
// Process TranslateIds Request
|
|
226
264
|
async function externalLambdaIamRoleDataTranslateId(_izContext, allRelSchemas, allObjSchemas) {
|
|
227
265
|
let functionName = upperCase(FUNCTION_NAME.translateIdsProcess) + upperCase(HANDLER.hdrDsq);
|
|
@@ -45,6 +45,9 @@ const createExternalSnsSubscriptions = async (_izContext, allRelSchemas, allObjS
|
|
|
45
45
|
const snsServiceConfigCreateNodeComplete = await snsSubscriptionCreateNodeComplete(_izContext, allObjSchemas)
|
|
46
46
|
snsServiceConfigCreateNodeComplete && snsServiceConfigArray.push(snsServiceConfigCreateNodeComplete);
|
|
47
47
|
|
|
48
|
+
const snsServiceConfigDeleteNodeComplete = await snsSubscriptionDeleteNodeComplate(_izContext, allObjSchemas)
|
|
49
|
+
snsServiceConfigDeleteNodeComplete && snsServiceConfigArray.push(snsServiceConfigDeleteNodeComplete);
|
|
50
|
+
|
|
48
51
|
return {
|
|
49
52
|
templatePath: templatePath,
|
|
50
53
|
templateData: { datas: snsServiceConfigArray },
|
|
@@ -102,6 +105,16 @@ async function snsSubscriptionCreateNodeComplete(_izContext, allObjectSchemas) {
|
|
|
102
105
|
}
|
|
103
106
|
}
|
|
104
107
|
|
|
108
|
+
async function snsSubscriptionDeleteNodeComplate(_izContext, allObjectSchemas) {
|
|
109
|
+
// let serviceNames = await getGraphServiceNameFromAllRelSchema(_izContext, allObjectSchemas)
|
|
110
|
+
|
|
111
|
+
// return {
|
|
112
|
+
// serviceNames: serviceNames,
|
|
113
|
+
// topicName: "OutDeleteNode",
|
|
114
|
+
// sqsEndpoint: "DeleteNodeComplete"
|
|
115
|
+
// }
|
|
116
|
+
}
|
|
117
|
+
|
|
105
118
|
// not done yet wait for comfirmation
|
|
106
119
|
|
|
107
120
|
|
|
@@ -176,14 +176,18 @@ const FUNCTION_NAME = {
|
|
|
176
176
|
createRel: "createRelationship",
|
|
177
177
|
updateRelComplete: "updateRelationshipComplete",
|
|
178
178
|
createRelComplete: "createRelationshipComplete",
|
|
179
|
+
deleteRel: "deleteRelationship",
|
|
180
|
+
deleteRelComplete: "deleteRelationshipComplete",
|
|
179
181
|
translateId: "translateIdsRequest",
|
|
180
182
|
translateIdsProcess: "processTranslateIds",
|
|
181
183
|
outTranslateIds: "processTranslateIdsComplete",
|
|
182
184
|
findData: "findData",
|
|
183
185
|
processLogical: "processLogical",
|
|
184
186
|
updateNodeComplete: "updateNodeComplete",
|
|
185
|
-
|
|
186
|
-
paginateProcessLogical: "paginateProcessLogical"
|
|
187
|
+
createObjectComplete: "createObjectComplete",
|
|
188
|
+
paginateProcessLogical: "paginateProcessLogical",
|
|
189
|
+
deleteNode: "deleteNode",
|
|
190
|
+
deleteNodeComplete: "deleteNodeComplete"
|
|
187
191
|
}
|
|
188
192
|
|
|
189
193
|
const getGraphServiceNameFromAllRelSchema = async (_izContext, allRelSchemas) => {
|
|
@@ -257,10 +261,28 @@ async function getGraphServiceNameFromObjectSchema(_izContext, allObjSchemas) {
|
|
|
257
261
|
}
|
|
258
262
|
}
|
|
259
263
|
let graphServiceNames = [...graphServiceName]
|
|
260
|
-
console.log("graphServiceName", graphServiceNames)
|
|
264
|
+
// console.log("graphServiceName", graphServiceNames)
|
|
261
265
|
return graphServiceNames
|
|
262
266
|
}
|
|
263
267
|
|
|
268
|
+
function awaitingMultipleStepsRole() {
|
|
269
|
+
let awaitingMultipleStepsRole = createIamRole(
|
|
270
|
+
{
|
|
271
|
+
[RESOURCE_CLASSES.dynamoDbTable]:
|
|
272
|
+
[
|
|
273
|
+
DYNAMO_RESOURCE.updateItem,
|
|
274
|
+
DYNAMO_RESOURCE.putItem,
|
|
275
|
+
DYNAMO_RESOURCE.deleteItem,
|
|
276
|
+
DYNAMO_RESOURCE.query
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
[
|
|
280
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "AwaitingMultipleSteps"),
|
|
281
|
+
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "AwaitingMultipleStepByPending"),
|
|
282
|
+
]
|
|
283
|
+
)
|
|
284
|
+
return awaitingMultipleStepsRole
|
|
285
|
+
}
|
|
264
286
|
|
|
265
287
|
module.exports = {
|
|
266
288
|
ACTIONS,
|
|
@@ -282,5 +304,6 @@ module.exports = {
|
|
|
282
304
|
getGraphServiceNameFromAllRelSchema,
|
|
283
305
|
defaultIamRolePerAction,
|
|
284
306
|
getComplexFilterServiceTag,
|
|
285
|
-
getGraphServiceNameFromObjectSchema
|
|
307
|
+
getGraphServiceNameFromObjectSchema,
|
|
308
|
+
awaitingMultipleStepsRole
|
|
286
309
|
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
-
|
|
4
|
-
This program is free software: you can redistribute it and/or modify
|
|
5
|
-
it under the terms of the GNU Affero General Public License as
|
|
6
|
-
published by the Free Software Foundation, either version 3 of the
|
|
7
|
-
License, or (at your option) any later version.
|
|
8
|
-
|
|
9
|
-
This program is distributed in the hope that it will be useful,
|
|
10
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
GNU Affero General Public License for more details.
|
|
13
|
-
|
|
14
|
-
You should have received a copy of the GNU Affero General Public License
|
|
15
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
'use strict';
|
|
19
|
-
const izara = require("@izara_project/izara-middleware");
|
|
20
|
-
const middleware = izara.middlewareHandler;
|
|
21
|
-
const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib')
|
|
22
|
-
const {
|
|
23
|
-
validateSchemaMiddleware
|
|
24
|
-
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
25
|
-
|
|
26
|
-
<%_ if (isCreateMainFunction == true) { _%>
|
|
27
|
-
// user generate main function
|
|
28
|
-
<%_ } else { %>
|
|
29
|
-
const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
|
|
30
|
-
<%_ } _%>
|
|
31
|
-
|
|
32
|
-
//(<globalVarible>
|
|
33
|
-
//</globalVarible>)
|
|
34
|
-
|
|
35
|
-
//validate event params in middleware before into main function
|
|
36
|
-
validateSchemaMiddleware(
|
|
37
|
-
middleware,
|
|
38
|
-
"<%- firstLetterUpperCase(objectType) %>",
|
|
39
|
-
"<%- action %>"
|
|
40
|
-
//(<validateSchemaSetting>
|
|
41
|
-
//</validateSchemaSetting>)
|
|
42
|
-
)
|
|
43
|
-
// if need to validate authorizer or additional params , add code to hook tag below
|
|
44
|
-
|
|
45
|
-
//(<afterValidateWith>)
|
|
46
|
-
//(</afterValidateWith>)
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
50
|
-
event._izContext.logger.debug('Event:', event);
|
|
51
|
-
try {
|
|
52
|
-
// invoke LambdaFunction
|
|
53
|
-
let lambdaFunctionResponse = await <%- functionName %>.<%- functionName %>Main(
|
|
54
|
-
event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId/userId
|
|
55
|
-
event,
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
// return error to client
|
|
59
|
-
if (lambdaFunctionResponse instanceof Error) {
|
|
60
|
-
return (izara.response.failure(lambdaFunctionResponse));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// return success to client
|
|
64
|
-
return (izara.response.success(lambdaFunctionResponse));
|
|
65
|
-
|
|
66
|
-
} catch (err) {
|
|
67
|
-
event._izContext.logger.error('Error, <%- functionName %>Main: ', err);
|
|
68
|
-
return (izara.response.failure(err));
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
<%_ function firstLetterUpperCase(text){
|
|
72
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
73
|
-
} _%>
|
|
74
|
-
<%_ function firstLetterLowerCase(str) {
|
|
75
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
76
|
-
} _%>
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
-
|
|
4
|
-
This program is free software: you can redistribute it and/or modify
|
|
5
|
-
it under the terms of the GNU Affero General Public License as
|
|
6
|
-
published by the Free Software Foundation, either version 3 of the
|
|
7
|
-
License, or (at your option) any later version.
|
|
8
|
-
|
|
9
|
-
This program is distributed in the hope that it will be useful,
|
|
10
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
GNU Affero General Public License for more details.
|
|
13
|
-
|
|
14
|
-
You should have received a copy of the GNU Affero General Public License
|
|
15
|
-
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
'use strict';
|
|
19
|
-
const izara = require("@izara_project/izara-middleware");
|
|
20
|
-
const middleware = izara.middlewareHandler;
|
|
21
|
-
const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib')
|
|
22
|
-
const {
|
|
23
|
-
validateSchemaMiddleware
|
|
24
|
-
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
25
|
-
|
|
26
|
-
<%_ if (isCreateMainFunction == true) { _%>
|
|
27
|
-
// user generate main function
|
|
28
|
-
<%_ } else { %>
|
|
29
|
-
const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
|
|
30
|
-
<%_ } _%>
|
|
31
|
-
|
|
32
|
-
//(<globalVarible>
|
|
33
|
-
//</globalVarible>)
|
|
34
|
-
// if need to validate authorizer or additional params , add code to hook tag below
|
|
35
|
-
|
|
36
|
-
//(<afterValidateWith>)
|
|
37
|
-
//(</afterValidateWith>)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
41
|
-
event._izContext.logger.debug('Event:', event);
|
|
42
|
-
try {
|
|
43
|
-
// invoke LambdaFunction
|
|
44
|
-
let lambdaFunctionResponse = await <%- functionName %>.<%- functionName %>Main(
|
|
45
|
-
event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId/userId
|
|
46
|
-
event,
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
// return error to client
|
|
50
|
-
if (lambdaFunctionResponse instanceof Error) {
|
|
51
|
-
return (izara.response.failure(lambdaFunctionResponse));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// return success to client
|
|
55
|
-
return (izara.response.success(lambdaFunctionResponse));
|
|
56
|
-
|
|
57
|
-
} catch (err) {
|
|
58
|
-
event._izContext.logger.error('Error, <%- functionName %>Main: ', err);
|
|
59
|
-
return (izara.response.failure(err));
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
<%_ function firstLetterUpperCase(text){
|
|
63
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
64
|
-
} _%>
|
|
65
|
-
<%_ function firstLetterLowerCase(str) {
|
|
66
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
67
|
-
} _%>
|