@izara_project/izara-core-generate-service-code 1.0.46 → 1.0.48

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 (244) hide show
  1. package/fix_array.js +11 -0
  2. package/fix_imports.js +41 -0
  3. package/fix_upper.js +38 -0
  4. package/package.json +1 -1
  5. package/src/generators/fromExternalService/externalServiceComponent/functionNameConfig/template.ejs +2 -2
  6. package/src/generators/fromExternalService/externalServiceComponent/functionNameConfig/templateIntTesting.ejs +1 -1
  7. package/src/generators/fromExternalService/externalServiceComponent/functionNameConfig/templateYaml.ejs +1 -1
  8. package/src/generators/fromFlowSchema/events/eventBridge/functionYaml/yaml.js +5 -1
  9. package/src/generators/fromFlowSchema/events/eventBridge/handler/inv/inv.js +5 -1
  10. package/src/generators/fromFlowSchema/events/eventBridge/mainFunction/main.js +13 -3
  11. package/src/generators/fromFlowSchema/events/eventBridge/mainFunction/template.ejs +1 -1
  12. package/src/generators/fromFlowSchema/events/extTopic/process/functionYaml/yaml.js +6 -1
  13. package/src/generators/fromFlowSchema/events/extTopic/process/handler/handler.js +4 -1
  14. package/src/generators/fromFlowSchema/events/extTopic/sns-in-sqs/template.ejs +3 -6
  15. package/src/generators/fromFlowSchema/events/lambdaSyncApi/functionYaml/yaml.js +6 -1
  16. package/src/generators/fromFlowSchema/events/lambdaSyncApi/handler/handler.js +5 -1
  17. package/src/generators/fromFlowSchema/events/lambdaSyncInv/functionYaml/yaml.js +5 -1
  18. package/src/generators/fromFlowSchema/events/lambdaSyncInv/handler/handler.js +3 -1
  19. package/src/generators/fromFlowSchema/events/ownTopic/endpoint/functionYaml/yaml.js +5 -1
  20. package/src/generators/fromFlowSchema/events/ownTopic/endpoint/handler/handler.js +5 -2
  21. package/src/generators/fromFlowSchema/events/ownTopic/flowSchema/handler/handler.js +3 -1
  22. package/src/generators/fromFlowSchema/events/ownTopic/flowSchema/handler/template.ejs +1 -1
  23. package/src/generators/fromFlowSchema/events/ownTopic/flowSchema/mainFunction/main.js +2 -1
  24. package/src/generators/fromFlowSchema/events/s3/flowSchemaMainFunction/main.js +3 -1
  25. package/src/generators/fromFlowSchema/events/s3/upload/confirmReserved/functionYaml/template.ejs +5 -9
  26. package/src/generators/fromFlowSchema/events/s3/upload/confirmReserved/functionYaml/yaml.js +20 -9
  27. package/src/generators/fromFlowSchema/events/s3/upload/confirmReserved/handler/handler.js +3 -1
  28. package/src/generators/fromFlowSchema/events/s3/upload/confirmReserved/queue/template.ejs +2 -5
  29. package/src/generators/fromFlowSchema/events/s3/upload/createObject/functionYaml/template.ejs +3 -7
  30. package/src/generators/fromFlowSchema/events/s3/upload/createObject/functionYaml/yaml.js +24 -8
  31. package/src/generators/fromFlowSchema/events/s3/upload/createObject/handler/handler.js +3 -1
  32. package/src/generators/fromFlowSchema/events/s3/upload/createObject/mainFunction/main.js +2 -1
  33. package/src/generators/fromFlowSchema/events/s3/upload/createObjectComplete/functionYaml/template.ejs +4 -8
  34. package/src/generators/fromFlowSchema/events/s3/upload/createObjectComplete/functionYaml/yaml.js +26 -9
  35. package/src/generators/fromFlowSchema/events/s3/upload/createObjectComplete/handler/handler.js +3 -1
  36. package/src/generators/fromFlowSchema/events/s3/upload/createObjectComplete/mainFunction/main.js +2 -1
  37. package/src/generators/fromFlowSchema/events/s3/upload/createObjectComplete/sns-sqs/template.ejs +2 -5
  38. package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/functionYaml/template.ejs +5 -9
  39. package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/functionYaml/yaml.js +27 -9
  40. package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/handler/handler.js +3 -1
  41. package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/mainFunction/main.js +2 -1
  42. package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/createPreSignUrl/queue/template.ejs +2 -5
  43. package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/reservedLimit/functionYaml/template.ejs +4 -8
  44. package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/reservedLimit/functionYaml/yaml.js +27 -9
  45. package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/reservedLimit/handler/handler.js +3 -1
  46. package/src/generators/fromFlowSchema/events/s3/upload/preSignUrl/reservedLimit/sqs/template.ejs +3 -6
  47. package/src/generators/fromFlowSchema/events/s3/upload/processFile/functionYml/HdrS3/template.ejs +3 -7
  48. package/src/generators/fromFlowSchema/events/s3/upload/processFile/functionYml/HdrS3/yaml.js +24 -8
  49. package/src/generators/fromFlowSchema/events/s3/upload/processFile/queue/s3Template.ejs +2 -5
  50. package/src/generators/fromFlowSchema/flowSchemaMainFunction/main.js +3 -1
  51. package/src/generators/fromFlowSchema/flowStep/firstFlowStep/templateResource.ejs +2 -5
  52. package/src/generators/fromFlowSchema/flowStep/flowStep.js +14 -3
  53. package/src/generators/fromFlowSchema/index.js +58 -21
  54. package/src/generators/fromFlowSchema/register/complete/functionYaml/yaml.js +6 -1
  55. package/src/generators/fromFlowSchema/register/complete/handler/handler.js +5 -1
  56. package/src/generators/fromFlowSchema/register/complete/handler/template.ejs +3 -3
  57. package/src/generators/fromFlowSchema/register/dynamoDB/register.js +6 -1
  58. package/src/generators/fromFlowSchema/register/sns-in/snsIn.js +5 -2
  59. package/src/generators/fromFlowSchema/register/sns-in/template.ejs +3 -6
  60. package/src/generators/fromFlowSchema/register/subscriptionOutAll/subscriptionOutAll.js +2 -1
  61. package/src/generators/fromFlowSchema/register/subscriptionOutAll/template.ejs +0 -3
  62. package/src/generators/fromFlowSchema/register/wbs/functionYaml/yaml.js +4 -1
  63. package/src/generators/fromFlowSchema/register/wbs/handler/handler.js +2 -1
  64. package/src/generators/fromFlowSchema/statusTypes/statusField/functionYaml/template.ejs +3 -7
  65. package/src/generators/fromFlowSchema/statusTypes/statusField/functionYaml/yaml.js +27 -9
  66. package/src/generators/fromFlowSchema/statusTypes/statusField/handler/handler.js +4 -1
  67. package/src/generators/fromFlowSchema/statusTypes/statusField/mainFunction/main.js +2 -1
  68. package/src/generators/fromFlowSchema/statusTypes/triggerCache/checkTriggerCacheComplete/functionYaml/template.ejs +3 -7
  69. package/src/generators/fromFlowSchema/statusTypes/triggerCache/checkTriggerCacheComplete/functionYaml/yaml.js +27 -9
  70. package/src/generators/fromFlowSchema/statusTypes/triggerCache/checkTriggerCacheComplete/handler/handler.js +3 -1
  71. package/src/generators/fromFlowSchema/statusTypes/triggerCache/checkTriggerCacheComplete/mainFunction/main.js +3 -1
  72. package/src/generators/fromFlowSchema/statusTypes/triggerCache/processTriggerCache/functionYaml/template.ejs +3 -7
  73. package/src/generators/fromFlowSchema/statusTypes/triggerCache/processTriggerCache/functionYaml/yaml.js +27 -9
  74. package/src/generators/fromFlowSchema/statusTypes/triggerCache/processTriggerCache/handler/handler.js +3 -1
  75. package/src/generators/fromFlowSchema/statusTypes/triggerCache/processTriggerCache/mainFunction/main.js +2 -1
  76. package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/functionYaml/dsq/dsq.js +27 -9
  77. package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/functionYaml/dsq/template.ejs +3 -7
  78. package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/functionYaml/sqs/sqs.js +27 -9
  79. package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/functionYaml/sqs/template.ejs +3 -7
  80. package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/handler/dsq/dsq.js +3 -1
  81. package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/handler/sqs/sqs.js +3 -1
  82. package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheComplete/mainFunction/main.js +3 -1
  83. package/src/generators/fromFlowSchema/statusTypes/triggerCache/triggerCacheQueue/template.ejs +2 -5
  84. package/src/generators/fromFlowSchema/webSocket/webSocket/connect/functionYaml/yaml.js +4 -1
  85. package/src/generators/fromFlowSchema/webSocket/webSocket/connect/handler/handler.js +4 -1
  86. package/src/generators/fromFlowSchema/webSocket/webSocket/dynamoDb/WebSocketTaskData.js +3 -4
  87. package/src/generators/fromFlowSchema/webSocket/webSocket/dynamoDb/template.ejs +28 -0
  88. package/src/generators/fromFlowSchema/webSocket/webSocket/dynamoDb/ttlDynamoTemplate.ejs +2 -5
  89. package/src/generators/fromFlowSchema/webSocket/webSocketComplete/functionYaml/yaml.js +7 -1
  90. package/src/generators/fromFlowSchema/webSocket/webSocketComplete/handler/handler.js +4 -1
  91. package/src/generators/fromFlowSchema/webSocket/webSocketComplete/mainFunction/main.js +4 -1
  92. package/src/generators/fromFlowSchema/webSocket/webSocketComplete/sqs/sqs.js +8 -2
  93. package/src/generators/fromFlowSchema/webSocket/webSocketComplete/sqs/template.ejs +3 -6
  94. package/src/generators/fromObjectSchema/endpoint/index.js +2 -1
  95. package/src/generators/fromObjectSchema/endpoint/main/beforeLogical/beforeLogical.js +4 -1
  96. package/src/generators/fromObjectSchema/endpoint/main/create/create.js +4 -1
  97. package/src/generators/fromObjectSchema/endpoint/main/delete/delete.js +2 -1
  98. package/src/generators/fromObjectSchema/endpoint/main/get/get.js +2 -1
  99. package/src/generators/fromObjectSchema/endpoint/main/update/update.js +2 -1
  100. package/src/generators/fromObjectSchema/endpointComplete/create/handler/handler.js +2 -1
  101. package/src/generators/fromObjectSchema/endpointComplete/create/sns-in-sqs/template.ejs +3 -6
  102. package/src/generators/fromObjectSchema/endpointComplete/create/sns-out/snsOut.js +4 -1
  103. package/src/generators/fromObjectSchema/endpointComplete/create/sns-out/template.ejs +3 -5
  104. package/src/generators/fromObjectSchema/endpointComplete/create/yaml/template.ejs +5 -9
  105. package/src/generators/fromObjectSchema/endpointComplete/create/yaml/yaml.js +17 -2
  106. package/src/generators/fromObjectSchema/endpointComplete/delete/handler/handler.js +8 -2
  107. package/src/generators/fromObjectSchema/endpointComplete/delete/handler/template.ejs +3 -6
  108. package/src/generators/fromObjectSchema/endpointComplete/delete/sns-in-sqs/template.ejs +3 -6
  109. package/src/generators/fromObjectSchema/endpointComplete/delete/yaml/template.ejs +5 -9
  110. package/src/generators/fromObjectSchema/endpointComplete/delete/yaml/yaml.js +17 -2
  111. package/src/generators/fromObjectSchema/endpointComplete/get/handler/handler.js +8 -2
  112. package/src/generators/fromObjectSchema/endpointComplete/get/handler/template.ejs +3 -6
  113. package/src/generators/fromObjectSchema/endpointComplete/get/sns-in-sqs/template.ejs +3 -6
  114. package/src/generators/fromObjectSchema/endpointComplete/get/yaml/template.ejs +5 -9
  115. package/src/generators/fromObjectSchema/endpointComplete/get/yaml/yaml.js +17 -2
  116. package/src/generators/fromObjectSchema/endpointComplete/update/handler/handler.js +8 -2
  117. package/src/generators/fromObjectSchema/endpointComplete/update/handler/template.ejs +3 -6
  118. package/src/generators/fromObjectSchema/endpointComplete/update/sns-in-sqs/template.ejs +3 -6
  119. package/src/generators/fromObjectSchema/endpointComplete/update/yaml/template.ejs +5 -9
  120. package/src/generators/fromObjectSchema/endpointComplete/update/yaml/yaml.js +17 -2
  121. package/src/generators/fromObjectSchema/findData/findDataYaml/findDataYaml.js +12 -3
  122. package/src/generators/fromObjectSchema/findData/findDataYaml/template.ejs +7 -11
  123. package/src/generators/fromObjectSchema/processLogical/yaml/template.ejs +4 -6
  124. package/src/generators/fromObjectSchema/processLogical/yaml/yaml.js +24 -6
  125. package/src/generators/fromObjectSchema/processLogicalPagination/yaml/dsq/dsq.js +24 -6
  126. package/src/generators/fromObjectSchema/processLogicalPagination/yaml/dsq/template.ejs +4 -6
  127. package/src/generators/fromObjectSchema/processLogicalPagination/yaml/sqs/sqs.js +24 -6
  128. package/src/generators/fromObjectSchema/processLogicalPagination/yaml/sqs/template.ejs +6 -8
  129. package/src/generators/fromObjectSchema/rbac/lambda/handler/handler.js +4 -1
  130. package/src/generators/fromObjectSchema/rbac/lambda/mainFunction/main.js +3 -2
  131. package/src/generators/fromObjectSchema/rbac/lambda/yaml/yaml.js +4 -1
  132. package/src/generators/fromObjectSchema/relationship/changeRelationship/action/functionYaml/template.ejs +5 -9
  133. package/src/generators/fromObjectSchema/relationship/changeRelationship/action/functionYaml/yaml.js +25 -6
  134. package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/handler.js +4 -1
  135. package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/templateByHandler/apiTemplate.ejs +1 -4
  136. package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/templateByHandler/dsqTemplate.ejs +2 -5
  137. package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/templateByHandler/invTemplate.ejs +2 -5
  138. package/src/generators/fromObjectSchema/relationship/changeRelationship/action/handler/templateByHandler/sqsTemplate.ejs +4 -7
  139. package/src/generators/fromObjectSchema/relationship/changeRelationship/action/mainFunction/main.js +2 -1
  140. package/src/generators/fromObjectSchema/relationship/changeRelationship/action/sns-in-sqs/snsTemplate.ejs +2 -5
  141. package/src/generators/fromObjectSchema/relationship/changeRelationship/action/sns-in-sqs/sqsTemplate.ejs +2 -5
  142. package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/functionYaml/template.ejs +7 -11
  143. package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/functionYaml/yaml.js +23 -5
  144. package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/sns-in-sqs/template.ejs +3 -6
  145. package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/sns-out/snsOut.js +4 -1
  146. package/src/generators/fromObjectSchema/relationship/changeRelationship/complete/sns-out/template.ejs +3 -5
  147. package/src/generators/fromObjectSchema/relationship/create/action/functionYaml/template.ejs +5 -9
  148. package/src/generators/fromObjectSchema/relationship/create/action/functionYaml/yaml.js +25 -6
  149. package/src/generators/fromObjectSchema/relationship/create/action/handler/handler.js +4 -1
  150. package/src/generators/fromObjectSchema/relationship/create/action/handler/templateByHandler/apiTemplate.ejs +1 -4
  151. package/src/generators/fromObjectSchema/relationship/create/action/handler/templateByHandler/dsqTemplate.ejs +2 -5
  152. package/src/generators/fromObjectSchema/relationship/create/action/handler/templateByHandler/invTemplate.ejs +2 -5
  153. package/src/generators/fromObjectSchema/relationship/create/action/handler/templateByHandler/sqsTemplate.ejs +4 -7
  154. package/src/generators/fromObjectSchema/relationship/create/action/mainFunction/main.js +2 -1
  155. package/src/generators/fromObjectSchema/relationship/create/action/sns-in-sqs/snsTemplate.ejs +2 -5
  156. package/src/generators/fromObjectSchema/relationship/create/action/sns-in-sqs/sqsTemplate.ejs +2 -5
  157. package/src/generators/fromObjectSchema/relationship/create/complete/functionYaml/template.ejs +7 -11
  158. package/src/generators/fromObjectSchema/relationship/create/complete/functionYaml/yaml.js +23 -5
  159. package/src/generators/fromObjectSchema/relationship/create/complete/sns-in-sqs/template.ejs +3 -6
  160. package/src/generators/fromObjectSchema/relationship/create/complete/sns-out/snsOut.js +4 -1
  161. package/src/generators/fromObjectSchema/relationship/create/complete/sns-out/template.ejs +3 -5
  162. package/src/generators/fromObjectSchema/relationship/delete/action/functionYaml/template.ejs +5 -9
  163. package/src/generators/fromObjectSchema/relationship/delete/action/functionYaml/yaml.js +26 -6
  164. package/src/generators/fromObjectSchema/relationship/delete/action/handler/handler.js +4 -1
  165. package/src/generators/fromObjectSchema/relationship/delete/action/handler/templateByHandler/apiTemplate.ejs +1 -4
  166. package/src/generators/fromObjectSchema/relationship/delete/action/handler/templateByHandler/dsqTemplate.ejs +2 -5
  167. package/src/generators/fromObjectSchema/relationship/delete/action/handler/templateByHandler/invTemplate.ejs +2 -5
  168. package/src/generators/fromObjectSchema/relationship/delete/action/handler/templateByHandler/sqsTemplate.ejs +3 -6
  169. package/src/generators/fromObjectSchema/relationship/delete/action/mainFunction/main.js +2 -1
  170. package/src/generators/fromObjectSchema/relationship/delete/action/sns-in-sqs/snsTemplate.ejs +2 -5
  171. package/src/generators/fromObjectSchema/relationship/delete/action/sns-in-sqs/sqsTemplate.ejs +2 -5
  172. package/src/generators/fromObjectSchema/relationship/delete/complete/functionYaml/template.ejs +7 -11
  173. package/src/generators/fromObjectSchema/relationship/delete/complete/functionYaml/yaml.js +23 -5
  174. package/src/generators/fromObjectSchema/relationship/delete/complete/sns-in-sqs/template.ejs +3 -6
  175. package/src/generators/fromObjectSchema/relationship/delete/complete/sns-out/snsOut.js +4 -1
  176. package/src/generators/fromObjectSchema/relationship/delete/complete/sns-out/template.ejs +3 -5
  177. package/src/generators/fromObjectSchema/relationship/get/action/functionYaml/template.ejs +5 -9
  178. package/src/generators/fromObjectSchema/relationship/get/action/functionYaml/yaml.js +25 -6
  179. package/src/generators/fromObjectSchema/relationship/get/action/handler/handler.js +4 -1
  180. package/src/generators/fromObjectSchema/relationship/get/action/handler/templateByHandler/apiTemplate.ejs +1 -4
  181. package/src/generators/fromObjectSchema/relationship/get/action/handler/templateByHandler/dsqTemplate.ejs +2 -5
  182. package/src/generators/fromObjectSchema/relationship/get/action/handler/templateByHandler/invTemplate.ejs +2 -5
  183. package/src/generators/fromObjectSchema/relationship/get/action/handler/templateByHandler/sqsTemplate.ejs +4 -7
  184. package/src/generators/fromObjectSchema/relationship/get/action/mainFunction/main.js +2 -1
  185. package/src/generators/fromObjectSchema/relationship/get/action/sns-in-sqs/snsTemplate.ejs +2 -5
  186. package/src/generators/fromObjectSchema/relationship/get/action/sns-in-sqs/sqsTemplate.ejs +2 -5
  187. package/src/generators/fromObjectSchema/relationship/get/complete/functionYaml/template.ejs +7 -11
  188. package/src/generators/fromObjectSchema/relationship/get/complete/functionYaml/yaml.js +23 -5
  189. package/src/generators/fromObjectSchema/relationship/get/complete/sns-in-sqs/template.ejs +3 -6
  190. package/src/generators/fromObjectSchema/relationship/get/complete/sns-out/snsOut.js +4 -1
  191. package/src/generators/fromObjectSchema/relationship/get/complete/sns-out/template.ejs +3 -5
  192. package/src/generators/fromObjectSchema/relationship/moveRelationship/action/functionYaml/template.ejs +5 -9
  193. package/src/generators/fromObjectSchema/relationship/moveRelationship/action/functionYaml/yaml.js +25 -6
  194. package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/handler.js +4 -1
  195. package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/templateByHandler/apiTemplate.ejs +1 -4
  196. package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/templateByHandler/dsqTemplate.ejs +2 -5
  197. package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/templateByHandler/invTemplate.ejs +2 -5
  198. package/src/generators/fromObjectSchema/relationship/moveRelationship/action/handler/templateByHandler/sqsTemplate.ejs +4 -7
  199. package/src/generators/fromObjectSchema/relationship/moveRelationship/action/mainFunction/main.js +2 -1
  200. package/src/generators/fromObjectSchema/relationship/moveRelationship/action/sns-in-sqs/snsTemplate.ejs +2 -5
  201. package/src/generators/fromObjectSchema/relationship/moveRelationship/action/sns-in-sqs/sqsTemplate.ejs +2 -5
  202. package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/functionYaml/template.ejs +7 -11
  203. package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/functionYaml/yaml.js +23 -5
  204. package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/mainFunction/main.js +2 -1
  205. package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/sns-in-sqs/template.ejs +3 -6
  206. package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/sns-out/snsOut.js +4 -1
  207. package/src/generators/fromObjectSchema/relationship/moveRelationship/complete/sns-out/template.ejs +3 -5
  208. package/src/generators/fromObjectSchema/relationship/update/action/functionYaml/template.ejs +5 -9
  209. package/src/generators/fromObjectSchema/relationship/update/action/functionYaml/yaml.js +25 -6
  210. package/src/generators/fromObjectSchema/relationship/update/action/handler/handler.js +4 -1
  211. package/src/generators/fromObjectSchema/relationship/update/action/handler/templateByHandler/apiTemplate.ejs +1 -4
  212. package/src/generators/fromObjectSchema/relationship/update/action/handler/templateByHandler/dsqTemplate.ejs +2 -5
  213. package/src/generators/fromObjectSchema/relationship/update/action/handler/templateByHandler/invTemplate.ejs +2 -5
  214. package/src/generators/fromObjectSchema/relationship/update/action/handler/templateByHandler/sqsTemplate.ejs +1 -4
  215. package/src/generators/fromObjectSchema/relationship/update/action/mainFunction/main.js +2 -1
  216. package/src/generators/fromObjectSchema/relationship/update/action/sns-in-sqs/snsTemplate.ejs +2 -5
  217. package/src/generators/fromObjectSchema/relationship/update/action/sns-in-sqs/sqsTemplate.ejs +2 -5
  218. package/src/generators/fromObjectSchema/relationship/update/complete/functionYaml/template.ejs +7 -11
  219. package/src/generators/fromObjectSchema/relationship/update/complete/functionYaml/yaml.js +23 -5
  220. package/src/generators/fromObjectSchema/relationship/update/complete/sns-in-sqs/template.ejs +2 -5
  221. package/src/generators/fromObjectSchema/relationship/update/complete/sns-out/template.ejs +3 -5
  222. package/src/generators/fromObjectSchema/textTag/systemText/systemText.js +13 -13
  223. package/src/generators/fromPlugIn/afterFirstFlowStep/recievePlugIn/mainFunction/main.js +3 -2
  224. package/src/generators/fromPlugIn/afterFirstFlowStep/recievePlugIn/yaml/yaml.js +3 -1
  225. package/src/generators/fromPlugIn/byConfig/mainFunction/templateAwaitingStep.ejs +1 -4
  226. package/src/generators/fromPlugIn/byConfig/sns-sqs/queueNoTopic.ejs +2 -5
  227. package/src/generators/fromPlugIn/byConfig/sns-sqs/snsSqs.js +8 -2
  228. package/src/generators/fromPlugIn/byConfig/sns-sqs/snsTemplate.ejs +2 -5
  229. package/src/generators/fromPlugIn/byConfig/sns-sqs/sqsTemplate.ejs +2 -5
  230. package/src/generators/fromPlugIn/firstFlowStep/mainFunction/templateByConfig/awaitingSteps.ejs +3 -6
  231. package/src/generators/fromPlugIn/firstFlowStep/queueNtopic/dsqTemplate.ejs +2 -5
  232. package/src/generators/fromPlugIn/firstFlowStep/queueNtopic/queueNtopic.js +5 -1
  233. package/src/generators/fromPlugIn/firstFlowStep/queueNtopic/snsTemplate.ejs +15 -18
  234. package/src/generators/fromPlugIn/firstFlowStep/queueNtopic/sqsTemplate.ejs +2 -5
  235. package/src/generators/fromPlugIn/firstFlowStep/topicOut/topicOut.js +5 -2
  236. package/src/generators/fromPlugIn/index.js +150 -155
  237. package/src/generators/resourceYamlComponent/dynamodb/template.ejs +2 -8
  238. package/src/generators/resourceYamlComponent/sns-in-sqs/snsTemplate.ejs +2 -5
  239. package/src/generators/resourceYamlComponent/sns-in-sqs/sqsTemplate.ejs +2 -5
  240. package/src/generators/roles/roleNameConfig/template.ejs +2 -2
  241. package/src/generators/roles/roleNameConfig/templateIntTesting.ejs +1 -1
  242. package/src/generators/roles/roleNameConfig/templateYaml.ejs +1 -1
  243. package/src/generators/roles/sharedResource/sharedResource.js +7 -1
  244. package/src/libs/Utils.js +4 -2
