@izara_project/izara-market-library-service-schemas 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/GenerateCodeLibs/src/Consts.js +21 -6
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +40 -48
- package/src/TemplateManager/src/FindData/Handler/data.js +4 -0
- package/src/TemplateManager/src/FindData/mainFunction/data.js +1 -1
- package/src/TemplateManager/src/GenerateCode.js +119 -44
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +2 -15
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/data.js +3 -1
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/template.ejs +1 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/template.ejs +12 -14
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/data.js +82 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/handler/data.js +61 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/handler/template.ejs +129 -0
- package/src/TemplateManager/src/{CreateRelationship/createRelationship → OutPerActionComplete/OutDeleteComplete}/mainFunction/data.js +9 -15
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/mainFunction/template.ejs +90 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/sns-out/data.js +62 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/sqs-in-sns/data.js +58 -0
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/data.js +2 -16
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/handler/data.js +3 -1
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/template.ejs +4 -4
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/data.js +30 -41
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/data.js +20 -36
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/data.js +14 -57
- package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/data.js +22 -39
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/data.js +8 -7
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/template.ejs +2 -2
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/data.js +9 -42
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/template.ejs +14 -11
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/data.js +14 -65
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/template.ejs +2 -2
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/data.js +11 -44
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/template.ejs +14 -18
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/data.js +1 -2
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/template.ejs +141 -183
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/data.js +66 -0
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/template.ejs +194 -0
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/data.js +1 -2
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/template.ejs +2 -3
- package/src/TemplateManager/src/ProcessLogical/Handler/data.js +3 -1
- package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/data.js +47 -79
- package/src/TemplateManager/src/ProcessLogical/mainFunction/template.ejs +1 -1
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/data.js +40 -71
- package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/data.js +42 -73
- package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrDsq/data.js +3 -1
- package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrSqs/data.js +3 -1
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js +84 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship → RelationshipPerAction/CreateRelationship/createRelationship}/functionYaml/HdrApi/template.ejs +2 -2
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/functionYaml/HdrDsq/data.js +4 -41
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/template.ejs +30 -0
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/functionYaml/HdrInv/data.js +4 -41
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/template.ejs +26 -0
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/functionYaml/HdrSqs/data.js +4 -41
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/template.ejs +26 -0
- package/src/TemplateManager/src/{CreateRelationship/createRelationship/perAction/HdrApi → RelationshipPerAction/CreateRelationship/createRelationship/mainFunction}/data.js +4 -4
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/mainFunction/template.ejs +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrApi/data.js +60 -0
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrDsq/data.js +5 -3
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrInv/data.js +5 -3
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrSqs/data.js +5 -3
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/sns-in-sqs/data.js +4 -4
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/functionYaml/data.js +8 -46
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/handler/HdrSqs/data.js +4 -2
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/mainFunction/data.js +2 -2
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-in-sqs/data.js +2 -2
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-out/data.js +3 -3
- package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-out/template.ejs +10 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/data.js +85 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/template.ejs +33 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/data.js +96 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/template.ejs +30 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/data.js +83 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/template.ejs +26 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/data.js +96 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/template.ejs +26 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/perAction/HdrApi → RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction}/data.js +4 -5
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction/template.ejs +329 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/data.js +60 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/template.ejs +119 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq/data.js +61 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq/template.ejs +167 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv/data.js +62 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv/template.ejs +107 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs/data.js +62 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs/template.ejs +146 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/request.json +30 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/data.js +78 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/data.js +95 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/template.ejs +33 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/perAction → RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler}/HdrSqs/data.js +9 -5
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler/HdrSqs/template.ejs +125 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/data.js +56 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/template.ejs +137 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/data.js +72 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/template.ejs +47 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/data.js +72 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/template.ejs +10 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/functionYaml/data.js +4 -44
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/template.ejs +33 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/handler/HdrSqs/data.js +5 -3
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/mainFunction/data.js +2 -2
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-in-sqs/data.js +2 -2
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-out/data.js +3 -3
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-out/template.ejs +10 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrApi/data.js +5 -42
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/template.ejs +33 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrDsq/data.js +4 -41
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/template.ejs +30 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrInv/data.js +4 -41
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/template.ejs +26 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrSqs/data.js +5 -42
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/request.json +0 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/template.ejs +26 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/mainFunction/data.js +3 -4
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/mainFunction/template.ejs +14 -15
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi/data.js +61 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrDsq/data.js +5 -3
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrInv/data.js +5 -3
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/data.js +61 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-in-sqs/data.js +4 -4
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/snsTemplate.ejs +59 -0
- package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/sqsTemplate.ejs +43 -0
- package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-out/data.js +2 -2
- package/src/TemplateManager/src/ResourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +27 -0
- package/src/TemplateManager/src/ResourceYaml/dynamodb/template.ejs +1 -1
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/functionYaml/data.js +3 -5
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/dataHdrDsq.js +3 -1
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/template.ejs +3 -5
- package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/mainFunction/template.ejs +42 -39
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrDsq/data.js +3 -29
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs/data.js +3 -29
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq/data.js +4 -2
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq/template.ejs +3 -5
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs/data.js +3 -1
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs/template.ejs +22 -34
- package/src/TemplateManager/src/TranslateIdReq/TranslateIds/mainFunction/template.ejs +5 -5
- package/src/TemplateManager/src/externalService/FunctionNameConfig/data.js +50 -0
- package/src/TemplateManager/src/externalService/FunctionNameConfig/template.ejs +3 -0
- package/src/TemplateManager/src/externalService/LambdaRole/data.js +75 -34
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +13 -0
- package/src/TemplateManager/src/libs/Consts.js +26 -3
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/getTemplate.ejs +0 -76
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/updateTemplate.ejs +0 -67
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/getTemplate.ejs +0 -105
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/updateTemplate.ejs +0 -109
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/createTemplate.ejs +0 -75
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/getTemplate.ejs +0 -82
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/updateTemplate.ejs +0 -75
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/getTemplate.ejs +0 -124
- package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/updateTemplate.ejs +0 -133
- /package/src/TemplateManager/src/{CreateRelationship/createRelationshipComplete → OutPerActionComplete/OutDeleteComplete}/functionYaml/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship/createRelationshipComplete/sns-in-sqs → OutPerActionComplete/OutDeleteComplete/sqs-in-sns}/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrApi/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrApi/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrDsq/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrDsq/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrInv/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrInv/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrSqs/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrSqs/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/functionYaml/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRalationshipComplete → RelationshipPerAction/CreateRelationship/createRelationshipComplete}/functionYaml/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/handler/HdrSqs/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/handler/HdrSqs/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/mainFunction/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/mainFunction/template.ejs +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-in-sqs/request.json +0 -0
- /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-out/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi}/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq}/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv}/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs}/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs → RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml}/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/functionYaml/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/handler/HdrSqs/template.ejs +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/mainFunction/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/mainFunction/template.ejs +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-in-sqs/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-in-sqs/template.ejs +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-out/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/mainFunction/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrApi/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrApi/template.ejs +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrDsq/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrDsq/template.ejs +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrInv/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrInv/template.ejs +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrSqs/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrSqs/template.ejs +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-in-sqs/request.json +0 -0
- /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-out/request.json +0 -0
|
@@ -22,11 +22,9 @@ const fs = require('fs');
|
|
|
22
22
|
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
23
|
|
|
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, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME, defaultIamRolePerAction } = require("../../../libs/Consts");
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME, defaultIamRolePerAction, SNS_RESOURCE, DYNAMO_RESOURCE } = require("../../../libs/Consts");
|
|
26
26
|
const templatePath = path.join(__dirname, "./template.ejs");
|
|
27
27
|
|
|
28
|
-
defaultIamRolePerAction()
|
|
29
|
-
|
|
30
28
|
/**
|
|
31
29
|
* receive objectSchema
|
|
32
30
|
* create data for hdrInv template
|
|
@@ -55,7 +53,7 @@ function createParamForCreateSource(_izContext, srcPath) {
|
|
|
55
53
|
SQS_RESOURCE.sendMessage,
|
|
56
54
|
SQS_RESOURCE.getQueueUrl,
|
|
57
55
|
],
|
|
58
|
-
[RESOURCE_CLASSES.sns]: [
|
|
56
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
59
57
|
},
|
|
60
58
|
[
|
|
61
59
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + handlerType),
|
|
@@ -65,7 +63,7 @@ function createParamForCreateSource(_izContext, srcPath) {
|
|
|
65
63
|
),
|
|
66
64
|
createIamRole(
|
|
67
65
|
{
|
|
68
|
-
[RESOURCE_CLASSES.dynamoDbTable]:
|
|
66
|
+
[RESOURCE_CLASSES.dynamoDbTable]: Object.values(DYNAMO_RESOURCE)
|
|
69
67
|
},
|
|
70
68
|
[
|
|
71
69
|
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "TranslateIdsCacheMain"),
|
|
@@ -33,12 +33,14 @@ function createParamsForCreateSource(_izContext, srcPath) {
|
|
|
33
33
|
let functionName = (FUNCTION_NAME.translateIdsProcess);
|
|
34
34
|
let handlerType = upperCase(HANDLER.hdrDsq)
|
|
35
35
|
let queueName = upperCase(functionName) + handlerType;
|
|
36
|
+
let functionNameConfig = `${upperCase(functionName)}${handlerType}`
|
|
36
37
|
return {
|
|
37
38
|
templatePath: templatePath,
|
|
38
39
|
templateData: {
|
|
39
40
|
functionName,
|
|
40
41
|
queueName,
|
|
41
|
-
handlerType
|
|
42
|
+
handlerType,
|
|
43
|
+
functionNameConfig
|
|
42
44
|
},
|
|
43
45
|
setting: {
|
|
44
46
|
savePath: path.join(srcPath, SOURCE_PATH.translateIdsRequestFile),
|
|
@@ -29,9 +29,7 @@ const perRecordsValidatorSchema = {
|
|
|
29
29
|
type: "object",
|
|
30
30
|
required: [
|
|
31
31
|
"fromObjType",
|
|
32
|
-
// "fromTypeId",
|
|
33
32
|
"toObjType",
|
|
34
|
-
// "toTypeId",
|
|
35
33
|
"relType",
|
|
36
34
|
],
|
|
37
35
|
properties: {
|
|
@@ -46,8 +44,8 @@ const perRecordsValidatorSchema = {
|
|
|
46
44
|
fromTypeId: {
|
|
47
45
|
type: "string",
|
|
48
46
|
},
|
|
49
|
-
|
|
50
|
-
type: "
|
|
47
|
+
identifiers: {
|
|
48
|
+
type: "array",
|
|
51
49
|
},
|
|
52
50
|
fromTable: {
|
|
53
51
|
type: "string",
|
|
@@ -150,7 +148,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
150
148
|
// add argument (to invoke lambda) to passOnProperties[]
|
|
151
149
|
passOnProperties.push(record.body.Message.fromObjType)
|
|
152
150
|
passOnProperties.push(record.body.Message.fromTypeId)
|
|
153
|
-
passOnProperties.push(record.body.Message.
|
|
151
|
+
passOnProperties.push(record.body.Message.identifiers)
|
|
154
152
|
passOnProperties.push(record.body.Message.fromTable)
|
|
155
153
|
passOnProperties.push(record.body.Message.fromPartitionKeyId)
|
|
156
154
|
passOnProperties.push(record.body.Message.fromPartitionKeyFieldName)
|
package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/mainFunction/template.ejs
CHANGED
|
@@ -38,7 +38,7 @@ const { firstLetterUpperCase: upperCase } = require('@izara_project/izara-market
|
|
|
38
38
|
* translate ids from one object to another related object
|
|
39
39
|
* @param {Object} _izContext
|
|
40
40
|
* @param {object} fromObjType - the type of object we are translating ids from
|
|
41
|
-
* @param {
|
|
41
|
+
* @param {Object[]} identifiers
|
|
42
42
|
* @param {string} fromTypeId - the type of object we are translating ids from
|
|
43
43
|
* @param {string} fromTable - table name
|
|
44
44
|
* @param {string} fromPartitionKeyId - partition key value
|
|
@@ -58,7 +58,7 @@ module.exports.processTranslateIds = async (
|
|
|
58
58
|
_izContext,
|
|
59
59
|
fromObjType,
|
|
60
60
|
fromTypeId,
|
|
61
|
-
|
|
61
|
+
identifiers, // identifiers
|
|
62
62
|
fromTable,
|
|
63
63
|
fromPartitionKeyId,
|
|
64
64
|
fromPartitionKeyFieldName,
|
|
@@ -79,10 +79,10 @@ module.exports.processTranslateIds = async (
|
|
|
79
79
|
// MediaLinkPropertyTranslation: filter dataId is propertyIds
|
|
80
80
|
// translate 2 time , propertyIds from MediaLinkProperty and propertyIds from MediaLinkPropertyTranslation
|
|
81
81
|
try {
|
|
82
|
-
_izContext.logger.debug("=== Function:
|
|
82
|
+
_izContext.logger.debug("=== Function:ProcessTranslateIds ===", {
|
|
83
83
|
fromObjType: fromObjType,
|
|
84
84
|
fromTypeId: fromTypeId,
|
|
85
|
-
|
|
85
|
+
identifiers: identifiers,
|
|
86
86
|
fromTable: fromTable,
|
|
87
87
|
fromPartitionKeyId: fromPartitionKeyId,
|
|
88
88
|
fromPartitionKeyFieldName: fromPartitionKeyFieldName,
|
|
@@ -106,7 +106,7 @@ module.exports.processTranslateIds = async (
|
|
|
106
106
|
just validate to check for error or use for do something further
|
|
107
107
|
if false throw error if true continue translateIds+
|
|
108
108
|
*/
|
|
109
|
-
// let validateObjTypeStatus = await validateFromTypeToToTypeWithRelType(_izContext, fromObjType, toObjType, relType
|
|
109
|
+
// let validateObjTypeStatus = await validateFromTypeToToTypeWithRelType(_izContext, fromObjType, toObjType, relType
|
|
110
110
|
let validateObjTypes = await TranslateIdsLibs.validateObjtypesAndRelType(_izContext, [fromObjType, toObjType], relType)
|
|
111
111
|
if (validateObjTypes == null) {
|
|
112
112
|
errorsFound = errorsFound.concat(`can't find ${fromObjType} and ${toObjType} in relationshipTag:${JSON.stringify(relType)}`)
|
|
@@ -119,7 +119,9 @@ module.exports.processTranslateIds = async (
|
|
|
119
119
|
let resultDatas;
|
|
120
120
|
let lastEvaluatedKeyResultDatas;
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
|
|
123
|
+
// incase didn't send identifiers
|
|
124
|
+
if (!identifiers) {
|
|
123
125
|
|
|
124
126
|
let getFromObjectSchema = await getObjectSchema.getObjSchemaS3WithHierarchy(_izContext, fromObjType);
|
|
125
127
|
_izContext.logger.debug("getFromObjectSchema", getFromObjectSchema);
|
|
@@ -139,7 +141,7 @@ module.exports.processTranslateIds = async (
|
|
|
139
141
|
if not have resultDatas it mean you cant query identifier from table and you didn't send identifier it will return error
|
|
140
142
|
*/
|
|
141
143
|
_izContext.logger.debug("resultDatas query fromtable =>", resultDatas);
|
|
142
|
-
if (!resultDatas &&
|
|
144
|
+
if (!resultDatas && identifiers === undefined) {
|
|
143
145
|
errorsFound.push(`Can not get resultDatas form Table${fromTable} and not have concatinateIdentifier to TranslateIds`)
|
|
144
146
|
}
|
|
145
147
|
}
|
|
@@ -156,23 +158,23 @@ module.exports.processTranslateIds = async (
|
|
|
156
158
|
fromObjType,
|
|
157
159
|
toObjType,
|
|
158
160
|
relType,
|
|
159
|
-
|
|
161
|
+
identifier
|
|
160
162
|
) {
|
|
161
163
|
_izContext.logger.debug("==== Function processOneRecord =====:", {
|
|
162
164
|
translateIdsCacheId: translateIdsCacheId,
|
|
163
165
|
fromObjType: fromObjType,
|
|
164
166
|
toObjType: toObjType,
|
|
165
167
|
relType: relType,
|
|
166
|
-
|
|
168
|
+
identifiers: identifier
|
|
167
169
|
});
|
|
168
170
|
//if true return becase has cache per FromdataId ,eles false found toDataId;
|
|
169
171
|
/*
|
|
170
172
|
check cache from each dataId
|
|
171
173
|
*/
|
|
172
|
-
let [cacheExist,
|
|
174
|
+
let [cacheExist, errorsFoundPerIdentifier, translateIdsCacheFromId] = await translateIdsSharedLib.translateIdsCheckCacheFromId(
|
|
173
175
|
_izContext,
|
|
174
176
|
fromObjType,
|
|
175
|
-
|
|
177
|
+
identifier,
|
|
176
178
|
toObjType,
|
|
177
179
|
relType,
|
|
178
180
|
translateIdsCacheId,
|
|
@@ -182,38 +184,38 @@ module.exports.processTranslateIds = async (
|
|
|
182
184
|
|
|
183
185
|
_izContext.logger.debug('After check translateIdsCheckCacheFromId', {
|
|
184
186
|
cacheExist: cacheExist,
|
|
185
|
-
|
|
187
|
+
errorsFoundPerIdentifier: errorsFoundPerIdentifier,
|
|
186
188
|
translateIdsCacheFromId: translateIdsCacheFromId
|
|
187
189
|
})
|
|
188
190
|
|
|
189
191
|
if (cacheExist) {
|
|
190
|
-
if (
|
|
191
|
-
errorsFound = errorsFound.concat(
|
|
192
|
+
if (errorsFoundPerIdentifier.length > 0) {
|
|
193
|
+
errorsFound = errorsFound.concat(errorsFoundPerIdentifier)
|
|
192
194
|
}
|
|
193
195
|
return;
|
|
194
196
|
};
|
|
195
197
|
// toDataIds from string to Object using function
|
|
196
198
|
let toDataIds = []
|
|
197
|
-
|
|
198
|
-
let identifierObject = await identifiersObject.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
)
|
|
203
|
-
_izContext.logger.debug("identifierObject", identifierObject)
|
|
199
|
+
|
|
200
|
+
// let identifierObject = await identifiersObject.identifiersFromIdentifiersConcat(
|
|
201
|
+
// _izContext,
|
|
202
|
+
// fromObjType,
|
|
203
|
+
// identifier
|
|
204
|
+
// )
|
|
205
|
+
// _izContext.logger.debug("identifierObject", identifierObject)
|
|
204
206
|
|
|
205
207
|
let dataIdFromGetNodeAndRelationship = await graphSharedLib.getNodeAndRelationshipsV2(
|
|
206
208
|
_izContext,
|
|
207
209
|
"GraphHandler",
|
|
208
210
|
fromObjType,
|
|
209
|
-
|
|
211
|
+
identifier,
|
|
210
212
|
relType
|
|
211
213
|
)
|
|
212
214
|
_izContext.logger.debug("dataIdFromGetNodeAndRelationship: ", dataIdFromGetNodeAndRelationship);
|
|
213
215
|
|
|
214
216
|
await Promise.all(
|
|
215
217
|
dataIdFromGetNodeAndRelationship[0].relNodes.map(async (getNodeAndRelResult) => {
|
|
216
|
-
let dataIdFromIdentifiersObject = await identifiersObject.
|
|
218
|
+
let dataIdFromIdentifiersObject = await identifiersObject.identifiersConcatFromIdentifiers(
|
|
217
219
|
_izContext,
|
|
218
220
|
toObjType,
|
|
219
221
|
getNodeAndRelResult.properties
|
|
@@ -231,9 +233,9 @@ module.exports.processTranslateIds = async (
|
|
|
231
233
|
status = passOnStatus;
|
|
232
234
|
}
|
|
233
235
|
|
|
234
|
-
if (
|
|
236
|
+
if (errorsFoundPerIdentifier.length > 0) {
|
|
235
237
|
status = 'error';
|
|
236
|
-
passOnErrorsFound = passOnErrorsFound.concat(
|
|
238
|
+
passOnErrorsFound = passOnErrorsFound.concat(errorsFoundPerIdentifier);
|
|
237
239
|
|
|
238
240
|
} else {
|
|
239
241
|
_izContext.logger.debug('saveTranslateIdsCacheBothDataTables')
|
|
@@ -251,7 +253,7 @@ module.exports.processTranslateIds = async (
|
|
|
251
253
|
_izContext,
|
|
252
254
|
translateIdsCacheFromId,
|
|
253
255
|
status,
|
|
254
|
-
|
|
256
|
+
errorsFoundPerIdentifier
|
|
255
257
|
);
|
|
256
258
|
} // end processOneRecord
|
|
257
259
|
|
|
@@ -260,7 +262,7 @@ module.exports.processTranslateIds = async (
|
|
|
260
262
|
check concatinateIdentifier
|
|
261
263
|
if not use data from resultDatas that query from dynamo
|
|
262
264
|
*/
|
|
263
|
-
if (
|
|
265
|
+
if (!identifiers.length) {
|
|
264
266
|
|
|
265
267
|
|
|
266
268
|
for (let resultData of resultDatas.Items) {
|
|
@@ -281,17 +283,18 @@ module.exports.processTranslateIds = async (
|
|
|
281
283
|
|
|
282
284
|
|
|
283
285
|
} else {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
286
|
+
for (const identifier of identifiers) {
|
|
287
|
+
resultPromises.push(
|
|
288
|
+
processOneRecord(
|
|
289
|
+
_izContext,
|
|
290
|
+
translateIdsCacheId, //fromPartitionKeyId, toType
|
|
291
|
+
fromObjType,
|
|
292
|
+
toObjType,
|
|
293
|
+
relType,
|
|
294
|
+
identifier, //value of DataId
|
|
295
|
+
)
|
|
296
|
+
);
|
|
297
|
+
}
|
|
295
298
|
|
|
296
299
|
}
|
|
297
300
|
await Promise.all(resultPromises);
|
|
@@ -307,7 +310,7 @@ module.exports.processTranslateIds = async (
|
|
|
307
310
|
await translateIdsSharedLib.translateIdsContinueProcessing( //translateIdsCheckCache the rest next frsit resultDatas fininsh
|
|
308
311
|
_izContext,
|
|
309
312
|
fromObjType,
|
|
310
|
-
|
|
313
|
+
identifiers,
|
|
311
314
|
fromTable,
|
|
312
315
|
fromPartitionKeyId,
|
|
313
316
|
fromPartitionKeyFieldName,
|
|
@@ -22,36 +22,10 @@ const fs = require('fs');
|
|
|
22
22
|
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
23
|
|
|
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, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME, externalResourceName } = require("../../../../libs/Consts");
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME, externalResourceName, defaultIamRolePerAction, DYNAMO_RESOURCE, SNS_RESOURCE } = require("../../../../libs/Consts");
|
|
26
26
|
|
|
27
27
|
const templatePath = path.join(__dirname, '../../../../PerActionEndpoint/FunctionYaml/HdrDsq/template.ejs');
|
|
28
28
|
|
|
29
|
-
function defaultIamRolePerAction() {
|
|
30
|
-
let defaultIamRole = [];
|
|
31
|
-
|
|
32
|
-
defaultIamRole.push(
|
|
33
|
-
createIamRole(
|
|
34
|
-
{
|
|
35
|
-
[RESOURCE_CLASSES.s3]: ["GetObject", "GetObjectVersion"],
|
|
36
|
-
},
|
|
37
|
-
[
|
|
38
|
-
resourceNames(RESOURCE_CLASSES.s3, "object-schema/perServiceSchemas/*"),
|
|
39
|
-
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/ServiceNameConfig.json"),
|
|
40
|
-
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/GraphServerTags.json")
|
|
41
|
-
]
|
|
42
|
-
),
|
|
43
|
-
createIamRole(
|
|
44
|
-
{
|
|
45
|
-
[RESOURCE_CLASSES.s3]: ["ListBucket"]
|
|
46
|
-
},
|
|
47
|
-
[
|
|
48
|
-
resourceNames(RESOURCE_CLASSES.s3, "object-schema")
|
|
49
|
-
]
|
|
50
|
-
)
|
|
51
|
-
)
|
|
52
|
-
return defaultIamRole
|
|
53
|
-
}
|
|
54
|
-
|
|
55
29
|
/**
|
|
56
30
|
* create data for function yaml for translateIds HdrDsq
|
|
57
31
|
*/
|
|
@@ -76,7 +50,7 @@ function createTranslateIdFunctionYamlHdrDsq(srcPath) {
|
|
|
76
50
|
],
|
|
77
51
|
[RESOURCE_CLASSES.sns]:
|
|
78
52
|
[
|
|
79
|
-
|
|
53
|
+
SNS_RESOURCE.publish, SNS_RESOURCE.subscription
|
|
80
54
|
]
|
|
81
55
|
},
|
|
82
56
|
[
|
|
@@ -88,7 +62,7 @@ function createTranslateIdFunctionYamlHdrDsq(srcPath) {
|
|
|
88
62
|
),
|
|
89
63
|
createIamRole(
|
|
90
64
|
{
|
|
91
|
-
[RESOURCE_CLASSES.dynamoDbTable]: [
|
|
65
|
+
[RESOURCE_CLASSES.dynamoDbTable]: [DYNAMO_RESOURCE.getItem, DYNAMO_RESOURCE.updateItem]
|
|
92
66
|
},
|
|
93
67
|
[
|
|
94
68
|
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "TranslateIdsCacheMain")
|
|
@@ -22,36 +22,10 @@ const fs = require('fs');
|
|
|
22
22
|
const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
23
|
|
|
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, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME, externalResourceName } = require("../../../../libs/Consts");
|
|
25
|
+
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SQS_RESOURCE, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME, externalResourceName, defaultIamRolePerAction, SNS_RESOURCE, DYNAMO_RESOURCE } = require("../../../../libs/Consts");
|
|
26
26
|
|
|
27
27
|
const templatePath = path.join(__dirname, '../../../../PerActionEndpoint/FunctionYaml/HdrDsq/template.ejs');
|
|
28
28
|
|
|
29
|
-
function defaultIamRolePerAction() {
|
|
30
|
-
let defaultIamRole = [];
|
|
31
|
-
|
|
32
|
-
defaultIamRole.push(
|
|
33
|
-
createIamRole(
|
|
34
|
-
{
|
|
35
|
-
[RESOURCE_CLASSES.s3]: ["GetObject", "GetObjectVersion"],
|
|
36
|
-
},
|
|
37
|
-
[
|
|
38
|
-
resourceNames(RESOURCE_CLASSES.s3, "object-schema/perServiceSchemas/*"),
|
|
39
|
-
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/ServiceNameConfig.json"),
|
|
40
|
-
resourceNames(RESOURCE_CLASSES.s3, "object-schema/serviceConfig/GraphServerTags.json")
|
|
41
|
-
]
|
|
42
|
-
),
|
|
43
|
-
createIamRole(
|
|
44
|
-
{
|
|
45
|
-
[RESOURCE_CLASSES.s3]: ["ListBucket"]
|
|
46
|
-
},
|
|
47
|
-
[
|
|
48
|
-
resourceNames(RESOURCE_CLASSES.s3, "object-schema")
|
|
49
|
-
]
|
|
50
|
-
)
|
|
51
|
-
)
|
|
52
|
-
return defaultIamRole
|
|
53
|
-
}
|
|
54
|
-
|
|
55
29
|
/**
|
|
56
30
|
* create data for function yaml for translateIds HdrSqs
|
|
57
31
|
*/
|
|
@@ -76,7 +50,7 @@ function createTranslateIdFunctionYmlHdrSqs(srcPath) {
|
|
|
76
50
|
],
|
|
77
51
|
[RESOURCE_CLASSES.sns]:
|
|
78
52
|
[
|
|
79
|
-
|
|
53
|
+
SNS_RESOURCE.publish, SNS_RESOURCE.subscription
|
|
80
54
|
]
|
|
81
55
|
},
|
|
82
56
|
[
|
|
@@ -88,7 +62,7 @@ function createTranslateIdFunctionYmlHdrSqs(srcPath) {
|
|
|
88
62
|
),
|
|
89
63
|
createIamRole(
|
|
90
64
|
{
|
|
91
|
-
[RESOURCE_CLASSES.dynamoDbTable]: [
|
|
65
|
+
[RESOURCE_CLASSES.dynamoDbTable]: [DYNAMO_RESOURCE.getItem, DYNAMO_RESOURCE.updateItem]
|
|
92
66
|
},
|
|
93
67
|
[
|
|
94
68
|
resourceNames(RESOURCE_CLASSES.dynamoDbTable, "TranslateIdsCacheMain")
|
|
@@ -21,7 +21,7 @@ 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
|
|
24
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils")
|
|
25
25
|
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME } = require("../../../../libs/Consts");
|
|
26
26
|
|
|
27
27
|
|
|
@@ -41,12 +41,14 @@ function createSourceParamsTranslateIdHandlerDsq(srcPath) {
|
|
|
41
41
|
const handlerType = HANDLER.hdrDsq
|
|
42
42
|
const functionName = FUNCTION_NAME.translateId
|
|
43
43
|
const queueName = upperCase(functionName) + upperCase(handlerType)
|
|
44
|
+
let functionNameConfig = upperCase(functionName) + upperCase(handlerType)
|
|
44
45
|
return {
|
|
45
46
|
templatePath: templatePath,
|
|
46
47
|
templateData: {
|
|
47
48
|
queueName,
|
|
48
49
|
functionName,
|
|
49
|
-
handlerType
|
|
50
|
+
handlerType,
|
|
51
|
+
functionNameConfig
|
|
50
52
|
},
|
|
51
53
|
setting: {
|
|
52
54
|
savePath: path.join(srcPath, SOURCE_PATH.translateIdsRequestFile),
|
|
@@ -29,9 +29,7 @@ const perRecordsValidatorSchema = {
|
|
|
29
29
|
type: "object",
|
|
30
30
|
required: [
|
|
31
31
|
"fromObjType",
|
|
32
|
-
// "fromTypeId",
|
|
33
32
|
"toObjType",
|
|
34
|
-
// "toTypeId",
|
|
35
33
|
"relType",
|
|
36
34
|
],
|
|
37
35
|
properties: {
|
|
@@ -46,8 +44,8 @@ const perRecordsValidatorSchema = {
|
|
|
46
44
|
fromTypeId: {
|
|
47
45
|
type: "string",
|
|
48
46
|
},
|
|
49
|
-
|
|
50
|
-
type: "
|
|
47
|
+
identifiers: {
|
|
48
|
+
type: "array",
|
|
51
49
|
},
|
|
52
50
|
fromTable: {
|
|
53
51
|
type: "string",
|
|
@@ -117,7 +115,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
117
115
|
// add argument (to invoke lambda) to passOnProperties[]
|
|
118
116
|
passOnProperties.push(record.body.Message.fromObjType)
|
|
119
117
|
passOnProperties.push(record.body.Message.fromTypeId)
|
|
120
|
-
passOnProperties.push(record.body.Message.
|
|
118
|
+
passOnProperties.push(record.body.Message.identifiers)
|
|
121
119
|
passOnProperties.push(record.body.Message.fromTable)
|
|
122
120
|
passOnProperties.push(record.body.Message.fromPartitionKeyId)
|
|
123
121
|
passOnProperties.push(record.body.Message.fromPartitionKeyFieldName)
|
|
@@ -40,12 +40,14 @@ function createTranslateIdsHandlerSqs(srcPath) {
|
|
|
40
40
|
const functionName = FUNCTION_NAME.translateId;
|
|
41
41
|
const handler = HANDLER.hdrSqs;
|
|
42
42
|
const queueName = upperCase(functionName) + upperCase(handler)
|
|
43
|
+
let functionNameConfig = upperCase(functionName) + upperCase(handler)
|
|
43
44
|
return {
|
|
44
45
|
templatePath: templatePath,
|
|
45
46
|
templateData: {
|
|
46
47
|
functionName,
|
|
47
48
|
handler,
|
|
48
|
-
queueName
|
|
49
|
+
queueName,
|
|
50
|
+
functionNameConfig
|
|
49
51
|
},
|
|
50
52
|
setting: {
|
|
51
53
|
savePath: path.join(srcPath, SOURCE_PATH.translateIdsRequestFile),
|
|
@@ -25,7 +25,7 @@ const {
|
|
|
25
25
|
const Logger = require('@izara_project/izara-core-library-logger');
|
|
26
26
|
const recordHandlerSharedLib = require('@izara_project/izara-shared').recordHandlerSharedLib
|
|
27
27
|
|
|
28
|
-
const
|
|
28
|
+
const translateIdsRequest = require('./TranslateIdsRequest_Main');
|
|
29
29
|
|
|
30
30
|
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
31
31
|
|
|
@@ -34,9 +34,7 @@ let validatorSchema = {
|
|
|
34
34
|
type: "object",
|
|
35
35
|
required: [
|
|
36
36
|
"fromObjType",
|
|
37
|
-
// "fromTypeId",
|
|
38
37
|
"toObjType",
|
|
39
|
-
// "toTypeId",
|
|
40
38
|
"relType",
|
|
41
39
|
],
|
|
42
40
|
properties: {
|
|
@@ -51,8 +49,8 @@ let validatorSchema = {
|
|
|
51
49
|
fromTypeId: {
|
|
52
50
|
type: "string",
|
|
53
51
|
},
|
|
54
|
-
|
|
55
|
-
type: "
|
|
52
|
+
identifiers: {
|
|
53
|
+
type: "array",
|
|
56
54
|
},
|
|
57
55
|
fromTable: {
|
|
58
56
|
type: "string",
|
|
@@ -117,7 +115,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
117
115
|
// --- validate message (and MessageAttributes)
|
|
118
116
|
await recordHandlerSharedLib.validateRecord(
|
|
119
117
|
record, // one record will send to mainFunction
|
|
120
|
-
"
|
|
118
|
+
"TranslateIdsRequestHdrSqs", // queue name that need to retry or send to dlq
|
|
121
119
|
validatorSchema, // schema for record.Message
|
|
122
120
|
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
123
121
|
);
|
|
@@ -125,7 +123,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
125
123
|
// add argument (to invoke lambda) to passOnProperties[]
|
|
126
124
|
passOnProperties.push(record.body.Message.fromObjType)
|
|
127
125
|
passOnProperties.push(record.body.Message.fromTypeId)
|
|
128
|
-
passOnProperties.push(record.body.Message.
|
|
126
|
+
passOnProperties.push(record.body.Message.identifiers)
|
|
129
127
|
passOnProperties.push(record.body.Message.fromTable)
|
|
130
128
|
passOnProperties.push(record.body.Message.fromPartitionKeyId)
|
|
131
129
|
passOnProperties.push(record.body.Message.fromPartitionKeyFieldName)
|
|
@@ -142,34 +140,24 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
142
140
|
// call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
|
|
143
141
|
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
144
142
|
record, // one record will send to mainFunction
|
|
145
|
-
|
|
146
|
-
"
|
|
143
|
+
translateIdsRequest.translateIdsRequest, // mainFunction that need to invoke.
|
|
144
|
+
"TranslateIdsRequestHdrSqs", // queue name that need to retry or send to dlq
|
|
147
145
|
passOnProperties, // all parameters that mainFunction needed.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
146
|
+
);
|
|
147
|
+
record._izContext.logger.debug('after recordPromise in handler');
|
|
148
|
+
recordPromises.push(recordPromise); // push promise to recordPromises
|
|
149
|
+
})) //end record
|
|
150
|
+
|
|
151
|
+
Logger.debug('before Promise.all(recordPromises) in handler');
|
|
152
|
+
try {
|
|
153
|
+
await Promise.all(recordPromises); // await all promises
|
|
154
|
+
return event.Records // return all for local test
|
|
155
|
+
} catch {
|
|
156
|
+
Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
|
|
157
|
+
}
|
|
158
|
+
Logger.debug('after Promise.all(recordPromises) in handler');
|
|
161
159
|
} catch (err) {
|
|
162
|
-
Logger.error('Unhandled Error,
|
|
160
|
+
Logger.error('Unhandled Error, TranslateIdsRequest:', err);
|
|
163
161
|
throw (err);
|
|
164
162
|
}
|
|
165
|
-
})
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<%_ function firstLetterUpperCase(text) {
|
|
171
|
-
return text.charAt(0).toUpperCase() + text.slice(1)
|
|
172
|
-
} _%>
|
|
173
|
-
<%_ function firstLetterLowerCase(str) {
|
|
174
|
-
return str.charAt(0).toLowerCase() + str.slice(1)
|
|
175
|
-
} _%>
|
|
163
|
+
})
|
|
@@ -39,7 +39,7 @@ const sqs = externalRequest.sqs
|
|
|
39
39
|
* translate ids from one object to another related object
|
|
40
40
|
* @param {Object} _izContext
|
|
41
41
|
* @param {object} fromObjType - the type of object we are translating ids from
|
|
42
|
-
* @param {
|
|
42
|
+
* @param {Object[]} identifiers
|
|
43
43
|
* @param {string} fromTypeId - the type of object we are translating ids from
|
|
44
44
|
* @param {string} fromTable - table name
|
|
45
45
|
* @param {string} fromPartitionKeyId - partition key value
|
|
@@ -59,7 +59,7 @@ module.exports.translateIdsRequest = async (
|
|
|
59
59
|
_izContext,
|
|
60
60
|
fromObjType,
|
|
61
61
|
fromTypeId,
|
|
62
|
-
|
|
62
|
+
identifiers,
|
|
63
63
|
fromTable,
|
|
64
64
|
fromPartitionKeyId,
|
|
65
65
|
fromPartitionKeyFieldName,
|
|
@@ -81,7 +81,7 @@ module.exports.translateIdsRequest = async (
|
|
|
81
81
|
_izContext.logger.debug("=== Function:TranslateIdsRequest ===", {
|
|
82
82
|
fromObjType: fromObjType,
|
|
83
83
|
fromTypeId: fromTypeId,
|
|
84
|
-
|
|
84
|
+
identifiers: identifiers,
|
|
85
85
|
fromTable: fromTable,
|
|
86
86
|
fromPartitionKeyId: fromPartitionKeyId,
|
|
87
87
|
fromPartitionKeyFieldName: fromPartitionKeyFieldName,
|
|
@@ -103,7 +103,7 @@ module.exports.translateIdsRequest = async (
|
|
|
103
103
|
let [translateIdsCacheMainStatus, translateIdsCacheId, translateIdsCacheMain] = await translateIdsSharedLib.translateIdsCheckCacheMain(
|
|
104
104
|
_izContext,
|
|
105
105
|
fromObjType,
|
|
106
|
-
|
|
106
|
+
identifiers,
|
|
107
107
|
fromTable,
|
|
108
108
|
fromPartitionKeyId,
|
|
109
109
|
fromPartitionKeyFieldName,
|
|
@@ -126,7 +126,7 @@ module.exports.translateIdsRequest = async (
|
|
|
126
126
|
MessageBody: JSON.stringify({
|
|
127
127
|
fromObjType: fromObjType,
|
|
128
128
|
fromTypeId: fromTypeId,
|
|
129
|
-
|
|
129
|
+
identifiers: identifiers,
|
|
130
130
|
fromTable: fromTable,
|
|
131
131
|
fromPartitionKeyId: fromPartitionKeyId,
|
|
132
132
|
fromPartitionKeyFieldName: fromPartitionKeyFieldName,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2020 Sven Mason <http://izara.io>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU Affero General Public License as
|
|
6
|
+
published by the Free Software Foundation, either version 3 of the
|
|
7
|
+
License, or (at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU Affero General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
'use strict';
|
|
19
|
+
const path = require('path');
|
|
20
|
+
const fs = require('fs');
|
|
21
|
+
|
|
22
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils");
|
|
23
|
+
const { SOURCE_PATH } = require('../../libs/Consts');
|
|
24
|
+
const templatePath = path.join(__dirname, "./template.ejs");
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
function data(_izContext, createSourceParams, srcPath) {
|
|
28
|
+
// console.log("createSourceParams in Data", createSourceParams);
|
|
29
|
+
const functionNameConfigs = new Set();
|
|
30
|
+
for (let { templatePath, templateData, setting } of createSourceParams) {
|
|
31
|
+
if (templateData.functionNameConfig !== undefined) {
|
|
32
|
+
functionNameConfigs.add(templateData.functionNameConfig)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
templatePath: templatePath,
|
|
38
|
+
templateData: {
|
|
39
|
+
functionNameConfigs: functionNameConfigs
|
|
40
|
+
},
|
|
41
|
+
setting: {
|
|
42
|
+
savePath: path.join(srcPath, SOURCE_PATH.appYaml),
|
|
43
|
+
saveFileName: "FunctionNameConfig",
|
|
44
|
+
fileExtension: ".yml",
|
|
45
|
+
isAppend: true
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
module.exports = data;
|