@izara_project/izara-market-library-service-schemas 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/package.json +1 -1
  2. package/src/GenerateCodeLibs/src/Consts.js +21 -6
  3. package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +40 -48
  4. package/src/TemplateManager/src/FindData/Handler/data.js +4 -0
  5. package/src/TemplateManager/src/FindData/mainFunction/data.js +1 -1
  6. package/src/TemplateManager/src/FindData/mainFunction/template.ejs +3 -0
  7. package/src/TemplateManager/src/GenerateCode.js +136 -55
  8. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +3 -16
  9. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/data.js +61 -0
  10. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/template.ejs +130 -0
  11. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/data.js +53 -0
  12. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/template.ejs +170 -0
  13. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-in-sqs/data.js +58 -0
  14. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-in-sqs/template.ejs +47 -0
  15. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-out/data.js +62 -0
  16. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-out/template.ejs +10 -0
  17. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/data.js +82 -0
  18. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/handler/data.js +61 -0
  19. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/handler/template.ejs +129 -0
  20. package/src/TemplateManager/src/{CreateRelationship/createRelationship → OutPerActionComplete/OutDeleteComplete}/mainFunction/data.js +9 -15
  21. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/mainFunction/template.ejs +90 -0
  22. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/sns-out/data.js +62 -0
  23. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/sqs-in-sns/data.js +58 -0
  24. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/data.js +2 -16
  25. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/handler/data.js +3 -1
  26. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/template.ejs +4 -4
  27. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/data.js +31 -43
  28. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/data.js +20 -36
  29. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/data.js +15 -56
  30. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/data.js +22 -39
  31. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/data.js +9 -9
  32. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/template.ejs +2 -2
  33. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/data.js +9 -42
  34. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/template.ejs +14 -11
  35. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/data.js +14 -65
  36. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/template.ejs +2 -2
  37. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/data.js +11 -44
  38. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/template.ejs +14 -18
  39. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/data.js +1 -2
  40. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/template.ejs +200 -248
  41. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/data.js +66 -0
  42. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/template.ejs +194 -0
  43. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/data.js +1 -2
  44. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/template.ejs +2 -3
  45. package/src/TemplateManager/src/ProcessLogical/Handler/data.js +3 -1
  46. package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/data.js +47 -79
  47. package/src/TemplateManager/src/ProcessLogical/mainFunction/template.ejs +10 -2
  48. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/data.js +40 -71
  49. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/data.js +42 -73
  50. package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrDsq/data.js +3 -1
  51. package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrSqs/data.js +3 -1
  52. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js +84 -0
  53. package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship → RelationshipPerAction/CreateRelationship/createRelationship}/functionYaml/HdrApi/template.ejs +2 -2
  54. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/functionYaml/HdrDsq/data.js +4 -41
  55. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/template.ejs +30 -0
  56. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/functionYaml/HdrInv/data.js +4 -41
  57. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/template.ejs +26 -0
  58. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/functionYaml/HdrSqs/data.js +4 -41
  59. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/template.ejs +26 -0
  60. package/src/TemplateManager/src/{CreateRelationship/createRelationship/perAction/HdrApi → RelationshipPerAction/CreateRelationship/createRelationship/mainFunction}/data.js +4 -4
  61. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/mainFunction/template.ejs +2 -2
  62. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrApi/data.js +60 -0
  63. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrDsq/data.js +5 -3
  64. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrInv/data.js +5 -3
  65. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrSqs/data.js +5 -3
  66. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/sns-in-sqs/data.js +4 -4
  67. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/sns-in-sqs/snsTemplate.ejs +59 -0
  68. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/sns-in-sqs/sqsTemplate.ejs +43 -0
  69. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/functionYaml/data.js +8 -46
  70. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/handler/HdrSqs/data.js +4 -2
  71. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/mainFunction/data.js +2 -2
  72. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-in-sqs/data.js +2 -2
  73. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-in-sqs/template.ejs +47 -0
  74. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-out/data.js +3 -3
  75. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-out/template.ejs +10 -0
  76. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/data.js +85 -0
  77. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/template.ejs +33 -0
  78. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/data.js +96 -0
  79. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/template.ejs +30 -0
  80. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/data.js +83 -0
  81. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/template.ejs +26 -0
  82. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/data.js +96 -0
  83. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/template.ejs +26 -0
  84. package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/perAction/HdrApi → RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction}/data.js +4 -5
  85. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction/template.ejs +329 -0
  86. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/data.js +60 -0
  87. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/template.ejs +119 -0
  88. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq/data.js +61 -0
  89. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq/template.ejs +167 -0
  90. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv/data.js +62 -0
  91. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv/template.ejs +107 -0
  92. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs/data.js +62 -0
  93. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs/template.ejs +146 -0
  94. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/request.json +30 -0
  95. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/data.js +78 -0
  96. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/snsTemplate.ejs +59 -0
  97. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/sqsTemplate.ejs +43 -0
  98. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/data.js +95 -0
  99. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/template.ejs +33 -0
  100. package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/perAction → RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler}/HdrSqs/data.js +9 -5
  101. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler/HdrSqs/request.json +0 -0
  102. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler/HdrSqs/template.ejs +125 -0
  103. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/data.js +56 -0
  104. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/request.json +0 -0
  105. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/template.ejs +137 -0
  106. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/data.js +72 -0
  107. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/request.json +0 -0
  108. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/template.ejs +47 -0
  109. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/data.js +72 -0
  110. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/request.json +0 -0
  111. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/template.ejs +10 -0
  112. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/functionYaml/data.js +4 -44
  113. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/template.ejs +33 -0
  114. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/handler/HdrSqs/data.js +5 -3
  115. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/request.json +0 -0
  116. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/mainFunction/data.js +2 -2
  117. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-in-sqs/data.js +2 -2
  118. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-out/data.js +3 -3
  119. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-out/template.ejs +10 -0
  120. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrApi/data.js +5 -42
  121. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/request.json +0 -0
  122. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/template.ejs +33 -0
  123. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrDsq/data.js +4 -41
  124. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/request.json +0 -0
  125. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/template.ejs +30 -0
  126. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrInv/data.js +4 -41
  127. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/request.json +0 -0
  128. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/template.ejs +26 -0
  129. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrSqs/data.js +5 -42
  130. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/request.json +0 -0
  131. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/template.ejs +26 -0
  132. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/mainFunction/data.js +3 -4
  133. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/mainFunction/template.ejs +14 -15
  134. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi/data.js +61 -0
  135. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrDsq/data.js +5 -3
  136. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrInv/data.js +5 -3
  137. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/data.js +61 -0
  138. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-in-sqs/data.js +4 -4
  139. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/snsTemplate.ejs +59 -0
  140. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/sqsTemplate.ejs +43 -0
  141. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-out/data.js +2 -2
  142. package/src/TemplateManager/src/ResourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +27 -0
  143. package/src/TemplateManager/src/ResourceYaml/dynamodb/template.ejs +1 -1
  144. package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/functionYaml/data.js +3 -5
  145. package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/dataHdrDsq.js +3 -1
  146. package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/template.ejs +3 -5
  147. package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/mainFunction/template.ejs +42 -39
  148. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrDsq/data.js +3 -29
  149. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs/data.js +3 -29
  150. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq/data.js +4 -2
  151. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq/template.ejs +3 -5
  152. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs/data.js +3 -1
  153. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs/template.ejs +22 -34
  154. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/mainFunction/template.ejs +5 -5
  155. package/src/TemplateManager/src/externalService/FunctionNameConfig/data.js +50 -0
  156. package/src/TemplateManager/src/externalService/FunctionNameConfig/template.ejs +3 -0
  157. package/src/TemplateManager/src/externalService/LambdaRole/data.js +78 -40
  158. package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +13 -0
  159. package/src/TemplateManager/src/libs/Consts.js +27 -4
  160. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/getTemplate.ejs +0 -76
  161. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/updateTemplate.ejs +0 -67
  162. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/getTemplate.ejs +0 -105
  163. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/updateTemplate.ejs +0 -109
  164. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/createTemplate.ejs +0 -75
  165. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/getTemplate.ejs +0 -82
  166. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/updateTemplate.ejs +0 -75
  167. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/getTemplate.ejs +0 -124
  168. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/updateTemplate.ejs +0 -133
  169. /package/src/TemplateManager/src/{CreateRelationship/createRelationshipComplete → OutPerActionComplete/OutDeleteComplete}/functionYaml/template.ejs +0 -0
  170. /package/src/TemplateManager/src/{CreateRelationship/createRelationshipComplete/sns-in-sqs → OutPerActionComplete/OutDeleteComplete/sqs-in-sns}/template.ejs +0 -0
  171. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrApi/request.json +0 -0
  172. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrApi/template.ejs +0 -0
  173. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrDsq/request.json +0 -0
  174. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrDsq/template.ejs +0 -0
  175. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrInv/request.json +0 -0
  176. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrInv/template.ejs +0 -0
  177. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrSqs/request.json +0 -0
  178. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrSqs/template.ejs +0 -0
  179. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/request.json +0 -0
  180. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/functionYaml/request.json +0 -0
  181. /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRalationshipComplete → RelationshipPerAction/CreateRelationship/createRelationshipComplete}/functionYaml/template.ejs +0 -0
  182. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/handler/HdrSqs/request.json +0 -0
  183. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/handler/HdrSqs/template.ejs +0 -0
  184. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/mainFunction/request.json +0 -0
  185. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/mainFunction/template.ejs +0 -0
  186. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-in-sqs/request.json +0 -0
  187. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-out/request.json +0 -0
  188. /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi}/request.json +0 -0
  189. /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq}/request.json +0 -0
  190. /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv}/request.json +0 -0
  191. /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs}/request.json +0 -0
  192. /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs → RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml}/request.json +0 -0
  193. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/functionYaml/request.json +0 -0
  194. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/handler/HdrSqs/template.ejs +0 -0
  195. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/mainFunction/request.json +0 -0
  196. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/mainFunction/template.ejs +0 -0
  197. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-in-sqs/request.json +0 -0
  198. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-in-sqs/template.ejs +0 -0
  199. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-out/request.json +0 -0
  200. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/mainFunction/request.json +0 -0
  201. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrApi/request.json +0 -0
  202. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrApi/template.ejs +0 -0
  203. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrDsq/request.json +0 -0
  204. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrDsq/template.ejs +0 -0
  205. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrInv/request.json +0 -0
  206. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrInv/template.ejs +0 -0
  207. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrSqs/request.json +0 -0
  208. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrSqs/template.ejs +0 -0
  209. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/request.json +0 -0
  210. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-in-sqs/request.json +0 -0
  211. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-out/request.json +0 -0
