@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,61 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const path = require('path');
20
+ const fs = require('fs');
21
+
22
+ const { ACTIONS, HANDLER } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
23
+
24
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase } = require("../../../../../MainLibs/src/Utils")
25
+ const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, FUNCTION_NAME } = require("../../../libs/Consts");
26
+
27
+ const templatePath = path.join(__dirname, "./template.ejs")
28
+
29
+ /**
30
+ * receive objectSchema
31
+ * create data for hdrInv template
32
+ *
33
+ * @return {{ templatePath, templateData, setting } }
34
+ */
35
+ function data(_izContext, srcPath) {
36
+ const createSourceParams = createParamForCreateSource(srcPath)
37
+ return [createSourceParams];
38
+ }
39
+
40
+ function createParamForCreateSource(srcPath) {
41
+ const functionName = FUNCTION_NAME.createObjectComplete;
42
+ let functionNameConfig = upperCase(functionName)
43
+
44
+ return {
45
+ templatePath: templatePath,
46
+ templateData: {
47
+ functionName,
48
+ queueName: upperCase(functionName),
49
+ functionName,
50
+ functionNameConfig
51
+ },
52
+ setting: {
53
+ savePath: path.join(srcPath, SOURCE_PATH.lambdaPerAction),
54
+ saveFileName: `${upperCase(functionName)}_${upperCase(HANDLER.hdrSqs)}`,
55
+ fileExtension: ".js",
56
+ isAppend: false
57
+ }
58
+ }
59
+ }
60
+
61
+ module.exports = data
@@ -0,0 +1,130 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+
20
+ // const AWS = require('aws-sdk');
21
+ // const sqs = new AWS.SQS({ apiVersion: '2012-11-05' });
22
+
23
+ const izara = require("@izara_project/izara-middleware");
24
+ const middleware = izara.middlewareHandler;
25
+ const izaraShared = require('@izara_project/izara-shared');
26
+ const recordHandlerSharedLib = izaraShared.recordHandlerSharedLib
27
+ const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
28
+
29
+ const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>_Main');
30
+ const Logger = require('@izara_project/izara-core-library-logger');
31
+ // validate event properties in body.Message of sqs event
32
+ middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
33
+ // set schema for record.body.Message
34
+ let perRecordsValidatorSchema = {
35
+ type: "object",
36
+ required: [
37
+ 'returnValue',
38
+ 'status',
39
+ 'errorFounds'
40
+ ],
41
+ properties: {
42
+ returnValue: {
43
+ type: 'object',
44
+ },
45
+ status: {
46
+ type: 'string',
47
+ },
48
+ errorFounds: {
49
+ type: 'array',
50
+ default: []
51
+ }
52
+ }
53
+ };
54
+
55
+ // set schema for record.body.MessageAttributes
56
+ // const messageAttributeValidatorSchema = {
57
+ // type: "object",
58
+ // required: ['msgAtrrParam1', 'msgAtrrParam2'],
59
+ // properties: {
60
+ // msgAtrrParam1: {
61
+ // type: "string"
62
+ // },
63
+ // msgAtrrParam2: {
64
+ // type: "object"
65
+ // }
66
+ // }
67
+ // };
68
+
69
+ perRecordsValidatorSchema = callingFlowSharedLib.addOptionalPassBackPropertiesToValidatorSchema(perRecordsValidatorSchema); // is Ok passBackProperties
70
+ module.exports.main = middleware.wrap(async (event, context, callback) => {
71
+
72
+ try {
73
+
74
+ let recordPromises = [];
75
+
76
+ // loop each record and send to mainFunction
77
+ await Promise.all(event.Records.map(async record => { // promise.all for map() function
78
+
79
+ let passOnProperties = []
80
+ record._izContext.logger.debug('record ReceiveMsgOutHdrSqs', record);
81
+
82
+ //validate message (and MessageAttributes)
83
+ await recordHandlerSharedLib.validateRecord(
84
+ record, // one record will send to mainFunction
85
+ "<%- firstLetterUpperCase(queueName) %>", // queue name that need to retry or send to dlq
86
+ perRecordsValidatorSchema, // schema for record.Message
87
+ // messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
88
+ );
89
+
90
+ // add argument (to invoke lambda) to passOnProperties[]
91
+ passOnProperties.push(record.body.Message.returnValue)
92
+ passOnProperties.push(record.body.Message.status)
93
+ passOnProperties.push(record.body.Message.errorFounds)
94
+ passOnProperties.push(record.body.Message.graphServerTag)
95
+ passOnProperties.push(callingFlowSharedLib.addPassBackPropertiesToPassOnProperties(record.body.Message)) // is Ok PassBackProperties
96
+ // passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message)) // is Ok callinfFlow
97
+ record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
98
+
99
+ // call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
100
+ let recordPromise = recordHandlerSharedLib.recordHandler(
101
+ record, // one record will send to mainFunction
102
+ <%- functionName %>.<%- functionName %>, // mainFunction that need to invoke.
103
+ "<%- firstLetterUpperCase(queueName) %>", // queue name that need to retry or send to dlq
104
+ passOnProperties, // all parameters that mainFunction needed.
105
+ );
106
+ record._izContext.logger.debug('after recordPromise in handler');
107
+ recordPromises.push(recordPromise); // push promise to recordPromises
108
+ }))
109
+
110
+ Logger.debug('before Promise.all(recordPromises) in handler');
111
+ try {
112
+ // --- main await all promises
113
+ await Promise.all(recordPromises); // await all promises
114
+
115
+ return event.Records // return all for local testing
116
+
117
+ } catch {
118
+ Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
119
+ }
120
+ Logger.debug('after Promise.all(recordPromises) in handler');
121
+
122
+ } catch (err) {
123
+ Logger.error('Unhandled Error, updateNodeCompleteHdrSqs: ', err);
124
+ throw (err);
125
+ }
126
+ });
127
+
128
+ <%_ function firstLetterUpperCase(text){
129
+ return text.charAt(0).toUpperCase()+ text.slice(1)
130
+ } _%>
@@ -0,0 +1,53 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const path = require('path');
20
+ const fs = require('fs');
21
+
22
+ const { ACTIONS, HANDLER } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
23
+
24
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase, firstLetterUpperCase } = require("../../../../../MainLibs/src/Utils")
25
+ const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, FUNCTION_NAME, SAVE_FILE_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
+
36
+ function data(_izContext, srcPath) {
37
+ return [createMainFunctionCreateComplete(_izContext, srcPath)]
38
+ }
39
+
40
+ function createMainFunctionCreateComplete(_izContext, srcPath) {
41
+ return {
42
+ templatePath: templatePath,
43
+ templateData: {},
44
+ setting: {
45
+ savePath: path.join(srcPath, SOURCE_PATH.lambdaPerAction),
46
+ saveFileName: `${upperCase(FUNCTION_NAME.createObjectComplete)}_Main`,
47
+ fileExtension: ".js",
48
+ isAppend: false
49
+ }
50
+ }
51
+ }
52
+
53
+ module.exports = data
@@ -0,0 +1,170 @@
1
+ /*
2
+ Copyright (C) 2021 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
+ 'use strict';
18
+ const asyncFlowSharedLib = require('@izara_project/izara-shared/src/AsyncFlowSharedLib');
19
+ const dynamodbSharedLib = require('@izara_project/izara-shared/src/DynamodbSharedLib');
20
+ const snsSharedLib = require('@izara_project/izara-shared/src/SnsSharedLib');
21
+ const sns = require('@izara_project/izara-core-library-external-request/src/resources/Sns');
22
+ const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib');
23
+ const _ = require('lodash');
24
+ const hash = require("object-hash")
25
+
26
+
27
+ const PREFIX = {
28
+ CREATE_OBJECT_ASYNC: "createObjectAsync",
29
+ CREATE_OBJECT_ASYNC_COMPLETE: "createObjectAsyncComplete"
30
+ }
31
+
32
+ /**
33
+ *
34
+ * @param {*} _izContext
35
+ * @param {*} returnValue
36
+ * @param {*} status
37
+ * @param {*} errorsFounds
38
+ * @param {*} graphServerTag
39
+ * @param {*} passBackProperties
40
+ * @param {*} callingFlowConfig
41
+ returnValue = {
42
+ queryResult: returnCreateNode,
43
+ objType,
44
+ objInstance,
45
+ relationships,
46
+ settings
47
+ }
48
+ */
49
+ module.exports.createObjectComplete = async (
50
+ _izContext,
51
+ returnValue,
52
+ status,
53
+ errorsFound,
54
+ graphServerTag,
55
+ passBackProperties,
56
+ callingFlowConfig
57
+ ) => {
58
+ try {
59
+ _izContext.logger.debug("function createObjectComplete:", {
60
+ returnValue,
61
+ status,
62
+ errorsFound,
63
+ graphServerTag,
64
+ passBackProperties,
65
+ callingFlowConfig
66
+ });
67
+
68
+ let errorFounds = [];
69
+
70
+ if (_.isEmpty(returnValue)) {
71
+ _izContext.logger.debug("message callingFlowProperties is empty");
72
+ throw new NoRetryError("message not an object")
73
+ };
74
+ // validate.
75
+ if (!returnValue.hasOwnProperty("queryResult")) {
76
+ errorFounds.push("message is not have property queryResult, should be not happen");
77
+ };
78
+ if (!returnValue.hasOwnProperty("objType")) {
79
+ errorFounds.push("message is not have property objType, should be not happen");
80
+ };
81
+ if (!returnValue.hasOwnProperty("objInstanceFull")) {
82
+ errorFounds.push("message is not have property objInstance, should be not objInstance");
83
+ };
84
+
85
+ if (status == "error" && errorsFound.length > 0) {
86
+ errorFounds.push(errorsFound);
87
+ } else if (status == "error" && errorsFound.length == 0) {
88
+ errorFounds.push("[invalid]statur is error not have errorfound form graphService");
89
+
90
+ };
91
+ if (status === "complete" && errorsFound.length > 0) {
92
+ errorFounds.push("[Invalid] status is commplete should be not have errorsFound");
93
+ };
94
+ if (graphServerTag == null) {
95
+ errorFounds.push("[Invalid] graphServerTag is not empty string");
96
+ };
97
+
98
+ if (errorsFound.length > 0) {
99
+ _izContext.logger.debug("Have error form grapService:", errorsFound);
100
+ errorFounds = errorFounds.concat(errorsFound);
101
+ };
102
+
103
+ let awaitingStepId = await asyncFlowSharedLib.createAwaitingStepId((hash(
104
+ {
105
+ objType: returnValue.objType,
106
+ graphServerTag: graphServerTag,
107
+ identifiers: returnValue.objInstanceFull.identifiers
108
+ })),
109
+ PREFIX.CREATE_OBJECT_ASYNC
110
+ )
111
+ _izContext.logger.debug("awaitingStepId:", awaitingStepId);
112
+
113
+ let recordAwaitingSteps = await dynamodbSharedLib.query(
114
+ _izContext,
115
+ await dynamodbSharedLib.tableName(_izContext, "AwaitingMultipleSteps"),
116
+ {
117
+ awaitingStepId: awaitingStepId
118
+ }
119
+ );
120
+ _izContext.logger.debug("record awaitingSteps::", recordAwaitingSteps);
121
+
122
+ nextAwaitingAteps:
123
+ for (let listRecordAwaitingStep of recordAwaitingSteps.Items) {
124
+
125
+ _izContext.logger.debug("iterate RecordAwaitingStep:", listRecordAwaitingStep);
126
+
127
+
128
+ if (!await asyncFlowSharedLib.checkAllAwaitingStepsFinished(
129
+ _izContext,
130
+ listRecordAwaitingStep.pendingStepId,
131
+ awaitingStepId
132
+ )) {
133
+ _izContext.logger.debug("!Waiting record form other graph::")
134
+ // **** add step of remove awaitingMultiplestep!! ??
135
+ continue nextAwaitingAteps
136
+ };
137
+
138
+ await asyncFlowSharedLib.removeAwaitingMultipleStep(
139
+ _izContext,
140
+ awaitingStepId,
141
+ listRecordAwaitingStep.pendingStepId,
142
+ );
143
+ _izContext.logger.debug("Remove awaitingStep finish")
144
+ };
145
+
146
+ // seagame: problem about lambdaComplete is will missing errorsFound from request if have 2 request
147
+ // one send with errorsFound and one send without errorsFound
148
+ // this scenario can complete with or without errorsFound
149
+ let messageObject = {
150
+ objType: returnValue.objType,
151
+ objInstanceFull: returnValue.objInstanceFull,
152
+ errorFounds: errorFounds
153
+ };
154
+
155
+ messageObject = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, messageObject)
156
+ let messageAttributes = callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(passBackProperties, {})
157
+
158
+ let sendMessageOutCreateObjectComplete = {
159
+ Message: JSON.stringify(messageObject),
160
+ MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
161
+ TopicArn: await snsSharedLib.snsTopicArn(_izContext, "OutCreateObjectComplete")
162
+ };
163
+ _izContext.logger.debug("Send message to OutCreateObjectComplete :::>", sendMessageOutCreateObjectComplete)
164
+ await sns.publishAsync(_izContext, sendMessageOutCreateObjectComplete);
165
+
166
+
167
+ } catch (err) {
168
+ throw (err)
169
+ }
170
+ }
@@ -0,0 +1,58 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+
20
+ const path = require("path")
21
+ const templatePath = path.join(__dirname, './template.ejs');
22
+ const { SOURCE_PATH, FUNCTION_NAME, SAVE_FILE_NAME } = require('../../../libs/Consts');
23
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../MainLibs/src/Utils")
24
+
25
+ /**
26
+ * create data for dynamoDbYaml tempalte from objectSchema
27
+ * return array of dynamoDb data
28
+ * because one objectSchema can create multiple dynamoDb table
29
+ *
30
+ * @param {Object} _izContext
31
+ * @param {String} saveFilePath
32
+ * @returns {Object[]} - data of multiple dynamoDb template
33
+ */
34
+
35
+ function data(_izContext, srcPath) {
36
+ let createUpdateNodeCompleteQueues = [];
37
+ const createCreateUpdatenodeCompleteQueueNames = [
38
+ {
39
+ queueName: upperCase(FUNCTION_NAME.createObjectComplete)
40
+ }
41
+ ]
42
+ for (let createUpdateNodeCompleteQueueName of createCreateUpdatenodeCompleteQueueNames) {
43
+ createUpdateNodeCompleteQueues.push({
44
+ templatePath: templatePath,
45
+ templateData: createUpdateNodeCompleteQueueName,
46
+ setting: {
47
+ initialData: "Resource\n",
48
+ savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
49
+ saveFileName: SAVE_FILE_NAME.snsInSqsYaml,
50
+ fileExtension: ".yml",
51
+ isAppend: true
52
+ }
53
+ })
54
+ }
55
+ return createUpdateNodeCompleteQueues
56
+ }
57
+
58
+ module.exports = data
@@ -0,0 +1,47 @@
1
+ ##===== [Queue]
2
+ <%- queueName %>:
3
+ Type: "AWS::SQS::Queue"
4
+ Properties:
5
+ QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>
6
+ RedrivePolicy:
7
+ deadLetterTargetArn:
8
+ # !GetAtt
9
+ Fn::GetAtt:
10
+ - <%- queueName %>DLQ
11
+ - Arn
12
+ maxReceiveCount: 3
13
+ VisibilityTimeout: 120
14
+ ##==== [QueueDLQ]
15
+ <%- queueName %>DLQ:
16
+ Type: AWS::SQS::Queue
17
+ Properties:
18
+ QueueName: ${self:custom.iz_resourcePrefix}<%- queueName %>DLQ
19
+ ##==== [QueuePolicy]
20
+ <%- queueName %>Policy:
21
+ Type: AWS::SQS::QueuePolicy
22
+ Properties:
23
+ PolicyDocument:
24
+ Version: "2012-10-17"
25
+ Statement:
26
+ - Sid: "allow-sns-messages"
27
+ Effect: Allow
28
+ Principal: "*"
29
+ Resource:
30
+ # !GetAtt
31
+ Fn::GetAtt:
32
+ - <%- queueName %>
33
+ - Arn
34
+ Action: "SQS:SendMessage"
35
+ Queues:
36
+ - Ref: <%- queueName %>
37
+ #<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
38
+ #<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
39
+
40
+
41
+ <%_ function firstLetterUpperCase(text){
42
+ return text.charAt(0).toUpperCase() + text.slice(1)
43
+ } _%>
44
+ <%_ function firstLetterLowerCase(str) {
45
+ return str.charAt(0).toLowerCase() + str.slice(1)
46
+ } _%>
47
+
@@ -0,0 +1,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, firstLetterUpperCase } = require("../../../../../MainLibs/src/Utils")
25
+ const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME } = require("../../../libs/Consts");
26
+
27
+ const templatePath = path.join(__dirname, "../../../ResourceYaml/sns-out/template.ejs")
28
+ // /ResourceYaml/sns-out/template.ejs
29
+ // /OutPerActionComplete/OutUpdateComplete/sns-out/data.js
30
+ /**
31
+ * create data for dynamoDbYaml tempalte from objectSchema
32
+ * return array of dynamoDb data
33
+ * because one objectSchema can create multiple dynamoDb table
34
+ *
35
+ * @param {Object} _izContext
36
+ * @param {String} saveFilePath
37
+ * @returns {Object[]} - data of multiple dynamoDb template
38
+ */
39
+
40
+ function data(_izContext, srcPath) {
41
+ const createSourceParams = createParamsForCreateSource(_izContext, srcPath)
42
+ return [createSourceParams]
43
+ }
44
+
45
+ function createParamsForCreateSource(_izContext, srcPath) {
46
+ let queueName = FUNCTION_NAME.createObjectComplete
47
+ return {
48
+ templatePath: templatePath,
49
+ templateData: {
50
+ queueName: upperCase(queueName)
51
+ },
52
+ setting: {
53
+ initialData: 'Resources:\n',
54
+ savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
55
+ saveFileName: SAVE_FILE_NAME.snsOutYaml,
56
+ fileExtension: '.yml',
57
+ isAppend: true
58
+ }
59
+ }
60
+ }
61
+
62
+ module.exports = data
@@ -0,0 +1,10 @@
1
+ ##--------- [Create Topic Out]
2
+ Out<%- firstLetterUpperCase(queueName) %>:
3
+ Type: AWS::SNS::Topic
4
+ Properties:
5
+ DisplayName: "SNS Message out"
6
+ TopicName: ${self:custom.iz_resourcePrefix}Out<%- firstLetterUpperCase(queueName) %>
7
+
8
+ <%_ function firstLetterUpperCase(text) {
9
+ return text.charAt(0).toUpperCase() + text.slice(1)
10
+ } _%>
@@ -0,0 +1,82 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const path = require('path');
20
+ const fs = require('fs');
21
+
22
+ const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
23
+ const { getGraphServiceNameFromGraphServerTagWithCache, getServiceNameWithCache } = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig')
24
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../MainLibs/src/Utils")
25
+ const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, externalResourceName, getGraphServiceNameFromAllRelSchema, FUNCTION_NAME, SAVE_FILE_NAME, getGraphServiceNameFromObjectSchema, defaultIamRolePerAction, SQS_RESOURCE, SNS_RESOURCE, DYNAMO_RESOURCE } = require("../../../libs/Consts");
26
+
27
+ const templatePath = path.join(__dirname, './template.ejs');
28
+
29
+ function data(_izContext, srcPath) {
30
+ return [createFunctionYamlOutUpdateComplete(_izContext, srcPath)]
31
+ }
32
+
33
+ function createFunctionYamlOutUpdateComplete(_izContext, srcPath) {
34
+ let functionName = upperCase(FUNCTION_NAME.deleteNodeComplete)
35
+ let additionalResourcePermission = defaultIamRolePerAction();
36
+ let awaitingTables = ["AwaitingMultipleSteps", "AwaitingMultipleStepByPending"]
37
+ let handlerType = upperCase(HANDLER.hdrSqs)
38
+
39
+ additionalResourcePermission.push(
40
+ createIamRole(
41
+ {
42
+ [RESOURCE_CLASSES.sqs]: [
43
+ SQS_RESOURCE.deleteMessage,
44
+ SQS_RESOURCE.deleteMessageBatch,
45
+ SQS_RESOURCE.getQueueAttributes,
46
+ SQS_RESOURCE.getQueueUrl,
47
+ SQS_RESOURCE.receiveMessage,
48
+ SQS_RESOURCE.sendMessage
49
+ ],
50
+ [RESOURCE_CLASSES.sns]: [
51
+ SNS_RESOURCE.publish,
52
+ SNS_RESOURCE.subscription
53
+ ]
54
+ },
55
+ [
56
+ resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName)),
57
+ resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + "DLQ"),
58
+ resourceNames(RESOURCE_CLASSES.sns, "In" + upperCase(functionName)),
59
+ resourceNames(RESOURCE_CLASSES.sns, "Out" + upperCase(functionName)),
60
+ ]
61
+ )
62
+ )
63
+
64
+ return {
65
+ templatePath: templatePath,
66
+ templateData: {
67
+ functionName,
68
+ handlerType,
69
+ additionalResourcePermission,
70
+ resourceLocation: SOURCE_PATH.resourceLocationPerAction
71
+ },
72
+ setting: {
73
+ savePath: path.join(srcPath, SOURCE_PATH.appYaml),
74
+ saveFileName: SAVE_FILE_NAME.functionPerActionYaml,
75
+ fileExtension: '.yml',
76
+ isAppend: true
77
+ }
78
+
79
+ }
80
+ }
81
+
82
+ module.exports = data