@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
|
@@ -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
|
-
} _%>
|
|
@@ -1,75 +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
|
-
|
|
20
|
-
const middleware = require("@izara_project/izara-middleware/src/MiddlewareCore/MiddlewareHandler");
|
|
21
|
-
|
|
22
|
-
const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib')
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const {
|
|
26
|
-
validateSchemaMiddleware
|
|
27
|
-
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<%_ if (isCreateMainFunction == true) { _%>
|
|
31
|
-
// user generate main function
|
|
32
|
-
<%_ } else { %>
|
|
33
|
-
const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
|
|
34
|
-
<%_ } _%>
|
|
35
|
-
|
|
36
|
-
//validate event params in middleware before into function
|
|
37
|
-
validateSchemaMiddleware(
|
|
38
|
-
middleware,
|
|
39
|
-
"<%- firstLetterUpperCase(objectType) %>", // objectType
|
|
40
|
-
"<%- action %>", // action
|
|
41
|
-
//(<validateSchemaSetting>)
|
|
42
|
-
//(</validateSchemaSetting>)
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
//(<afterValidateWithGenereatedSchema>)
|
|
46
|
-
//(</afterValidateWithGenereatedSchema>)
|
|
47
|
-
|
|
48
|
-
module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
49
|
-
event._izContext.logger.debug('Event:', event);
|
|
50
|
-
event._izContext.logger.debug('context:', context);
|
|
51
|
-
|
|
52
|
-
try {
|
|
53
|
-
|
|
54
|
-
//(<beforeInvoke>)
|
|
55
|
-
//(</beforeInvoke>)
|
|
56
|
-
|
|
57
|
-
// invoke LambdaFunction
|
|
58
|
-
return await <%- functionName %>.<%- functionName %>Main(
|
|
59
|
-
event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId
|
|
60
|
-
event,
|
|
61
|
-
callingFlowSharedLib.addCallingFlowToPassOnProperties(event)
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
} catch (err) {
|
|
65
|
-
event._izContext.logger.error('Error, <%- firstLetterUpperCase(objectType) %>: ', err);
|
|
66
|
-
throw (err);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
<%_ function firstLetterUpperCase(text){
|
|
71
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
72
|
-
} _%>
|
|
73
|
-
<%_ function firstLetterLowerCase(str) {
|
|
74
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
75
|
-
} _%>
|
|
@@ -1,82 +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
|
-
|
|
20
|
-
const middleware = require("@izara_project/izara-middleware/src/MiddlewareCore/MiddlewareHandler");
|
|
21
|
-
|
|
22
|
-
const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib')
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const {
|
|
26
|
-
validateSchemaMiddleware
|
|
27
|
-
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<%_ if (isCreateMainFunction == true) { _%>
|
|
31
|
-
// user generate main function
|
|
32
|
-
<%_ } else { %>
|
|
33
|
-
const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
|
|
34
|
-
<%_ } _%>
|
|
35
|
-
|
|
36
|
-
//(<globalVariable>
|
|
37
|
-
//</globalVariable>)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
//validate event params in middleware before into function
|
|
41
|
-
validateSchemaMiddleware(
|
|
42
|
-
middleware,
|
|
43
|
-
"<%- firstLetterUpperCase(objectType) %>", // objectType
|
|
44
|
-
"<%- action %>", // action
|
|
45
|
-
//(<validateSchemaSetting>)
|
|
46
|
-
//(</validateSchemaSetting>)
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
// if need to validate authorizer or additional params, add code to hook tag below
|
|
50
|
-
|
|
51
|
-
//(<afterValidateWithGenereatedSchema>)
|
|
52
|
-
//(</afterValidateWithGenereatedSchema>)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
56
|
-
event._izContext.logger.debug('Event:', event);
|
|
57
|
-
event._izContext.logger.debug('context:', context);
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
|
|
61
|
-
//(<beforeInvoke>)
|
|
62
|
-
//(</beforeInvoke>)
|
|
63
|
-
|
|
64
|
-
// invoke LambdaFunction
|
|
65
|
-
return await <%- functionName %>.<%- functionName %>Main(
|
|
66
|
-
event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId
|
|
67
|
-
event,
|
|
68
|
-
callingFlowSharedLib.addCallingFlowToPassOnProperties(event)
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
} catch (err) {
|
|
72
|
-
event._izContext.logger.error('Error, <%- firstLetterUpperCase(objectType) %>: ', err);
|
|
73
|
-
throw (err);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
<%_ function firstLetterUpperCase(text){
|
|
78
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
79
|
-
} _%>
|
|
80
|
-
<%_ function firstLetterLowerCase(str) {
|
|
81
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
82
|
-
} _%>
|
|
@@ -1,75 +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
|
-
|
|
20
|
-
const middleware = require("@izara_project/izara-middleware/src/MiddlewareCore/MiddlewareHandler");
|
|
21
|
-
|
|
22
|
-
const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib')
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const {
|
|
26
|
-
validateSchemaMiddleware
|
|
27
|
-
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<%_ if (isCreateMainFunction == true) { _%>
|
|
31
|
-
// user generate main function
|
|
32
|
-
<%_ } else { %>
|
|
33
|
-
const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
|
|
34
|
-
<%_ } _%>
|
|
35
|
-
|
|
36
|
-
//validate event params in middleware before into function
|
|
37
|
-
validateSchemaMiddleware(
|
|
38
|
-
middleware,
|
|
39
|
-
"<%- firstLetterUpperCase(objectType) %>", // objectType
|
|
40
|
-
"<%- action %>", // action
|
|
41
|
-
//(<validateSchemaSetting>)
|
|
42
|
-
//(</validateSchemaSetting>)
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
//(<afterValidateWithGenereatedSchema>)
|
|
46
|
-
//(</afterValidateWithGenereatedSchema>)
|
|
47
|
-
|
|
48
|
-
module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
49
|
-
event._izContext.logger.debug('Event:', event);
|
|
50
|
-
event._izContext.logger.debug('context:', context);
|
|
51
|
-
|
|
52
|
-
try {
|
|
53
|
-
|
|
54
|
-
//(<beforeInvoke>)
|
|
55
|
-
//(</beforeInvoke>)
|
|
56
|
-
|
|
57
|
-
// invoke LambdaFunction
|
|
58
|
-
return await <%- functionName %>.<%- functionName %>Main(
|
|
59
|
-
event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId
|
|
60
|
-
event,
|
|
61
|
-
callingFlowSharedLib.addCallingFlowToPassOnProperties(event)
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
} catch (err) {
|
|
65
|
-
event._izContext.logger.error('Error, <%- firstLetterUpperCase(objectType) %>: ', err);
|
|
66
|
-
throw (err);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
<%_ function firstLetterUpperCase(text){
|
|
71
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
72
|
-
} _%>
|
|
73
|
-
<%_ function firstLetterLowerCase(str) {
|
|
74
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
75
|
-
} _%>
|
|
@@ -1,124 +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
|
-
const Logger = require('@izara_project/izara-core-library-logger');
|
|
26
|
-
const recordHandlerSharedLib = require('@izara_project/izara-shared').recordHandlerSharedLib
|
|
27
|
-
|
|
28
|
-
<%_ if (isCreateMainFunction == true) { _%>
|
|
29
|
-
// user generate main function
|
|
30
|
-
<%_ } else { %>
|
|
31
|
-
const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
|
|
32
|
-
<%_ } _%>
|
|
33
|
-
|
|
34
|
-
//(<globalVarible>
|
|
35
|
-
//</globalVarible>)
|
|
36
|
-
|
|
37
|
-
const perRecordValidatorSchema = {
|
|
38
|
-
type: "object",
|
|
39
|
-
required: ['identifiers'],
|
|
40
|
-
properties: {
|
|
41
|
-
identifiers: {
|
|
42
|
-
type: 'object'
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const messageAttributeValidatorSchema = {
|
|
48
|
-
type: "object",
|
|
49
|
-
require: ['msgAtrrParam1','msgAtrrParam2'],
|
|
50
|
-
properties: {
|
|
51
|
-
msgAtrrParam1: {
|
|
52
|
-
type: 'string'
|
|
53
|
-
},
|
|
54
|
-
msgAtrrParam2: {
|
|
55
|
-
type: 'string'
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
//validate event params in middleware before into main function
|
|
61
|
-
validateSchemaMiddleware(
|
|
62
|
-
middleware,
|
|
63
|
-
"<%- firstLetterUpperCase(objectType) %>",
|
|
64
|
-
"<%- action %>"
|
|
65
|
-
//(<validateSchemaSetting>
|
|
66
|
-
//</validateSchemaSetting>)
|
|
67
|
-
)
|
|
68
|
-
// if need to validate authorizer or additional params , add code to hook tag below
|
|
69
|
-
|
|
70
|
-
//(<afterValidateWith)
|
|
71
|
-
module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
72
|
-
try {
|
|
73
|
-
|
|
74
|
-
let recordPromises = [];
|
|
75
|
-
|
|
76
|
-
await Promise.all(event.Records.map(async record => {
|
|
77
|
-
|
|
78
|
-
let passOnProperties = [];
|
|
79
|
-
record._izContext.logger.debug('record ReceiveMesOutHdrSqs' , record);
|
|
80
|
-
|
|
81
|
-
// validate message (and MessageAttributes)
|
|
82
|
-
await recordHandlerSharedLib.validateRecord(
|
|
83
|
-
record,
|
|
84
|
-
"<%- functionName %>",
|
|
85
|
-
perRecordValidatorSchema,
|
|
86
|
-
// messageAttributeValidatorSchema
|
|
87
|
-
);
|
|
88
|
-
|
|
89
|
-
// add argument (to invoke lambda) to passOnProperties[]
|
|
90
|
-
passOnProperties.push(record.body.Message)
|
|
91
|
-
record._izContext.logger.debug("passOnProperties in handler", passOnProperties);
|
|
92
|
-
|
|
93
|
-
// call recordHandlerSharedLib.recordHandler with 3 parameters and return Promise (resolve)
|
|
94
|
-
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
95
|
-
record,
|
|
96
|
-
<%- functionName %>.<%- functionName %>Main,
|
|
97
|
-
"<%- queueName %>",
|
|
98
|
-
passOnProperties,
|
|
99
|
-
);
|
|
100
|
-
record._izContext.logger.debug('after recoedPromise in handler');
|
|
101
|
-
recordPromises.push(recordPromise);
|
|
102
|
-
}))
|
|
103
|
-
|
|
104
|
-
Logger.debug('before Promise.all(recordPromises) in handler');
|
|
105
|
-
try {
|
|
106
|
-
// --- main await all Promises
|
|
107
|
-
await Promise.all(recordPromises); // await all Promises
|
|
108
|
-
|
|
109
|
-
return event.Records // return all for local testing
|
|
110
|
-
} catch {
|
|
111
|
-
Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did not resolve)');
|
|
112
|
-
}
|
|
113
|
-
Logger.debug('after Promise,all(recordPromises) in handler');
|
|
114
|
-
} catch (err) {
|
|
115
|
-
Logger.error('unhandler Error , <%- functionName %>:', err);
|
|
116
|
-
throw (err);
|
|
117
|
-
}
|
|
118
|
-
})
|
|
119
|
-
<%_ function firstLetterUpperCase(text){
|
|
120
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
121
|
-
} _%>
|
|
122
|
-
<%_ function firstLetterLowerCase(str) {
|
|
123
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
124
|
-
} _%>
|