@@ -25,7 +25,7 @@ import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record
25
25
  //(<optionalRequire>)
26
26
  //(</optionalRequire>)
27
27
 
28
- import <%- functionName %> from './<%- firstLetterUpperCase(functionName) %>_Main.js';
28
+ import <%- functionName %> from './<%- upperFunctionName %>_Main.js';
29
29
 
30
30
  middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
31
31
 
@@ -136,7 +136,7 @@ let validator = {
136
136
  // --- validate message (and MessageAttributes)
137
137
  await recordHandlerSharedLib.validateRecord(
138
138
  record, // one record will send to mainFunction
139
- "<%-firstLetterUpperCase(queueName) %>", // queue name that need to retry or send to dlq
139
+ "<%- queueName %>", // queue name that need to retry or send to dlq
140
140
  validator, // schema for record.Message
141
141
  // messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
142
142
  );
@@ -153,7 +153,7 @@ let validator = {
153
153
  let recordPromise = recordHandlerSharedLib.recordHandler(
154
154
  record, // one record will send to mainFunction
155
155
  <%- functionName %> , // mainFunction that need to invoke.
156
- "<%-firstLetterUpperCase(queueName) %>", // queue name that need to retry or send to dlq
156
+ "<%- queueName %>", // queue name that need to retry or send to dlq
157
157
  passOnProperties, // all parameters that mainFunction needed.
158
158
  );
159
159
  record._izContext.logger.debug('after recordPromise in handler');
@@ -173,9 +173,6 @@ let validator = {
173
173
  throw (err);
174
174
  }
175
175
  });
