@izara_project/izara-core-generate-service-code 1.0.1 → 1.0.3

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 (523) hide show
  1. package/index.js +41 -0
  2. package/package.json +10 -10
  3. package/src/GenerateCode.js +185 -0
  4. package/src/GenerateResources.js +122 -0
  5. package/src/GenerateSchema.js +165 -0
  6. package/src/GenerateTests.js +137 -0
  7. package/src/IntTestConfig.js +23 -0
  8. package/src/SchemaConfig.js +23 -0
  9. package/src/SourceManager/CreateSource.js +226 -0
  10. package/src/TemplateConfig.js +55 -0
  11. package/src/TemplateData/Auth/generateAuthYml/data.js +47 -0
  12. package/src/TemplateData/Auth/generateAuthYml/template.ejs +16 -0
  13. package/src/TemplateData/Auth/generateTemplateData.js +48 -0
  14. package/src/TemplateData/EndpointPerService/generateTemplateData.js +127 -0
  15. package/src/TemplateData/EndpointPerService/handler/api/data.js +72 -0
  16. package/src/TemplateData/EndpointPerService/handler/api/request.json +7 -0
  17. package/src/TemplateData/EndpointPerService/handler/api/template.ejs +73 -0
  18. package/src/TemplateData/EndpointPerService/handler/dsq/data.js +76 -0
  19. package/src/TemplateData/EndpointPerService/handler/dsq/request.json +7 -0
  20. package/src/TemplateData/EndpointPerService/handler/dsq/template.ejs +129 -0
  21. package/src/TemplateData/EndpointPerService/handler/inv/data.js +78 -0
  22. package/src/TemplateData/EndpointPerService/handler/inv/request.json +7 -0
  23. package/src/TemplateData/EndpointPerService/handler/inv/template.ejs +73 -0
  24. package/src/TemplateData/EndpointPerService/handler/sqs/data.js +76 -0
  25. package/src/TemplateData/EndpointPerService/handler/sqs/request.json +7 -0
  26. package/src/TemplateData/EndpointPerService/handler/sqs/template.ejs +131 -0
  27. package/src/TemplateData/EndpointPerService/mainFunction/create/data.js +51 -0
  28. package/src/TemplateData/EndpointPerService/mainFunction/create/template.ejs +616 -0
  29. package/src/TemplateData/EndpointPerService/mainFunction/delete/data.js +51 -0
  30. package/src/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +158 -0
  31. package/src/TemplateData/EndpointPerService/mainFunction/get/data.js +52 -0
  32. package/src/TemplateData/EndpointPerService/mainFunction/get/template.ejs +270 -0
  33. package/src/TemplateData/EndpointPerService/mainFunction/update/data.js +52 -0
  34. package/src/TemplateData/EndpointPerService/mainFunction/update/template.ejs +434 -0
  35. package/src/TemplateData/EndpointPerService/yaml/data.js +311 -0
  36. package/src/TemplateData/EndpointPerService/yaml/template.ejs +35 -0
  37. package/src/TemplateData/IntTest/generateResources/generateResources.js +113 -0
  38. package/src/TemplateData/IntTest/generateResources/templateResources.ejs +33 -0
  39. package/src/TemplateData/IntTest/generateTests/events/data.js +137 -0
  40. package/src/TemplateData/IntTest/generateTests/events/templateEvents.ejs +11 -0
  41. package/src/TemplateData/IntTest/generateTests/generateTemplate.js +69 -0
  42. package/src/TemplateData/IntTest/generateTests/pathIntTest/data.js +56 -0
  43. package/src/TemplateData/IntTest/generateTests/pathIntTest/template.ejs +5 -0
  44. package/src/TemplateData/IntTest/generateTests/tests/data.js +212 -0
  45. package/src/TemplateData/IntTest/generateTests/tests/templateTests.ejs +3 -0
  46. package/src/TemplateData/IntTest/libs/libs.js +385 -0
  47. package/src/TemplateData/IntTest/upload/uploadIntTest.js +96 -0
  48. package/src/TemplateData/externalService/functionNameConfig/data.js +178 -0
  49. package/src/TemplateData/externalService/functionNameConfig/template.ejs +14 -0
  50. package/src/TemplateData/externalService/functionNameConfig/templateIntTesting.ejs +31 -0
  51. package/src/TemplateData/externalService/functionNameConfig/templateYaml.ejs +10 -0
  52. package/src/TemplateData/externalService/generateTemplateData.js +79 -0
  53. package/src/TemplateData/externalService/lambdaRole/data.js +448 -0
  54. package/src/TemplateData/externalService/lambdaRole/request.json +18 -0
  55. package/src/TemplateData/externalService/lambdaRole/template.ejs +57 -0
  56. package/src/TemplateData/externalService/snsTopicSubscriptions/data.js +271 -0
  57. package/src/TemplateData/externalService/snsTopicSubscriptions/request.json +12 -0
  58. package/src/TemplateData/externalService/snsTopicSubscriptions/template.ejs +33 -0
  59. package/src/TemplateData/findData/GetByStorage/getByDynamo.ejs +54 -0
  60. package/src/TemplateData/findData/GetByStorage/getByGraph.ejs +81 -0
  61. package/src/TemplateData/findData/findDataYaml/data.js +188 -0
  62. package/src/TemplateData/findData/findDataYaml/template.ejs +14 -0
  63. package/src/TemplateData/findData/generateTemplateData.js +69 -0
  64. package/src/TemplateData/findData/handler/data.js +51 -0
  65. package/src/TemplateData/findData/handler/template.ejs +136 -0
  66. package/src/TemplateData/findData/mainFunction/data.js +316 -0
  67. package/src/TemplateData/findData/mainFunction/template.ejs +149 -0
  68. package/src/TemplateData/flowSchema/CreateRecordComplete/functionYaml/data.js +133 -0
  69. package/src/TemplateData/flowSchema/CreateRecordComplete/functionYaml/template.ejs +20 -0
  70. package/src/TemplateData/flowSchema/CreateRecordComplete/handler/data.js +68 -0
  71. package/src/TemplateData/flowSchema/CreateRecordComplete/handler/template.ejs +84 -0
  72. package/src/TemplateData/flowSchema/CreateRecordComplete/mainFunction/data.js +71 -0
  73. package/src/TemplateData/flowSchema/CreateRecordComplete/mainFunction/template.ejs +118 -0
  74. package/src/TemplateData/flowSchema/CreateRecordComplete/queue/data.js +73 -0
  75. package/src/TemplateData/flowSchema/CreateRecordComplete/queue/template.ejs +49 -0
  76. package/src/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/data.js +131 -0
  77. package/src/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/template.ejs +17 -0
  78. package/src/TemplateData/flowSchema/components/upload/confirmReserved/handler/data.js +66 -0
  79. package/src/TemplateData/flowSchema/components/upload/confirmReserved/handler/template.ejs +123 -0
  80. package/src/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/data.js +58 -0
  81. package/src/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +129 -0
  82. package/src/TemplateData/flowSchema/components/upload/confirmReserved/queue/data.js +63 -0
  83. package/src/TemplateData/flowSchema/components/upload/confirmReserved/queue/template.ejs +45 -0
  84. package/src/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js +120 -0
  85. package/src/TemplateData/flowSchema/components/upload/createObject/functionYaml/template.ejs +20 -0
  86. package/src/TemplateData/flowSchema/components/upload/createObject/handler/data.js +67 -0
  87. package/src/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +83 -0
  88. package/src/TemplateData/flowSchema/components/upload/createObject/mainFunction/data.js +68 -0
  89. package/src/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +131 -0
  90. package/src/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/data.js +120 -0
  91. package/src/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/template.ejs +17 -0
  92. package/src/TemplateData/flowSchema/components/upload/createObjectComplete/handler/data.js +65 -0
  93. package/src/TemplateData/flowSchema/components/upload/createObjectComplete/handler/template.ejs +99 -0
  94. package/src/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/data.js +63 -0
  95. package/src/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +81 -0
  96. package/src/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/data.js +69 -0
  97. package/src/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/template.ejs +49 -0
  98. package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/data.js +142 -0
  99. package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/template.ejs +18 -0
  100. package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/handler/data.js +66 -0
  101. package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/handler/template.ejs +123 -0
  102. package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/data.js +66 -0
  103. package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +262 -0
  104. package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/queue/data.js +64 -0
  105. package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/queue/template.ejs +45 -0
  106. package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/data.js +150 -0
  107. package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/template.ejs +14 -0
  108. package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/data.js +66 -0
  109. package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/template.ejs +121 -0
  110. package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/data.js +62 -0
  111. package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +172 -0
  112. package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/data.js +66 -0
  113. package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/template.ejs +53 -0
  114. package/src/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/data.js +144 -0
  115. package/src/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/template.ejs +25 -0
  116. package/src/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/data.js +53 -0
  117. package/src/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/template.ejs +50 -0
  118. package/src/TemplateData/flowSchema/components/upload/processFile/mainFunction/ProcessCsvtemplate.ejs +182 -0
  119. package/src/TemplateData/flowSchema/components/upload/processFile/mainFunction/data.js +52 -0
  120. package/src/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +66 -0
  121. package/src/TemplateData/flowSchema/components/upload/processFile/queue/data.js +77 -0
  122. package/src/TemplateData/flowSchema/components/upload/processFile/queue/dsqTemplatePath.ejs +32 -0
  123. package/src/TemplateData/flowSchema/components/upload/processFile/queue/s3Template.ejs +59 -0
  124. package/src/TemplateData/flowSchema/components/upload/relate/S3/data.js +60 -0
  125. package/src/TemplateData/flowSchema/components/upload/relate/S3/template.ejs +13 -0
  126. package/src/TemplateData/flowSchema/components/upload/relate/libs/data.js +53 -0
  127. package/src/TemplateData/flowSchema/components/upload/relate/libs/template.ejs +97 -0
  128. package/src/TemplateData/flowSchema/components/upload/relate/sns-out/data.js +67 -0
  129. package/src/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +96 -0
  130. package/src/TemplateData/flowSchema/components/websocket/connect/functionYaml/template.ejs +17 -0
  131. package/src/TemplateData/flowSchema/components/websocket/connect/handler/data.js +58 -0
  132. package/src/TemplateData/flowSchema/components/websocket/connect/handler/template.ejs +72 -0
  133. package/src/TemplateData/flowSchema/components/websocket/dynamoDb/ReservedTableData.js +68 -0
  134. package/src/TemplateData/flowSchema/components/websocket/dynamoDb/WebSocketTaskData.js +69 -0
  135. package/src/TemplateData/flowSchema/components/websocket/dynamoDb/ttlDynamoTemplate.ejs +32 -0
  136. package/src/TemplateData/flowSchema/components/websocket/dynamoDb/userUploadRecords.js +61 -0
  137. package/src/TemplateData/flowSchema/dynamoDb/data.js +117 -0
  138. package/src/TemplateData/flowSchema/eventBridge/functionYaml/data.js +172 -0
  139. package/src/TemplateData/flowSchema/eventBridge/functionYaml/template.ejs +21 -0
  140. package/src/TemplateData/flowSchema/eventBridge/handler/inv/data.js +70 -0
  141. package/src/TemplateData/flowSchema/eventBridge/handler/inv/request.json +7 -0
  142. package/src/TemplateData/flowSchema/eventBridge/handler/inv/template.ejs +60 -0
  143. package/src/TemplateData/flowSchema/eventBridge/mainFunction/data.js +68 -0
  144. package/src/TemplateData/flowSchema/eventBridge/mainFunction/request.json +5 -0
  145. package/src/TemplateData/flowSchema/eventBridge/mainFunction/template.ejs +59 -0
  146. package/src/TemplateData/flowSchema/externalTopic/Complete/functionYaml/data.js +114 -0
  147. package/src/TemplateData/flowSchema/externalTopic/Complete/functionYaml/template.ejs +20 -0
  148. package/src/TemplateData/flowSchema/externalTopic/Complete/handler/data.js +76 -0
  149. package/src/TemplateData/flowSchema/externalTopic/Complete/handler/template.ejs +81 -0
  150. package/src/TemplateData/flowSchema/externalTopic/Complete/mainFunction/data.js +70 -0
  151. package/src/TemplateData/flowSchema/externalTopic/Complete/mainFunction/template.ejs +58 -0
  152. package/src/TemplateData/flowSchema/externalTopic/Process/functionYaml/data.js +163 -0
  153. package/src/TemplateData/flowSchema/externalTopic/Process/functionYaml/template.ejs +20 -0
  154. package/src/TemplateData/flowSchema/externalTopic/Process/handler/data.js +68 -0
  155. package/src/TemplateData/flowSchema/externalTopic/Process/handler/template.ejs +101 -0
  156. package/src/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +79 -0
  157. package/src/TemplateData/flowSchema/externalTopic/sns-in-sqs/template.ejs +47 -0
  158. package/src/TemplateData/flowSchema/externalTopic/sns-out/data.js +71 -0
  159. package/src/TemplateData/flowSchema/flowSchemaMainFunction/data.js +116 -0
  160. package/src/TemplateData/flowSchema/flowSchemaMainFunction/template.ejs +92 -0
  161. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/data.js +116 -0
  162. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/template.ejs +21 -0
  163. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/data.js +70 -0
  164. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/template.ejs +81 -0
  165. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/data.js +70 -0
  166. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/template.ejs +61 -0
  167. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +152 -0
  168. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/template.ejs +17 -0
  169. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/DsqHandlerTemplate.ejs +91 -0
  170. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/SqsHandlerTemplate.ejs +87 -0
  171. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +83 -0
  172. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +116 -0
  173. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/template.ejs +18 -0
  174. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/data.js +66 -0
  175. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +107 -0
  176. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data.js +67 -0
  177. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +106 -0
  178. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +100 -0
  179. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/sqsTemplate.ejs +43 -0
  180. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +74 -0
  181. package/src/TemplateData/flowSchema/flowStep/functionYaml/data.js +157 -0
  182. package/src/TemplateData/flowSchema/flowStep/functionYaml/template.ejs +20 -0
  183. package/src/TemplateData/flowSchema/flowStep/handler/data.js +102 -0
  184. package/src/TemplateData/flowSchema/flowStep/handler/template.ejs +89 -0
  185. package/src/TemplateData/flowSchema/flowStep/mainFunction/data.js +101 -0
  186. package/src/TemplateData/flowSchema/flowStep/mainFunction/template.ejs +58 -0
  187. package/src/TemplateData/flowSchema/flowStep/sns-in/data.js +98 -0
  188. package/src/TemplateData/flowSchema/flowStep/sns-in/template.ejs +59 -0
  189. package/src/TemplateData/flowSchema/generateTemplateData.js +803 -0
  190. package/src/TemplateData/flowSchema/lambdaSync/Api/functionYaml/data.js +92 -0
  191. package/src/TemplateData/flowSchema/lambdaSync/Api/functionYaml/template.ejs +28 -0
  192. package/src/TemplateData/flowSchema/lambdaSync/Api/handler/data.js +69 -0
  193. package/src/TemplateData/flowSchema/lambdaSync/Api/handler/template.ejs +86 -0
  194. package/src/TemplateData/flowSchema/lambdaSync/Inv/functionYaml/data.js +80 -0
  195. package/src/TemplateData/flowSchema/lambdaSync/Inv/functionYaml/template.ejs +13 -0
  196. package/src/TemplateData/flowSchema/lambdaSync/Inv/handler/data.js +65 -0
  197. package/src/TemplateData/flowSchema/lambdaSync/Inv/handler/template.ejs +52 -0
  198. package/src/TemplateData/flowSchema/register/complete/functionYaml/data.js +119 -0
  199. package/src/TemplateData/flowSchema/register/complete/functionYaml/template.ejs +22 -0
  200. package/src/TemplateData/flowSchema/register/complete/handler/data.js +59 -0
  201. package/src/TemplateData/flowSchema/register/complete/handler/template.ejs +85 -0
  202. package/src/TemplateData/flowSchema/register/complete/mainFunction/data.js +63 -0
  203. package/src/TemplateData/flowSchema/register/complete/mainFunction/template.ejs +176 -0
  204. package/src/TemplateData/flowSchema/register/dynamoDB/register.js +71 -0
  205. package/src/TemplateData/flowSchema/register/sns-in/data.js +57 -0
  206. package/src/TemplateData/flowSchema/register/sns-in/template.ejs +45 -0
  207. package/src/TemplateData/flowSchema/register/subscriptionOutAll/data.js +82 -0
  208. package/src/TemplateData/flowSchema/register/subscriptionOutAll/template.ejs +13 -0
  209. package/src/TemplateData/flowSchema/register/wbs/functionYaml/data.js +112 -0
  210. package/src/TemplateData/flowSchema/register/wbs/functionYaml/template.ejs +19 -0
  211. package/src/TemplateData/flowSchema/register/wbs/handler/data.js +66 -0
  212. package/src/TemplateData/flowSchema/register/wbs/handler/template.ejs +83 -0
  213. package/src/TemplateData/flowSchema/register/wbs/mainFunction/data.js +57 -0
  214. package/src/TemplateData/flowSchema/register/wbs/mainFunction/template.ejs +165 -0
  215. package/src/TemplateData/flowSchema/statusFieldComponent/FunctionYaml/data.js +151 -0
  216. package/src/TemplateData/flowSchema/statusFieldComponent/FunctionYaml/template.ejs +22 -0
  217. package/src/TemplateData/flowSchema/statusFieldComponent/Handler/data.js +70 -0
  218. package/src/TemplateData/flowSchema/statusFieldComponent/Handler/template.ejs +86 -0
  219. package/src/TemplateData/flowSchema/statusFieldComponent/MainFunction/data.js +63 -0
  220. package/src/TemplateData/flowSchema/statusFieldComponent/MainFunction/template.ejs +80 -0
  221. package/src/TemplateData/flowSchema/statusFieldComponent/sns/data.js +63 -0
  222. package/src/TemplateData/flowSchema/statusFieldComponent/sns/template.ejs +59 -0
  223. package/src/TemplateData/flowSchema/templateByStatusType/statusFieldTemplate.ejs +30 -0
  224. package/src/TemplateData/flowSchema/templateByStatusType/storedCacheTemplate.ejs +26 -0
  225. package/src/TemplateData/flowSchema/templateByStatusType/triggerCacheTemplate.ejs +44 -0
  226. package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/functionYaml/data.js +139 -0
  227. package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/functionYaml/template.ejs +22 -0
  228. package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/data.js +70 -0
  229. package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/template.ejs +89 -0
  230. package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/mainFunction/data.js +72 -0
  231. package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/mainFunction/template.ejs +85 -0
  232. package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/functionYaml/data.js +145 -0
  233. package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/functionYaml/template.ejs +22 -0
  234. package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/data.js +74 -0
  235. package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/template.ejs +89 -0
  236. package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/mainFunction/data.js +70 -0
  237. package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/mainFunction/template.ejs +58 -0
  238. package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/functionYaml/data.js +134 -0
  239. package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/functionYaml/template.ejs +21 -0
  240. package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/data.js +70 -0
  241. package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/template.ejs +88 -0
  242. package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/data.js +69 -0
  243. package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/template.ejs +74 -0
  244. package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheQueue/data.js +83 -0
  245. package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheQueue/template.ejs +49 -0
  246. package/src/TemplateData/flowSchema/webSocketComplete/functionYaml/data.js +140 -0
  247. package/src/TemplateData/flowSchema/webSocketComplete/functionYaml/template.ejs +21 -0
  248. package/src/TemplateData/flowSchema/webSocketComplete/handler/data.js +62 -0
  249. package/src/TemplateData/flowSchema/webSocketComplete/handler/template.ejs +85 -0
  250. package/src/TemplateData/flowSchema/webSocketComplete/mainFunction/data.js +55 -0
  251. package/src/TemplateData/flowSchema/webSocketComplete/mainFunction/template.ejs +134 -0
  252. package/src/TemplateData/flowSchema/webSocketComplete/sqs/data.js +100 -0
  253. package/src/TemplateData/flowSchema/webSocketComplete/sqs/template.ejs +43 -0
  254. package/src/TemplateData/flowSchema/webSocketComplete/sqs/templateSub.ejs +7 -0
  255. package/src/TemplateData/generateRole/createSharedResource.js +469 -0
  256. package/src/TemplateData/generateRole/data.js +97 -0
  257. package/src/TemplateData/generateRole/sharedResourceTemplate.ejs +32 -0
  258. package/src/TemplateData/generateRole/template.ejs +33 -0
  259. package/src/TemplateData/perActionComplete/create/handler/data.js +61 -0
  260. package/src/TemplateData/perActionComplete/create/handler/template.ejs +126 -0
  261. package/src/TemplateData/perActionComplete/create/mainFunction/createObjectComplete_main.js +196 -0
  262. package/src/TemplateData/perActionComplete/create/mainFunction/data.js +53 -0
  263. package/src/TemplateData/perActionComplete/create/mainFunction/template.ejs +187 -0
  264. package/src/TemplateData/perActionComplete/create/sns-in-sqs/data.js +62 -0
  265. package/src/TemplateData/perActionComplete/create/sns-in-sqs/template.ejs +47 -0
  266. package/src/TemplateData/perActionComplete/create/sns-out/data.js +67 -0
  267. package/src/TemplateData/perActionComplete/create/sns-out/template.ejs +10 -0
  268. package/src/TemplateData/perActionComplete/create/yaml/data.js +110 -0
  269. package/src/TemplateData/perActionComplete/create/yaml/template.ejs +21 -0
  270. package/src/TemplateData/perActionComplete/delete/handler/data.js +61 -0
  271. package/src/TemplateData/perActionComplete/delete/handler/template.ejs +125 -0
  272. package/src/TemplateData/perActionComplete/delete/mainFunction/data.js +54 -0
  273. package/src/TemplateData/perActionComplete/delete/mainFunction/template.ejs +87 -0
  274. package/src/TemplateData/perActionComplete/delete/sns-in-sqs/data.js +63 -0
  275. package/src/TemplateData/perActionComplete/delete/sns-in-sqs/template.ejs +47 -0
  276. package/src/TemplateData/perActionComplete/delete/sns-out/data.js +67 -0
  277. package/src/TemplateData/perActionComplete/delete/yaml/data.js +108 -0
  278. package/src/TemplateData/perActionComplete/delete/yaml/template.ejs +20 -0
  279. package/src/TemplateData/perActionComplete/generateTemplateData.js +162 -0
  280. package/src/TemplateData/perActionComplete/get/handler/data.js +61 -0
  281. package/src/TemplateData/perActionComplete/get/handler/template.ejs +125 -0
  282. package/src/TemplateData/perActionComplete/get/mainFunction/data.js +53 -0
  283. package/src/TemplateData/perActionComplete/get/mainFunction/template.ejs +131 -0
  284. package/src/TemplateData/perActionComplete/get/sns-in-sqs/data.js +62 -0
  285. package/src/TemplateData/perActionComplete/get/sns-in-sqs/template.ejs +47 -0
  286. package/src/TemplateData/perActionComplete/get/sns-out/data.js +67 -0
  287. package/src/TemplateData/perActionComplete/get/yaml/data.js +111 -0
  288. package/src/TemplateData/perActionComplete/get/yaml/template.ejs +21 -0
  289. package/src/TemplateData/perActionComplete/update/handler/data.js +61 -0
  290. package/src/TemplateData/perActionComplete/update/handler/template.ejs +125 -0
  291. package/src/TemplateData/perActionComplete/update/mainFunction/data.js +53 -0
  292. package/src/TemplateData/perActionComplete/update/mainFunction/template.ejs +133 -0
  293. package/src/TemplateData/perActionComplete/update/sns-in-sqs/data.js +62 -0
  294. package/src/TemplateData/perActionComplete/update/sns-in-sqs/template.ejs +47 -0
  295. package/src/TemplateData/perActionComplete/update/sns-out/data.js +64 -0
  296. package/src/TemplateData/perActionComplete/update/yaml/data.js +111 -0
  297. package/src/TemplateData/perActionComplete/update/yaml/template.ejs +20 -0
  298. package/src/TemplateData/processLogical/generateTemplateData.js +60 -0
  299. package/src/TemplateData/processLogical/handler/data.js +50 -0
  300. package/src/TemplateData/processLogical/handler/template.ejs +127 -0
  301. package/src/TemplateData/processLogical/mainFunction/data.js +50 -0
  302. package/src/TemplateData/processLogical/mainFunction/template.ejs +424 -0
  303. package/src/TemplateData/processLogical/yaml/data.js +175 -0
  304. package/src/TemplateData/processLogical/yaml/template.ejs +12 -0
  305. package/src/TemplateData/processLogicalPagination/DsqYaml/data.js +50 -0
  306. package/src/TemplateData/processLogicalPagination/DsqYaml/template.ejs +32 -0
  307. package/src/TemplateData/processLogicalPagination/generateTemplateData.js +68 -0
  308. package/src/TemplateData/processLogicalPagination/handler/dsq/data.js +50 -0
  309. package/src/TemplateData/processLogicalPagination/handler/dsq/template.ejs +160 -0
  310. package/src/TemplateData/processLogicalPagination/handler/sqs/data.js +49 -0
  311. package/src/TemplateData/processLogicalPagination/handler/sqs/template.ejs +143 -0
  312. package/src/TemplateData/processLogicalPagination/mainFunction/data.js +49 -0
  313. package/src/TemplateData/processLogicalPagination/mainFunction/template.ejs +210 -0
  314. package/src/TemplateData/processLogicalPagination/yaml/dsq/data.js +166 -0
  315. package/src/TemplateData/processLogicalPagination/yaml/dsq/template.ejs +12 -0
  316. package/src/TemplateData/processLogicalPagination/yaml/sqs/data.js +174 -0
  317. package/src/TemplateData/processLogicalPagination/yaml/sqs/template.ejs +13 -0
  318. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/data.js +166 -0
  319. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/template.ejs +9 -0
  320. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
  321. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
  322. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
  323. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/templateByHandler/sqsTemplate.ejs +18 -0
  324. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/data.js +72 -0
  325. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/template.ejs +9 -0
  326. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/apiTemplate.ejs +153 -0
  327. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/dsqTemplate.ejs +197 -0
  328. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/invTemplate.ejs +141 -0
  329. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/sqsTemplate.ejs +181 -0
  330. package/src/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/data.js +59 -0
  331. package/src/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/template.ejs +377 -0
  332. package/src/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/data.js +75 -0
  333. package/src/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/snsTemplate.ejs +59 -0
  334. package/src/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/sqsTemplate.ejs +43 -0
  335. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/functionYaml/data.js +120 -0
  336. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/functionYaml/template.ejs +20 -0
  337. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/data.js +60 -0
  338. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/template.ejs +126 -0
  339. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/data.js +55 -0
  340. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/template.ejs +151 -0
  341. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-in-sqs/data.js +63 -0
  342. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-in-sqs/template.ejs +46 -0
  343. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-out/data.js +64 -0
  344. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-out/template.ejs +10 -0
  345. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/data.js +206 -0
  346. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/template.ejs +9 -0
  347. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/apiTemplate.ejs +21 -0
  348. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
  349. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
  350. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
  351. package/src/TemplateData/relationshipPerAction/create/action/handler/data.js +72 -0
  352. package/src/TemplateData/relationshipPerAction/create/action/handler/template.ejs +9 -0
  353. package/src/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/apiTemplate.ejs +137 -0
  354. package/src/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/dsqTemplate.ejs +179 -0
  355. package/src/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/invTemplate.ejs +123 -0
  356. package/src/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/sqsTemplate.ejs +163 -0
  357. package/src/TemplateData/relationshipPerAction/create/action/mainFunction/data.js +58 -0
  358. package/src/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +443 -0
  359. package/src/TemplateData/relationshipPerAction/create/action/sns-in-sqs/data.js +76 -0
  360. package/src/TemplateData/relationshipPerAction/create/action/sns-in-sqs/snsTemplate.ejs +59 -0
  361. package/src/TemplateData/relationshipPerAction/create/action/sns-in-sqs/sqsTemplate.ejs +43 -0
  362. package/src/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js +121 -0
  363. package/src/TemplateData/relationshipPerAction/create/complete/functionYaml/request.json +0 -0
  364. package/src/TemplateData/relationshipPerAction/create/complete/functionYaml/template.ejs +20 -0
  365. package/src/TemplateData/relationshipPerAction/create/complete/handler/sqs/data.js +60 -0
  366. package/src/TemplateData/relationshipPerAction/create/complete/handler/sqs/request.json +0 -0
  367. package/src/TemplateData/relationshipPerAction/create/complete/handler/sqs/template.ejs +126 -0
  368. package/src/TemplateData/relationshipPerAction/create/complete/mainFunction/data.js +55 -0
  369. package/src/TemplateData/relationshipPerAction/create/complete/mainFunction/request.json +0 -0
  370. package/src/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +152 -0
  371. package/src/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/data.js +62 -0
  372. package/src/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/request.json +0 -0
  373. package/src/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/template.ejs +46 -0
  374. package/src/TemplateData/relationshipPerAction/create/complete/sns-out/data.js +62 -0
  375. package/src/TemplateData/relationshipPerAction/create/complete/sns-out/request.json +0 -0
  376. package/src/TemplateData/relationshipPerAction/create/complete/sns-out/template.ejs +10 -0
  377. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/data.js +206 -0
  378. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/template.ejs +9 -0
  379. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/apiTemplate.ejs +21 -0
  380. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
  381. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
  382. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/templateByHandler/sqsTemplate.ejs +18 -0
  383. package/src/TemplateData/relationshipPerAction/delete/action/handler/data.js +72 -0
  384. package/src/TemplateData/relationshipPerAction/delete/action/handler/template.ejs +9 -0
  385. package/src/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/apiTemplate.ejs +139 -0
  386. package/src/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/dsqTemplate.ejs +182 -0
  387. package/src/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/invTemplate.ejs +124 -0
  388. package/src/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/sqsTemplate.ejs +162 -0
  389. package/src/TemplateData/relationshipPerAction/delete/action/mainFunction/data.js +58 -0
  390. package/src/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +365 -0
  391. package/src/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/data.js +76 -0
  392. package/src/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/snsTemplate.ejs +59 -0
  393. package/src/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/sqsTemplate.ejs +43 -0
  394. package/src/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js +119 -0
  395. package/src/TemplateData/relationshipPerAction/delete/complete/functionYaml/request.json +0 -0
  396. package/src/TemplateData/relationshipPerAction/delete/complete/functionYaml/template.ejs +20 -0
  397. package/src/TemplateData/relationshipPerAction/delete/complete/handler/sqs/data.js +61 -0
  398. package/src/TemplateData/relationshipPerAction/delete/complete/handler/sqs/request.json +0 -0
  399. package/src/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs +126 -0
  400. package/src/TemplateData/relationshipPerAction/delete/complete/mainFunction/data.js +55 -0
  401. package/src/TemplateData/relationshipPerAction/delete/complete/mainFunction/request.json +0 -0
  402. package/src/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +142 -0
  403. package/src/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/data.js +64 -0
  404. package/src/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/request.json +0 -0
  405. package/src/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/template.ejs +47 -0
  406. package/src/TemplateData/relationshipPerAction/delete/complete/sns-out/data.js +64 -0
  407. package/src/TemplateData/relationshipPerAction/delete/complete/sns-out/request.json +0 -0
  408. package/src/TemplateData/relationshipPerAction/delete/complete/sns-out/template.ejs +10 -0
  409. package/src/TemplateData/relationshipPerAction/generateTemplateData.js +547 -0
  410. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/data.js +205 -0
  411. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/template.ejs +9 -0
  412. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/apiTemplate.ejs +21 -0
  413. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
  414. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
  415. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/templateByHandler/sqsTemplate.ejs +18 -0
  416. package/src/TemplateData/relationshipPerAction/get/action/handler/data.js +72 -0
  417. package/src/TemplateData/relationshipPerAction/get/action/handler/template.ejs +9 -0
  418. package/src/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/apiTemplate.ejs +137 -0
  419. package/src/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/dsqTemplate.ejs +178 -0
  420. package/src/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/invTemplate.ejs +122 -0
  421. package/src/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/sqsTemplate.ejs +163 -0
  422. package/src/TemplateData/relationshipPerAction/get/action/mainFunction/data.js +57 -0
  423. package/src/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +320 -0
  424. package/src/TemplateData/relationshipPerAction/get/action/sns-in-sqs/data.js +76 -0
  425. package/src/TemplateData/relationshipPerAction/get/action/sns-in-sqs/snsTemplate.ejs +59 -0
  426. package/src/TemplateData/relationshipPerAction/get/action/sns-in-sqs/sqsTemplate.ejs +43 -0
  427. package/src/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +120 -0
  428. package/src/TemplateData/relationshipPerAction/get/complete/functionYaml/request.json +0 -0
  429. package/src/TemplateData/relationshipPerAction/get/complete/functionYaml/template.ejs +20 -0
  430. package/src/TemplateData/relationshipPerAction/get/complete/handler/sqs/data.js +62 -0
  431. package/src/TemplateData/relationshipPerAction/get/complete/handler/sqs/request.json +0 -0
  432. package/src/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs +127 -0
  433. package/src/TemplateData/relationshipPerAction/get/complete/mainFunction/data.js +56 -0
  434. package/src/TemplateData/relationshipPerAction/get/complete/mainFunction/request.json +0 -0
  435. package/src/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +144 -0
  436. package/src/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/data.js +65 -0
  437. package/src/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/request.json +0 -0
  438. package/src/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/template.ejs +47 -0
  439. package/src/TemplateData/relationshipPerAction/get/complete/sns-out/data.js +65 -0
  440. package/src/TemplateData/relationshipPerAction/get/complete/sns-out/request.json +0 -0
  441. package/src/TemplateData/relationshipPerAction/get/complete/sns-out/template.ejs +10 -0
  442. package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/data.js +172 -0
  443. package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/template.ejs +9 -0
  444. package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
  445. package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/dsqTemplate.ejs +17 -0
  446. package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
  447. package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
  448. package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/data.js +72 -0
  449. package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/template.ejs +9 -0
  450. package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/apiTemplate.ejs +155 -0
  451. package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/dsqTemplate.ejs +198 -0
  452. package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/invTemplate.ejs +143 -0
  453. package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/sqsTemplate.ejs +182 -0
  454. package/src/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/data.js +59 -0
  455. package/src/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/template.ejs +382 -0
  456. package/src/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/data.js +75 -0
  457. package/src/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/snsTemplate.ejs +59 -0
  458. package/src/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/sqsTemplate.ejs +43 -0
  459. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/functionYaml/data.js +119 -0
  460. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/functionYaml/template.ejs +20 -0
  461. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/data.js +60 -0
  462. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/template.ejs +126 -0
  463. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/data.js +58 -0
  464. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/template.ejs +156 -0
  465. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-in-sqs/data.js +64 -0
  466. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-in-sqs/template.ejs +46 -0
  467. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-out/data.js +64 -0
  468. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-out/template.ejs +10 -0
  469. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/data.js +196 -0
  470. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/template.ejs +9 -0
  471. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/apiTemplate.ejs +20 -0
  472. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/dsqTemplate.ejs +18 -0
  473. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/invTemplate.ejs +13 -0
  474. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/templateByHandler/sqsTemplate.ejs +17 -0
  475. package/src/TemplateData/relationshipPerAction/update/action/handler/data.js +73 -0
  476. package/src/TemplateData/relationshipPerAction/update/action/handler/template.ejs +9 -0
  477. package/src/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/apiTemplate.ejs +138 -0
  478. package/src/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/dsqTemplate.ejs +180 -0
  479. package/src/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/invTemplate.ejs +124 -0
  480. package/src/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/sqsTemplate.ejs +163 -0
  481. package/src/TemplateData/relationshipPerAction/update/action/mainFunction/data.js +60 -0
  482. package/src/TemplateData/relationshipPerAction/update/action/mainFunction/request.json +1 -0
  483. package/src/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +387 -0
  484. package/src/TemplateData/relationshipPerAction/update/action/sns-in-sqs/data.js +84 -0
  485. package/src/TemplateData/relationshipPerAction/update/action/sns-in-sqs/request.json +3 -0
  486. package/src/TemplateData/relationshipPerAction/update/action/sns-in-sqs/snsTemplate.ejs +59 -0
  487. package/src/TemplateData/relationshipPerAction/update/action/sns-in-sqs/sqsTemplate.ejs +43 -0
  488. package/src/TemplateData/relationshipPerAction/update/action/sns-out/data.js +67 -0
  489. package/src/TemplateData/relationshipPerAction/update/action/sns-out/request.json +3 -0
  490. package/src/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +120 -0
  491. package/src/TemplateData/relationshipPerAction/update/complete/functionYaml/request.json +3 -0
  492. package/src/TemplateData/relationshipPerAction/update/complete/functionYaml/template.ejs +21 -0
  493. package/src/TemplateData/relationshipPerAction/update/complete/handler/sqs/data.js +60 -0
  494. package/src/TemplateData/relationshipPerAction/update/complete/handler/sqs/request.json +0 -0
  495. package/src/TemplateData/relationshipPerAction/update/complete/handler/sqs/template.ejs +128 -0
  496. package/src/TemplateData/relationshipPerAction/update/complete/mainFunction/data.js +56 -0
  497. package/src/TemplateData/relationshipPerAction/update/complete/mainFunction/request.json +1 -0
  498. package/src/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +146 -0
  499. package/src/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/data.js +63 -0
  500. package/src/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/request.json +3 -0
  501. package/src/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/template.ejs +46 -0
  502. package/src/TemplateData/relationshipPerAction/update/complete/sns-out/data.js +62 -0
  503. package/src/TemplateData/relationshipPerAction/update/complete/sns-out/request.json +3 -0
  504. package/src/TemplateData/relationshipPerAction/update/complete/sns-out/template.ejs +10 -0
  505. package/src/TemplateData/resourceYaml/dynamodb/defaultDynamoDbTable.js +145 -0
  506. package/src/TemplateData/resourceYaml/dynamodb/generateDynamoPerLink.js +115 -0
  507. package/src/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +166 -0
  508. package/src/TemplateData/resourceYaml/dynamodb/template.ejs +29 -0
  509. package/src/TemplateData/resourceYaml/filterGenerateResource/data.js +126 -0
  510. package/src/TemplateData/resourceYaml/generateTemplateData.js +149 -0
  511. package/src/TemplateData/resourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +91 -0
  512. package/src/TemplateData/resourceYaml/sns-in-sqs/request.json +4 -0
  513. package/src/TemplateData/resourceYaml/sns-in-sqs/snsAndSqsPerActionData.js +85 -0
  514. package/src/TemplateData/resourceYaml/sns-in-sqs/snsTemplate.ejs +59 -0
  515. package/src/TemplateData/resourceYaml/sns-in-sqs/sqsTemplate.ejs +43 -0
  516. package/src/TemplateData/resourceYaml/sns-out/data.js +78 -0
  517. package/src/TemplateData/resourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +65 -0
  518. package/src/TemplateData/resourceYaml/sns-out/request.json +3 -0
  519. package/src/TemplateData/resourceYaml/sns-out/template.ejs +10 -0
  520. package/src/libs/Consts.js +432 -0
  521. package/src/libs/GenerateCodeLibs.js +32 -0
  522. package/src/libs/Libs.js +379 -0
  523. package/src/libs/Utils.js +140 -0
