@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
@@ -20,7 +20,8 @@ import fs from 'fs';
20
20
  import yaml from 'yaml';
21
21
  import libs from '#libs/Libs.js';
22
22
  import utils from '#libs/Utils.js';
23
- const { firstLetterUpperCase: upperCase, firstLetterLowerCase: lowerCase } = utils;
23
+ const { firstLetterUpperCase: upperCase, firstLetterLowerCase: lowerCase } =
24
+ utils;
24
25
  import consts from '#libs/Consts.js';
25
26
  const { SOURCE_PATH, HANDLER, RESOURCE_CLASSES, SNS_RESOURCE } = consts;
26
27
 
@@ -54,7 +55,6 @@ const {
54
55
  // import handlerSendPlugIn from './afterFirstFlowStep/sendPlugIn/handler/handler.js';
55
56
  // import mainFunctionSendPlugIn from './afterFirstFlowStep/sendPlugIn/mainFunction/main.js';
56
57
 
57
-
58
58
  /**
59
59
  * Generates code from templates based on object schemas
60
60
  * @param {Object} _izContext
@@ -69,7 +69,7 @@ async function generatePlunIg(
69
69
  rootServicePath,
70
70
  appPath,
71
71
  allObjSchemas,
72
- allLocalFlowSchemas,
72
+ allLocalFlowSchemas
73
73
  ) {
74
74
  const allCreateSourceParams = [];
75
75
 
@@ -79,18 +79,22 @@ async function generatePlunIg(
79
79
  ? allObjSchemas.length
80
80
  : 0;
81
81
 
82
-
83
82
  console.info(`[plugIn] start totalSchemas=${totalSchemas}`);
84
83
  if (totalSchemas === 0) return [];
85
84
 
86
- const configPath = path.join(rootServicePath, 'config/serverless.config.yml');
85
+ const configPath = path.join(
86
+ rootServicePath,
87
+ 'config/serverless.config.yml'
88
+ );
87
89
  const serverlessConfig = fs.readFileSync(configPath, 'utf8');
88
90
  const config = yaml.parse(serverlessConfig);
89
91
  const serviceTag = config.main_config.iz_serviceTag;
90
92
 
91
93
  for (const flowSchema of allLocalFlowSchemas) {
92
- for (const [flowStepName, flowStepConfig] of Object.entries(flowSchema.flowSteps)) {
93
- if (flowStepName === "In" || flowStepName === "Out") continue;
94
+ for (const [flowStepName, flowStepConfig] of Object.entries(
95
+ flowSchema.flowSteps
96
+ )) {
97
+ if (flowStepName === 'In' || flowStepName === 'Out') continue;
94
98
 
95
99
  const flowTag = flowSchema.flowTag;
96
100
  const roleName = upperCase(flowTag);
@@ -104,7 +108,7 @@ async function generatePlunIg(
104
108
  resourceApis,
105
109
  hookTagSetting: `${flowSchema.flowTag}FunctionSetting`,
106
110
  functionName: upperCase(flowSchema.flowTag) + upperCase(flowStepName),
107
- roleName,
111
+ roleName
108
112
  };
109
113
 
110
114
  resolveHandlerConfig(
@@ -112,7 +116,9 @@ async function generatePlunIg(
112
116
  flowStepConfig,
113
117
  additionalResourcePermission,
114
118
  resourceApis,
115
- serviceTag);
119
+ serviceTag,
120
+ flowSchema.event
121
+ );
116
122
 
117
123
  Object.assign(data, {
118
124
  handlerType: data.handlerType,
@@ -121,20 +127,25 @@ async function generatePlunIg(
121
127
  upperCase(flowSchema.flowTag),
122
128
  upperCase(flowStepName),
123
129
  'source/',
124
- `${upperCase(flowTag)}${upperCase(flowStepName)}_${upperCase(data.handlerType)}`,
130
+ `${upperCase(flowTag)}${upperCase(flowStepName)}_${upperCase(data.handlerType)}`
125
131
  ),
126
- functionNameConfig: upperCase(flowSchema.flowTag) +
132
+ functionNameConfig:
133
+ upperCase(flowSchema.flowTag) +
127
134
  upperCase(flowStepName) +
128
135
  upperCase(data.handlerType),
129
136
  event: resourceNames(
130
137
  RESOURCE_CLASSES.sqs,
138
+ upperCase(flowSchema.flowTag) +
139
+ upperCase(flowStepName) +
140
+ upperCase(data.handlerType)
141
+ ),
142
+ queueName:
131
143
  upperCase(flowSchema.flowTag) +
132
144
  upperCase(flowStepName) +
133
- upperCase(data.handlerType)),
134
- queueName: upperCase(flowSchema.flowTag) + upperCase(flowStepName) + upperCase(data.handlerType),
145
+ upperCase(data.handlerType),
146
+ topicName: upperCase(flowSchema.flowTag) + upperCase(flowStepName)
135
147
  });
136
148
 
137
-
138
149
  // ── branch into the three helpers ──────────────────────────────────
139
150
  if (flowStepConfig.plugInHooks?.length) {
140
151
  for (let i = 0; i < flowStepConfig.plugInHooks.length; i++) {
@@ -166,29 +177,26 @@ async function generatePlunIg(
166
177
  allCreateSourceParams.push(...noHookResults);
167
178
  }
168
179
 
169
- if (flowStepConfig.hasOwnProperty("settings")) {
170
- data["handleLogic"] = flowStepConfig.settings.handleLogic;
171
- data["childFlow"] = flowStepConfig.settings.flowType;
180
+ if (flowStepConfig.hasOwnProperty('settings')) {
181
+ data['handleLogic'] = flowStepConfig.settings.handleLogic;
182
+ data['childFlow'] = flowStepConfig.settings.flowType;
172
183
  data.event = resourceNames(
173
184
  RESOURCE_CLASSES.sqs,
174
185
  upperCase(flowSchema.flowTag) +
175
- upperCase(flowStepName) +
176
- upperCase(data.handleLogic) +
177
- upperCase(data.handlerType)
178
- )
186
+ upperCase(flowStepName) +
187
+ upperCase(data.handleLogic) +
188
+ upperCase(data.handlerType)
189
+ );
179
190
  const generateLambdaFlowStepByConfig = buildFlowStepResourceByConfig(
180
191
  _izContext,
181
192
  data,
182
193
  appPath
183
194
  );
184
195
  allCreateSourceParams.push(...generateLambdaFlowStepByConfig);
185
-
186
196
  }
187
-
188
197
  }
189
198
  }
190
199
 
191
-
192
200
  const uniqueSortedTargetFiles = Array.from(
193
201
  new Set(
194
202
  allCreateSourceParams
@@ -217,24 +225,22 @@ async function generatePlunIg(
217
225
 
218
226
  export default generatePlunIg;
219
227
 
220
-
221
- async function buildNoPluginHookResources(_izContext, data, flowStepConfig, appPath) {
228
+ async function buildNoPluginHookResources(
229
+ _izContext,
230
+ data,
231
+ flowStepConfig,
232
+ appPath
233
+ ) {
222
234
  const results = [];
223
235
 
224
- const yamlRes = await yamlFlowStep(
225
- _izContext,
226
- data,
227
- appPath);
228
- const handlerRes = await handlerFlowStep(
229
- _izContext,
230
- data,
231
- appPath);
232
-
233
- if (data.handlerType === HANDLER.hdrSqs || data.handlerType === HANDLER.hdrDsq) {
234
- const sqsRes = await sqsFlowStep(
235
- _izContext,
236
- data,
237
- appPath);
236
+ const yamlRes = await yamlFlowStep(_izContext, data, appPath);
237
+ const handlerRes = await handlerFlowStep(_izContext, data, appPath);
238
+
239
+ if (
240
+ data.handlerType === HANDLER.hdrSqs ||
241
+ data.handlerType === HANDLER.hdrDsq
242
+ ) {
243
+ const sqsRes = await sqsFlowStep(_izContext, data, appPath);
238
244
  results.push(sqsRes);
239
245
  }
240
246
 
@@ -254,51 +260,52 @@ async function buildNoPluginHookResources(_izContext, data, flowStepConfig, appP
254
260
  appPath
255
261
  );
256
262
 
257
- results.push(mainRes,
263
+ results.push(
264
+ mainRes,
258
265
  // snsOutRes,
259
266
  yamlRes,
260
- handlerRes);
267
+ handlerRes
268
+ );
261
269
 
262
270
  return results;
263
271
  }
264
272
 
265
- async function buildFirstPluginHookResources(_izContext, data, flowStepConfig, appPath) {
273
+ async function buildFirstPluginHookResources(
274
+ _izContext,
275
+ data,
276
+ flowStepConfig,
277
+ appPath
278
+ ) {
266
279
  const results = [];
267
280
 
268
- const yamlRes = await yamlFlowStep(
269
- _izContext,
270
- data,
271
- appPath);
281
+ const yamlRes = await yamlFlowStep(_izContext, data, appPath);
272
282
 
273
- const handlerRes = await handlerFlowStep(
274
- _izContext,
275
- data,
276
- appPath);
283
+ const handlerRes = await handlerFlowStep(_izContext, data, appPath);
277
284
 
278
285
  results.push(yamlRes, handlerRes);
279
286
 
280
- if (data.handlerType === HANDLER.hdrSqs ||
281
- data.handlerType === HANDLER.hdrDsq) {
282
- const sqsRes = await sqsFlowStep(
283
- _izContext,
284
- data,
285
- appPath);
287
+ if (
288
+ data.handlerType === HANDLER.hdrSqs ||
289
+ data.handlerType === HANDLER.hdrDsq
290
+ ) {
291
+ const sqsRes = await sqsFlowStep(_izContext, data, appPath);
286
292
  results.push(sqsRes);
287
293
  }
288
294
 
289
- const snsOutRes = await snsOut(
290
- _izContext,
291
- data,
292
- appPath);
295
+ const snsOutRes = await snsOut(_izContext, data, appPath);
293
296
  results.push(snsOutRes);
294
297
 
295
298
  // Original: only the first plugInHook (index 0) creates the main function
296
299
  const firstHook = flowStepConfig.plugInHooks[0];
297
- const [objSchema] = await getLocalOrS3ObjectSchema(
300
+ const [objSchema, error] = await getLocalOrS3ObjectSchema(
298
301
  _izContext,
299
302
  firstHook.objType,
300
303
  path.join(appPath, './src/schemas')
301
304
  );
305
+ if (error) {
306
+ console.error('[plugIn] error:', error);
307
+ throw new NoRetryError(error);
308
+ }
302
309
 
303
310
  let mainData = { ...data, havePlugIn: false };
304
311
 
@@ -326,27 +333,29 @@ async function buildFirstPluginHookResources(_izContext, data, flowStepConfig, a
326
333
  }
327
334
  }
328
335
 
329
- const mainRes = await mainFunctionFlowStep(
330
- _izContext,
331
- mainData,
332
- appPath);
336
+ const mainRes = await mainFunctionFlowStep(_izContext, mainData, appPath);
333
337
 
334
338
  results.push(mainRes);
335
339
 
336
340
  return results;
337
341
  }
338
342
 
339
- async function buildRecievePluginHookResource(_izContext, data, appPath, allObjSchemas) {
343
+ async function buildRecievePluginHookResource(
344
+ _izContext,
345
+ data,
346
+ appPath,
347
+ allObjSchemas
348
+ ) {
340
349
  const results = [];
341
350
 
342
351
  for (const objSchema of allObjSchemas) {
343
- if (!objSchema.hasOwnProperty("recievePlugInHookTag")) continue;
352
+ if (!objSchema.hasOwnProperty('recievePlugInHookTag')) continue;
344
353
 
345
354
  for (const recieveConfig of Object.values(objSchema.recievePlugInHookTag)) {
346
355
  const localData = { ...data };
347
356
 
348
357
  if (recieveConfig.hasOwnProperty('flowType')) {
349
- localData.recieveType = "async";
358
+ localData.recieveType = 'async';
350
359
  localData.flowType = recieveConfig.flowType;
351
360
  } else {
352
361
  localData.recieveType = 'sync';
@@ -355,21 +364,20 @@ async function buildRecievePluginHookResource(_izContext, data, appPath, allObjS
355
364
  const yamlRecieveRes = await yamlRecievePlugIn(
356
365
  _izContext,
357
366
  localData,
358
- appPath);
367
+ appPath
368
+ );
359
369
  const handlerRecieveRes = await handlerRecievePlugIn(
360
370
  _izContext,
361
371
  localData,
362
- appPath);
372
+ appPath
373
+ );
363
374
  const mainRecieveRes = await mainFunctionRecievePlugIn(
364
375
  _izContext,
365
376
  localData,
366
- appPath);
367
-
368
- results.push(
369
- ...yamlRecieveRes,
370
- ...handlerRecieveRes,
371
- mainRecieveRes
377
+ appPath
372
378
  );
379
+
380
+ results.push(...yamlRecieveRes, ...handlerRecieveRes, mainRecieveRes);
373
381
  }
374
382
  }
375
383
 
@@ -377,94 +385,100 @@ async function buildRecievePluginHookResource(_izContext, data, appPath, allObjS
377
385
  }
378
386
 
379
387
  // Extracted from the original if/else chain — mutates data, additionalResourcePermission, resourceApis in place
380
- function resolveHandlerConfig(data, flowStepConfig, additionalResourcePermission, resourceApis, serviceTag) {
388
+ function resolveHandlerConfig(
389
+ data,
390
+ flowStepConfig,
391
+ additionalResourcePermission,
392
+ resourceApis,
393
+ serviceTag,
394
+ fallbackEvent = []
395
+ ) {
381
396
  const { flowTag, flowStepName } = data;
382
397
  let handler;
398
+ const events = flowStepConfig.event || fallbackEvent || [];
383
399
 
384
- if (flowStepConfig.event.includes("ownTopic")) {
400
+ if (events.includes('ownTopic')) {
385
401
  data.eventFlow = 'ownTopic';
386
402
  handler = HANDLER.hdrSqs;
387
403
  additionalResourcePermission.push(
388
- createSnsResource([upperCase(flowTag) +
389
- upperCase(flowStepName) + "_In"]),
404
+ createSnsResource([upperCase(flowTag) + upperCase(flowStepName) + '_In']),
390
405
  createSqsResource([
406
+ upperCase(flowTag) + upperCase(flowStepName) + upperCase(handler),
391
407
  upperCase(flowTag) +
392
- upperCase(flowStepName) +
393
- upperCase(handler),
394
- upperCase(flowTag) +
395
- upperCase(flowStepName) +
396
- upperCase(handler) + "DLQ",
408
+ upperCase(flowStepName) +
409
+ upperCase(handler) +
410
+ 'DLQ'
397
411
  ])
398
412
  );
399
- } else if (flowStepConfig.event.includes("extTopic")) {
413
+ } else if (events.includes('extTopic')) {
400
414
  data.eventFlow = 'extTopic';
401
415
  handler = HANDLER.hdrSqs;
402
416
  additionalResourcePermission.push(
403
417
  createSqsResource([
418
+ upperCase(flowTag) + upperCase(flowStepName) + upperCase(handler),
404
419
  upperCase(flowTag) +
405
- upperCase(flowStepName) +
406
- upperCase(handler),
407
- upperCase(flowTag) +
408
- upperCase(flowStepName) +
409
- upperCase(handler) + "DLQ",
420
+ upperCase(flowStepName) +
421
+ upperCase(handler) +
422
+ 'DLQ'
410
423
  ])
411
424
  );
412
- } else if (flowStepConfig.event.includes("lambdaSyncInv")) {
425
+ } else if (events.includes('lambdaSyncInv')) {
413
426
  handler = HANDLER.hdrInv;
414
- } else if (flowStepConfig.event.includes("lambdaSyncApi")) {
427
+ } else if (events.includes('lambdaSyncApi')) {
415
428
  handler = HANDLER.hdrApi;
416
429
  resourceApis.push({
417
430
  path: `${serviceTag}/${lowerCase(flowTag)}${lowerCase(flowStepName)}`,
418
431
  pathWithUser: `${serviceTag}/${lowerCase(flowTag)}${lowerCase(flowStepName)}/{targetUserId}`,
419
432
  method: 'post',
420
433
  hookTagApp: `${upperCase(flowStepName)}${upperCase(handler)}AppLevelAuthorizer`,
421
- hookTagUser: `${upperCase(flowStepName)}${upperCase(handler)}UserLevelAuthorizer`,
434
+ hookTagUser: `${upperCase(flowStepName)}${upperCase(handler)}UserLevelAuthorizer`
422
435
  });
423
- } else if (flowStepConfig.event.includes("queue")) {
436
+ } else if (events.includes('queue')) {
424
437
  handler = HANDLER.hdrDsq;
425
438
  additionalResourcePermission.push(
426
439
  createSqsResource([
440
+ upperCase(flowTag) + upperCase(flowStepName) + upperCase(handler),
427
441
  upperCase(flowTag) +
428
- upperCase(flowStepName) +
429
- upperCase(handler),
430
- upperCase(flowTag) +
431
- upperCase(flowStepName) +
432
- upperCase(handler) +
433
- "DSQ",
442
+ upperCase(flowStepName) +
443
+ upperCase(handler) +
444
+ 'DSQ'
434
445
  ])
435
446
  );
436
447
  }
437
448
 
438
- if (flowStepConfig.hasOwnProperty("settings")) {
439
- if (flowStepConfig.settings.hasOwnProperty("handleLogic")) {
449
+ if (flowStepConfig.hasOwnProperty('settings')) {
450
+ if (flowStepConfig.settings.hasOwnProperty('handleLogic')) {
440
451
  const handleLogic = flowStepConfig.settings.handleLogic;
441
452
  const childFlow = flowStepConfig.settings.flowType;
442
453
  if (handleLogic === 'awaitingMultipleSteps') {
443
454
  handler = HANDLER.hdrSqs;
444
- additionalResourcePermission.push(awaitingMultipleStepsRole())
445
- additionalResourcePermission.push(createSqsResource(
446
- [
455
+ additionalResourcePermission.push(awaitingMultipleStepsRole());
456
+ additionalResourcePermission.push(
457
+ createSqsResource([
447
458
  upperCase(flowTag) +
448
- upperCase(flowStepName) +
449
- upperCase(flowStepConfig.settings.handleLogic) +
450
- upperCase(HANDLER.hdrSqs),
459
+ upperCase(flowStepName) +
460
+ upperCase(flowStepConfig.settings.handleLogic) +
461
+ upperCase(HANDLER.hdrSqs),
451
462
  upperCase(flowTag) +
452
- upperCase(flowStepName) +
453
- upperCase(flowStepConfig.settings.handleLogic) +
454
- upperCase(HANDLER.hdrSqs) + "DLQ"
455
- ]
456
- ))
463
+ upperCase(flowStepName) +
464
+ upperCase(flowStepConfig.settings.handleLogic) +
465
+ upperCase(HANDLER.hdrSqs) +
466
+ 'DLQ'
467
+ ])
468
+ );
457
469
  } else if (handleLogic === 'paginated') {
458
470
  handler = HANDLER.hdrSqs;
459
- additionalResourcePermission.push(createSqsResource(
460
- [
471
+ additionalResourcePermission.push(
472
+ createSqsResource([
461
473
  upperCase(flowTag) +
462
- upperCase(flowStepName) +
463
- upperCase(HANDLER.hdrDsq),
474
+ upperCase(flowStepName) +
475
+ upperCase(HANDLER.hdrDsq),
464
476
  upperCase(flowTag) +
465
- upperCase(flowStepName) +
466
- upperCase(HANDLER.hdrDsq) + "DLQ"
467
- ]))
477
+ upperCase(flowStepName) +
478
+ upperCase(HANDLER.hdrDsq) +
479
+ 'DLQ'
480
+ ])
481
+ );
468
482
  }
469
483
  }
470
484
  }
@@ -475,50 +489,31 @@ function buildFlowStepResourceByConfig(_izContext, data, appPath) {
475
489
  const results = [];
476
490
 
477
491
  if (data.handleLogic === 'awaitingMultipleSteps') {
478
- data.handlerType = HANDLER.hdrSqs
492
+ data.handlerType = HANDLER.hdrSqs;
479
493
  } else if (data.handleLogic === 'paginated') {
480
- data.handlerType = HANDLER.hdrDsq
494
+ data.handlerType = HANDLER.hdrDsq;
481
495
  }
482
496
 
483
- data["functionName"] = upperCase(data.flowTag) +
497
+ data['functionName'] =
498
+ upperCase(data.flowTag) +
484
499
  upperCase(data.flowStepName) +
485
- upperCase(data.handleLogic)
500
+ upperCase(data.handleLogic);
486
501
 
487
- data["functionNameConfig"] = upperCase(data.flowTag) +
502
+ data['functionNameConfig'] =
503
+ upperCase(data.flowTag) +
488
504
  upperCase(data.flowStepName) +
489
505
  upperCase(data.handleLogic) +
490
- upperCase(data.handlerType)
506
+ upperCase(data.handlerType);
491
507
 
492
- const handler = handlerFlowConfig(
493
- _izContext,
494
- data,
495
- appPath
496
- );
508
+ const handler = handlerFlowConfig(_izContext, data, appPath);
497
509
 
498
- const mainFunction = mainFunctionFlowConfig(
499
- _izContext,
500
- data,
501
- appPath
502
- );
510
+ const mainFunction = mainFunctionFlowConfig(_izContext, data, appPath);
503
511
 
504
- const sqs = sqsFlowConfig(
505
- _izContext,
506
- data,
507
- appPath
508
- );
512
+ const sqs = sqsFlowConfig(_izContext, data, appPath);
509
513
 
510
- const yaml = yamlFlowConfig(
511
- _izContext,
512
- data,
513
- appPath
514
- );
514
+ const yaml = yamlFlowConfig(_izContext, data, appPath);
515
515
 
516
- results.push(
517
- handler,
518
- mainFunction,
519
- sqs,
520
- yaml
521
- );
516
+ results.push(handler, mainFunction, sqs, yaml);
522
517
 
523
518
  return results;
524
- }
519
+ }
@@ -19,11 +19,5 @@
19
19
  KeyType: RANGE
20
20
  <%_ } -%>
21
21
  <%_ }) _%>
22
- #<#<%- firstLetterUpperCase(tableName) %>DynamoDbSetting#>
23
- #<#/<%- firstLetterUpperCase(tableName) %>DynamoDbSetting#>
24
- <%_ function firstLetterUpperCase(text){
25
- return text.charAt(0).toUpperCase() + text.slice(1)
26
- } _%>
27
- <%_ function firstLetterLowerCase(str) {
28
- return str.charAt(0).toLowerCase() + str.slice(1)
29
- } _%>
22
+ #<#<%- tableName %>DynamoDbSetting#>
23
+ #<#/<%- tableName %>DynamoDbSetting#>
@@ -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,12 +1,12 @@
1
1
  # for createIamRole
2
2
 
3
3
  <% functionNameConfigs.forEach(functionNameConfig => { _%>
4
- - ${self:custom.iz_prefixIamRole}<%- firstLetterUpperCase(functionNameConfig) %>${self:custom.iz_suffixIamRole}
4
+ - ${self:custom.iz_prefixIamRole}<%- functionNameConfig %>${self:custom.iz_suffixIamRole}
5
5
  <% }) _%>
6
6
 
7
7
  # for createIntTest
8
8
  <% functionNameConfigs.forEach(functionNameConfig => { _%>
9
- "<%- firstLetterUpperCase(functionNameConfig) %>",
9
+ "<%- functionNameConfig %>",
10
10
  <% }) _%>
11
11
 
12
12
  <%_function firstLetterUpperCase(text) {
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
  export function generatedIntTestRoleNameConfig () {
21
21
  let roleNameConfigIntTest = [
22
22
  <% roleNameConfigs.forEach(roleNameConfig => { _%>
23
- "<%- firstLetterUpperCase(roleNameConfig) %>",
23
+ "<%- roleNameConfig %>",
24
24
  <% }) _%>
25
25
  ]
26
26
  return roleNameConfigIntTest
@@ -1,7 +1,7 @@
1
1
  # for createIamRole
2
2
 
3
3
  <% roleNameConfigs.forEach(roleNameConfig => { _%>
4
- - arn:aws:iam::${self:custom.iz_accountId}:role/${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(roleNameConfig) %>
4
+ - arn:aws:iam::${self:custom.iz_accountId}:role/${self:custom.iz_resourcePrefix}<%- roleNameConfig %>
5
5
  <% }) _%>
6
6
 
7
7
 
@@ -17,6 +17,8 @@ import { fileURLToPath } from 'url';
17
17
  const __filename = fileURLToPath(import.meta.url);
18
18
  const __dirname = path.dirname(__filename);
19
19
  import consts from '#libs/Consts.js';
20
+ import utils from '#libs/Utils.js';
21
+ const { firstLetterUpperCase: upperCase } = utils;
20
22
  const { SOURCE_PATH, SAVE_FILE_NAME } = consts;
21
23
 
22
24
  const templatePath = path.join(__dirname, 'template.ejs');
@@ -80,7 +82,11 @@ function generateRole(_izContext, createSourceParams, appPath) {
80
82
  for (const [roleName, roleData] of Object.entries(reformCreateSourceParams)) {
81
83
  createSourceRole.add({
82
84
  templatePath: templatePath,
83
- templateData: { roleName, roleData },
85
+ templateData: {
86
+ roleName,
87
+ roleData,
88
+ upperRoleName: upperCase(roleName)
89
+ },
84
90
  setting: {
85
91
  initialData: 'Resources:\n',
86
92
  savePath: path.join(appPath, SOURCE_PATH.appYaml),
package/src/libs/Utils.js CHANGED
@@ -25,11 +25,13 @@ import consts from '#libs/Consts.js';
25
25
  const { SOURCE_PATH } = consts;
26
26
 
27
27
  function firstLetterUpperCase(text) {
28
+ if (!text) return text;
28
29
  return text.charAt(0).toUpperCase() + text.slice(1);
29
30
  }
30
31
 
31
- function firstLetterLowerCase(str) {
32
- return str.charAt(0).toLowerCase() + str.slice(1);
32
+ function firstLetterLowerCase(text) {
33
+ if (!text) return text;
34
+ return text.charAt(0).toLowerCase() + text.slice(1);
33
35
  }
34
36
 
35
37
  function checkOverWriteGenerateMainFunction(objectSchema, action) {