176
- <%_ function firstLetterUpperCase(text) {
177
- return text.charAt(0).toUpperCase() + text.slice(1)
178
- } _%>
179
- <%_ function firstLetterLowerCase(str) {
176
+ <%_ function firstLetterLowerCase(str) {
180
177
  return str.charAt(0).toLowerCase() + str.slice(1)
181
178
  } _%>
@@ -46,7 +46,8 @@ function createParamForCreateSource(srcPath) {
46
46
  return {
47
47
  templatePath: templatePath,
48
48
  templateData: {
49
- functionName
49
+ functionName,
50
+ upperFunctionName: upperCase(functionName)
50
51
  },
51
52
  setting: {
52
53
  savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
@@ -48,12 +48,9 @@
48
48
  Action: "SQS:SendMessage"
49
49
  Queues:
50
50
  - Ref: <%- queueName %>HdrSqs
51
- #<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
52
- #<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
51
+ #<#<%- queueName %>QueueSetting#>
52
+ #<#/<%- queueName %>QueueSetting#>
53
53
 
54
- <%_ function firstLetterUpperCase(text){
55
- return text.charAt(0).toUpperCase() + text.slice(1)
56
- } _%>
57
54
  <%_ function firstLetterLowerCase(str) {
58
55
  return str.charAt(0).toLowerCase() + str.slice(1)
59
56
  } _%>
@@ -32,12 +32,9 @@
32
32
  Action: "SQS:SendMessage"
33
33
  Queues:
34
34
  - Ref: <%- queueName %>
35
- #<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
36
- #<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
35
+ #<#<%- queueName %>QueueSetting#>
36
+ #<#/<%- queueName %>QueueSetting#>
37
37
 
38
- <%_ function firstLetterUpperCase(text){
39
- return text.charAt(0).toUpperCase() + text.slice(1)
40
- } _%>
41
38
  <%_ function firstLetterLowerCase(str) {
42
39
  return str.charAt(0).toLowerCase() + str.slice(1)
43
40
  } _%>
@@ -1,20 +1,16 @@
1
- <%_ const join = require('path').join; _%>
2
- <%- firstLetterUpperCase(functionNameConfig) %>:
3
- handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
4
- name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
1
+ <%- functionNameConfig %>:
2
+ handler: <%- handlerPathUpperFunctionName %>
3
+ name: ${self:custom.iz_resourcePrefix}<%- upperFunctionName %>
5
4
  role: <%- roleName %>Role
6
- #<#<%- functionName %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
7
- #<#/<%- functionName %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
5
+ #<#<%- functionName %><%- upperHandlerType %>FunctionSetting#>
6
+ #<#/<%- functionName %><%- upperHandlerType %>FunctionSetting#>
8
7
  events:
9
8
  - sqs:
10
- arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
9
+ arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- upperFunctionName %>
11
10
  batchSize: 10
12
11
  filterPatterns: #**** need to update serverless framework upper v.2.69.1
13
- - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-firstLetterUpperCase(functionName) %>"]}}} # functionName of callingFlow
12
+ - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- upperFunctionName %>"]}}} # functionName of callingFlow
14
13
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
15
- <%_ function firstLetterUpperCase(text){
16
- return text.charAt(0).toUpperCase() + text.slice(1)
17
- } _%>
18
14
  <%_ function firstLetterLowerCase(str) {
19
15
  return str.charAt(0).toLowerCase() + str.slice(1)
20
16
  } _%>
@@ -97,17 +97,35 @@ function createParamForCreateSource(srcPath) {
97
97
 
98
98
  additionalResourcePermission.push(awaitingMultipleStepsRole());
99
99
 
100
+ const resourceLocation = SOURCE_PATH.resourceLocationRelationshipPerAction;
101
+
102
+ const functionNameConfig = upperCase(
103
+ SHORT_FUNCTION_NAME(FUNCTION_NAME.changeRelComplete)
104
+ );
105
+
106
+ const roleName = SOURCE_GENERATE_IAM_ROLE.RelationshipCompleteRole;
107
+ const upperFunctionName = upperCase(functionName);
108
+ const upperHandlerType = upperCase(handlerType);
109
+ const upperFunctionNameConfig = upperCase(functionNameConfig);
110
+ const upperRoleName = upperCase(roleName);
111
+ const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
112
+ const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
113
+
100
114
  return {
101
115
  templatePath: templatePath,
102
116
  templateData: {
103
117
  functionName,
104
118
  handlerType,
105
119
  additionalResourcePermission,
106
- resourceLocation: SOURCE_PATH.resourceLocationRelationshipPerAction,
107
- functionNameConfig: upperCase(
108
- SHORT_FUNCTION_NAME(FUNCTION_NAME.changeRelComplete)
109
- ),
110
- roleName: SOURCE_GENERATE_IAM_ROLE.RelationshipCompleteRole
120
+ resourceLocation,
121
+ functionNameConfig,
122
+ roleName,
123
+ upperFunctionName,
124
+ upperHandlerType,
125
+ upperFunctionNameConfig,
126
+ upperRoleName,
127
+ handlerPath,
128
+ handlerPathUpperFunctionName
111
129
  },
112
130
  setting: {
113
131
  savePath: path.join(srcPath, SOURCE_PATH.appYaml),
@@ -34,13 +34,10 @@
34
34
  Action: "SQS:SendMessage"
35
35
  Queues:
36
36
  - Ref: <%- queueName %>
37
- #<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
38
- #<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
37
+ #<#<%- queueName %>QueueSetting#>
38
+ #<#/<%- queueName %>QueueSetting#>
39
39
 
40
40
 
41
- <%_ function firstLetterUpperCase(text){
42
- return text.charAt(0).toUpperCase() + text.slice(1)
43
- } _%>
44
- <%_ function firstLetterLowerCase(str) {
41
+ <%_ function firstLetterLowerCase(str) {
45
42
  return str.charAt(0).toLowerCase() + str.slice(1)
46
43
  } _%>
@@ -46,10 +46,13 @@ function createDefaultSnsOut(_izContext, srcPath) {
46
46
 
47
47
  function createParamsForCreateSource(_izContext, srcPath) {
48
48
  let queueName = FUNCTION_NAME.changeRelComplete;
49
+ queueName = upperCase(queueName);
50
+ const upperQueueName = upperCase(queueName);
49
51
  return {
50
52
  templatePath: templatePath,
51
53
  templateData: {
52
- queueName: upperCase(queueName)
54
+ queueName,
55
+ upperQueueName
53
56
  },
54
57
  setting: {
55
58
  initialData: 'Resources:\n',
@@ -1,10 +1,8 @@
1
1
  ##--------- [Create Topic Out]
2
- Out<%- firstLetterUpperCase(queueName) %>:
2
+ Out<%- queueName %>:
3
3
  Type: AWS::SNS::Topic
4
4
  Properties:
5
5
  DisplayName: "SNS Message out"
6
- TopicName: ${self:custom.iz_serviceTag}_${self:custom.iz_stage}_<%- firstLetterUpperCase(queueName) %>_Out
6
+ TopicName: ${self:custom.iz_serviceTag}_${self:custom.iz_stage}_<%- queueName %>_Out
7
7
 
8
- <%_ function firstLetterUpperCase(text) {
9
- return text.charAt(0).toUpperCase() + text.slice(1)
10
- } _%>
8
+
@@ -1,10 +1,9 @@
1
- <%_ const join = require('path').join; _%>
2
- <%- firstLetterUpperCase(functionNameConfig) %>:
3
- handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
4
- name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
1
+ <%- functionNameConfig %>:
2
+ handler: <%- handlerPathUpperFunctionName %>
3
+ name: ${self:custom.iz_resourcePrefix}<%- upperFunctionName %><%- upperHandlerType %>
5
4
  role: <%- roleName %>Role
6
- #<#<%- functionName %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
7
- #<#/<%- functionName %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
5
+ #<#<%- functionName %><%- upperHandlerType %>FunctionSetting#>
6
+ #<#/<%- functionName %><%- upperHandlerType %>FunctionSetting#>
8
7
  <%_ if (handlerType === 'hdrDsq' || handlerType === 'hdrSqs') { _%>
9
8
  events:
10
9
  - sqs:
@@ -28,6 +27,3 @@
28
27
  <%_ }) _%>
29
28
  <%_ } _%>
30
29
 
31
- <%_ function firstLetterUpperCase(text) {
32
- return text.charAt(0).toUpperCase() + text.slice(1)
33
- } _%>
@@ -187,17 +187,29 @@ function createParamForCreateSource(
187
187
  }
188
188
  const event = resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(handlerType));
189
189
 
190
+ const resourceLocation = SOURCE_PATH.resourceLocationRelationshipPerAction;
191
+
192
+ const functionNameConfig = upperCase(SHORT_FUNCTION_NAME(FUNCTION_NAME.createRel)) +
193
+ upperCase(shortNameHandler(handlerType));
194
+
195
+ const roleName = SOURCE_GENERATE_IAM_ROLE.RelationshipRole;
196
+ const upperFunctionName = upperCase(functionName);
197
+ const upperHandlerType = upperCase(handlerType);
198
+ const upperFunctionNameConfig = upperCase(functionNameConfig);
199
+ const upperRoleName = upperCase(roleName);
200
+ const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
201
+ const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
202
+
190
203
  return {
191
204
  templatePath: templatePath,
192
205
  templateData: {
193
206
  functionName,
194
207
  handlerType,
195
208
  additionalResourcePermission,
196
- resourceLocation: SOURCE_PATH.resourceLocationRelationshipPerAction,
197
- functionNameConfig:
198
- upperCase(SHORT_FUNCTION_NAME(FUNCTION_NAME.createRel)) +
199
- upperCase(shortNameHandler(handlerType)),
200
- roleName: SOURCE_GENERATE_IAM_ROLE.RelationshipRole,
209
+ resourceLocation,
210
+ functionNameConfig,
211
+ roleName,
212
+
201
213
  resourceApis: resourcesApi.map(api => ({
202
214
  path: `/${serviceTag}/${api.event}/${api.action}`,
203
215
  pathWithUser: `/${serviceTag}/${api.event}/${api.action}/{targetUserId}`,
@@ -205,7 +217,14 @@ function createParamForCreateSource(
205
217
  hookTagApp: `${upperCase(api.event)}AppLevelAuthorizer`,
206
218
  hookTagUser: `${upperCase(api.event)}UserLevelAuthorizer`
207
219
  })),
208
- event
220
+
221
+ event,
222
+ upperFunctionName,
223
+ upperHandlerType,
224
+ upperFunctionNameConfig,
225
+ upperRoleName,
226
+ handlerPath,
227
+ handlerPathUpperFunctionName
209
228
  },
210
229
  setting: {
211
230
  savePath: path.join(srcPath, SOURCE_PATH.appYaml),
@@ -59,7 +59,10 @@ function createParamForCreateSource(handler, srcPath) {
59
59
  dsqTemplate,
60
60
  invTemplate,
61
61
  sqsTemplate,
62
- handler
62
+ handler,
63
+ upperFunctionName: upperCase(functionName),
64
+ upperHandler: upperCase(handler),
65
+ upperQueueName: upperCase(queueName)
63
66
  },
64
67
  setting: {
65
68
  savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
@@ -22,7 +22,7 @@ import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow
22
22
  import Logger from '@izara_project/izara-core-library-logger';
23
23
  import recordHandlerSharedLib from '@izara_project/izara-core-library-record-handler';
24
24
 
25
- import <%- functionName %> from './<%- firstLetterUpperCase(functionName) %>_Main.js';
25
+ import <%- functionName %> from './<%- upperFunctionName %>_Main.js';
26
26
 
27
27
  // validate event params in middleware before into function
28
28
  let validator = {
@@ -129,9 +129,6 @@ export const main = middleware.wrap(async (event, context) => {
129
129
  return (response.failure(err));
130
130
  }
131
131
  });
132
- <%_ function firstLetterUpperCase(text) {
133
- return text.charAt(0).toUpperCase() + text.slice(1)
134
- } _%>
135
132
  <%_ function firstLetterLowerCase(str) {
136
133
  return str.charAt(0).toLowerCase() + str.slice(1)
137
134
  } _%>
@@ -22,7 +22,7 @@ import Logger from '@izara_project/izara-core-library-logger';
22
22
  import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
23
23
  import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record-handler';
24
24
 
25
- import <%- functionName %> from './<%- firstLetterUpperCase(functionName) %>_Main.js'
25
+ import <%- functionName %> from './<%- upperFunctionName %>_Main.js'
26
26
 
27
27
  // validate event properties in body.Message of sqs event
28
28
  middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema(
@@ -171,9 +171,6 @@ let validator = {
171
171
  throw (err);
172
172
  }
173
173
  });
174
- <%_ function firstLetterUpperCase(text) {
175
- return text.charAt(0).toUpperCase() + text.slice(1)
176
- } _%>
177
- <%_ function firstLetterLowerCase(str) {
174
+ <%_ function firstLetterLowerCase(str) {
178
175
  return str.charAt(0).toLowerCase() + str.slice(1)
179
176
  } _%>
@@ -23,7 +23,7 @@ import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow
23
23
  //(<optionalRequire>)
24
24
  //(</optionalRequire>)
25
25
 
26
- import <%- functionName %> from './<%- firstLetterUpperCase(functionName) %>_Main.js'
26
+ import <%- functionName %> from './<%- upperFunctionName %>_Main.js'
27
27
 
28
28
  // validate event params in middlewware before into function.
29
29
  let validator = {
@@ -111,13 +111,10 @@ export const main = middleware.wrap(async (event, context) => {
111
111
  );
112
112
 
113
113
  } catch (err) {
114
- event._izContext.logger.error('Error, <%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handler) %> : ', err);
114
+ event._izContext.logger.error('Error, <%- upperFunctionName %><%- upperHandler %> : ', err);
115
115
  throw (err);
116
116
  }
117
117
  });
118
- <%_ function firstLetterUpperCase(text) {
119
- return text.charAt(0).toUpperCase() + text.slice(1)
120
- } _%>
121
118
  <%_ function firstLetterLowerCase(str) {
122
119
  return str.charAt(0).toLowerCase() + str.slice(1)
123
120
  } _%>
@@ -25,7 +25,7 @@ import { recordHandlerSharedLib } from '@izara_project/izara-core-library-record
25
25
  //(<optionalRequire>)
26
26
  //(</optionalRequire>)
27
27
 
28
- import <%- functionName %> from './<%- firstLetterUpperCase(functionName) %>_Main.js';
28
+ import <%- functionName %> from './<%- upperFunctionName %>_Main.js';
29
29
 
30
30
  middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
31
31
 
@@ -118,7 +118,7 @@ let validator = {
118
118
  // --- validate message (and MessageAttributes)
119
119
  await recordHandlerSharedLib.validateRecord(
120
120
  record, // one record will send to mainFunction
121
- "<%-firstLetterUpperCase(queueName) %>", // queue name that need to retry or send to dlq
121
+ "<%- queueName %>", // queue name that need to retry or send to dlq
122
122
  validator, // schema for record.Message
123
123
  // messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
124
124
  );
@@ -135,7 +135,7 @@ let validator = {
135
135
  let recordPromise = recordHandlerSharedLib.recordHandler(
136
136
  record, // one record will send to mainFunction
137
137
  <%- functionName %>, // mainFunction that need to invoke.
138
- "<%-firstLetterUpperCase(queueName) %>", // queue name that need to retry or send to dlq
138
+ "<%- queueName %>", // queue name that need to retry or send to dlq
139
139
  passOnProperties, // all parameters that mainFunction needed.
140
140
  );
141
141
  record._izContext.logger.debug('after recordPromise in handler');
@@ -155,9 +155,6 @@ let validator = {
155
155
  throw (err);
156
156
  }
157
157
  });
158
- <%_ function firstLetterUpperCase(text) {
159
- return text.charAt(0).toUpperCase() + text.slice(1)
160
- } _%>
161
- <%_ function firstLetterLowerCase(str) {
158
+ <%_ function firstLetterLowerCase(str) {
162
159
  return str.charAt(0).toLowerCase() + str.slice(1)
163
160
  } _%>
@@ -45,7 +45,8 @@ function createParamForCreateSource(srcPath) {
45
45
  return {
46
46
  templatePath: templatePath,
47
47
  templateData: {
48
- functionName
48
+ functionName,
49
+ upperFunctionName: upperCase(functionName)
49
50
  },
50
51
  setting: {
51
52
  savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
@@ -48,12 +48,9 @@
48
48
  Action: "SQS:SendMessage"
49
49
  Queues:
50
50
  - Ref: <%- queueName %>HdrSqs
51
- #<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
52
- #<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
51
+ #<#<%- queueName %>QueueSetting#>
52
+ #<#/<%- queueName %>QueueSetting#>
53
53
 
54
- <%_ function firstLetterUpperCase(text){
55
- return text.charAt(0).toUpperCase() + text.slice(1)
56
- } _%>
57
54
  <%_ function firstLetterLowerCase(str) {
58
55
  return str.charAt(0).toLowerCase() + str.slice(1)
59
56
  } _%>
@@ -32,12 +32,9 @@
32
32
  Action: "SQS:SendMessage"
33
33
  Queues:
34
34
  - Ref: <%- queueName %>
35
- #<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
36
- #<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
35
+ #<#<%- queueName %>QueueSetting#>
36
+ #<#/<%- queueName %>QueueSetting#>
37
37
 
38
- <%_ function firstLetterUpperCase(text){
39
- return text.charAt(0).toUpperCase() + text.slice(1)
40
- } _%>
41
38
  <%_ function firstLetterLowerCase(str) {
42
39
  return str.charAt(0).toLowerCase() + str.slice(1)
43
40
  } _%>
@@ -1,20 +1,16 @@
1
- <%_ const join = require('path').join; _%>
2
- <%- firstLetterUpperCase(functionNameConfig) %>:
3
- handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
4
- name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
1
+ <%- functionNameConfig %>:
2
+ handler: <%- handlerPathUpperFunctionName %>
3
+ name: ${self:custom.iz_resourcePrefix}<%- upperFunctionName %>
5
4
  role: <%- roleName %>Role
6
- #<#<%- functionName %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
7
- #<#/<%- functionName %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
5
+ #<#<%- functionName %><%- upperHandlerType %>FunctionSetting#>
6
+ #<#/<%- functionName %><%- upperHandlerType %>FunctionSetting#>
8
7
  events:
9
8
  - sqs:
10
- arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
9
+ arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- upperFunctionName %>
11
10
  batchSize: 10
12
11
  filterPatterns: #**** need to update serverless framework upper v.2.69.1
13
- - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-firstLetterUpperCase(functionName) %>"]}}} # functionName of callingFlow
12
+ - body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- upperFunctionName %>"]}}} # functionName of callingFlow
14
13
  - body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
15
- <%_ function firstLetterUpperCase(text){
16
- return text.charAt(0).toUpperCase() + text.slice(1)
17
- } _%>
18
14
  <%_ function firstLetterLowerCase(str) {
19
15
  return str.charAt(0).toLowerCase() + str.slice(1)
20
16
  } _%>
@@ -98,17 +98,35 @@ function createParamForCreateSource(srcPath) {
98
98
 
99
99
  additionalResourcePermission.push(awaitingMultipleStepsRole());
100
100
 
101
+ const resourceLocation = SOURCE_PATH.resourceLocationRelationshipPerAction;
102
+
103
+ const functionNameConfig = upperCase(
104
+ SHORT_FUNCTION_NAME(FUNCTION_NAME.createRelComplete)
105
+ );
106
+
107
+ const roleName = SOURCE_GENERATE_IAM_ROLE.RelationshipCompleteRole;
108
+ const upperFunctionName = upperCase(functionName);
109
+ const upperHandlerType = upperCase(handlerType);
110
+ const upperFunctionNameConfig = upperCase(functionNameConfig);
111
+ const upperRoleName = upperCase(roleName);
112
+ const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
113
+ const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
114
+
101
115
  return {
102
116
  templatePath: templatePath,
103
117
  templateData: {
104
118
  functionName,
105
119
  handlerType,
106
120
  additionalResourcePermission,
107
- resourceLocation: SOURCE_PATH.resourceLocationRelationshipPerAction,
108
- functionNameConfig: upperCase(
109
- SHORT_FUNCTION_NAME(FUNCTION_NAME.createRelComplete)
110
- ),
111
- roleName: SOURCE_GENERATE_IAM_ROLE.RelationshipCompleteRole
121
+ resourceLocation,
122
+ functionNameConfig,
123
+ roleName,
124
+ upperFunctionName,
125
+ upperHandlerType,
126
+ upperFunctionNameConfig,
127
+ upperRoleName,
128
+ handlerPath,
129
+ handlerPathUpperFunctionName
112
130
  },
113
131
  setting: {
114
132
  savePath: path.join(srcPath, SOURCE_PATH.appYaml),
@@ -34,13 +34,10 @@
34
34
  Action: "SQS:SendMessage"
35
35
  Queues:
36
36
  - Ref: <%- queueName %>
37
- #<#<%- firstLetterUpperCase(queueName) %>QueueSetting#>
38
- #<#/<%- firstLetterUpperCase(queueName) %>QueueSetting#>
37
+ #<#<%- queueName %>QueueSetting#>
38
+ #<#/<%- queueName %>QueueSetting#>
39
39
 
40
40
 
41
- <%_ function firstLetterUpperCase(text){
42
- return text.charAt(0).toUpperCase() + text.slice(1)
43
- } _%>
44
- <%_ function firstLetterLowerCase(str) {
41
+ <%_ function firstLetterLowerCase(str) {
45
42
  return str.charAt(0).toLowerCase() + str.slice(1)
46
43
  } _%>
@@ -45,10 +45,13 @@ function createDefaultSnsOut(_izContext, srcPath) {
45
45
 
46
46
  function createParamsForCreateSource(_izContext, srcPath) {
47
47
  let queueName = FUNCTION_NAME.createRelComplete;
48
+ queueName = upperCase(queueName);
49
+ const upperQueueName = upperCase(queueName);
48
50
  return {
49
51
  templatePath: templatePath,
50
52
  templateData: {
51
- queueName: upperCase(queueName)
53
+ queueName,
54
+ upperQueueName
52
55
  },
53
56
  setting: {
54
57
  initialData: 'Resources:\n',
@@ -1,10 +1,8 @@
1
1
  ##--------- [Create Topic Out]
2
- Out<%- firstLetterUpperCase(queueName) %>:
2
+ Out<%- queueName %>:
3
3
  Type: AWS::SNS::Topic
4
4
  Properties:
5
5
  DisplayName: "SNS Message out"
6
- TopicName: ${self:custom.iz_serviceTag}_${self:custom.iz_stage}_<%- firstLetterUpperCase(queueName) %>_Out
6
+ TopicName: ${self:custom.iz_serviceTag}_${self:custom.iz_stage}_<%- queueName %>_Out
7
7
 
8
- <%_ function firstLetterUpperCase(text) {
9
- return text.charAt(0).toUpperCase() + text.slice(1)
10
- } _%>
8
+
@@ -1,10 +1,9 @@
1
- <%_ const join = require('path').join; _%>
2
- <%- firstLetterUpperCase(functionNameConfig) %>:
3
- handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
4
- name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
1
+ <%- functionNameConfig %>:
2
+ handler: <%- handlerPathUpperFunctionName %>
3
+ name: ${self:custom.iz_resourcePrefix}<%- upperFunctionName %><%- upperHandlerType %>
5
4
  role: <%- roleName %>Role
6
- #<#<%- functionName %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
7
- #<#/<%- functionName %><%- firstLetterUpperCase(handlerType) %>FunctionSetting#>
5
+ #<#<%- functionName %><%- upperHandlerType %>FunctionSetting#>
6
+ #<#/<%- functionName %><%- upperHandlerType %>FunctionSetting#>
8
7
  <%_ if (handlerType === 'hdrDsq' || handlerType === 'hdrSqs') { _%>
9
8
  events:
10
9
  - sqs:
@@ -28,6 +27,3 @@
28
27
  <%_ }) _%>
29
28
  <%_ } _%>
30
29
 
31
- <%_ function firstLetterUpperCase(text) {
32
- return text.charAt(0).toUpperCase() + text.slice(1)
33
- } _%>
@@ -189,17 +189,30 @@ function createParamForCreateSource(
189
189
  const event = resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(handlerType));
190
190
 
191
191
 
192
+ const resourceLocation = SOURCE_PATH.resourceLocationRelationshipPerAction;
193
+
194
+ const functionNameConfig = upperCase(SHORT_FUNCTION_NAME(FUNCTION_NAME.deleteRel)) +
195
+ upperCase(shortNameHandler(handlerType));
196
+
197
+ const roleName = SOURCE_GENERATE_IAM_ROLE.RelationshipRole;
198
+ const upperFunctionName = upperCase(functionName);
199
+ const upperHandlerType = upperCase(handlerType);
200
+ const upperFunctionNameConfig = upperCase(functionNameConfig);
201
+ const upperRoleName = upperCase(roleName);
202
+ const handlerPath = path.join(resourceLocation, `${functionName}_${upperHandlerType}.main`);
203
+ const handlerPathUpperFunctionName = path.join(resourceLocation, `${upperFunctionName}_${upperHandlerType}.main`);
204
+
205
+
192
206
  return {
193
207
  templatePath: templatePath,
194
208
  templateData: {
195
209
  functionName,
196
210
  handlerType,
197
211
  additionalResourcePermission,
198
- resourceLocation: SOURCE_PATH.resourceLocationRelationshipPerAction,
199
- functionNameConfig:
200
- upperCase(SHORT_FUNCTION_NAME(FUNCTION_NAME.deleteRel)) +
201
- upperCase(shortNameHandler(handlerType)),
202
- roleName: SOURCE_GENERATE_IAM_ROLE.RelationshipRole,
212
+ resourceLocation,
213
+ functionNameConfig,
214
+ roleName,
215
+
203
216
  resourceApis: resourcesApi.map(api => ({
204
217
  path: `/${serviceTag}/${api.event}/${api.action}`,
205
218
  pathWithUser: `/${serviceTag}/${api.event}/${api.action}/{targetUserId}`,
@@ -207,7 +220,14 @@ function createParamForCreateSource(
207
220
  hookTagApp: `${upperCase(api.event)}AppLevelAuthorizer`,
208
221
  hookTagUser: `${upperCase(api.event)}UserLevelAuthorizer`
209
222
  })),
210
- event
223
+
224
+ event,
225
+ upperFunctionName,
226
+ upperHandlerType,
227
+ upperFunctionNameConfig,
228
+ upperRoleName,
229
+ handlerPath,
230
+ handlerPathUpperFunctionName
211
231
  },
212
232
  setting: {
213
233
  savePath: path.join(srcPath, SOURCE_PATH.appYaml),
@@ -59,7 +59,10 @@ function createParamForCreateSource(handler, srcPath) {
59
59
  dsqTemplate,
60
60
  invTemplate,
61
61
  sqsTemplate,
62
- handler
62
+ handler,
63
+ upperFunctionName: upperCase(functionName),
64
+ upperHandler: upperCase(handler),
65
+ upperQueueName: upperCase(queueName)
63
66
  },
64
67
  setting: {
65
68
  savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),