@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
|
@@ -0,0 +1,56 @@
|
|
|
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 { 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
|
+
|
|
41
|
+
function createParamForCreateSource(srcPath) {
|
|
42
|
+
const functionName = FUNCTION_NAME.deleteRelComplete;
|
|
43
|
+
return {
|
|
44
|
+
templatePath: templatePath,
|
|
45
|
+
templateData: {
|
|
46
|
+
},
|
|
47
|
+
setting: {
|
|
48
|
+
savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
|
|
49
|
+
saveFileName: `${upperCase(functionName)}_Main`,
|
|
50
|
+
fileExtension: '.js',
|
|
51
|
+
isAppend: false
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
module.exports = data;
|
|
File without changes
|
|
@@ -0,0 +1,137 @@
|
|
|
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.createRelationshipComplete = async (
|
|
40
|
+
_izContext,
|
|
41
|
+
returnValue,
|
|
42
|
+
status,
|
|
43
|
+
errorsFound,
|
|
44
|
+
passBackProperties = {},
|
|
45
|
+
|
|
46
|
+
) => {
|
|
47
|
+
try {
|
|
48
|
+
_izContext.logger.debug("Function:createRelationshipComplete", {
|
|
49
|
+
returnValue: returnValue,
|
|
50
|
+
status: status,
|
|
51
|
+
errorsFound: errorsFound,
|
|
52
|
+
passBackProperties: passBackProperties,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
// start create awaitingStepId
|
|
57
|
+
const linkTypeId = createLinkTypeId(
|
|
58
|
+
_izContext,
|
|
59
|
+
[
|
|
60
|
+
returnValue.objects[0].objType,
|
|
61
|
+
returnValue.objects[1].objType,
|
|
62
|
+
],
|
|
63
|
+
returnValue.relType
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
let awaitingStepId = asyncFlowSharedLib.createAwaitingStepId(
|
|
67
|
+
hash({
|
|
68
|
+
linkTypeId,
|
|
69
|
+
relationshipProperties: returnValue.relationshipProperties,
|
|
70
|
+
graphServiceTag: passBackProperties.passBackProperties.graphServiceTag
|
|
71
|
+
}), // hash id
|
|
72
|
+
PREFIX.createRel // prefix, use constant further
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
let createRelPendingObjects = await dynamodbSharedLib.query(
|
|
77
|
+
_izContext,
|
|
78
|
+
await dynamodbSharedLib.tableName(_izContext, "AwaitingMultipleSteps"),
|
|
79
|
+
{
|
|
80
|
+
awaitingStepId: awaitingStepId
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
_izContext.logger.debug("record of createRelPendingObjects ::", createRelPendingObjects);
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
await Promise.all(
|
|
88
|
+
createRelPendingObjects.Items.map(async ({ pendingStepId }) => {
|
|
89
|
+
if (await asyncFlowSharedLib.checkAllAwaitingStepsFinished(
|
|
90
|
+
_izContext,
|
|
91
|
+
pendingStepId, // task waiting
|
|
92
|
+
awaitingStepId
|
|
93
|
+
)) {
|
|
94
|
+
_izContext.logger.debug("finished all awaitingStep");
|
|
95
|
+
|
|
96
|
+
let createCompleteMsg = {
|
|
97
|
+
objects: returnValue.objects,
|
|
98
|
+
relType: returnValue.relType,
|
|
99
|
+
relationshipProperties: returnValue.relationshipProperties,
|
|
100
|
+
status: status,
|
|
101
|
+
errorFounds: errorsFound
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
createCompleteMsg = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, createCompleteMsg);
|
|
105
|
+
_izContext.logger.debug("After addCallingFlowToSnsResponseMessageObject", createCompleteMsg);
|
|
106
|
+
|
|
107
|
+
let messageAttributes = callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(passBackProperties, {});
|
|
108
|
+
_izContext.logger.debug("After addCallingFlowToSnsResponseMessageAttributes", createCompleteMsg);
|
|
109
|
+
|
|
110
|
+
let sendMessageToOutCreateRelatonshipComplete = {
|
|
111
|
+
Message: JSON.stringify(createCompleteMsg),
|
|
112
|
+
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
113
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete)
|
|
114
|
+
};
|
|
115
|
+
_izContext.logger.debug("Send message to OutCreateRelationshipComplete :::>", sendMessageToOutCreateRelatonshipComplete);
|
|
116
|
+
await sns.publishAsync(_izContext, sendMessageToOutCreateRelatonshipComplete);
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
// remove awaitingMultipleStep after finished
|
|
120
|
+
await asyncFlowSharedLib.removeAwaitingMultipleStep(
|
|
121
|
+
_izContext,
|
|
122
|
+
awaitingStepId,
|
|
123
|
+
pendingStepId,
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
} // check pendingStepId finished
|
|
127
|
+
}) // end per pendingStep
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
return { returnValue: 'function:createRelationshipComplete' };
|
|
132
|
+
|
|
133
|
+
} catch (err) {
|
|
134
|
+
_izContext.logger.error('error createRelationshipComplete:', err)
|
|
135
|
+
throw (err)
|
|
136
|
+
}
|
|
137
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
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 path = require("path")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
// const {
|
|
24
|
+
// HANDLER,
|
|
25
|
+
// STORAGE_TYPES
|
|
26
|
+
// } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const STORAGE_TYPES = {
|
|
30
|
+
dynamoDB: "dynamoDB",
|
|
31
|
+
graph: "graph"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const templatePath = path.join(__dirname, './template.ejs');
|
|
35
|
+
const { SOURCE_PATH, FUNCTION_NAME, SAVE_FILE_NAME } = require('../../../../libs/Consts');
|
|
36
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* create data for dynamoDbYaml tempalte from objectSchema
|
|
41
|
+
* return array of dynamoDb data
|
|
42
|
+
* because one objectSchema can create multiple dynamoDb table
|
|
43
|
+
*
|
|
44
|
+
* @param {Object} _izContext
|
|
45
|
+
* @param {String} saveFilePath
|
|
46
|
+
* @returns {Object[]} - data of multiple dynamoDb template
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
function createDataForDefaultSnsInSqs(_izContext, srcPath) {
|
|
50
|
+
let createCreateRelationCompleteQueue = [];
|
|
51
|
+
const createRelationshipCompleteQueues = [
|
|
52
|
+
{
|
|
53
|
+
queueName: upperCase(FUNCTION_NAME.deleteRelComplete)
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
for (let createRelationshipCompleteQueue of createRelationshipCompleteQueues) {
|
|
57
|
+
createCreateRelationCompleteQueue.push({
|
|
58
|
+
templatePath: templatePath,
|
|
59
|
+
templateData: createRelationshipCompleteQueue,
|
|
60
|
+
setting: {
|
|
61
|
+
initialData: "Resources:\n",
|
|
62
|
+
savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
|
|
63
|
+
saveFileName: SAVE_FILE_NAME.snsInSqsYaml,
|
|
64
|
+
fileExtension: ".yml",
|
|
65
|
+
isAppend: true
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
return createCreateRelationCompleteQueue
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
module.exports = createDataForDefaultSnsInSqs;
|
|
File without changes
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
##===== [Queue]
|
|
2
|
+
<%- queueName %>:
|
|
3
|
+
Type: "AWS::SQS::Queue"
|
|
4
|
+
Properties:
|
|
5
|
+
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>
|
|
6
|
+
RedrivePolicy:
|
|
7
|
+
deadLetterTargetArn:
|
|
8
|
+
# !GetAtt
|
|
9
|
+
Fn::GetAtt:
|
|
10
|
+
- <%- queueName %>DLQ
|
|
11
|
+
- Arn
|
|
12
|
+
maxReceiveCount: 3
|
|
13
|
+
VisibilityTimeout: 120
|
|
14
|
+
##==== [QueueDLQ]
|
|
15
|
+
<%- queueName %>DLQ:
|
|
16
|
+
Type: AWS::SQS::Queue
|
|
17
|
+
Properties:
|
|
18
|
+
QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>DLQ
|
|
19
|
+
##==== [QueuePolicy]
|
|
20
|
+
<%- queueName %>Policy:
|
|
21
|
+
Type: AWS::SQS::QueuePolicy
|
|
22
|
+
Properties:
|
|
23
|
+
PolicyDocument:
|
|
24
|
+
Version: "2012-10-17"
|
|
25
|
+
Statement:
|
|
26
|
+
- Sid: "allow-sns-messages"
|
|
27
|
+
Effect: Allow
|
|
28
|
+
Principal: "*"
|
|
29
|
+
Resource:
|
|
30
|
+
# !GetAtt
|
|
31
|
+
Fn::GetAtt:
|
|
32
|
+
- <%- queueName %>
|
|
33
|
+
- Arn
|
|
34
|
+
Action: "SQS:SendMessage"
|
|
35
|
+
Queues:
|
|
36
|
+
- Ref: <%- queueName %>
|
|
37
|
+
#<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
|
|
38
|
+
#<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
<%_ function firstLetterUpperCase(text){
|
|
42
|
+
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
43
|
+
} _%>
|
|
44
|
+
<%_ function firstLetterLowerCase(str) {
|
|
45
|
+
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
46
|
+
} _%>
|
|
47
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
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 path = require("path")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
// const {
|
|
24
|
+
// HANDLER,
|
|
25
|
+
// STORAGE_TYPES
|
|
26
|
+
// } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const STORAGE_TYPES = {
|
|
30
|
+
dynamoDB: "dynamoDB",
|
|
31
|
+
graph: "graph"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
35
|
+
const { SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME } = require("../../../../libs/Consts");
|
|
36
|
+
const templatePath = path.join(__dirname, './template.ejs')
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* create data for dynamoDbYaml tempalte from objectSchema
|
|
40
|
+
* return array of dynamoDb data
|
|
41
|
+
* because one objectSchema can create multiple dynamoDb table
|
|
42
|
+
*
|
|
43
|
+
* @param {Object} _izContext
|
|
44
|
+
* @param {String} saveFilePath
|
|
45
|
+
* @returns {Object[]} - data of multiple dynamoDb template
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
function createDefaultSnsOut(_izContext, srcPath) {
|
|
49
|
+
const createSourceParams = createParamsForCreateSource(_izContext, srcPath)
|
|
50
|
+
// console.log("createSourceParamsCreateRelationshipComplete", createSourceParams)
|
|
51
|
+
|
|
52
|
+
return [createSourceParams]
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function createParamsForCreateSource(_izContext, srcPath) {
|
|
56
|
+
let queueName = FUNCTION_NAME.deleteRelComplete;
|
|
57
|
+
return {
|
|
58
|
+
templatePath: templatePath,
|
|
59
|
+
templateData: {
|
|
60
|
+
queueName: upperCase(queueName)
|
|
61
|
+
},
|
|
62
|
+
setting: {
|
|
63
|
+
initialData: 'Resources:\n',
|
|
64
|
+
savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
|
|
65
|
+
saveFileName: SAVE_FILE_NAME.snsOutYaml,
|
|
66
|
+
fileExtension: '.yml',
|
|
67
|
+
isAppend: true
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
module.exports = createDefaultSnsOut
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
##--------- [Create Topic Out]
|
|
2
|
+
Out<%- firstLetterUpperCase(queueName) %>:
|
|
3
|
+
Type: AWS::SNS::Topic
|
|
4
|
+
Properties:
|
|
5
|
+
DisplayName: "SNS Message out"
|
|
6
|
+
TopicName: ${self:custom.iz_resourcePrefix}Out<%- firstLetterUpperCase(queueName) %>
|
|
7
|
+
|
|
8
|
+
<%_ function firstLetterUpperCase(text) {
|
|
9
|
+
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
10
|
+
} _%>
|
|
@@ -21,41 +21,11 @@ const fs = require('fs');
|
|
|
21
21
|
|
|
22
22
|
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
23
|
|
|
24
|
-
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("
|
|
25
|
-
const {
|
|
24
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
25
|
+
const { createIamRole, resourceNames, RESOURCE_CLASSES, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME, defaultIamRolePerAction, awaitingMultipleStepsRole, SNS_RESOURCE, shortNameHandler } = require("../../../../libs/Consts");
|
|
26
26
|
|
|
27
27
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
28
28
|
|
|
29
|
-
function defaultIamRolePerAction() {
|
|
30
|
-
|
|
31
|
-
let defaultIamRole = [];
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
defaultIamRole.push(
|
|
35
|
-
createIamRole(
|
|
36
|
-
{
|
|
37
|
-
[RESOURCE_CLASSES.s3]: ["GetObject", "GetObjectVersion"],
|
|
38
|
-
},
|
|
39
|
-
[
|
|
40
|
-
resourceNames(RESOURCE_CLASSES.s3, "object-schema/perServiceSchemas/*"),
|
|
41
|
-
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/ServiceNameConfig.json"),
|
|
42
|
-
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/GraphServerTags.json"),
|
|
43
|
-
]
|
|
44
|
-
)
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
defaultIamRole.push(
|
|
48
|
-
createIamRole(
|
|
49
|
-
{ [RESOURCE_CLASSES.s3]: ["ListBucket"] },
|
|
50
|
-
[
|
|
51
|
-
resourceNames(RESOURCE_CLASSES.s3, "object-schema"),
|
|
52
|
-
]
|
|
53
|
-
)
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
return defaultIamRole
|
|
57
|
-
}
|
|
58
|
-
|
|
59
29
|
/**
|
|
60
30
|
* receive objectSchema
|
|
61
31
|
* create data for updateRelationshipSchema
|
|
@@ -74,7 +44,6 @@ function data(_izContext, srcPath) {
|
|
|
74
44
|
|
|
75
45
|
|
|
76
46
|
function createParamForCreateSource(srcPath) {
|
|
77
|
-
let awaitingTable = ["AwaitingMultipleSteps", "AwaitingMultipleStepByPending"]
|
|
78
47
|
let handlerType = upperCase(HANDLER.hdrSqs);
|
|
79
48
|
let functionName = FUNCTION_NAME.updateRelComplete
|
|
80
49
|
let additionalResourcePermission = defaultIamRolePerAction();
|
|
@@ -92,7 +61,7 @@ function createParamForCreateSource(srcPath) {
|
|
|
92
61
|
SQS_RESOURCE.getQueueUrl,
|
|
93
62
|
],
|
|
94
63
|
[RESOURCE_CLASSES.sns]: [
|
|
95
|
-
|
|
64
|
+
SNS_RESOURCE.publish, SNS_RESOURCE.subscription
|
|
96
65
|
]
|
|
97
66
|
},
|
|
98
67
|
[
|
|
@@ -102,23 +71,15 @@ function createParamForCreateSource(srcPath) {
|
|
|
102
71
|
resourceNames(RESOURCE_CLASSES.sns, "Out" + upperCase(functionName))
|
|
103
72
|
],
|
|
104
73
|
))
|
|
105
|
-
additionalResourcePermission.push(
|
|
106
|
-
createIamRole(
|
|
107
|
-
{
|
|
108
|
-
[RESOURCE_CLASSES.dynamoDbTable]: ["UpdateItem", "Query", "DeleteItem"]
|
|
109
|
-
},
|
|
110
|
-
awaitingTable.map(tableName =>
|
|
111
|
-
resourceNames(RESOURCE_CLASSES.dynamoDbTable, tableName)
|
|
112
|
-
)
|
|
113
|
-
)
|
|
114
|
-
)
|
|
74
|
+
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
115
75
|
return {
|
|
116
76
|
templatePath: templatePath,
|
|
117
77
|
templateData: {
|
|
118
78
|
functionName,
|
|
119
79
|
handlerType,
|
|
120
80
|
additionalResourcePermission,
|
|
121
|
-
resourceLocation: SOURCE_PATH.resourceLocationRelationshipPerAction
|
|
81
|
+
resourceLocation: SOURCE_PATH.resourceLocationRelationshipPerAction,
|
|
82
|
+
functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType))
|
|
122
83
|
},
|
|
123
84
|
setting: {
|
|
124
85
|
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<%_ const join = require('path').join; _%>
|
|
2
|
+
<%- firstLetterUpperCase(functionNameConfig) %>:
|
|
3
|
+
handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
|
|
4
|
+
name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
|
|
5
|
+
events:
|
|
6
|
+
- sqs:
|
|
7
|
+
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
|
|
8
|
+
batchSize: 10
|
|
9
|
+
filterPatterns: #**** need to update serverless framwork upper v.2.69.1
|
|
10
|
+
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-firstLetterUpperCase(functionName) %>"]}}} # functionName of callingFlow
|
|
11
|
+
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
|
+
iamRoleStatements:
|
|
13
|
+
<%_ additionalResourcePermission.forEach(resourcePermission => { _%>
|
|
14
|
+
- Effect: <%- resourcePermission.effect %>
|
|
15
|
+
Action:
|
|
16
|
+
<%_ Object.keys(resourcePermission.action).forEach(resourcePerAction => { _%>
|
|
17
|
+
<%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
|
|
18
|
+
- <%- resourcePerAction %>:<%- permission %>
|
|
19
|
+
<%_}) _%>
|
|
20
|
+
<%_ }) _%>
|
|
21
|
+
Resource:
|
|
22
|
+
<%_ resourcePermission.resource.forEach(resource => { _%>
|
|
23
|
+
- <%- resource %>
|
|
24
|
+
<%_ }) _%>
|
|
25
|
+
<%_}) _%>
|
|
26
|
+
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
27
|
+
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
28
|
+
<%_ function firstLetterUpperCase(text){
|
|
29
|
+
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
30
|
+
} _%>
|
|
31
|
+
<%_ function firstLetterLowerCase(str) {
|
|
32
|
+
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
33
|
+
} _%>
|
|
@@ -21,8 +21,8 @@ const fs = require('fs');
|
|
|
21
21
|
|
|
22
22
|
const { ACTIONS, HANDLER } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
23
|
|
|
24
|
-
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase } = require("
|
|
25
|
-
const {
|
|
24
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase } = require("../../../../../../../MainLibs/src/Utils")
|
|
25
|
+
const { SOURCE_PATH, FUNCTION_NAME } = require("../../../../../libs/Consts");
|
|
26
26
|
|
|
27
27
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
28
28
|
|
|
@@ -47,7 +47,7 @@ function createParamForCreateSource(srcPath) {
|
|
|
47
47
|
templateData: {
|
|
48
48
|
functionName: upperCase(functionName),
|
|
49
49
|
queueName: upperCase(functionName) + upperCase(handler),
|
|
50
|
-
isCreateMainFunction: false
|
|
50
|
+
isCreateMainFunction: false,
|
|
51
51
|
},
|
|
52
52
|
setting: {
|
|
53
53
|
savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
|
|
File without changes
|
|
@@ -21,8 +21,8 @@ const fs = require('fs');
|
|
|
21
21
|
|
|
22
22
|
const { ACTIONS, HANDLER } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
23
|
|
|
24
|
-
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase } = require("
|
|
25
|
-
const {
|
|
24
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
25
|
+
const { SOURCE_PATH, FUNCTION_NAME } = require("../../../../libs/Consts");
|
|
26
26
|
|
|
27
27
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
28
28
|
|
|
@@ -32,8 +32,8 @@ const STORAGE_TYPES = {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const templatePath = path.join(__dirname, './template.ejs');
|
|
35
|
-
const { SOURCE_PATH, FUNCTION_NAME, SAVE_FILE_NAME } = require('
|
|
36
|
-
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("
|
|
35
|
+
const { SOURCE_PATH, FUNCTION_NAME, SAVE_FILE_NAME } = require('../../../../libs/Consts')
|
|
36
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
/**
|
|
@@ -31,9 +31,9 @@ const STORAGE_TYPES = {
|
|
|
31
31
|
graph: "graph"
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("
|
|
35
|
-
const {
|
|
36
|
-
const templatePath = path.join(__dirname, '
|
|
34
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
35
|
+
const { SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME } = require("../../../../libs/Consts");
|
|
36
|
+
const templatePath = path.join(__dirname, './template.ejs')
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* create data for dynamoDbYaml tempalte from objectSchema
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
##--------- [Create Topic Out]
|
|
2
|
+
Out<%- firstLetterUpperCase(queueName) %>:
|
|
3
|
+
Type: AWS::SNS::Topic
|
|
4
|
+
Properties:
|
|
5
|
+
DisplayName: "SNS Message out"
|
|
6
|
+
TopicName: ${self:custom.iz_resourcePrefix}Out<%- firstLetterUpperCase(queueName) %>
|
|
7
|
+
|
|
8
|
+
<%_ function firstLetterUpperCase(text) {
|
|
9
|
+
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
10
|
+
} _%>
|