@izara_project/izara-market-library-service-schemas 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/package.json +2 -2
  2. package/src/GenerateCodeLibs/src/Consts.js +27 -12
  3. package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +41 -50
  4. package/src/MainLibs/src/Utils.js +13 -0
  5. package/src/TemplateManager/src/FindData/FindDataYaml/data.js +3 -2
  6. package/src/TemplateManager/src/FindData/FindDataYaml/template.ejs +1 -1
  7. package/src/TemplateManager/src/FindData/Handler/data.js +1 -2
  8. package/src/TemplateManager/src/FindData/mainFunction/data.js +1 -1
  9. package/src/TemplateManager/src/GenerateCode.js +120 -47
  10. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +3 -16
  11. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/data.js +4 -2
  12. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/template.ejs +11 -10
  13. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/data.js +1 -1
  14. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/template.ejs +9 -14
  15. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/data.js +82 -0
  16. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/handler/data.js +61 -0
  17. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/handler/template.ejs +129 -0
  18. package/src/TemplateManager/src/{CreateRelationship/createRelationship → OutPerActionComplete/OutDeleteComplete}/mainFunction/data.js +9 -15
  19. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/mainFunction/template.ejs +90 -0
  20. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/sns-out/data.js +62 -0
  21. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/sqs-in-sns/data.js +58 -0
  22. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/data.js +3 -17
  23. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/handler/data.js +4 -2
  24. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/data.js +1 -1
  25. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/template.ejs +4 -4
  26. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/data.js +41 -46
  27. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/template.ejs +1 -1
  28. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/data.js +31 -43
  29. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/template.ejs +1 -1
  30. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/data.js +22 -67
  31. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/template.ejs +1 -1
  32. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/data.js +31 -43
  33. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/template.ejs +1 -1
  34. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/data.js +6 -7
  35. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/template.ejs +2 -2
  36. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/data.js +8 -42
  37. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/template.ejs +80 -65
  38. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/data.js +12 -65
  39. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/template.ejs +3 -4
  40. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/data.js +11 -45
  41. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/template.ejs +64 -59
  42. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/data.js +1 -2
  43. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/template.ejs +141 -183
  44. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/data.js +66 -0
  45. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/template.ejs +194 -0
  46. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/data.js +1 -2
  47. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/template.ejs +2 -3
  48. package/src/TemplateManager/src/ProcessLogical/Handler/data.js +2 -1
  49. package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/data.js +49 -80
  50. package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/template.ejs +1 -1
  51. package/src/TemplateManager/src/ProcessLogical/mainFunction/template.ejs +1 -1
  52. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/data.js +42 -72
  53. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/template.ejs +1 -1
  54. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/data.js +44 -74
  55. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/template.ejs +1 -1
  56. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js +85 -0
  57. package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship → RelationshipPerAction/CreateRelationship/createRelationship}/functionYaml/HdrApi/template.ejs +3 -3
  58. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/functionYaml/HdrDsq/data.js +6 -42
  59. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/template.ejs +30 -0
  60. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/functionYaml/HdrInv/data.js +6 -42
  61. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/template.ejs +26 -0
  62. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/functionYaml/HdrSqs/data.js +6 -42
  63. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/template.ejs +26 -0
  64. package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/perAction/HdrApi → RelationshipPerAction/CreateRelationship/createRelationship/mainFunction}/data.js +4 -5
  65. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/mainFunction/template.ejs +2 -2
  66. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrApi/data.js +3 -3
  67. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrDsq/data.js +3 -3
  68. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrInv/data.js +3 -3
  69. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrSqs/data.js +3 -3
  70. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/sns-in-sqs/data.js +4 -4
  71. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/sns-in-sqs/snsTemplate.ejs +59 -0
  72. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/sns-in-sqs/sqsTemplate.ejs +43 -0
  73. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/functionYaml/data.js +10 -47
  74. package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRalationshipComplete → RelationshipPerAction/CreateRelationship/createRelationshipComplete}/functionYaml/template.ejs +1 -1
  75. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/handler/HdrSqs/data.js +2 -2
  76. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/mainFunction/data.js +2 -2
  77. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-in-sqs/data.js +2 -2
  78. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-in-sqs/template.ejs +47 -0
  79. package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-out/data.js +3 -3
  80. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-out/template.ejs +10 -0
  81. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/data.js +86 -0
  82. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/template.ejs +33 -0
  83. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/data.js +97 -0
  84. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/template.ejs +30 -0
  85. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/data.js +84 -0
  86. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/template.ejs +26 -0
  87. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/data.js +97 -0
  88. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/template.ejs +26 -0
  89. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction/data.js +58 -0
  90. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction/template.ejs +329 -0
  91. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/data.js +58 -0
  92. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/template.ejs +119 -0
  93. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq/data.js +59 -0
  94. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq/template.ejs +167 -0
  95. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv/data.js +60 -0
  96. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv/template.ejs +107 -0
  97. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs/data.js +60 -0
  98. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs/template.ejs +146 -0
  99. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/request.json +30 -0
  100. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/data.js +78 -0
  101. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/snsTemplate.ejs +59 -0
  102. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/sqsTemplate.ejs +43 -0
  103. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/data.js +96 -0
  104. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/template.ejs +33 -0
  105. package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/perAction → RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler}/HdrSqs/data.js +7 -5
  106. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler/HdrSqs/request.json +0 -0
  107. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler/HdrSqs/template.ejs +125 -0
  108. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/data.js +56 -0
  109. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/request.json +0 -0
  110. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/template.ejs +137 -0
  111. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/data.js +72 -0
  112. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/request.json +0 -0
  113. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/template.ejs +47 -0
  114. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/data.js +72 -0
  115. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/request.json +0 -0
  116. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/template.ejs +10 -0
  117. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/functionYaml/data.js +6 -45
  118. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/template.ejs +33 -0
  119. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/handler/HdrSqs/data.js +3 -3
  120. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/request.json +0 -0
  121. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/mainFunction/data.js +2 -2
  122. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-in-sqs/data.js +2 -2
  123. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-out/data.js +3 -3
  124. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-out/template.ejs +10 -0
  125. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrApi/data.js +6 -42
  126. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/request.json +0 -0
  127. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/template.ejs +33 -0
  128. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrDsq/data.js +6 -42
  129. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/request.json +0 -0
  130. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/template.ejs +30 -0
  131. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrInv/data.js +7 -42
  132. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/request.json +0 -0
  133. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/template.ejs +26 -0
  134. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/functionYaml/HdrSqs/data.js +7 -43
  135. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/request.json +0 -0
  136. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/template.ejs +26 -0
  137. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/mainFunction/data.js +3 -4
  138. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/mainFunction/template.ejs +14 -15
  139. package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/perAction/HdrInv → RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi}/data.js +3 -6
  140. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrDsq/data.js +3 -3
  141. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrInv/data.js +62 -0
  142. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/data.js +59 -0
  143. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-in-sqs/data.js +4 -4
  144. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/snsTemplate.ejs +59 -0
  145. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/sqsTemplate.ejs +43 -0
  146. package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-out/data.js +2 -2
  147. package/src/TemplateManager/src/ResourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +30 -3
  148. package/src/TemplateManager/src/ResourceYaml/dynamodb/template.ejs +1 -1
  149. package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +6 -6
  150. package/src/TemplateManager/src/ResourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +2 -2
  151. package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/functionYaml/data.js +5 -6
  152. package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/functionYaml/template.ejs +1 -1
  153. package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/dataHdrDsq.js +1 -1
  154. package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/handler/template.ejs +3 -5
  155. package/src/TemplateManager/src/TranslateIdReq/ProcessingTranslateIds/mainFunction/template.ejs +42 -39
  156. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrDsq/data.js +6 -31
  157. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrDsq/template.ejs +30 -0
  158. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs/data.js +6 -31
  159. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs/template.ejs +30 -0
  160. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq/data.js +2 -2
  161. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrDsq/template.ejs +3 -5
  162. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs/data.js +1 -1
  163. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/handler/HdrSqs/template.ejs +22 -34
  164. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/mainFunction/template.ejs +5 -5
  165. package/src/TemplateManager/src/externalService/FunctionNameConfig/data.js +50 -0
  166. package/src/TemplateManager/src/externalService/FunctionNameConfig/template.ejs +14 -0
  167. package/src/TemplateManager/src/externalService/LambdaRole/data.js +94 -53
  168. package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +13 -0
  169. package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/template.ejs +19 -0
  170. package/src/TemplateManager/src/libs/Consts.js +41 -15
  171. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/getTemplate.ejs +0 -76
  172. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/updateTemplate.ejs +0 -67
  173. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/getTemplate.ejs +0 -105
  174. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/updateTemplate.ejs +0 -109
  175. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/createTemplate.ejs +0 -75
  176. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/getTemplate.ejs +0 -82
  177. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/updateTemplate.ejs +0 -75
  178. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/getTemplate.ejs +0 -124
  179. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/updateTemplate.ejs +0 -133
  180. /package/src/TemplateManager/src/{CreateRelationship/createRelationshipComplete → OutPerActionComplete/OutDeleteComplete}/functionYaml/template.ejs +0 -0
  181. /package/src/TemplateManager/src/{CreateRelationship/createRelationshipComplete/sns-in-sqs → OutPerActionComplete/OutDeleteComplete/sqs-in-sns}/template.ejs +0 -0
  182. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrApi/request.json +0 -0
  183. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrApi/template.ejs +0 -0
  184. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrDsq/request.json +0 -0
  185. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrDsq/template.ejs +0 -0
  186. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrInv/request.json +0 -0
  187. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrInv/template.ejs +0 -0
  188. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrSqs/request.json +0 -0
  189. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/HdrSqs/template.ejs +0 -0
  190. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationship/perAction/request.json +0 -0
  191. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/functionYaml/request.json +0 -0
  192. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/handler/HdrSqs/request.json +0 -0
  193. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/handler/HdrSqs/template.ejs +0 -0
  194. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/mainFunction/request.json +0 -0
  195. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/mainFunction/template.ejs +0 -0
  196. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-in-sqs/request.json +0 -0
  197. /package/src/TemplateManager/src/{CreateRelationship → RelationshipPerAction/CreateRelationship}/createRelationshipComplete/sns-out/request.json +0 -0
  198. /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi}/request.json +0 -0
  199. /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq}/request.json +0 -0
  200. /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv}/request.json +0 -0
  201. /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv → RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs}/request.json +0 -0
  202. /package/src/TemplateManager/src/{UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs → RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml}/request.json +0 -0
  203. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/functionYaml/request.json +0 -0
  204. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/handler/HdrSqs/template.ejs +0 -0
  205. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/mainFunction/request.json +0 -0
  206. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/mainFunction/template.ejs +0 -0
  207. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-in-sqs/request.json +0 -0
  208. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-in-sqs/template.ejs +0 -0
  209. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRalationshipComplete/sns-out/request.json +0 -0
  210. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/mainFunction/request.json +0 -0
  211. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrApi/request.json +0 -0
  212. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrApi/template.ejs +0 -0
  213. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrDsq/request.json +0 -0
  214. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrDsq/template.ejs +0 -0
  215. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrInv/request.json +0 -0
  216. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrInv/template.ejs +0 -0
  217. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrSqs/request.json +0 -0
  218. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/HdrSqs/template.ejs +0 -0
  219. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/perAction/request.json +0 -0
  220. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-in-sqs/request.json +0 -0
  221. /package/src/TemplateManager/src/{UpdateRelationshipSchema → RelationshipPerAction/UpdateRelationshipSchema}/updateRelationship/sns-out/request.json +0 -0
