@izara_project/izara-market-library-service-schemas 1.0.7 → 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/GenerateCode.js +119 -44
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +2 -15
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/data.js +3 -1
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/template.ejs +1 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/template.ejs +12 -14
- 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 +30 -41
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/data.js +20 -36
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/data.js +14 -57
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/data.js +22 -39
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/data.js +8 -7
- 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 +141 -183
- 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 +1 -1
- 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 +75 -34
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +13 -0
- package/src/TemplateManager/src/libs/Consts.js +26 -3
- 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
|
@@ -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,40 +124,59 @@ 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
|
-
|
|
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
|
+
)
|
|
132
134
|
)
|
|
133
135
|
)
|
|
134
|
-
|
|
136
|
+
}
|
|
135
137
|
|
|
136
138
|
} else if (action === ACTIONS.update) {
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
+
)
|
|
144
150
|
)
|
|
145
151
|
)
|
|
146
|
-
|
|
152
|
+
}
|
|
147
153
|
|
|
148
154
|
} else if (action === ACTIONS.create) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
+
)
|
|
156
166
|
)
|
|
157
167
|
)
|
|
158
|
-
|
|
168
|
+
}
|
|
159
169
|
} else if (action === ACTIONS.delete) {
|
|
160
|
-
|
|
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
|
+
// )
|
|
161
180
|
} else {
|
|
162
181
|
throw new error("Invalid action")
|
|
163
182
|
}
|
|
@@ -219,6 +238,28 @@ async function externalLambdaIamRoleDataCreateRelationshipSchema(_izContext, all
|
|
|
219
238
|
}
|
|
220
239
|
}
|
|
221
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
|
+
|
|
222
263
|
// Process TranslateIds Request
|
|
223
264
|
async function externalLambdaIamRoleDataTranslateId(_izContext, allRelSchemas, allObjSchemas) {
|
|
224
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,6 +176,8 @@ 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",
|
|
@@ -183,7 +185,9 @@ const FUNCTION_NAME = {
|
|
|
183
185
|
processLogical: "processLogical",
|
|
184
186
|
updateNodeComplete: "updateNodeComplete",
|
|
185
187
|
createObjectComplete: "createObjectComplete",
|
|
186
|
-
paginateProcessLogical: "paginateProcessLogical"
|
|
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
|
-
} _%>
|
|
@@ -1,105 +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 recordHandlerSharedLib = require('@izara_project/izara-shared').recordHandlerSharedLib;
|
|
23
|
-
const {
|
|
24
|
-
validateSchemaMiddleware
|
|
25
|
-
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
26
|
-
const Logger = require('@izara_project/izara-core-library-logger');
|
|
27
|
-
|
|
28
|
-
<%_ if (isCreateMainFunction == true) { _%>
|
|
29
|
-
// user generate main function
|
|
30
|
-
<%_ } else { %>
|
|
31
|
-
const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
|
|
32
|
-
<%_ } _%>
|
|
33
|
-
|
|
34
|
-
const perRecordsValidatorSchema = {
|
|
35
|
-
type: "object",
|
|
36
|
-
required: ['identifiers'],
|
|
37
|
-
properties: {
|
|
38
|
-
identifiers: {
|
|
39
|
-
type: "object"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
module.exports.main = middleware.wrap(async(event,context,callback) => {
|
|
45
|
-
|
|
46
|
-
try {
|
|
47
|
-
|
|
48
|
-
let recordPromises = []; // final return
|
|
49
|
-
|
|
50
|
-
// loop each record and send to mainFunction
|
|
51
|
-
await Promise.all(event.Records.map(async record => { // promise.all for map() function
|
|
52
|
-
|
|
53
|
-
// --- reforming record.body for Dsq request
|
|
54
|
-
record = recordHandlerSharedLib.reformatDsqMessage(record._izContext, record);
|
|
55
|
-
record._izContext.logger.debug('record LambdaFunctionHdrDsq after reform', record);
|
|
56
|
-
|
|
57
|
-
let passOnProperties = []
|
|
58
|
-
|
|
59
|
-
// --- validate message (and MessageAttributes)
|
|
60
|
-
await recordHandlerSharedLib.validateRecord(
|
|
61
|
-
record, // one record will send to mainFunction
|
|
62
|
-
"<%- queueName %>", // queue name that need to retry or send to dlq
|
|
63
|
-
perRecordsValidatorSchema, // schema for record.Message
|
|
64
|
-
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
// add argument (to invoke lambda) to passOnProperties[]
|
|
68
|
-
passOnProperties.push(record.body.Message)
|
|
69
|
-
record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
|
|
70
|
-
|
|
71
|
-
// call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
|
|
72
|
-
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
73
|
-
record, // one record will send to mainFunction
|
|
74
|
-
<%- functionName %>.<%- functionName %>Main, // mainFunction that need to invoke.
|
|
75
|
-
"<%- queueName %>", // queue name that need to retry or send to dlq
|
|
76
|
-
passOnProperties, // all parameters that mainFunction needed.
|
|
77
|
-
);
|
|
78
|
-
record._izContext.logger.debug('after recordPromise in handler');
|
|
79
|
-
recordPromises.push(recordPromise); // push promise to recordPromises
|
|
80
|
-
})) //end record
|
|
81
|
-
|
|
82
|
-
Logger.debug('before Promise.all(recordPromises) in handler');
|
|
83
|
-
try {
|
|
84
|
-
await Promise.all(recordPromises); // await all promises
|
|
85
|
-
return event.Records // return all for local test
|
|
86
|
-
} catch {
|
|
87
|
-
Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
|
|
88
|
-
}
|
|
89
|
-
Logger.debug('after Promise.all(recordPromises) in handler');
|
|
90
|
-
} catch (err) {
|
|
91
|
-
Logger.error('Unhandled Error, <%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>Dsq :', err);
|
|
92
|
-
throw (err);
|
|
93
|
-
}
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<%_ function firstLetterUpperCase(text){
|
|
101
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
102
|
-
} _%>
|
|
103
|
-
<%_ function firstLetterLowerCase(str) {
|
|
104
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
105
|
-
} _%>
|
|
@@ -1,109 +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 recordHandlerSharedLib = require('@izara_project/izara-shared').recordHandlerSharedLib;
|
|
23
|
-
const {
|
|
24
|
-
validateSchemaMiddleware
|
|
25
|
-
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
26
|
-
const Logger = require('@izara_project/izara-core-library-logger');
|
|
27
|
-
|
|
28
|
-
<%_ if (isCreateMainFunction == true) { _%>
|
|
29
|
-
// user generate main function
|
|
30
|
-
<%_ } else { %>
|
|
31
|
-
const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
|
|
32
|
-
<%_ } _%>
|
|
33
|
-
|
|
34
|
-
const perRecordsValidatorSchema = {
|
|
35
|
-
type: 'object',
|
|
36
|
-
required: ["objInstance"],
|
|
37
|
-
properties: {
|
|
38
|
-
objInstance: {
|
|
39
|
-
type: "object",
|
|
40
|
-
required: ["identifiers", "fields"],
|
|
41
|
-
properties: {
|
|
42
|
-
identifiers: {
|
|
43
|
-
type: "object",
|
|
44
|
-
minProperties: 1
|
|
45
|
-
},
|
|
46
|
-
fields: {
|
|
47
|
-
type: "object",
|
|
48
|
-
minProperties: 1
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
module.exports.main = middleware.wrap(async(event, context,callback) => {
|
|
56
|
-
|
|
57
|
-
try {
|
|
58
|
-
let recordPromises = [];
|
|
59
|
-
|
|
60
|
-
await Promise.all(event.Records.map(async record => {
|
|
61
|
-
|
|
62
|
-
record = recordHandlerSharedLib.reformatDsqMessage(record._izContext, record);
|
|
63
|
-
record._izContext.logger.debug('record <%- objectType %> after reform', record);
|
|
64
|
-
let passOnProperties = []
|
|
65
|
-
|
|
66
|
-
// --- validate message (and MessageAttributes)
|
|
67
|
-
await recordHandlerSharedLib.validateRecord(
|
|
68
|
-
record, // one record will send to mainFunction
|
|
69
|
-
"<%- queueName %>", // queue name that need to retry or send to dlq
|
|
70
|
-
perRecordsValidatorSchema, // schema for record.Message
|
|
71
|
-
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
// add argument (to invoke lambda) to passOnProperties[]
|
|
75
|
-
passOnProperties.push(record.body.Message)
|
|
76
|
-
record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
|
|
77
|
-
|
|
78
|
-
// call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
|
|
79
|
-
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
80
|
-
record, // one record will send to mainFunction
|
|
81
|
-
<%- functionName %>.<%- functionName %>Main, // mainFunction that need to invoke.
|
|
82
|
-
"<%- queueName %>", // queue name that need to retry or send to dlq
|
|
83
|
-
passOnProperties, // all parameters that mainFunction needed.
|
|
84
|
-
);
|
|
85
|
-
record._izContext.logger.debug('after recordPromise in handler');
|
|
86
|
-
recordPromises.push(recordPromise); // push promise to recordPromises
|
|
87
|
-
})) //end record
|
|
88
|
-
|
|
89
|
-
Logger.debug('before Promise.all(recordPromises) in handler');
|
|
90
|
-
try {
|
|
91
|
-
await Promise.all(recordPromises); // await all promises
|
|
92
|
-
return event.Records // return all for local test
|
|
93
|
-
} catch {
|
|
94
|
-
Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
|
|
95
|
-
}
|
|
96
|
-
Logger.debug('after Promise.all(recordPromises) in handler');
|
|
97
|
-
} catch (err) {
|
|
98
|
-
Logger.error('Unhandled Error, <%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>Dsq :', err);
|
|
99
|
-
throw (err);
|
|
100
|
-
}
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<%_ function firstLetterUpperCase(text){
|
|
105
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
106
|
-
} _%>
|
|
107
|
-
<%_ function firstLetterLowerCase(str) {
|
|
108
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
109
|
-
} _%>
|