@izara_project/izara-market-library-service-schemas 1.0.7 → 1.0.9
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 +2 -2
- package/src/GenerateCodeLibs/src/Consts.js +27 -12
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +41 -50
- package/src/MainLibs/src/Utils.js +13 -0
- package/src/TemplateManager/src/FindData/FindDataYaml/data.js +3 -2
- package/src/TemplateManager/src/FindData/FindDataYaml/template.ejs +1 -1
- package/src/TemplateManager/src/FindData/Handler/data.js +1 -2
- package/src/TemplateManager/src/FindData/mainFunction/data.js +1 -1
- package/src/TemplateManager/src/GenerateCode.js +120 -47
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +3 -16
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/data.js +4 -2
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/template.ejs +11 -10
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/data.js +1 -1
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/template.ejs +9 -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 +3 -17
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/handler/data.js +4 -2
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/data.js +1 -1
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/template.ejs +4 -4
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/data.js +41 -46
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/template.ejs +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/data.js +31 -43
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/template.ejs +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/data.js +22 -67
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/template.ejs +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/data.js +31 -43
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/template.ejs +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/data.js +6 -7
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/template.ejs +2 -2
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/data.js +8 -42
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/template.ejs +80 -65
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/data.js +12 -65
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/template.ejs +3 -4
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/data.js +11 -45
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/template.ejs +64 -59
- 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 +2 -1
- package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/data.js +49 -80
- package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/template.ejs +1 -1
- package/src/TemplateManager/src/ProcessLogical/mainFunction/template.ejs +1 -1
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/data.js +42 -72
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/template.ejs +1 -1
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/data.js +44 -74
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/template.ejs +1 -1
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js +85 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship → RelationshipPerAction/CreateRelationship/createRelationship}/functionYaml/HdrApi/template.ejs +3 -3
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/functionYaml/HdrDsq/data.js +6 -42
- 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 +6 -42
- 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 +6 -42
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/template.ejs +26 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/perAction/HdrApi → RelationshipPerAction/CreateRelationship/createRelationship/mainFunction}/data.js +4 -5
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/mainFunction/template.ejs +2 -2
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrApi/data.js +3 -3
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrDsq/data.js +3 -3
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrInv/data.js +3 -3
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrSqs/data.js +3 -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 +10 -47
- package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRalationshipComplete → RelationshipPerAction/CreateRelationship/createRelationshipComplete}/functionYaml/template.ejs +1 -1
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/handler/HdrSqs/data.js +2 -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 +86 -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 +97 -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 +84 -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 +97 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/template.ejs +26 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction/data.js +58 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction/template.ejs +329 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/data.js +58 -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 +59 -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 +60 -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 +60 -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 +96 -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 +7 -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 +6 -45
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/template.ejs +33 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/handler/HdrSqs/data.js +3 -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 +6 -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 +6 -42
- 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 +7 -42
- 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 +7 -43
- 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/{UpdateRelationshipSchema/updateRelationship/perAction/HdrInv → RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi}/data.js +3 -6
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrDsq/data.js +3 -3
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrInv/data.js +62 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/data.js +59 -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 +30 -3
- package/src/TemplateManager/src/ResourceYaml/dynamodb/template.ejs +1 -1
- package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +6 -6
- package/src/TemplateManager/src/ResourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +2 -2
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/functionYaml/data.js +5 -6
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/functionYaml/template.ejs +1 -1
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/dataHdrDsq.js +1 -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 +6 -31
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrDsq/template.ejs +30 -0
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs/data.js +6 -31
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs/template.ejs +30 -0
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq/data.js +2 -2
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq/template.ejs +3 -5
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs/data.js +1 -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 +14 -0
- package/src/TemplateManager/src/externalService/LambdaRole/data.js +94 -53
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +13 -0
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/template.ejs +19 -0
- package/src/TemplateManager/src/libs/Consts.js +41 -15
- 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/{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
|
@@ -22,7 +22,7 @@ const fs = require('fs');
|
|
|
22
22
|
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
23
|
const { getGraphServiceNameFromGraphServerTagWithCache, getServiceNameWithCache } = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig')
|
|
24
24
|
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../MainLibs/src/Utils")
|
|
25
|
-
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, externalResourceName, getGraphServiceNameFromAllRelSchema, FUNCTION_NAME, SAVE_FILE_NAME, getGraphServiceNameFromObjectSchema, defaultIamRolePerAction, SQS_RESOURCE, SNS_RESOURCE, DYNAMO_RESOURCE } = require("../../../libs/Consts");
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, externalResourceName, getGraphServiceNameFromAllRelSchema, FUNCTION_NAME, SAVE_FILE_NAME, getGraphServiceNameFromObjectSchema, defaultIamRolePerAction, SQS_RESOURCE, SNS_RESOURCE, DYNAMO_RESOURCE, awaitingMultipleStepsRole } = require("../../../libs/Consts");
|
|
26
26
|
|
|
27
27
|
const templatePath = path.join(__dirname, './template.ejs');
|
|
28
28
|
|
|
@@ -61,20 +61,7 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
|
|
|
61
61
|
)
|
|
62
62
|
)
|
|
63
63
|
|
|
64
|
-
additionalResourcePermission.push(
|
|
65
|
-
createIamRole(
|
|
66
|
-
{
|
|
67
|
-
[RESOURCE_CLASSES.dynamoDbTable]: [
|
|
68
|
-
DYNAMO_RESOURCE.updateItem,
|
|
69
|
-
DYNAMO_RESOURCE.query,
|
|
70
|
-
DYNAMO_RESOURCE.deleteItem
|
|
71
|
-
]
|
|
72
|
-
},
|
|
73
|
-
awaitingTables.map(tableName =>
|
|
74
|
-
resourceNames(RESOURCE_CLASSES.dynamoDbTable, tableName)
|
|
75
|
-
)
|
|
76
|
-
)
|
|
77
|
-
)
|
|
64
|
+
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
78
65
|
|
|
79
66
|
|
|
80
67
|
return {
|
|
@@ -83,7 +70,7 @@ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
|
|
|
83
70
|
functionName,
|
|
84
71
|
handlerType,
|
|
85
72
|
additionalResourcePermission,
|
|
86
|
-
resourceLocation: SOURCE_PATH.
|
|
73
|
+
resourceLocation: SOURCE_PATH.resourceLocationOutPerActionComplete
|
|
87
74
|
},
|
|
88
75
|
setting: {
|
|
89
76
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
@@ -39,16 +39,18 @@ function data(_izContext, srcPath) {
|
|
|
39
39
|
|
|
40
40
|
function createParamForCreateSource(srcPath) {
|
|
41
41
|
const functionName = FUNCTION_NAME.createObjectComplete;
|
|
42
|
+
let functionNameConfig = upperCase(functionName)
|
|
42
43
|
|
|
43
44
|
return {
|
|
44
45
|
templatePath: templatePath,
|
|
45
46
|
templateData: {
|
|
46
47
|
functionName,
|
|
47
48
|
queueName: upperCase(functionName),
|
|
48
|
-
functionName
|
|
49
|
+
functionName,
|
|
50
|
+
functionNameConfig
|
|
49
51
|
},
|
|
50
52
|
setting: {
|
|
51
|
-
savePath: path.join(srcPath, SOURCE_PATH.
|
|
53
|
+
savePath: path.join(srcPath, SOURCE_PATH.outPerActionComplete),
|
|
52
54
|
saveFileName: `${upperCase(functionName)}_${upperCase(HANDLER.hdrSqs)}`,
|
|
53
55
|
fileExtension: ".js",
|
|
54
56
|
isAppend: false
|
|
@@ -26,7 +26,7 @@ const izaraShared = require('@izara_project/izara-shared');
|
|
|
26
26
|
const recordHandlerSharedLib = izaraShared.recordHandlerSharedLib
|
|
27
27
|
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
28
28
|
|
|
29
|
-
const
|
|
29
|
+
const createObjectComplete = require('./CreateObjectComplete_Main');
|
|
30
30
|
const Logger = require('@izara_project/izara-core-library-logger');
|
|
31
31
|
// validate event properties in body.Message of sqs event
|
|
32
32
|
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
@@ -36,7 +36,8 @@ let perRecordsValidatorSchema = {
|
|
|
36
36
|
required: [
|
|
37
37
|
'returnValue',
|
|
38
38
|
'status',
|
|
39
|
-
'errorFounds'
|
|
39
|
+
'errorFounds',
|
|
40
|
+
'graphServiceTag'
|
|
40
41
|
],
|
|
41
42
|
properties: {
|
|
42
43
|
returnValue: {
|
|
@@ -48,6 +49,9 @@ let perRecordsValidatorSchema = {
|
|
|
48
49
|
errorFounds: {
|
|
49
50
|
type: 'array',
|
|
50
51
|
default: []
|
|
52
|
+
},
|
|
53
|
+
graphServiceTag: {
|
|
54
|
+
type: 'string',
|
|
51
55
|
}
|
|
52
56
|
}
|
|
53
57
|
};
|
|
@@ -82,7 +86,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
82
86
|
//validate message (and MessageAttributes)
|
|
83
87
|
await recordHandlerSharedLib.validateRecord(
|
|
84
88
|
record, // one record will send to mainFunction
|
|
85
|
-
"
|
|
89
|
+
"CreateObjectComplete", // queue name that need to retry or send to dlq
|
|
86
90
|
perRecordsValidatorSchema, // schema for record.Message
|
|
87
91
|
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
88
92
|
);
|
|
@@ -91,6 +95,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
91
95
|
passOnProperties.push(record.body.Message.returnValue)
|
|
92
96
|
passOnProperties.push(record.body.Message.status)
|
|
93
97
|
passOnProperties.push(record.body.Message.errorFounds)
|
|
98
|
+
passOnProperties.push(record.body.Message.graphServiceTag)
|
|
94
99
|
passOnProperties.push(callingFlowSharedLib.addPassBackPropertiesToPassOnProperties(record.body.Message)) // is Ok PassBackProperties
|
|
95
100
|
// passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message)) // is Ok callinfFlow
|
|
96
101
|
record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
|
|
@@ -98,8 +103,8 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
98
103
|
// call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
|
|
99
104
|
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
100
105
|
record, // one record will send to mainFunction
|
|
101
|
-
|
|
102
|
-
"
|
|
106
|
+
createObjectComplete.createObjectComplete, // mainFunction that need to invoke.
|
|
107
|
+
"CreateObjectComplete", // queue name that need to retry or send to dlq
|
|
103
108
|
passOnProperties, // all parameters that mainFunction needed.
|
|
104
109
|
);
|
|
105
110
|
record._izContext.logger.debug('after recordPromise in handler');
|
|
@@ -122,8 +127,4 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
122
127
|
Logger.error('Unhandled Error, updateNodeCompleteHdrSqs: ', err);
|
|
123
128
|
throw (err);
|
|
124
129
|
}
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
<%_ function firstLetterUpperCase(text){
|
|
128
|
-
return text.charAt(0).toUpperCase()+ text.slice(1)
|
|
129
|
-
} _%>
|
|
130
|
+
});
|
|
@@ -42,7 +42,7 @@ function createMainFunctionCreateComplete(_izContext, srcPath) {
|
|
|
42
42
|
templatePath: templatePath,
|
|
43
43
|
templateData: {},
|
|
44
44
|
setting: {
|
|
45
|
-
savePath: path.join(srcPath, SOURCE_PATH.
|
|
45
|
+
savePath: path.join(srcPath, SOURCE_PATH.outPerActionComplete),
|
|
46
46
|
saveFileName: `${upperCase(FUNCTION_NAME.createObjectComplete)}_Main`,
|
|
47
47
|
fileExtension: ".js",
|
|
48
48
|
isAppend: false
|
package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/template.ejs
CHANGED
|
@@ -37,7 +37,6 @@ const PREFIX = {
|
|
|
37
37
|
* @param {*} errorsFounds
|
|
38
38
|
* @param {*} graphServiceTag
|
|
39
39
|
* @param {*} passBackProperties
|
|
40
|
-
* @param {*} callingFlowConfig
|
|
41
40
|
returnValue = {
|
|
42
41
|
queryResult: returnCreateNode,
|
|
43
42
|
objType,
|
|
@@ -53,7 +52,6 @@ module.exports.createObjectComplete = async (
|
|
|
53
52
|
errorsFound,
|
|
54
53
|
graphServiceTag,
|
|
55
54
|
passBackProperties,
|
|
56
|
-
callingFlowConfig
|
|
57
55
|
) => {
|
|
58
56
|
try {
|
|
59
57
|
_izContext.logger.debug("function createObjectComplete:", {
|
|
@@ -62,7 +60,6 @@ module.exports.createObjectComplete = async (
|
|
|
62
60
|
errorsFound,
|
|
63
61
|
graphServiceTag,
|
|
64
62
|
passBackProperties,
|
|
65
|
-
callingFlowConfig
|
|
66
63
|
});
|
|
67
64
|
|
|
68
65
|
let errorFounds = [];
|
|
@@ -78,7 +75,7 @@ module.exports.createObjectComplete = async (
|
|
|
78
75
|
if (!returnValue.hasOwnProperty("objType")) {
|
|
79
76
|
errorFounds.push("message is not have property objType, should be not happen");
|
|
80
77
|
};
|
|
81
|
-
if (!returnValue.hasOwnProperty("
|
|
78
|
+
if (!returnValue.hasOwnProperty("objInstanceFull")) {
|
|
82
79
|
errorFounds.push("message is not have property objInstance, should be not objInstance");
|
|
83
80
|
};
|
|
84
81
|
|
|
@@ -91,8 +88,8 @@ module.exports.createObjectComplete = async (
|
|
|
91
88
|
if (status === "complete" && errorsFound.length > 0) {
|
|
92
89
|
errorFounds.push("[Invalid] status is commplete should be not have errorsFound");
|
|
93
90
|
};
|
|
94
|
-
if (graphServiceTag ==
|
|
95
|
-
errorFounds.push("[Invalid]
|
|
91
|
+
if (graphServiceTag == null) {
|
|
92
|
+
errorFounds.push("[Invalid] graphServerTag is not empty string");
|
|
96
93
|
};
|
|
97
94
|
|
|
98
95
|
if (errorsFound.length > 0) {
|
|
@@ -100,14 +97,12 @@ module.exports.createObjectComplete = async (
|
|
|
100
97
|
errorFounds = errorFounds.concat(errorsFound);
|
|
101
98
|
};
|
|
102
99
|
|
|
103
|
-
|
|
104
|
-
let awaitingStepId = asyncFlowSharedLib.createAwaitingStepId((hash(
|
|
100
|
+
let awaitingStepId = await asyncFlowSharedLib.createAwaitingStepId((hash(
|
|
105
101
|
{
|
|
106
102
|
objType: returnValue.objType,
|
|
107
|
-
|
|
108
|
-
identifiers: returnValue.
|
|
109
|
-
}
|
|
110
|
-
)),
|
|
103
|
+
graphServiceTag: graphServiceTag,
|
|
104
|
+
identifiers: returnValue.objInstanceFull.identifiers
|
|
105
|
+
})),
|
|
111
106
|
PREFIX.CREATE_OBJECT_ASYNC
|
|
112
107
|
)
|
|
113
108
|
_izContext.logger.debug("awaitingStepId:", awaitingStepId);
|
|
@@ -150,7 +145,7 @@ module.exports.createObjectComplete = async (
|
|
|
150
145
|
// this scenario can complete with or without errorsFound
|
|
151
146
|
let messageObject = {
|
|
152
147
|
objType: returnValue.objType,
|
|
153
|
-
|
|
148
|
+
objInstanceFull: returnValue.objInstanceFull,
|
|
154
149
|
errorFounds: errorFounds
|
|
155
150
|
};
|
|
156
151
|
|
|
@@ -169,4 +164,4 @@ module.exports.createObjectComplete = async (
|
|
|
169
164
|
} catch (err) {
|
|
170
165
|
throw (err)
|
|
171
166
|
}
|
|
172
|
-
}
|
|
167
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
|
+
const { getGraphServiceNameFromGraphServerTagWithCache, getServiceNameWithCache } = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig')
|
|
24
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../MainLibs/src/Utils")
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, externalResourceName, getGraphServiceNameFromAllRelSchema, FUNCTION_NAME, SAVE_FILE_NAME, getGraphServiceNameFromObjectSchema, defaultIamRolePerAction, SQS_RESOURCE, SNS_RESOURCE, DYNAMO_RESOURCE } = require("../../../libs/Consts");
|
|
26
|
+
|
|
27
|
+
const templatePath = path.join(__dirname, './template.ejs');
|
|
28
|
+
|
|
29
|
+
function data(_izContext, srcPath) {
|
|
30
|
+
return [createFunctionYamlOutUpdateComplete(_izContext, srcPath)]
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
|
|
34
|
+
let functionName = upperCase(FUNCTION_NAME.deleteNodeComplete)
|
|
35
|
+
let additionalResourcePermission = defaultIamRolePerAction();
|
|
36
|
+
let awaitingTables = ["AwaitingMultipleSteps", "AwaitingMultipleStepByPending"]
|
|
37
|
+
let handlerType = upperCase(HANDLER.hdrSqs)
|
|
38
|
+
|
|
39
|
+
additionalResourcePermission.push(
|
|
40
|
+
createIamRole(
|
|
41
|
+
{
|
|
42
|
+
[RESOURCE_CLASSES.sqs]: [
|
|
43
|
+
SQS_RESOURCE.deleteMessage,
|
|
44
|
+
SQS_RESOURCE.deleteMessageBatch,
|
|
45
|
+
SQS_RESOURCE.getQueueAttributes,
|
|
46
|
+
SQS_RESOURCE.getQueueUrl,
|
|
47
|
+
SQS_RESOURCE.receiveMessage,
|
|
48
|
+
SQS_RESOURCE.sendMessage
|
|
49
|
+
],
|
|
50
|
+
[RESOURCE_CLASSES.sns]: [
|
|
51
|
+
SNS_RESOURCE.publish,
|
|
52
|
+
SNS_RESOURCE.subscription
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
[
|
|
56
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName)),
|
|
57
|
+
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + "DLQ"),
|
|
58
|
+
resourceNames(RESOURCE_CLASSES.sns, "In" + upperCase(functionName)),
|
|
59
|
+
resourceNames(RESOURCE_CLASSES.sns, "Out" + upperCase(functionName)),
|
|
60
|
+
]
|
|
61
|
+
)
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
templatePath: templatePath,
|
|
66
|
+
templateData: {
|
|
67
|
+
functionName,
|
|
68
|
+
handlerType,
|
|
69
|
+
additionalResourcePermission,
|
|
70
|
+
resourceLocation: SOURCE_PATH.resourceLocationOutPerActionComplete
|
|
71
|
+
},
|
|
72
|
+
setting: {
|
|
73
|
+
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
74
|
+
saveFileName: SAVE_FILE_NAME.functionPerActionYaml,
|
|
75
|
+
fileExtension: '.yml',
|
|
76
|
+
isAppend: true
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
module.exports = data
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { ACTIONS, HANDLER } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
|
+
|
|
24
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase } = require("../../../../../MainLibs/src/Utils")
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, FUNCTION_NAME } = require("../../../libs/Consts");
|
|
26
|
+
|
|
27
|
+
const templatePath = path.join(__dirname, "./template.ejs")
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* receive objectSchema
|
|
31
|
+
* create data for hdrInv template
|
|
32
|
+
*
|
|
33
|
+
* @return {{ templatePath, templateData, setting } }
|
|
34
|
+
*/
|
|
35
|
+
function data(_izContext, srcPath) {
|
|
36
|
+
const createSourceParams = createParamForCreateSource(srcPath)
|
|
37
|
+
return [createSourceParams];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function createParamForCreateSource(srcPath) {
|
|
41
|
+
const functionName = FUNCTION_NAME.deleteNodeComplete;
|
|
42
|
+
let functionNameConfig = upperCase(functionName)
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
templatePath: templatePath,
|
|
46
|
+
templateData: {
|
|
47
|
+
functionName,
|
|
48
|
+
queueName: upperCase(functionName),
|
|
49
|
+
functionName,
|
|
50
|
+
functionNameConfig
|
|
51
|
+
},
|
|
52
|
+
setting: {
|
|
53
|
+
savePath: path.join(srcPath, SOURCE_PATH.outPerActionComplete),
|
|
54
|
+
saveFileName: `${upperCase(functionName)}_${upperCase(HANDLER.hdrSqs)}`,
|
|
55
|
+
fileExtension: ".js",
|
|
56
|
+
isAppend: false
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = data
|
|
@@ -0,0 +1,129 @@
|
|
|
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 AWS = require('aws-sdk');
|
|
21
|
+
// const sqs = new AWS.SQS({ apiVersion: '2012-11-05' });
|
|
22
|
+
|
|
23
|
+
const izara = require("@izara_project/izara-middleware");
|
|
24
|
+
const middleware = izara.middlewareHandler;
|
|
25
|
+
const izaraShared = require('@izara_project/izara-shared');
|
|
26
|
+
const recordHandlerSharedLib = izaraShared.recordHandlerSharedLib
|
|
27
|
+
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
28
|
+
|
|
29
|
+
const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>_Main');
|
|
30
|
+
const Logger = require('@izara_project/izara-core-library-logger');
|
|
31
|
+
// validate event properties in body.Message of sqs event
|
|
32
|
+
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
33
|
+
// set schema for record.body.Message
|
|
34
|
+
let perRecordsValidatorSchema = {
|
|
35
|
+
type: "object",
|
|
36
|
+
required: [
|
|
37
|
+
'returnValue',
|
|
38
|
+
'status',
|
|
39
|
+
'errorFounds'
|
|
40
|
+
],
|
|
41
|
+
properties: {
|
|
42
|
+
returnValue: {
|
|
43
|
+
type: 'object',
|
|
44
|
+
},
|
|
45
|
+
status: {
|
|
46
|
+
type: 'string',
|
|
47
|
+
},
|
|
48
|
+
errorFounds: {
|
|
49
|
+
type: 'array',
|
|
50
|
+
default: []
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// set schema for record.body.MessageAttributes
|
|
56
|
+
// const messageAttributeValidatorSchema = {
|
|
57
|
+
// type: "object",
|
|
58
|
+
// required: ['msgAtrrParam1', 'msgAtrrParam2'],
|
|
59
|
+
// properties: {
|
|
60
|
+
// msgAtrrParam1: {
|
|
61
|
+
// type: "string"
|
|
62
|
+
// },
|
|
63
|
+
// msgAtrrParam2: {
|
|
64
|
+
// type: "object"
|
|
65
|
+
// }
|
|
66
|
+
// }
|
|
67
|
+
// };
|
|
68
|
+
|
|
69
|
+
perRecordsValidatorSchema = callingFlowSharedLib.addOptionalPassBackPropertiesToValidatorSchema(perRecordsValidatorSchema); // is Ok passBackProperties
|
|
70
|
+
module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
71
|
+
|
|
72
|
+
try {
|
|
73
|
+
|
|
74
|
+
let recordPromises = [];
|
|
75
|
+
|
|
76
|
+
// loop each record and send to mainFunction
|
|
77
|
+
await Promise.all(event.Records.map(async record => { // promise.all for map() function
|
|
78
|
+
|
|
79
|
+
let passOnProperties = []
|
|
80
|
+
record._izContext.logger.debug('record ReceiveMsgOutHdrSqs', record);
|
|
81
|
+
|
|
82
|
+
//validate message (and MessageAttributes)
|
|
83
|
+
await recordHandlerSharedLib.validateRecord(
|
|
84
|
+
record, // one record will send to mainFunction
|
|
85
|
+
"<%- firstLetterUpperCase(queueName) %>", // queue name that need to retry or send to dlq
|
|
86
|
+
perRecordsValidatorSchema, // schema for record.Message
|
|
87
|
+
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
// add argument (to invoke lambda) to passOnProperties[]
|
|
91
|
+
passOnProperties.push(record.body.Message.returnValue)
|
|
92
|
+
passOnProperties.push(record.body.Message.status)
|
|
93
|
+
passOnProperties.push(record.body.Message.errorFounds)
|
|
94
|
+
passOnProperties.push(callingFlowSharedLib.addPassBackPropertiesToPassOnProperties(record.body.Message)) // is Ok PassBackProperties
|
|
95
|
+
// passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message)) // is Ok callinfFlow
|
|
96
|
+
record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
|
|
97
|
+
|
|
98
|
+
// call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
|
|
99
|
+
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
100
|
+
record, // one record will send to mainFunction
|
|
101
|
+
<%- functionName %>.<%- functionName %>, // mainFunction that need to invoke.
|
|
102
|
+
"<%- firstLetterUpperCase(queueName) %>", // queue name that need to retry or send to dlq
|
|
103
|
+
passOnProperties, // all parameters that mainFunction needed.
|
|
104
|
+
);
|
|
105
|
+
record._izContext.logger.debug('after recordPromise in handler');
|
|
106
|
+
recordPromises.push(recordPromise); // push promise to recordPromises
|
|
107
|
+
}))
|
|
108
|
+
|
|
109
|
+
Logger.debug('before Promise.all(recordPromises) in handler');
|
|
110
|
+
try {
|
|
111
|
+
// --- main await all promises
|
|
112
|
+
await Promise.all(recordPromises); // await all promises
|
|
113
|
+
|
|
114
|
+
return event.Records // return all for local testing
|
|
115
|
+
|
|
116
|
+
} catch {
|
|
117
|
+
Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
|
|
118
|
+
}
|
|
119
|
+
Logger.debug('after Promise.all(recordPromises) in handler');
|
|
120
|
+
|
|
121
|
+
} catch (err) {
|
|
122
|
+
Logger.error('Unhandled Error, updateNodeCompleteHdrSqs: ', err);
|
|
123
|
+
throw (err);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
<%_ function firstLetterUpperCase(text){
|
|
128
|
+
return text.charAt(0).toUpperCase()+ text.slice(1)
|
|
129
|
+
} _%>
|
|
@@ -20,11 +20,9 @@ const path = require('path');
|
|
|
20
20
|
const fs = require('fs');
|
|
21
21
|
|
|
22
22
|
const { ACTIONS, HANDLER } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
|
-
const { createGetDataDetails } = require('../../../../../GenerateCodeLibs/src/GenerateCodeLibs')
|
|
24
23
|
|
|
25
24
|
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase } = require("../../../../../MainLibs/src/Utils")
|
|
26
|
-
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH } = require("../../../libs/Consts");
|
|
27
|
-
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, FUNCTION_NAME, SAVE_FILE_NAME } = require("../../../libs/Consts");
|
|
28
26
|
|
|
29
27
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
30
28
|
|
|
@@ -32,28 +30,24 @@ const templatePath = path.join(__dirname, "./template.ejs")
|
|
|
32
30
|
* receive objectSchema
|
|
33
31
|
* create data for hdrInv template
|
|
34
32
|
*
|
|
35
|
-
* @param {Object} objectSchema
|
|
36
33
|
* @return {{ templatePath, templateData, setting } }
|
|
37
34
|
*/
|
|
35
|
+
|
|
38
36
|
function data(_izContext, srcPath) {
|
|
39
|
-
|
|
40
|
-
return [createSourceParams];
|
|
37
|
+
return [createMainFunctionUpdateComplete(_izContext, srcPath)]
|
|
41
38
|
}
|
|
42
39
|
|
|
43
|
-
|
|
44
|
-
function createParamForCreateSource(srcPath) {
|
|
40
|
+
function createMainFunctionUpdateComplete(_izContext, srcPath) {
|
|
45
41
|
return {
|
|
46
42
|
templatePath: templatePath,
|
|
47
|
-
templateData: {
|
|
48
|
-
},
|
|
43
|
+
templateData: {},
|
|
49
44
|
setting: {
|
|
50
|
-
savePath: path.join(srcPath, SOURCE_PATH.
|
|
51
|
-
saveFileName:
|
|
52
|
-
fileExtension:
|
|
45
|
+
savePath: path.join(srcPath, SOURCE_PATH.outPerActionComplete),
|
|
46
|
+
saveFileName: `${upperCase(FUNCTION_NAME.deleteNodeComplete)}_Main`,
|
|
47
|
+
fileExtension: ".js",
|
|
53
48
|
isAppend: false
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
51
|
}
|
|
57
52
|
|
|
58
|
-
|
|
59
|
-
module.exports = data;
|
|
53
|
+
module.exports = data
|
package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/mainFunction/template.ejs
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
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 hash = require("object-hash");
|
|
20
|
+
|
|
21
|
+
const izaraShared = require('@izara_project/izara-shared');
|
|
22
|
+
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
23
|
+
const configSharedLib = izaraShared.configSharedLib;
|
|
24
|
+
const snsSharedLib = izaraShared.snsSharedLib;
|
|
25
|
+
const asyncFlowSharedLib = izaraShared.asyncFlowSharedLib;
|
|
26
|
+
const dynamodbSharedLib = izaraShared.dynamodbSharedLib;
|
|
27
|
+
|
|
28
|
+
const sns = require("@izara_project/izara-core-library-external-request").sns;
|
|
29
|
+
const NoRetryError = require("@izara_project/izara-core-library-core/src/NoRetryError");
|
|
30
|
+
|
|
31
|
+
const { explodedObjectTypeId, explodedRelationshipTypeId, createLinkTypeId } = require('@izara_project/izara-core-library-service-schemas/src/Utils');
|
|
32
|
+
|
|
33
|
+
const {
|
|
34
|
+
TOPIC_NAME_GENERATE_CODE,
|
|
35
|
+
TOPIC_NAME_GRAPH_HANDLER,
|
|
36
|
+
PREFIX
|
|
37
|
+
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
38
|
+
|
|
39
|
+
module.exports.deleteNodeComplete = async (
|
|
40
|
+
_izContext,
|
|
41
|
+
returnValue,
|
|
42
|
+
status,
|
|
43
|
+
errorsFound,
|
|
44
|
+
passBackProperties = {}
|
|
45
|
+
) => {
|
|
46
|
+
try {
|
|
47
|
+
_izContext.logger.debug("Function:DeleteNodeComplete", {
|
|
48
|
+
_izContext: _izContext,
|
|
49
|
+
returnValue: returnValue,
|
|
50
|
+
status: status,
|
|
51
|
+
errorsFound: errorsFound,
|
|
52
|
+
passBackProperties: passBackProperties
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
let deleteNodeComplete = {
|
|
56
|
+
objType: {
|
|
57
|
+
objectType: returnValue.objType.objectType,
|
|
58
|
+
serviceTag: returnValue.objType.serviceTag
|
|
59
|
+
},
|
|
60
|
+
objInstance: {
|
|
61
|
+
identifiers: returnValue.objInstanceFull.identifiers,
|
|
62
|
+
fields: returnValue.objInstanceFull.fields
|
|
63
|
+
},
|
|
64
|
+
status: status,
|
|
65
|
+
errorsFound: errorsFound
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
deleteNodeComplete = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, updateCompleteMsg);
|
|
69
|
+
_izContext.logger.debug("after addCallingFlow to SnsResponseMessageObject", updateCompleteMsg);
|
|
70
|
+
|
|
71
|
+
let messageAttributes = callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(passBackProperties, {});
|
|
72
|
+
_izContext.logger.debug("after addCallingFlow to SnsResponseMessageAttributes", updateCompleteMsg);
|
|
73
|
+
|
|
74
|
+
let sendMessageToOutUpdateNodeComplete = {
|
|
75
|
+
Message: JSON.stringify(deleteNodeComplete),
|
|
76
|
+
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
77
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outUpdateNodeComplete)
|
|
78
|
+
};
|
|
79
|
+
_izContext.logger.debug("Send Message to DeleteNodeComplete::", sendMessageToOutUpdateNodeComplete);
|
|
80
|
+
await sns.publishAsync(_izContext, sendMessageToOutUpdateNodeComplete)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
return { returnValue: 'Function:DeleteNodeComplete' };
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
_izContext.logger.error("error DeleteNodeComplete : ", err)
|
|
88
|
+
throw (err)
|
|
89
|
+
}
|
|
90
|
+
}
|