@@ -45,6 +45,9 @@ const createExternalSnsSubscriptions = async (_izContext, allRelSchemas, allObjS
45
45
  const snsServiceConfigCreateNodeComplete = await snsSubscriptionCreateNodeComplete(_izContext, allObjSchemas)
46
46
  snsServiceConfigCreateNodeComplete && snsServiceConfigArray.push(snsServiceConfigCreateNodeComplete);
47
47
 
48
+ const snsServiceConfigDeleteNodeComplete = await snsSubscriptionDeleteNodeComplate(_izContext, allObjSchemas)
49
+ snsServiceConfigDeleteNodeComplete && snsServiceConfigArray.push(snsServiceConfigDeleteNodeComplete);
50
+
48
51
  return {
49
52
  templatePath: templatePath,
50
53
  templateData: { datas: snsServiceConfigArray },
@@ -102,6 +105,16 @@ async function snsSubscriptionCreateNodeComplete(_izContext, allObjectSchemas) {
102
105
  }
103
106
  }
104
107
 
108
+ async function snsSubscriptionDeleteNodeComplate(_izContext, allObjectSchemas) {
109
+ // let serviceNames = await getGraphServiceNameFromAllRelSchema(_izContext, allObjectSchemas)
110
+
111
+ // return {
112
+ // serviceNames: serviceNames,
113
+ // topicName: "OutDeleteNode",
114
+ // sqsEndpoint: "DeleteNodeComplete"
115
+ // }
116
+ }
117
+
105
118
  // not done yet wait for comfirmation
106
119
 
107
120
 
@@ -1,3 +1,22 @@
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
+
1
20
  module.exports.generatedSnsTopicSubscription = [ <% datas.forEach(data => { -%>
2
21
  <% data.serviceNames.forEach(serviceName => { -%>
3
22
  {
@@ -89,6 +89,8 @@ const SOURCE_PATH = {
89
89
  resourceYaml: `../../resource/sls_yaml/generatedCode/source/`,
90
90
  externalService: '../initial_setup/generatedCode/source/',
91
91
  lambdaPerAction: '../src/generatedCode/ObjectTypePerActionEndpoint/source/',
92
+ outPerActionComplete: "../src/generatedCode/OutPerActionComplete/source/",
93
+ resourceLocationOutPerActionComplete: "src/generatedCode/OutPerActionComplete/source/",
92
94
  relationshipPerAction: '../src/generatedCode/RelationshipPerAction/source/',
93
95
  findData: '../src/generatedCode/FindData/source/',
94
96
  translateIdsRequestFile: '../src/generatedCode/TranslateId/source/',
@@ -172,18 +174,22 @@ const SAVE_FILE_NAME = {
172
174
  }
173
175
 
174
176
  const FUNCTION_NAME = {
175
- updateRel: "updateRelationship",
176
- createRel: "createRelationship",
177
- updateRelComplete: "updateRelationshipComplete",
178
- createRelComplete: "createRelationshipComplete",
179
- translateId: "translateIdsRequest",
177
+ updateRel: "updateRel",
178
+ createRel: "createRel",
179
+ updateRelComplete: "updateRelComp",
180
+ createRelComplete: "createRelComp",
181
+ deleteRel: "deleteRel",
182
+ deleteRelComplete: "deleteRelComp",
183
+ translateId: "translateIdsReq",
180
184
  translateIdsProcess: "processTranslateIds",
181
- outTranslateIds: "processTranslateIdsComplete",
185
+ outTranslateIds: "processTranslateIdsComp",
182
186
  findData: "findData",
183
187
  processLogical: "processLogical",
184
- updateNodeComplete: "updateNodeComplete",
185
- createObjectComplete: "createObjectComplete",
186
- paginateProcessLogical: "paginateProcessLogical"
188
+ updateNodeComplete: "updateNodeComp",
189
+ createObjectComplete: "createObjectComp",
190
+ paginateProcessLogical: "paginateProLogical",
191
+ deleteNode: "deleteNode",
192
+ deleteNodeComplete: "deleteNodeComp"
187
193
  }
188
194
 
189
195
  const getGraphServiceNameFromAllRelSchema = async (_izContext, allRelSchemas) => {
@@ -203,10 +209,6 @@ const getGraphServiceNameFromAllRelSchema = async (_izContext, allRelSchemas) =>
203
209
  return graphServiceName
204
210
  }
205
211
 
206
- const TRANSLATEIDS_HANDLER = {
207
- sqs: "HdrSqs",
208
- dsq: "HdrDsq"
209
- }
210
212
  function defaultIamRolePerAction() {
211
213
 
212
214
  let defaultIamRole = [];
@@ -257,10 +259,32 @@ async function getGraphServiceNameFromObjectSchema(_izContext, allObjSchemas) {
257
259
  }
258
260
  }
259
261
  let graphServiceNames = [...graphServiceName]
260
- console.log("graphServiceName", graphServiceNames)
262
+ // console.log("graphServiceName", graphServiceNames)
261
263
  return graphServiceNames
262
264
  }
263
265
 
266
+ function awaitingMultipleStepsRole() {
267
+ let awaitingMultipleStepsRole = createIamRole(
268
+ {
269
+ [RESOURCE_CLASSES.dynamoDbTable]:
270
+ [
271
+ DYNAMO_RESOURCE.updateItem,
272
+ DYNAMO_RESOURCE.putItem,
273
+ DYNAMO_RESOURCE.deleteItem,
274
+ DYNAMO_RESOURCE.query
275
+ ]
276
+ },
277
+ [
278
+ resourceNames(RESOURCE_CLASSES.dynamoDbTable, "AwaitingMultipleSteps"),
279
+ resourceNames(RESOURCE_CLASSES.dynamoDbTable, "AwaitingMultipleStepByPending"),
280
+ ]
281
+ )
282
+ return awaitingMultipleStepsRole
283
+ }
284
+
285
+ function shortNameHandler(fullNameHandler) {
286
+ return fullNameHandler.slice(3)
287
+ }
264
288
 
265
289
  module.exports = {
266
290
  ACTIONS,
@@ -282,5 +306,7 @@ module.exports = {
282
306
  getGraphServiceNameFromAllRelSchema,
283
307
  defaultIamRolePerAction,
284
308
  getComplexFilterServiceTag,
285
- getGraphServiceNameFromObjectSchema
309
+ getGraphServiceNameFromObjectSchema,
310
+ awaitingMultipleStepsRole,
311
+ shortNameHandler
286
312
  }
@@ -1,76 +0,0 @@
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
- <%_ if (isCreateMainFunction == true) { _%>
27
- // user generate main function
28
- <%_ } else { %>
29
- const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
30
- <%_ } _%>
31
-
32
- //(<globalVarible>
33
- //</globalVarible>)
34
-
35
- //validate event params in middleware before into main function
36
- validateSchemaMiddleware(
37
- middleware,
38
- "<%- firstLetterUpperCase(objectType) %>",
39
- "<%- action %>"
40
- //(<validateSchemaSetting>
41
- //</validateSchemaSetting>)
42
- )
43
- // if need to validate authorizer or additional params , add code to hook tag below
44
-
45
- //(<afterValidateWith>)
46
- //(</afterValidateWith>)
47
-
48
-
49
- module.exports.main = middleware.wrap(async (event, context, callback) => {
50
- event._izContext.logger.debug('Event:', event);
51
- try {
52
- // invoke LambdaFunction
53
- let lambdaFunctionResponse = await <%- functionName %>.<%- functionName %>Main(
54
- event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId/userId
55
- event,
56
- );
57
-
58
- // return error to client
59
- if (lambdaFunctionResponse instanceof Error) {
60
- return (izara.response.failure(lambdaFunctionResponse));
61
- }
62
-
63
- // return success to client
64
- return (izara.response.success(lambdaFunctionResponse));
65
-
66
- } catch (err) {
67
- event._izContext.logger.error('Error, <%- functionName %>Main: ', err);
68
- return (izara.response.failure(err));
69
- }
70
- });
71
- <%_ function firstLetterUpperCase(text){
72
- return text.charAt(0).toUpperCase() + text.slice(1)
73
- } _%>
74
- <%_ function firstLetterLowerCase(str) {
75
- return str.charAt(0).toLowerCase() + str.slice(1)
76
- } _%>
@@ -1,67 +0,0 @@
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
- <%_ if (isCreateMainFunction == true) { _%>
27
- // user generate main function
28
- <%_ } else { %>
29
- const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
30
- <%_ } _%>
31
-
32
- //(<globalVarible>
33
- //</globalVarible>)
34
- // if need to validate authorizer or additional params , add code to hook tag below
35
-
36
- //(<afterValidateWith>)
37
- //(</afterValidateWith>)
38
-
39
-
40
- module.exports.main = middleware.wrap(async (event, context, callback) => {
41
- event._izContext.logger.debug('Event:', event);
42
- try {
43
- // invoke LambdaFunction
44
- let lambdaFunctionResponse = await <%- functionName %>.<%- functionName %>Main(
45
- event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId/userId
46
- event,
47
- );
48
-
49
- // return error to client
50
- if (lambdaFunctionResponse instanceof Error) {
51
- return (izara.response.failure(lambdaFunctionResponse));
52
- }
53
-
54
- // return success to client
55
- return (izara.response.success(lambdaFunctionResponse));
56
-
57
- } catch (err) {
58
- event._izContext.logger.error('Error, <%- functionName %>Main: ', err);
59
- return (izara.response.failure(err));
60
- }
61
- });
62
- <%_ function firstLetterUpperCase(text){
63
- return text.charAt(0).toUpperCase() + text.slice(1)
64
- } _%>
65
- <%_ function firstLetterLowerCase(str) {
66
- return str.charAt(0).toLowerCase() + str.slice(1)
67
- } _%>
@@ -1,105 +0,0 @@
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 recordHandlerSharedLib = require('@izara_project/izara-shared').recordHandlerSharedLib;
23
- const {
24
- validateSchemaMiddleware
25
- } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
26
- const Logger = require('@izara_project/izara-core-library-logger');
27
-
28
- <%_ if (isCreateMainFunction == true) { _%>
29
- // user generate main function
30
- <%_ } else { %>
31
- const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
32
- <%_ } _%>
33
-
34
- const perRecordsValidatorSchema = {
35
- type: "object",
36
- required: ['identifiers'],
37
- properties: {
38
- identifiers: {
39
- type: "object"
40
- }
41
- }
42
- }
43
-
44
- module.exports.main = middleware.wrap(async(event,context,callback) => {
45
-
46
- try {
47
-
48
- let recordPromises = []; // final return
49
-
50
- // loop each record and send to mainFunction
51
- await Promise.all(event.Records.map(async record => { // promise.all for map() function
52
-
53
- // --- reforming record.body for Dsq request
54
- record = recordHandlerSharedLib.reformatDsqMessage(record._izContext, record);
55
- record._izContext.logger.debug('record LambdaFunctionHdrDsq after reform', record);
56
-
57
- let passOnProperties = []
58
-
59
- // --- validate message (and MessageAttributes)
60
- await recordHandlerSharedLib.validateRecord(
61
- record, // one record will send to mainFunction
62
- "<%- queueName %>", // queue name that need to retry or send to dlq
63
- perRecordsValidatorSchema, // schema for record.Message
64
- // messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
65
- );
66
-
67
- // add argument (to invoke lambda) to passOnProperties[]
68
- passOnProperties.push(record.body.Message)
69
- record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
70
-
71
- // call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
72
- let recordPromise = recordHandlerSharedLib.recordHandler(
73
- record, // one record will send to mainFunction
74
- <%- functionName %>.<%- functionName %>Main, // mainFunction that need to invoke.
75
- "<%- queueName %>", // queue name that need to retry or send to dlq
76
- passOnProperties, // all parameters that mainFunction needed.
77
- );
78
- record._izContext.logger.debug('after recordPromise in handler');
79
- recordPromises.push(recordPromise); // push promise to recordPromises
80
- })) //end record
81
-
82
- Logger.debug('before Promise.all(recordPromises) in handler');
83
- try {
84
- await Promise.all(recordPromises); // await all promises
85
- return event.Records // return all for local test
86
- } catch {
87
- Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
88
- }
89
- Logger.debug('after Promise.all(recordPromises) in handler');
90
- } catch (err) {
91
- Logger.error('Unhandled Error, <%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>Dsq :', err);
92
- throw (err);
93
- }
94
- })
95
-
96
-
97
-
98
-
99
-
100
- <%_ function firstLetterUpperCase(text){
101
- return text.charAt(0).toUpperCase() + text.slice(1)
102
- } _%>
103
- <%_ function firstLetterLowerCase(str) {
104
- return str.charAt(0).toLowerCase() + str.slice(1)
105
- } _%>
@@ -1,109 +0,0 @@
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 recordHandlerSharedLib = require('@izara_project/izara-shared').recordHandlerSharedLib;
23
- const {
24
- validateSchemaMiddleware
25
- } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
26
- const Logger = require('@izara_project/izara-core-library-logger');
27
-
28
- <%_ if (isCreateMainFunction == true) { _%>
29
- // user generate main function
30
- <%_ } else { %>
31
- const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
32
- <%_ } _%>
33
-
34
- const perRecordsValidatorSchema = {
35
- type: 'object',
36
- required: ["objInstance"],
37
- properties: {
38
- objInstance: {
39
- type: "object",
40
- required: ["identifiers", "fields"],
41
- properties: {
42
- identifiers: {
43
- type: "object",
44
- minProperties: 1
45
- },
46
- fields: {
47
- type: "object",
48
- minProperties: 1
49
- }
50
- }
51
- }
52
- }
53
- }
54
-
55
- module.exports.main = middleware.wrap(async(event, context,callback) => {
56
-
57
- try {
58
- let recordPromises = [];
59
-
60
- await Promise.all(event.Records.map(async record => {
61
-
62
- record = recordHandlerSharedLib.reformatDsqMessage(record._izContext, record);
63
- record._izContext.logger.debug('record <%- objectType %> after reform', record);
64
- let passOnProperties = []
65
-
66
- // --- validate message (and MessageAttributes)
67
- await recordHandlerSharedLib.validateRecord(
68
- record, // one record will send to mainFunction
69
- "<%- queueName %>", // queue name that need to retry or send to dlq
70
- perRecordsValidatorSchema, // schema for record.Message
71
- // messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
72
- );
73
-
74
- // add argument (to invoke lambda) to passOnProperties[]
75
- passOnProperties.push(record.body.Message)
76
- record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
77
-
78
- // call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
79
- let recordPromise = recordHandlerSharedLib.recordHandler(
80
- record, // one record will send to mainFunction
81
- <%- functionName %>.<%- functionName %>Main, // mainFunction that need to invoke.
82
- "<%- queueName %>", // queue name that need to retry or send to dlq
83
- passOnProperties, // all parameters that mainFunction needed.
84
- );
85
- record._izContext.logger.debug('after recordPromise in handler');
86
- recordPromises.push(recordPromise); // push promise to recordPromises
87
- })) //end record
88
-
89
- Logger.debug('before Promise.all(recordPromises) in handler');
90
- try {
91
- await Promise.all(recordPromises); // await all promises
92
- return event.Records // return all for local test
93
- } catch {
94
- Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
95
- }
96
- Logger.debug('after Promise.all(recordPromises) in handler');
97
- } catch (err) {
98
- Logger.error('Unhandled Error, <%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>Dsq :', err);
99
- throw (err);
100
- }
101
- })
102
-
103
-
104
- <%_ function firstLetterUpperCase(text){
105
- return text.charAt(0).toUpperCase() + text.slice(1)
106
- } _%>
107
- <%_ function firstLetterLowerCase(str) {
108
- return str.charAt(0).toLowerCase() + str.slice(1)
109
- } _%>
@@ -1,75 +0,0 @@
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 middleware = require("@izara_project/izara-middleware/src/MiddlewareCore/MiddlewareHandler");
21
-
22
- const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib')
23
-
24
-
25
- const {
26
- validateSchemaMiddleware
27
- } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
28
-
29
-
30
- <%_ if (isCreateMainFunction == true) { _%>
31
- // user generate main function
32
- <%_ } else { %>
33
- const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
34
- <%_ } _%>
35
-
36
- //validate event params in middleware before into function
37
- validateSchemaMiddleware(
38
- middleware,
39
- "<%- firstLetterUpperCase(objectType) %>", // objectType
40
- "<%- action %>", // action
41
- //(<validateSchemaSetting>)
42
- //(</validateSchemaSetting>)
43
- )
44
-
45
- //(<afterValidateWithGenereatedSchema>)
46
- //(</afterValidateWithGenereatedSchema>)
47
-
48
- module.exports.main = middleware.wrap(async (event, context, callback) => {
49
- event._izContext.logger.debug('Event:', event);
50
- event._izContext.logger.debug('context:', context);
51
-
52
- try {
53
-
54
- //(<beforeInvoke>)
55
- //(</beforeInvoke>)
56
-
57
- // invoke LambdaFunction
58
- return await <%- functionName %>.<%- functionName %>Main(
59
- event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId
60
- event,
61
- callingFlowSharedLib.addCallingFlowToPassOnProperties(event)
62
- );
63
-
64
- } catch (err) {
65
- event._izContext.logger.error('Error, <%- firstLetterUpperCase(objectType) %>: ', err);
66
- throw (err);
67
- }
68
- });
69
-
70
- <%_ function firstLetterUpperCase(text){
71
- return text.charAt(0).toUpperCase() + text.slice(1)
72
- } _%>
73
- <%_ function firstLetterLowerCase(str) {
74
- return str.charAt(0).toLowerCase() + str.slice(1)
75
- } _%>
@@ -1,82 +0,0 @@
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 middleware = require("@izara_project/izara-middleware/src/MiddlewareCore/MiddlewareHandler");
21
-
22
- const callingFlowSharedLib = require('@izara_project/izara-shared/src/CallingFlowSharedLib')
23
-
24
-
25
- const {
26
- validateSchemaMiddleware
27
- } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
28
-
29
-
30
- <%_ if (isCreateMainFunction == true) { _%>
31
- // user generate main function
32
- <%_ } else { %>
33
- const <%- functionName %> =require('./<%- firstLetterUpperCase(objectType) %><%- firstLetterUpperCase(action) %>_Main')
34
- <%_ } _%>
35
-
36
- //(<globalVariable>
37
- //</globalVariable>)
38
-
39
-
40
- //validate event params in middleware before into function
41
- validateSchemaMiddleware(
42
- middleware,
43
- "<%- firstLetterUpperCase(objectType) %>", // objectType
44
- "<%- action %>", // action
45
- //(<validateSchemaSetting>)
46
- //(</validateSchemaSetting>)
47
- )
48
-
49
- // if need to validate authorizer or additional params, add code to hook tag below
50
-
51
- //(<afterValidateWithGenereatedSchema>)
52
- //(</afterValidateWithGenereatedSchema>)
53
-
54
-
55
- module.exports.main = middleware.wrap(async (event, context, callback) => {
56
- event._izContext.logger.debug('Event:', event);
57
- event._izContext.logger.debug('context:', context);
58
-
59
- try {
60
-
61
- //(<beforeInvoke>)
62
- //(</beforeInvoke>)
63
-
64
- // invoke LambdaFunction
65
- return await <%- functionName %>.<%- functionName %>Main(
66
- event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId
67
- event,
68
- callingFlowSharedLib.addCallingFlowToPassOnProperties(event)
69
- );
70
-
71
- } catch (err) {
72
- event._izContext.logger.error('Error, <%- firstLetterUpperCase(objectType) %>: ', err);
73
- throw (err);
74
- }
75
- });
76
-
77
- <%_ function firstLetterUpperCase(text){
78
- return text.charAt(0).toUpperCase() + text.slice(1)
79
- } _%>
80
- <%_ function firstLetterLowerCase(str) {
81
- return str.charAt(0).toLowerCase() + str.slice(1)
82
- } _%>