@@ -0,0 +1,119 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const izara = require("@izara_project/izara-middleware");
20
+ const middleware = izara.middlewareHandler;
21
+ const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib')
22
+ const {
23
+ validateSchemaMiddleware
24
+ } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
25
+
26
+ const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>_Main');
27
+ // validate event params in middleware before into function
28
+ let validatorSchema = {
29
+ type: "object",
30
+ required: ["objects", "relType", "relationshipProperties"],
31
+ properties: {
32
+ objects: {
33
+ type: "array",
34
+ minItems: 2,
35
+ maxItems: 2,
36
+ Items: {
37
+ type: "object",
38
+ required: ["objType", "identifiers"],
39
+ properties: {
40
+ objType: {
41
+ type: "object",
42
+ required: ["serviceTag", "objectType"],
43
+ properties: {
44
+ serviceTag: izara.validatorSchema.stringNotEmpty(),
45
+ objectType: izara.validatorSchema.stringNotEmpty()
46
+ }
47
+ },
48
+ identifiers: {
49
+ type: "object",
50
+ minproperties: 1
51
+ }
52
+ }
53
+ }
54
+ },
55
+ relType: {
56
+ type: "object",
57
+ required: ["relationshipTag", "serviceTag"],
58
+ properties: {
59
+ relationshipTag: izara.validatorSchema.stringNotEmpty(),
60
+ serviceTag: {
61
+ type: 'string',
62
+ pattern: "^[a-zA-Z0-9_-]+$",
63
+ enum: [process.env.iz_serviceTag]
64
+ }
65
+ }
66
+ },
67
+ relationshipProperties: {
68
+ type: "object",
69
+ minProperties: 1
70
+ }
71
+ }
72
+ };
73
+
74
+
75
+ //(<globalVarible>
76
+ //</globalVarible>)
77
+
78
+ // validate event params in middleware before into main function
79
+ validatorSchema = callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(validatorSchema);
80
+ middleware.setValidatorSchema(validatorSchema)
81
+ // if need to validate authorizer or additional params , add code to hook tag below
82
+
83
+ //(<afterValidateWith>)
84
+ //(</afterValidateWith>)
85
+
86
+
87
+ module.exports.main = middleware.wrap(async (event, context, callback) => {
88
+ event._izContext.logger.debug('Event:', event);
89
+ try {
90
+ // invoke LambdaFunction
91
+ let lambdaFunctionResponse = await <%- functionName %>.<%- functionName %>(
92
+ event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId/userId
93
+ {
94
+ objects: event.objects,
95
+ relType: event.relType,
96
+ relId: event.relId,
97
+ relationshipProperties: event.relationshipProperties
98
+ }
99
+ );
100
+
101
+ // return error to client
102
+ if (lambdaFunctionResponse instanceof Error) {
103
+ return (izara.response.failure(lambdaFunctionResponse));
104
+ }
105
+
106
+ // return success to client
107
+ return (izara.response.success(lambdaFunctionResponse));
108
+
109
+ } catch (err) {
110
+ event._izContext.logger.error('Error, <%- functionName %>HdrApi: ', err);
111
+ return (izara.response.failure(err));
112
+ }
113
+ });
114
+ <%_ function firstLetterUpperCase(text) {
115
+ return text.charAt(0).toUpperCase() + text.slice(1)
116
+ } _%>
117
+ <%_ function firstLetterLowerCase(str) {
118
+ return str.charAt(0).toLowerCase() + str.slice(1)
119
+ } _%>
@@ -0,0 +1,61 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const path = require('path');
20
+ const fs = require('fs');
21
+
22
+ const { ACTIONS, HANDLER } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
23
+
24
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = 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
+ * create data for hdrInv template
31
+ *
32
+ * @return {{ templatePath, templateData, setting } }
33
+ */
34
+ function data(_izContext, srcPath) {
35
+ const createSourceParams = createParamForCreateSource(srcPath)
36
+ return [createSourceParams];
37
+ }
38
+
39
+
40
+ function createParamForCreateSource(srcPath) {
41
+ let functionName = FUNCTION_NAME.deleteRel
42
+ let queueName = functionName + upperCase(HANDLER.hdrDsq)
43
+ let functionNameConfig = upperCase(functionName) + upperCase(HANDLER.hdrDsq)
44
+ return {
45
+ templatePath: templatePath,
46
+ templateData: {
47
+ functionName,
48
+ queueName,
49
+ functionNameConfig
50
+ },
51
+ setting: {
52
+ savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
53
+ saveFileName: upperCase(functionName) + "_" + upperCase(HANDLER.hdrDsq),
54
+ fileExtension: '.js',
55
+ isAppend: false
56
+ }
57
+ }
58
+ }
59
+
60
+
61
+ module.exports = data;
@@ -0,0 +1,167 @@
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 izara = require("@izara_project/izara-middleware");
21
+ const middleware = izara.middlewareHandler;
22
+
23
+ const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib');
24
+
25
+ // const CorrelationIds = require('@izara_project/izara-core-library-correlation-ids')
26
+ // const IntegrationTestDetail = require('@izara_project/izara-core-library-integration-tests')
27
+ const Logger = require('@izara_project/izara-core-library-logger');
28
+ const recordHandlerSharedLib = require('@izara_project/izara-shared').recordHandlerSharedLib
29
+
30
+
31
+ const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>_Main');
32
+ // validate event properties in body.Message of sqs event
33
+ middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema(
34
+ {
35
+ type: "object",
36
+ required: ['body', 'messageAttributes'],
37
+ properties: {
38
+ body: {
39
+ type: 'object',
40
+ },
41
+ messageAttributes: {
42
+ type: 'object'
43
+ }
44
+ }
45
+ }
46
+ ));
47
+
48
+ // validate event params in middlewware before into function.
49
+ let validatorSchema = {
50
+ type: "object",
51
+ required: ["objects", "relType", "relationshipProperties"],
52
+ properties: {
53
+ objects: {
54
+ type: "array",
55
+ minItems: 2,
56
+ maxItems: 2,
57
+ Items: {
58
+ type: "object",
59
+ required: ["objType", "identifiers"],
60
+ properties: {
61
+ objType: {
62
+ type: "object",
63
+ required: ["serviceTag", "objectType"],
64
+ properties: {
65
+ serviceTag: izara.validatorSchema.stringNotEmpty(),
66
+ objectType: izara.validatorSchema.stringNotEmpty()
67
+ }
68
+ },
69
+ identifiers: {
70
+ type: "object",
71
+ minproperties: 1
72
+ }
73
+ }
74
+ }
75
+ },
76
+ relType: {
77
+ type: "object",
78
+ required: ["relationshipTag", "serviceTag"],
79
+ properties: {
80
+ relationshipTag: izara.validatorSchema.stringNotEmpty(),
81
+ serviceTag: {
82
+ type: 'string',
83
+ pattern: "^[a-zA-Z0-9_-]+$",
84
+ enum: [process.env.iz_serviceTag]
85
+ }
86
+ }
87
+ },
88
+ relationshipProperties: {
89
+ type: "object",
90
+ minProperties: 1
91
+ }
92
+ }
93
+ };
94
+
95
+
96
+ //(<globalVarible>
97
+ //</globalVarible>)
98
+
99
+ // validate event params in middleware before into main function
100
+ validatorSchema = callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(validatorSchema);
101
+ // if need to validate authorizer or additional params , add code to hook tag below
102
+
103
+ //(<afterValidateWith>)
104
+ //(</afterValidateWith>)
105
+
106
+
107
+ module.exports.main = middleware.wrap(async (event, context, callback) => {
108
+ Logger.debug('event:', event);
109
+ Logger.debug('context:', context);
110
+ try {
111
+
112
+ let recordPromises = []; // final return
113
+
114
+ // loop each record and send to mainFunction
115
+ await Promise.all(event.Records.map(async record => { // promise.all for map() function
116
+
117
+ // --- reforming record.body for Dsq request
118
+ record = recordHandlerSharedLib.reformatDsqMessage(record._izContext, record);
119
+ record._izContext.logger.debug('record LambdaFunctionHdrDsq after reform', record);
120
+
121
+ let passOnProperties = []
122
+
123
+ // --- validate message (and MessageAttributes)
124
+ await recordHandlerSharedLib.validateRecord(
125
+ record, // one record will send to mainFunction
126
+ "<%- queueName %>", // queue name that need to retry or send to dlq
127
+ validatorSchema, // schema for record.Message
128
+ // messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
129
+ );
130
+
131
+ // add argument (to invoke lambda) to passOnProperties[]
132
+ passOnProperties.push(record.body.Message)
133
+ passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message));
134
+ //(<afterPutParamIntoMainFunction>)
135
+ //(</afterPutParamIntoMainFunction>)
136
+ record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
137
+
138
+ // call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
139
+ let recordPromise = recordHandlerSharedLib.recordHandler(
140
+ record, // one record will send to mainFunction
141
+ <%- functionName %>.<%- functionName %>, // mainFunction that need to invoke.
142
+ "<%- queueName %>", // queue name that need to retry or send to dlq
143
+ passOnProperties, // all parameters that mainFunction needed.
144
+ );
145
+ record._izContext.logger.debug('after recordPromise in handler');
146
+ recordPromises.push(recordPromise); // push promise to recordPromises
147
+ })) //end record
148
+
149
+ Logger.debug('before Promise.all(recordPromises) in handler');
150
+ try {
151
+ await Promise.all(recordPromises); // await all promises
152
+ return event.Records // return all for local test
153
+ } catch {
154
+ Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
155
+ }
156
+ Logger.debug('after Promise.all(recordPromises) in handler');
157
+ } catch (err) {
158
+ Logger.error('Unhandled Error, updateRelationshipHdrDsq:', err);
159
+ throw (err);
160
+ }
161
+ });
162
+ <%_ function firstLetterUpperCase(text) {
163
+ return text.charAt(0).toUpperCase() + text.slice(1)
164
+ } _%>
165
+ <%_ function firstLetterLowerCase(str) {
166
+ return str.charAt(0).toLowerCase() + str.slice(1)
167
+ } _%>
@@ -0,0 +1,62 @@
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 } = 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
+ let functionName = FUNCTION_NAME.deleteRel;
43
+ let handler = HANDLER.hdrInv
44
+ let functionNameConfig = upperCase(functionName) + upperCase(handler)
45
+ return {
46
+ templatePath: templatePath,
47
+ templateData: {
48
+ functionName,
49
+ handler,
50
+ functionNameConfig
51
+ },
52
+ setting: {
53
+ savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
54
+ saveFileName: upperCase(functionName) + "_" + upperCase(handler),
55
+ fileExtension: '.js',
56
+ isAppend: false
57
+ }
58
+ }
59
+ }
60
+
61
+
62
+ module.exports = data;
@@ -0,0 +1,107 @@
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 izara = require("@izara_project/izara-middleware");
21
+ const middleware = izara.middlewareHandler;
22
+
23
+ const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib');
24
+
25
+ // const CorrelationIds = require('@izara_project/izara-core-library-correlation-ids')
26
+ // const Logger = require('@izara_project/izara-core-library-logger');
27
+ // const IntegrationTestDetail = require('@izara_project/izara-core-library-integration-tests')
28
+
29
+ const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>_Main');
30
+
31
+ // validate event params in middlewware before into function.
32
+ let validatorSchema = {
33
+ type: "object",
34
+ required: ["objects", "relType", "relationshipProperties"],
35
+ properties: {
36
+ objects: {
37
+ type: "array",
38
+ minItems: 2,
39
+ maxItems: 2,
40
+ Items: {
41
+ type: "object",
42
+ required: ["objType", "identifiers"],
43
+ properties: {
44
+ objType: {
45
+ type: "object",
46
+ required: ["serviceTag", "objectType"],
47
+ properties: {
48
+ serviceTag: izara.validatorSchema.stringNotEmpty(),
49
+ objectType: izara.validatorSchema.stringNotEmpty()
50
+ }
51
+ },
52
+ identifiers: {
53
+ type: "object",
54
+ minproperties: 1
55
+ }
56
+ }
57
+ }
58
+ },
59
+ relType: {
60
+ type: "object",
61
+ required: ["relationshipTag", "serviceTag"],
62
+ properties: {
63
+ relationshipTag: izara.validatorSchema.stringNotEmpty(),
64
+ serviceTag: {
65
+ type: 'string',
66
+ pattern: "^[a-zA-Z0-9_-]+$",
67
+ enum: [process.env.iz_serviceTag]
68
+ }
69
+ }
70
+ },
71
+ relationshipProperties: {
72
+ type: "object",
73
+ minProperties: 1
74
+ }
75
+ }
76
+ };
77
+
78
+ validatorSchema = callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(validatorSchema); // is Ok callinfFlow
79
+ middleware.setValidatorSchema(validatorSchema)
80
+
81
+ module.exports.main = middleware.wrap(async (event, context, callback) => {
82
+ event._izContext.logger.debug('Event:', event);
83
+ event._izContext.logger.debug('context:', context);
84
+
85
+ try {
86
+ // invoke LambdaFunction
87
+ return await createRelationship.createRelationship(
88
+ event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId
89
+ {
90
+ objects: event.objects,
91
+ relType: event.relType,
92
+ relationshipProperties: event.relationshipProperties,
93
+ },
94
+ callingFlowSharedLib.addCallingFlowToPassOnProperties(event)
95
+ );
96
+
97
+ } catch (err) {
98
+ event._izContext.logger.error('Error, <%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handler) %> : ', err);
99
+ throw (err);
100
+ }
101
+ });
102
+ <%_ function firstLetterUpperCase(text) {
103
+ return text.charAt(0).toUpperCase() + text.slice(1)
104
+ } _%>
105
+ <%_ function firstLetterLowerCase(str) {
106
+ return str.charAt(0).toLowerCase() + str.slice(1)
107
+ } _%>
@@ -0,0 +1,62 @@
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 } = 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 sqs 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
+ let functionName = FUNCTION_NAME.deleteRel;
43
+ let queueName = functionName + upperCase(HANDLER.hdrSqs)
44
+ let functionNameConfig = upperCase(functionName) + upperCase(HANDLER.hdrSqs)
45
+ return {
46
+ templatePath: templatePath,
47
+ templateData: {
48
+ functionName,
49
+ queueName,
50
+ functionNameConfig
51
+ },
52
+ setting: {
53
+ savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
54
+ saveFileName: upperCase(functionName) + "_" + upperCase(HANDLER.hdrSqs),
55
+ fileExtension: '.js',
56
+ isAppend: false
57
+ }
58
+ }
59
+ }
60
+
61
+
62
+ module.exports = data;