@@ -0,0 +1,155 @@
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
+
19
+
20
+ import { middlewareHandler as middleware, validatorSchema, response } from "@izara_project/izara-middleware";
21
+ import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
22
+
23
+ import <%- functionName %> from './<%- firstLetterUpperCase(functionName) %>_Main.js'
24
+
25
+ // validate event params in middleware before into function
26
+ let basicValidatorSchema = {
27
+ type: "object",
28
+ required: [
29
+ 'firstObject',
30
+ 'secondObject',
31
+ 'relType',
32
+ 'relationshipProperties',
33
+ 'relationshipDirection',
34
+ 'moveObject'
35
+ ],
36
+ properties: {
37
+ firstObject: {
38
+ type: 'object',
39
+ required: ['objType', 'identifiers'],
40
+ properties: {
41
+ objType: {
42
+ type: 'object',
43
+ required: ['objectType', 'serviceTag'],
44
+ properties: {
45
+ serviceTag: validatorSchema.stringNotEmpty(),
46
+ objectType: validatorSchema.stringNotEmpty(),
47
+ }
48
+ },
49
+ identifiers: {
50
+ type: "object",
51
+ minProperties: 1
52
+ },
53
+ }
54
+ },
55
+ secondObject: {
56
+ type: 'object',
57
+ required: ['objType', 'identifiers'],
58
+ properties: {
59
+ objType: {
60
+ type: 'object',
61
+ required: ['objectType', 'serviceTag'],
62
+ properties: {
63
+ serviceTag: validatorSchema.stringNotEmpty(),
64
+ objectType: validatorSchema.stringNotEmpty()
65
+ }
66
+ },
67
+ identifiers: {
68
+ type: "object",
69
+ minProperties: 1
70
+ },
71
+ }
72
+ },
73
+ relType: {
74
+ type: "object",
75
+ required: ['serviceTag', 'relationshipTag'],
76
+ properties: {
77
+ serviceTag: validatorSchema.stringNotEmpty(),
78
+ relationshipTag: validatorSchema.stringNotEmpty()
79
+ }
80
+ },
81
+ relationshipDirection: {
82
+ type: "string",
83
+ enum: ['from', 'to']
84
+ },
85
+ relationshipProperties: {
86
+ type: "object",
87
+ minProperties: 1
88
+ },
89
+ moveObject: {
90
+ required: ["fromObjectRef", "moveToIdentifiers"],
91
+ properties: {
92
+ fromObjectRef: {
93
+ type: "string",
94
+ enum: ["firstObject", "secondObject"]
95
+ },
96
+ moveToIdentifiers: {
97
+ type: "object",
98
+ minProperties: 1,
99
+ }
100
+ }
101
+ },
102
+ settings: {
103
+ type: 'object'
104
+ }
105
+ }
106
+ };
107
+
108
+ //(<globalVariable>
109
+ //</globalVariable>)
110
+
111
+ // validate event params in middleware before into main function
112
+ basicValidatorSchema = callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(basicValidatorSchema);
113
+ middleware.setValidatorSchema(basicValidatorSchema)
114
+ // if need to validate authorizer or additional params , add code to hook tag below
115
+
116
+ //(<afterValidateWith>)
117
+ //(</afterValidateWith>)
118
+
119
+
120
+ export const main = middleware.wrap(async (event, context) => {
121
+ event._izContext.logger.debug('Event:', event);
122
+ try {
123
+ // invoke LambdaFunction
124
+ let lambdaFunctionResponse = await <%- functionName %>(
125
+ event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId/userId
126
+ {
127
+ firstObject: event.firstObject,
128
+ secondObject: event.secondObject,
129
+ relType: event.relType,
130
+ relationshipDirection: event.relationshipDirection,
131
+ relationshipProperties: event.relationshipProperties,
132
+ moveObject: event.moveObject
133
+ },
134
+ callingFlowSharedLib.addCallingFlowToPassOnProperties(event)
135
+ );
136
+
137
+ // return error to client
138
+ if (lambdaFunctionResponse instanceof Error) {
139
+ return (izara.response.failure(lambdaFunctionResponse));
140
+ }
141
+
142
+ // return success to client
143
+ return (izara.response.success(lambdaFunctionResponse));
144
+
145
+ } catch (err) {
146
+ event._izContext.logger.error('Error, <%- functionName %>HdrApi: ', err);
147
+ return (izara.response.failure(err));
148
+ }
149
+ });
150
+ <%_ function firstLetterUpperCase(text) {
151
+ return text.charAt(0).toUpperCase() + text.slice(1)
152
+ } _%>
153
+ <%_ function firstLetterLowerCase(str) {
154
+ return str.charAt(0).toLowerCase() + str.slice(1)
155
+ } _%>
@@ -0,0 +1,198 @@
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
+
19
+
20
+ import { middlewareHandler as middleware, validatorSchema } from "@izara_project/izara-middleware";
21
+ import Logger from '@izara_project/izara-core-library-logger';
22
+ import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
23
+ import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
24
+
25
+ import <%- functionName %> from './<%- firstLetterUpperCase(functionName) %>_Main.js'
26
+
27
+ // validate event properties in body.Message of sqs event
28
+ middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema(
29
+ {
30
+ type: "object",
31
+ required: ['body', 'messageAttributes'],
32
+ properties: {
33
+ body: {
34
+ type: 'object',
35
+ },
36
+ messageAttributes: {
37
+ type: 'object'
38
+ }
39
+ }
40
+ }
41
+ ));
42
+
43
+ // validate event params in middlewware before into function.
44
+ let basicValidatorSchema = {
45
+ type: "object",
46
+ required: [
47
+ 'firstObject',
48
+ 'secondObject',
49
+ 'relType',
50
+ 'relationshipProperties',
51
+ 'relationshipDirection',
52
+ 'moveObject'
53
+ ],
54
+ properties: {
55
+ firstObject: {
56
+ type: 'object',
57
+ required: ['objType', 'identifiers'],
58
+ properties: {
59
+ objType: {
60
+ type: 'object',
61
+ required: ['objectType', 'serviceTag'],
62
+ properties: {
63
+ serviceTag: validatorSchema.stringNotEmpty(),
64
+ objectType: validatorSchema.stringNotEmpty(),
65
+ }
66
+ },
67
+ identifiers: {
68
+ type: "object",
69
+ minProperties: 1
70
+ },
71
+ }
72
+ },
73
+ secondObject: {
74
+ type: 'object',
75
+ required: ['objType', 'identifiers'],
76
+ properties: {
77
+ objType: {
78
+ type: 'object',
79
+ required: ['objectType', 'serviceTag'],
80
+ properties: {
81
+ serviceTag: validatorSchema.stringNotEmpty(),
82
+ objectType: validatorSchema.stringNotEmpty()
83
+ }
84
+ },
85
+ identifiers: {
86
+ type: "object",
87
+ minProperties: 1
88
+ },
89
+ }
90
+ },
91
+ relType: {
92
+ type: "object",
93
+ required: ['serviceTag', 'relationshipTag'],
94
+ properties: {
95
+ serviceTag: validatorSchema.stringNotEmpty(),
96
+ relationshipTag: validatorSchema.stringNotEmpty()
97
+ }
98
+ },
99
+ relationshipDirection: {
100
+ type: "string",
101
+ enum: ['from', 'to']
102
+ },
103
+ relationshipProperties: {
104
+ type: "object",
105
+ minProperties: 1
106
+ },
107
+ moveObject: {
108
+ required: ["fromObjectRef", "moveToIdentifiers"],
109
+ properties: {
110
+ fromObjectRef: {
111
+ type: "string",
112
+ enum: ["firstObject", "secondObject"]
113
+ },
114
+ moveToIdentifiers: {
115
+ type: "object",
116
+ minProperties: 1,
117
+ }
118
+ }
119
+ },
120
+ settings: {
121
+ type: 'object'
122
+ }
123
+ }
124
+ };
125
+
126
+
127
+ //(<globalVariable>
128
+ //</globalVariable>)
129
+
130
+ // validate event params in middleware before into main function
131
+ basicValidatorSchema = callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(basicValidatorSchema);
132
+ // if need to validate authorizer or additional params , add code to hook tag below
133
+
134
+ //(<afterValidateWith>)
135
+ //(</afterValidateWith>)
136
+
137
+
138
+ export const main = middleware.wrap(async (event, context) => {
139
+ Logger.debug('event:', event);
140
+ Logger.debug('context:', context);
141
+ try {
142
+
143
+ let recordPromises = []; // final return
144
+
145
+ // loop each record and send to mainFunction
146
+ await Promise.all(event.Records.map(async record => { // promise.all for map() function
147
+
148
+ // --- reforming record.body for Dsq request
149
+ record = recordHandlerSharedLib.reformatDsqMessage(record._izContext, record);
150
+ record._izContext.logger.debug('record LambdaFunctionHdrDsq after reform', record);
151
+
152
+ let passOnProperties = []
153
+
154
+ // --- validate message (and MessageAttributes)
155
+ await recordHandlerSharedLib.validateRecord(
156
+ record, // one record will send to mainFunction
157
+ "<%- queueName %>", // queue name that need to retry or send to dlq
158
+ basicValidatorSchema, // schema for record.Message
159
+ // messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
160
+ );
161
+
162
+ // add argument (to invoke lambda) to passOnProperties[]
163
+ passOnProperties.push(record.body.Message)
164
+ passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message));
165
+ //(<afterPutParamIntoMainFunction>)
166
+ //(</afterPutParamIntoMainFunction>)
167
+ record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
168
+
169
+ // call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
170
+ let recordPromise = recordHandlerSharedLib.recordHandler(
171
+ record, // one record will send to mainFunction
172
+ <%- functionName %>, // mainFunction that need to invoke.
173
+ "<%- queueName %>", // queue name that need to retry or send to dlq
174
+ passOnProperties, // all parameters that mainFunction needed.
175
+ );
176
+ record._izContext.logger.debug('after recordPromise in handler');
177
+ recordPromises.push(recordPromise); // push promise to recordPromises
178
+ })) //end record
179
+
180
+ Logger.debug('before Promise.all(recordPromises) in handler');
181
+ try {
182
+ await Promise.all(recordPromises); // await all promises
183
+ return event.Records // return all for local test
184
+ } catch {
185
+ Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
186
+ }
187
+ Logger.debug('after Promise.all(recordPromises) in handler');
188
+ } catch (err) {
189
+ Logger.error('Unhandled Error, updateRelationshipHdrDsq:', err);
190
+ throw (err);
191
+ }
192
+ });
193
+ <%_ function firstLetterUpperCase(text) {
194
+ return text.charAt(0).toUpperCase() + text.slice(1)
195
+ } _%>
196
+ <%_ function firstLetterLowerCase(str) {
197
+ return str.charAt(0).toLowerCase() + str.slice(1)
198
+ } _%>
@@ -0,0 +1,143 @@
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
+
19
+
20
+ import { middlewareHandler as middleware, validatorSchema } from "@izara_project/izara-middleware";
21
+ import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
22
+
23
+ //(<optionalRequire>)
24
+ //(</optionalRequire>)
25
+
26
+ import <%- functionName %> from './<%- firstLetterUpperCase(functionName) %>_Main.js'
27
+
28
+ // validate event params in middlewware before into function.
29
+ let basicValidatorSchema = {
30
+ type: "object",
31
+ required: [
32
+ 'firstObject',
33
+ 'secondObject',
34
+ 'relType',
35
+ 'relationshipProperties',
36
+ 'relationshipDirection',
37
+ 'moveObject'
38
+ ],
39
+ properties: {
40
+ firstObject: {
41
+ type: 'object',
42
+ required: ['objType', 'identifiers'],
43
+ properties: {
44
+ objType: {
45
+ type: 'object',
46
+ required: ['objectType', 'serviceTag'],
47
+ properties: {
48
+ serviceTag: validatorSchema.stringNotEmpty(),
49
+ objectType: validatorSchema.stringNotEmpty(),
50
+ }
51
+ },
52
+ identifiers: {
53
+ type: "object",
54
+ minProperties: 1
55
+ },
56
+ }
57
+ },
58
+ secondObject: {
59
+ type: 'object',
60
+ required: ['objType', 'identifiers'],
61
+ properties: {
62
+ objType: {
63
+ type: 'object',
64
+ required: ['objectType', 'serviceTag'],
65
+ properties: {
66
+ serviceTag: validatorSchema.stringNotEmpty(),
67
+ objectType: validatorSchema.stringNotEmpty()
68
+ }
69
+ },
70
+ identifiers: {
71
+ type: "object",
72
+ minProperties: 1
73
+ },
74
+ }
75
+ },
76
+ relType: {
77
+ type: "object",
78
+ required: ['serviceTag', 'relationshipTag'],
79
+ properties: {
80
+ serviceTag: validatorSchema.stringNotEmpty(),
81
+ relationshipTag: validatorSchema.stringNotEmpty()
82
+ }
83
+ },
84
+ relationshipDirection: {
85
+ type: "string",
86
+ enum: ['from', 'to']
87
+ },
88
+ relationshipProperties: {
89
+ type: "object",
90
+ minProperties: 1
91
+ },
92
+ moveObject: {
93
+ required: ["fromObjectRef", "moveToIdentifiers"],
94
+ properties: {
95
+ fromObjectRef: {
96
+ type: "string",
97
+ enum: ["firstObject", "secondObject"]
98
+ },
99
+ moveToIdentifiers: {
100
+ type: "object",
101
+ minProperties: 1,
102
+ }
103
+ }
104
+ },
105
+ settings: {
106
+ type: 'object'
107
+ }
108
+ }
109
+ };
110
+
111
+ basicValidatorSchema = callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(basicValidatorSchema); // is Ok callinfFlow
112
+ middleware.setValidatorSchema(basicValidatorSchema)
113
+
114
+ export const main = middleware.wrap(async (event, context) => {
115
+ event._izContext.logger.debug('Event:', event);
116
+ event._izContext.logger.debug('context:', context);
117
+
118
+ try {
119
+ // invoke LambdaFunction
120
+ return await <%- functionName %>(
121
+ event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId
122
+ {
123
+ firstObject: event.firstObject,
124
+ secondObject: event.secondObject,
125
+ relType: event.relType,
126
+ relationshipDirection: event.relationshipDirection,
127
+ relationshipProperties: event.relationshipProperties,
128
+ moveObject: event.moveObject
129
+ },
130
+ callingFlowSharedLib.addCallingFlowToPassOnProperties(event)
131
+ );
132
+
133
+ } catch (err) {
134
+ event._izContext.logger.error('Error, <%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handler) %> : ', err);
135
+ throw (err);
136
+ }
137
+ });
138
+ <%_ function firstLetterUpperCase(text) {
139
+ return text.charAt(0).toUpperCase() + text.slice(1)
140
+ } _%>
141
+ <%_ function firstLetterLowerCase(str) {
142
+ return str.charAt(0).toLowerCase() + str.slice(1)
143
+ } _%>
@@ -0,0 +1,182 @@
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
+
19
+
20
+ import { middlewareHandler as middleware, validatorSchema} from "@izara_project/izara-middleware";
21
+ import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
22
+ import Logger from '@izara_project/izara-core-library-logger';
23
+ import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
24
+
25
+ //(<optionalRequire>)
26
+ //(</optionalRequire>)
27
+
28
+ import <%- functionName %> from './<%- firstLetterUpperCase(functionName) %>_Main.js';
29
+
30
+ middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
31
+
32
+ // validate event params in middleware before into function
33
+ let basicValidatorSchema = {
34
+ type: "object",
35
+ required: [
36
+ 'firstObject',
37
+ 'secondObject',
38
+ 'relType',
39
+ 'relationshipProperties',
40
+ 'relationshipDirection',
41
+ 'moveObject'
42
+ ],
43
+ properties: {
44
+ firstObject: {
45
+ type: 'object',
46
+ required: ['objType', 'identifiers'],
47
+ properties: {
48
+ objType: {
49
+ type: 'object',
50
+ required: ['objectType', 'serviceTag'],
51
+ properties: {
52
+ serviceTag: validatorSchema.stringNotEmpty(),
53
+ objectType: validatorSchema.stringNotEmpty(),
54
+ }
55
+ },
56
+ identifiers: {
57
+ type: "object",
58
+ minProperties: 1
59
+ },
60
+ }
61
+ },
62
+ secondObject: {
63
+ type: 'object',
64
+ required: ['objType', 'identifiers'],
65
+ properties: {
66
+ objType: {
67
+ type: 'object',
68
+ required: ['objectType', 'serviceTag'],
69
+ properties: {
70
+ serviceTag: validatorSchema.stringNotEmpty(),
71
+ objectType: validatorSchema.stringNotEmpty()
72
+ }
73
+ },
74
+ identifiers: {
75
+ type: "object",
76
+ minProperties: 1
77
+ },
78
+ }
79
+ },
80
+ relType: {
81
+ type: "object",
82
+ required: ['serviceTag', 'relationshipTag'],
83
+ properties: {
84
+ serviceTag: validatorSchema.stringNotEmpty(),
85
+ relationshipTag: validatorSchema.stringNotEmpty()
86
+ }
87
+ },
88
+ relationshipDirection: {
89
+ type: "string",
90
+ enum: ['from', 'to']
91
+ },
92
+ relationshipProperties: {
93
+ type: "object",
94
+ minProperties: 1
95
+ },
96
+ moveObject: {
97
+ required: ["fromObjectRef", "moveToIdentifiers"],
98
+ properties: {
99
+ fromObjectRef: {
100
+ type: "string",
101
+ enum: ["firstObject", "secondObject"]
102
+ },
103
+ moveToIdentifiers: {
104
+ type: "object",
105
+ minProperties: 1,
106
+ }
107
+ }
108
+ },
109
+ settings: {
110
+ type: 'object'
111
+ }
112
+ }
113
+ };
114
+
115
+
116
+ //(<globalVariable>
117
+ //</globalVariable>)
118
+
119
+ // validate event params in middleware before into main function
120
+ basicValidatorSchema = callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(basicValidatorSchema);
121
+ // if need to validate authorizer or additional params , add code to hook tag below
122
+
123
+ //(<afterValidateWith>)
124
+ //(</afterValidateWith>)
125
+
126
+ export const main = middleware.wrap(async (event, context) => {
127
+
128
+ try {
129
+
130
+ let recordPromises = []; // final return
131
+
132
+ // loop each record and send to mainFunction
133
+ await Promise.all(event.Records.map(async record => { // promise.all for map() function
134
+
135
+ let passOnProperties = []
136
+
137
+ // --- validate message (and MessageAttributes)
138
+ await recordHandlerSharedLib.validateRecord(
139
+ record, // one record will send to mainFunction
140
+ "<%-firstLetterUpperCase(queueName) %>", // queue name that need to retry or send to dlq
141
+ basicValidatorSchema, // schema for record.Message
142
+ // messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
143
+ );
144
+
145
+ // add argument (to invoke lambda) to passOnProperties[]
146
+ passOnProperties.push(record.body.Message)
147
+ passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message));
148
+ //(<afterPutParamIntoMainFunction>)
149
+ //(</afterPutParamIntoMainFunction>)
150
+
151
+ record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
152
+
153
+ // call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
154
+ let recordPromise = recordHandlerSharedLib.recordHandler(
155
+ record, // one record will send to mainFunction
156
+ <%- functionName %>, // mainFunction that need to invoke.
157
+ "<%-firstLetterUpperCase(queueName) %>", // queue name that need to retry or send to dlq
158
+ passOnProperties, // all parameters that mainFunction needed.
159
+ );
160
+ record._izContext.logger.debug('after recordPromise in handler');
161
+ recordPromises.push(recordPromise); // push promise to recordPromises
162
+ })) //end record
163
+
164
+ Logger.debug('before Promise.all(recordPromises) in handler');
165
+ try {
166
+ await Promise.all(recordPromises); // await all promises
167
+ return event.Records // return all for local test
168
+ } catch {
169
+ Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
170
+ }
171
+ Logger.debug('after Promise.all(recordPromises) in handler');
172
+ } catch (err) {
173
+ Logger.error('Unhandled Error, updateRelationshipHdrDsq:', err);
174
+ throw (err);
175
+ }
176
+ });
177
+ <%_ function firstLetterUpperCase(text) {
178
+ return text.charAt(0).toUpperCase() + text.slice(1)
179
+ } _%>
180
+ <%_ function firstLetterLowerCase(str) {
181
+ return str.charAt(0).toLowerCase() + str.slice(1)
182
+ } _%>