@izara_project/izara-core-generate-service-code 1.0.2 → 1.0.4

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 (393) hide show
  1. package/index.js +0 -2
  2. package/package.json +3 -3
  3. package/src/GenerateCode.js +5 -4
  4. package/src/GenerateResources.js +4 -3
  5. package/src/GenerateTests.js +6 -7
  6. package/src/TemplateConfig.js +18 -18
  7. package/src/TemplateData/EndpointPerService/generateTemplateData.js +1 -1
  8. package/src/TemplateData/EndpointPerService/mainFunction/create/template.ejs +37 -39
  9. package/src/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +7 -12
  10. package/src/TemplateData/EndpointPerService/mainFunction/get/template.ejs +7 -10
  11. package/src/TemplateData/EndpointPerService/mainFunction/update/template.ejs +24 -31
  12. package/src/TemplateData/IntTest/generateResources/generateResources.js +4 -3
  13. package/src/TemplateData/IntTest/generateTests/events/data.js +3 -1
  14. package/src/TemplateData/IntTest/generateTests/generateTemplate.js +4 -2
  15. package/src/TemplateData/IntTest/generateTests/pathIntTest/data.js +2 -2
  16. package/src/TemplateData/IntTest/generateTests/tests/data.js +9 -8
  17. package/src/TemplateData/IntTest/libs/libs.js +4 -35
  18. package/src/TemplateData/IntTest/upload/uploadIntTest.js +4 -3
  19. package/src/TemplateData/externalService/lambdaRole/template.ejs +1 -3
  20. package/src/TemplateData/externalService/snsTopicSubscriptions/template.ejs +0 -2
  21. package/src/TemplateData/findData/findDataYaml/data.js +2 -1
  22. package/src/TemplateData/findData/mainFunction/data.js +1 -1
  23. package/src/TemplateData/flowSchema/CreateRecordComplete/functionYaml/data.js +9 -5
  24. package/src/TemplateData/flowSchema/CreateRecordComplete/handler/data.js +3 -3
  25. package/src/TemplateData/flowSchema/CreateRecordComplete/mainFunction/data.js +3 -3
  26. package/src/TemplateData/flowSchema/CreateRecordComplete/queue/data.js +3 -3
  27. package/src/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/data.js +11 -8
  28. package/src/TemplateData/flowSchema/components/upload/confirmReserved/handler/data.js +3 -3
  29. package/src/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/data.js +1 -1
  30. package/src/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +1 -1
  31. package/src/TemplateData/flowSchema/components/upload/confirmReserved/queue/data.js +3 -2
  32. package/src/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js +11 -7
  33. package/src/TemplateData/flowSchema/components/upload/createObject/handler/data.js +3 -3
  34. package/src/TemplateData/flowSchema/components/upload/createObject/mainFunction/data.js +4 -3
  35. package/src/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +2 -2
  36. package/src/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/data.js +9 -7
  37. package/src/TemplateData/flowSchema/components/upload/createObjectComplete/handler/data.js +3 -3
  38. package/src/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/data.js +3 -3
  39. package/src/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/data.js +3 -3
  40. package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/data.js +11 -7
  41. package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/handler/data.js +3 -3
  42. package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/data.js +3 -3
  43. package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +2 -2
  44. package/src/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/queue/data.js +2 -4
  45. package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/data.js +15 -9
  46. package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/data.js +3 -3
  47. package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/data.js +2 -1
  48. package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +1 -1
  49. package/src/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/data.js +3 -5
  50. package/src/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/data.js +10 -5
  51. package/src/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/data.js +2 -1
  52. package/src/TemplateData/flowSchema/components/upload/processFile/mainFunction/data.js +2 -1
  53. package/src/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +0 -2
  54. package/src/TemplateData/flowSchema/components/upload/processFile/queue/data.js +1 -1
  55. package/src/TemplateData/flowSchema/components/upload/relate/S3/data.js +1 -1
  56. package/src/TemplateData/flowSchema/components/upload/relate/libs/data.js +1 -1
  57. package/src/TemplateData/flowSchema/components/upload/relate/sns-out/data.js +2 -1
  58. package/src/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +9 -4
  59. package/src/TemplateData/flowSchema/components/websocket/connect/handler/data.js +1 -1
  60. package/src/TemplateData/flowSchema/components/websocket/dynamoDb/ReservedTableData.js +1 -2
  61. package/src/TemplateData/flowSchema/components/websocket/dynamoDb/WebSocketTaskData.js +1 -1
  62. package/src/TemplateData/flowSchema/components/websocket/dynamoDb/userUploadRecords.js +1 -1
  63. package/src/TemplateData/flowSchema/dynamoDb/data.js +2 -1
  64. package/src/TemplateData/flowSchema/eventBridge/functionYaml/data.js +9 -4
  65. package/src/TemplateData/flowSchema/eventBridge/handler/inv/data.js +2 -1
  66. package/src/TemplateData/flowSchema/eventBridge/mainFunction/data.js +2 -1
  67. package/src/TemplateData/flowSchema/externalTopic/Complete/functionYaml/data.js +9 -6
  68. package/src/TemplateData/flowSchema/externalTopic/Complete/handler/data.js +2 -19
  69. package/src/TemplateData/flowSchema/externalTopic/Complete/mainFunction/data.js +3 -1
  70. package/src/TemplateData/flowSchema/externalTopic/Process/functionYaml/data.js +12 -5
  71. package/src/TemplateData/flowSchema/externalTopic/Process/handler/data.js +4 -1
  72. package/src/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +3 -1
  73. package/src/TemplateData/flowSchema/externalTopic/sns-out/data.js +5 -6
  74. package/src/TemplateData/flowSchema/flowSchemaMainFunction/data.js +5 -9
  75. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/data.js +10 -5
  76. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/data.js +3 -3
  77. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/data.js +3 -3
  78. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +65 -58
  79. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/template.ejs +0 -4
  80. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/DsqHandlerTemplate.ejs +91 -0
  81. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +31 -16
  82. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +10 -5
  83. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/data.js +4 -3
  84. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +5 -6
  85. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data.js +3 -1
  86. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +3 -3
  87. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +3 -3
  88. package/src/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +3 -3
  89. package/src/TemplateData/flowSchema/flowStep/functionYaml/data.js +13 -8
  90. package/src/TemplateData/flowSchema/flowStep/handler/data.js +3 -3
  91. package/src/TemplateData/flowSchema/flowStep/mainFunction/data.js +2 -1
  92. package/src/TemplateData/flowSchema/flowStep/sns-in/data.js +3 -3
  93. package/src/TemplateData/flowSchema/generateTemplateData.js +1 -6
  94. package/src/TemplateData/flowSchema/lambdaSync/Api/functionYaml/data.js +10 -3
  95. package/src/TemplateData/flowSchema/lambdaSync/Api/handler/data.js +3 -1
  96. package/src/TemplateData/flowSchema/lambdaSync/Inv/functionYaml/data.js +9 -3
  97. package/src/TemplateData/flowSchema/lambdaSync/Inv/handler/data.js +2 -1
  98. package/src/TemplateData/flowSchema/register/complete/functionYaml/data.js +11 -5
  99. package/src/TemplateData/flowSchema/register/complete/handler/data.js +2 -1
  100. package/src/TemplateData/flowSchema/register/complete/mainFunction/data.js +2 -1
  101. package/src/TemplateData/flowSchema/register/dynamoDB/register.js +2 -4
  102. package/src/TemplateData/flowSchema/register/sns-in/data.js +3 -4
  103. package/src/TemplateData/flowSchema/register/subscriptionOutAll/data.js +3 -3
  104. package/src/TemplateData/flowSchema/register/wbs/functionYaml/data.js +10 -5
  105. package/src/TemplateData/flowSchema/register/wbs/handler/data.js +2 -1
  106. package/src/TemplateData/flowSchema/register/wbs/mainFunction/data.js +2 -1
  107. package/src/TemplateData/flowSchema/statusFieldComponent/FunctionYaml/data.js +14 -6
  108. package/src/TemplateData/flowSchema/statusFieldComponent/Handler/data.js +4 -7
  109. package/src/TemplateData/flowSchema/statusFieldComponent/MainFunction/data.js +4 -3
  110. package/src/TemplateData/flowSchema/statusFieldComponent/sns/data.js +3 -3
  111. package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/functionYaml/data.js +12 -8
  112. package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/data.js +3 -3
  113. package/src/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/mainFunction/data.js +3 -3
  114. package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/functionYaml/data.js +12 -6
  115. package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/data.js +2 -1
  116. package/src/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/mainFunction/data.js +2 -1
  117. package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/functionYaml/data.js +11 -8
  118. package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/data.js +2 -1
  119. package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/data.js +3 -3
  120. package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/template.ejs +10 -4
  121. package/src/TemplateData/flowSchema/triggerCacheComponent/triggerCacheQueue/data.js +4 -11
  122. package/src/TemplateData/flowSchema/webSocketComplete/functionYaml/data.js +11 -8
  123. package/src/TemplateData/flowSchema/webSocketComplete/handler/data.js +2 -1
  124. package/src/TemplateData/flowSchema/webSocketComplete/mainFunction/data.js +1 -1
  125. package/src/TemplateData/flowSchema/webSocketComplete/sqs/data.js +3 -3
  126. package/src/TemplateData/generateRole/data.js +7 -2
  127. package/src/TemplateData/perActionComplete/create/handler/data.js +3 -3
  128. package/src/TemplateData/perActionComplete/create/mainFunction/data.js +3 -3
  129. package/src/TemplateData/perActionComplete/create/mainFunction/template.ejs +2 -2
  130. package/src/TemplateData/perActionComplete/create/sns-in-sqs/data.js +3 -3
  131. package/src/TemplateData/perActionComplete/create/sns-out/data.js +3 -3
  132. package/src/TemplateData/perActionComplete/create/yaml/data.js +11 -7
  133. package/src/TemplateData/perActionComplete/delete/handler/data.js +3 -3
  134. package/src/TemplateData/perActionComplete/delete/mainFunction/data.js +4 -3
  135. package/src/TemplateData/perActionComplete/delete/mainFunction/template.ejs +3 -4
  136. package/src/TemplateData/perActionComplete/delete/sns-in-sqs/data.js +4 -3
  137. package/src/TemplateData/perActionComplete/delete/sns-out/data.js +3 -3
  138. package/src/TemplateData/perActionComplete/delete/yaml/data.js +11 -7
  139. package/src/TemplateData/perActionComplete/get/handler/data.js +3 -3
  140. package/src/TemplateData/perActionComplete/get/mainFunction/data.js +3 -4
  141. package/src/TemplateData/perActionComplete/get/mainFunction/template.ejs +2 -2
  142. package/src/TemplateData/perActionComplete/get/sns-in-sqs/data.js +3 -3
  143. package/src/TemplateData/perActionComplete/get/sns-out/data.js +3 -3
  144. package/src/TemplateData/perActionComplete/get/yaml/data.js +12 -7
  145. package/src/TemplateData/perActionComplete/update/handler/data.js +3 -3
  146. package/src/TemplateData/perActionComplete/update/mainFunction/data.js +3 -3
  147. package/src/TemplateData/perActionComplete/update/mainFunction/template.ejs +2 -2
  148. package/src/TemplateData/perActionComplete/update/sns-in-sqs/data.js +3 -3
  149. package/src/TemplateData/perActionComplete/update/sns-out/data.js +4 -6
  150. package/src/TemplateData/perActionComplete/update/yaml/data.js +11 -7
  151. package/src/TemplateData/processLogical/handler/data.js +3 -3
  152. package/src/TemplateData/processLogical/mainFunction/data.js +2 -1
  153. package/src/TemplateData/processLogical/yaml/data.js +10 -7
  154. package/src/TemplateData/processLogicalPagination/DsqYaml/data.js +1 -1
  155. package/src/TemplateData/processLogicalPagination/handler/dsq/data.js +2 -1
  156. package/src/TemplateData/processLogicalPagination/handler/sqs/data.js +2 -1
  157. package/src/TemplateData/processLogicalPagination/mainFunction/data.js +2 -1
  158. package/src/TemplateData/processLogicalPagination/yaml/dsq/data.js +11 -7
  159. package/src/TemplateData/processLogicalPagination/yaml/sqs/data.js +9 -6
  160. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/data.js +12 -7
  161. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/data.js +3 -3
  162. package/src/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/data.js +3 -3
  163. package/src/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/template.ejs +2 -2
  164. package/src/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/data.js +5 -3
  165. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/functionYaml/data.js +11 -7
  166. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/data.js +3 -3
  167. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/data.js +3 -3
  168. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/template.ejs +12 -11
  169. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-in-sqs/data.js +3 -3
  170. package/src/TemplateData/relationshipPerAction/changeRelationship/complete/sns-out/data.js +2 -1
  171. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/data.js +20 -15
  172. package/src/TemplateData/relationshipPerAction/create/action/handler/data.js +4 -3
  173. package/src/TemplateData/relationshipPerAction/create/action/mainFunction/data.js +4 -3
  174. package/src/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +2 -2
  175. package/src/TemplateData/relationshipPerAction/create/action/sns-in-sqs/data.js +6 -4
  176. package/src/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js +14 -10
  177. package/src/TemplateData/relationshipPerAction/create/complete/handler/sqs/data.js +3 -3
  178. package/src/TemplateData/relationshipPerAction/create/complete/mainFunction/data.js +3 -3
  179. package/src/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +3 -2
  180. package/src/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/data.js +3 -3
  181. package/src/TemplateData/relationshipPerAction/create/complete/sns-out/data.js +3 -4
  182. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/data.js +20 -15
  183. package/src/TemplateData/relationshipPerAction/delete/action/handler/data.js +4 -4
  184. package/src/TemplateData/relationshipPerAction/delete/action/mainFunction/data.js +4 -7
  185. package/src/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +2 -2
  186. package/src/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/data.js +5 -3
  187. package/src/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js +11 -7
  188. package/src/TemplateData/relationshipPerAction/delete/complete/handler/sqs/data.js +2 -1
  189. package/src/TemplateData/relationshipPerAction/delete/complete/mainFunction/data.js +3 -3
  190. package/src/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +4 -5
  191. package/src/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/data.js +3 -3
  192. package/src/TemplateData/relationshipPerAction/delete/complete/sns-out/data.js +3 -3
  193. package/src/TemplateData/relationshipPerAction/generateTemplateData.js +1 -1
  194. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/data.js +19 -16
  195. package/src/TemplateData/relationshipPerAction/get/action/handler/data.js +4 -4
  196. package/src/TemplateData/relationshipPerAction/get/action/mainFunction/data.js +3 -4
  197. package/src/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +6 -3
  198. package/src/TemplateData/relationshipPerAction/get/action/sns-in-sqs/data.js +5 -3
  199. package/src/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +13 -9
  200. package/src/TemplateData/relationshipPerAction/get/complete/handler/sqs/data.js +2 -1
  201. package/src/TemplateData/relationshipPerAction/get/complete/mainFunction/data.js +3 -3
  202. package/src/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +3 -2
  203. package/src/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/data.js +2 -1
  204. package/src/TemplateData/relationshipPerAction/get/complete/sns-out/data.js +3 -3
  205. package/src/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/data.js +17 -13
  206. package/src/TemplateData/relationshipPerAction/moveRelationship/action/handler/data.js +4 -3
  207. package/src/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/data.js +6 -4
  208. package/src/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/template.ejs +6 -3
  209. package/src/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/data.js +6 -4
  210. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/functionYaml/data.js +13 -9
  211. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/data.js +3 -3
  212. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/data.js +3 -3
  213. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/template.ejs +3 -2
  214. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-in-sqs/data.js +3 -3
  215. package/src/TemplateData/relationshipPerAction/moveRelationship/complete/sns-out/data.js +3 -3
  216. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/data.js +20 -15
  217. package/src/TemplateData/relationshipPerAction/update/action/handler/data.js +4 -4
  218. package/src/TemplateData/relationshipPerAction/update/action/mainFunction/data.js +4 -4
  219. package/src/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +6 -3
  220. package/src/TemplateData/relationshipPerAction/update/action/sns-in-sqs/data.js +4 -3
  221. package/src/TemplateData/relationshipPerAction/update/action/sns-out/data.js +5 -6
  222. package/src/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +13 -10
  223. package/src/TemplateData/relationshipPerAction/update/complete/handler/sqs/data.js +3 -3
  224. package/src/TemplateData/relationshipPerAction/update/complete/mainFunction/data.js +2 -1
  225. package/src/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +3 -2
  226. package/src/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/data.js +3 -3
  227. package/src/TemplateData/relationshipPerAction/update/complete/sns-out/data.js +3 -3
  228. package/src/TemplateData/resourceYaml/dynamodb/defaultDynamoDbTable.js +1 -1
  229. package/src/TemplateData/resourceYaml/dynamodb/generateDynamoPerLink.js +7 -3
  230. package/src/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +2 -1
  231. package/src/TemplateData/resourceYaml/filterGenerateResource/data.js +5 -3
  232. package/src/TemplateData/resourceYaml/generateTemplateData.js +5 -2
  233. package/src/TemplateData/resourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +3 -3
  234. package/src/TemplateData/resourceYaml/sns-in-sqs/snsAndSqsPerActionData.js +4 -3
  235. package/src/TemplateData/resourceYaml/sns-out/data.js +3 -3
  236. package/src/TemplateData/resourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +2 -1
  237. package/src/libs/GenerateCodeLibs.js +1 -1
  238. package/src/libs/Libs.js +22 -0
  239. package/src/libs/Utils.js +4 -4
  240. package/src/GenerateSchema.js +0 -164
  241. package/src/SchemaConfig.js +0 -23
  242. package/src/TemplateData/EndpointPerService/mainFunction/create/backupTemplate.ejs +0 -358
  243. package/src/TemplateData/perActionEndpoint/generateTemplateData.js +0 -112
  244. package/src/TemplateData/perActionEndpoint/handler/api/data.js +0 -109
  245. package/src/TemplateData/perActionEndpoint/handler/api/request.json +0 -7
  246. package/src/TemplateData/perActionEndpoint/handler/api/template.ejs +0 -36
  247. package/src/TemplateData/perActionEndpoint/handler/dsq/data.js +0 -118
  248. package/src/TemplateData/perActionEndpoint/handler/dsq/request.json +0 -7
  249. package/src/TemplateData/perActionEndpoint/handler/dsq/template.ejs +0 -55
  250. package/src/TemplateData/perActionEndpoint/handler/inv/data.js +0 -112
  251. package/src/TemplateData/perActionEndpoint/handler/inv/request.json +0 -7
  252. package/src/TemplateData/perActionEndpoint/handler/inv/template.ejs +0 -37
  253. package/src/TemplateData/perActionEndpoint/handler/sqs/data.js +0 -116
  254. package/src/TemplateData/perActionEndpoint/handler/sqs/request.json +0 -7
  255. package/src/TemplateData/perActionEndpoint/handler/sqs/template.ejs +0 -57
  256. package/src/TemplateData/perActionEndpoint/handler/webSocket/data.js +0 -94
  257. package/src/TemplateData/perActionEndpoint/handler/webSocket/template.ejs +0 -61
  258. package/src/TemplateData/perActionEndpoint/handler/webSocketConnect/data.js +0 -54
  259. package/src/TemplateData/perActionEndpoint/handler/webSocketConnect/template.ejs +0 -55
  260. package/src/TemplateData/perActionEndpoint/libs/data.js +0 -60
  261. package/src/TemplateData/perActionEndpoint/libs/template.ejs +0 -46
  262. package/src/TemplateData/perActionEndpoint/mainFunction/create/data.js +0 -91
  263. package/src/TemplateData/perActionEndpoint/mainFunction/create/request.json +0 -0
  264. package/src/TemplateData/perActionEndpoint/mainFunction/create/template.ejs +0 -339
  265. package/src/TemplateData/perActionEndpoint/mainFunction/delete/data.js +0 -91
  266. package/src/TemplateData/perActionEndpoint/mainFunction/delete/template.ejs +0 -99
  267. package/src/TemplateData/perActionEndpoint/mainFunction/get/data.js +0 -92
  268. package/src/TemplateData/perActionEndpoint/mainFunction/get/request.json +0 -5
  269. package/src/TemplateData/perActionEndpoint/mainFunction/get/template.ejs +0 -116
  270. package/src/TemplateData/perActionEndpoint/mainFunction/get/testParam.json +0 -5
  271. package/src/TemplateData/perActionEndpoint/mainFunction/update/data.js +0 -85
  272. package/src/TemplateData/perActionEndpoint/mainFunction/update/request.json +0 -0
  273. package/src/TemplateData/perActionEndpoint/mainFunction/update/template.ejs +0 -166
  274. package/src/TemplateData/perActionEndpoint/yaml/api/data.js +0 -229
  275. package/src/TemplateData/perActionEndpoint/yaml/api/request.json +0 -14
  276. package/src/TemplateData/perActionEndpoint/yaml/api/template.ejs +0 -20
  277. package/src/TemplateData/perActionEndpoint/yaml/dsq/data.js +0 -234
  278. package/src/TemplateData/perActionEndpoint/yaml/dsq/request.json +0 -19
  279. package/src/TemplateData/perActionEndpoint/yaml/dsq/template.ejs +0 -17
  280. package/src/TemplateData/perActionEndpoint/yaml/inv/data.js +0 -207
  281. package/src/TemplateData/perActionEndpoint/yaml/inv/example req.js +0 -15
  282. package/src/TemplateData/perActionEndpoint/yaml/inv/request.json +0 -14
  283. package/src/TemplateData/perActionEndpoint/yaml/inv/template.ejs +0 -13
  284. package/src/TemplateData/perActionEndpoint/yaml/sqs/data.js +0 -237
  285. package/src/TemplateData/perActionEndpoint/yaml/sqs/request.json +0 -19
  286. package/src/TemplateData/perActionEndpoint/yaml/sqs/template.ejs +0 -17
  287. package/src/TemplateData/perActionEndpoint/yaml/wbs/data.js +0 -204
  288. package/src/TemplateData/perActionEndpoint/yaml/wbs/request.json +0 -19
  289. package/src/TemplateData/perActionEndpoint/yaml/wbs/template.ejs +0 -29
  290. package/src/TemplateData/perActionEndpoint/yaml/webSocketConnect/data.js +0 -58
  291. package/src/TemplateData/perActionEndpoint/yaml/webSocketConnect/template.ejs +0 -10
  292. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/api/data.js +0 -146
  293. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/api/template.ejs +0 -20
  294. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/dsq/data.js +0 -146
  295. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/dsq/template.ejs +0 -17
  296. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/inv/data.js +0 -146
  297. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/inv/template.ejs +0 -13
  298. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/sqs/data.js +0 -147
  299. package/src/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/sqs/template.ejs +0 -17
  300. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/data.js +0 -62
  301. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/template.ejs +0 -59
  302. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/data.js +0 -63
  303. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/template.ejs +0 -202
  304. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/data.js +0 -64
  305. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/template.ejs +0 -144
  306. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/data.js +0 -64
  307. package/src/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/template.ejs +0 -77
  308. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/api/data.js +0 -175
  309. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/api/template.ejs +0 -20
  310. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +0 -176
  311. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/template.ejs +0 -17
  312. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +0 -175
  313. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/inv/template.ejs +0 -13
  314. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +0 -177
  315. package/src/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/template.ejs +0 -17
  316. package/src/TemplateData/relationshipPerAction/create/action/handler/api/data.js +0 -62
  317. package/src/TemplateData/relationshipPerAction/create/action/handler/api/request.json +0 -0
  318. package/src/TemplateData/relationshipPerAction/create/action/handler/api/template.ejs +0 -57
  319. package/src/TemplateData/relationshipPerAction/create/action/handler/dsq/data.js +0 -63
  320. package/src/TemplateData/relationshipPerAction/create/action/handler/dsq/request.json +0 -0
  321. package/src/TemplateData/relationshipPerAction/create/action/handler/dsq/template.ejs +0 -184
  322. package/src/TemplateData/relationshipPerAction/create/action/handler/inv/data.js +0 -64
  323. package/src/TemplateData/relationshipPerAction/create/action/handler/inv/request.json +0 -0
  324. package/src/TemplateData/relationshipPerAction/create/action/handler/inv/template.ejs +0 -126
  325. package/src/TemplateData/relationshipPerAction/create/action/handler/sqs/data.js +0 -64
  326. package/src/TemplateData/relationshipPerAction/create/action/handler/sqs/request.json +0 -0
  327. package/src/TemplateData/relationshipPerAction/create/action/handler/sqs/template.ejs +0 -75
  328. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js +0 -178
  329. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/api/template.ejs +0 -20
  330. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +0 -176
  331. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/template.ejs +0 -17
  332. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +0 -178
  333. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/template.ejs +0 -13
  334. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +0 -176
  335. package/src/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/template.ejs +0 -17
  336. package/src/TemplateData/relationshipPerAction/delete/action/handler/api/data.js +0 -62
  337. package/src/TemplateData/relationshipPerAction/delete/action/handler/api/request.json +0 -0
  338. package/src/TemplateData/relationshipPerAction/delete/action/handler/api/template.ejs +0 -139
  339. package/src/TemplateData/relationshipPerAction/delete/action/handler/dsq/data.js +0 -63
  340. package/src/TemplateData/relationshipPerAction/delete/action/handler/dsq/request.json +0 -0
  341. package/src/TemplateData/relationshipPerAction/delete/action/handler/dsq/template.ejs +0 -182
  342. package/src/TemplateData/relationshipPerAction/delete/action/handler/inv/data.js +0 -64
  343. package/src/TemplateData/relationshipPerAction/delete/action/handler/inv/request.json +0 -0
  344. package/src/TemplateData/relationshipPerAction/delete/action/handler/inv/template.ejs +0 -124
  345. package/src/TemplateData/relationshipPerAction/delete/action/handler/sqs/data.js +0 -64
  346. package/src/TemplateData/relationshipPerAction/delete/action/handler/sqs/request.json +0 -0
  347. package/src/TemplateData/relationshipPerAction/delete/action/handler/sqs/template.ejs +0 -162
  348. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/api/data.js +0 -168
  349. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/api/template.ejs +0 -20
  350. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/data.js +0 -177
  351. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/template.ejs +0 -17
  352. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/inv/data.js +0 -167
  353. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/inv/template.ejs +0 -13
  354. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/data.js +0 -166
  355. package/src/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/template.ejs +0 -17
  356. package/src/TemplateData/relationshipPerAction/get/action/handler/api/data.js +0 -62
  357. package/src/TemplateData/relationshipPerAction/get/action/handler/api/request.json +0 -0
  358. package/src/TemplateData/relationshipPerAction/get/action/handler/api/template.ejs +0 -138
  359. package/src/TemplateData/relationshipPerAction/get/action/handler/dsq/data.js +0 -63
  360. package/src/TemplateData/relationshipPerAction/get/action/handler/dsq/request.json +0 -0
  361. package/src/TemplateData/relationshipPerAction/get/action/handler/dsq/template.ejs +0 -185
  362. package/src/TemplateData/relationshipPerAction/get/action/handler/inv/data.js +0 -64
  363. package/src/TemplateData/relationshipPerAction/get/action/handler/inv/request.json +0 -0
  364. package/src/TemplateData/relationshipPerAction/get/action/handler/inv/template.ejs +0 -127
  365. package/src/TemplateData/relationshipPerAction/get/action/handler/sqs/data.js +0 -64
  366. package/src/TemplateData/relationshipPerAction/get/action/handler/sqs/request.json +0 -0
  367. package/src/TemplateData/relationshipPerAction/get/action/handler/sqs/template.ejs +0 -165
  368. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/api/data.js +0 -167
  369. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/api/request.json +0 -0
  370. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/api/template.ejs +0 -20
  371. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +0 -196
  372. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/request.json +0 -0
  373. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/template.ejs +0 -17
  374. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js +0 -186
  375. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/inv/request.json +0 -0
  376. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/inv/template.ejs +0 -13
  377. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js +0 -187
  378. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/request.json +0 -0
  379. package/src/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/template.ejs +0 -17
  380. package/src/TemplateData/relationshipPerAction/update/action/handler/api/data.js +0 -78
  381. package/src/TemplateData/relationshipPerAction/update/action/handler/api/request.json +0 -7
  382. package/src/TemplateData/relationshipPerAction/update/action/handler/api/template.ejs +0 -142
  383. package/src/TemplateData/relationshipPerAction/update/action/handler/dsq/data.js +0 -79
  384. package/src/TemplateData/relationshipPerAction/update/action/handler/dsq/request.json +0 -7
  385. package/src/TemplateData/relationshipPerAction/update/action/handler/dsq/template.ejs +0 -188
  386. package/src/TemplateData/relationshipPerAction/update/action/handler/inv/data.js +0 -80
  387. package/src/TemplateData/relationshipPerAction/update/action/handler/inv/request.json +0 -5
  388. package/src/TemplateData/relationshipPerAction/update/action/handler/inv/template.ejs +0 -147
  389. package/src/TemplateData/relationshipPerAction/update/action/handler/sqs/data.js +0 -79
  390. package/src/TemplateData/relationshipPerAction/update/action/handler/sqs/request.json +0 -7
  391. package/src/TemplateData/relationshipPerAction/update/action/handler/sqs/template.ejs +0 -163
  392. package/src/TemplateData/resourceYaml/CreateSourceData.js +0 -79
  393. /package/src/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/{template.ejs → SqsHandlerTemplate.ejs} +0 -0
@@ -1,62 +0,0 @@
1
- /*
2
- Copyright (C) 2020 Sven Mason <http://izara.io>
3
-
4
- This program is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU Affero General Public License as
6
- published by the Free Software Foundation, either version 3 of the
7
- License, or (at your option) any later version.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU Affero General Public License for more details.
13
-
14
- You should have received a copy of the GNU Affero General Public License
15
- along with this program. If not, see <http://www.gnu.org/licenses/>.
16
- */
17
-
18
- import path from 'path';
19
- import { fileURLToPath } from 'url';
20
- const __filename = fileURLToPath(import.meta.url);
21
- const __dirname = path.dirname(__filename);
22
-
23
- const {
24
- ACTIONS,
25
- HANDLER
26
- } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
27
-
28
- const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
29
- require('../../../../../../../MainLibs/src/Consts.js').utils;
30
- const { SOURCE_PATH, FUNCTION_NAME } =
31
- require('../../../../../../../MainLibs/src/Consts.js').consts;
32
-
33
- const templatePath = path.join(__dirname, 'template.ejs');
34
-
35
- /**
36
- * receive objectSchema
37
- * create data for hdrInv template
38
- *
39
- * @return {{ templatePath, templateData, setting } }
40
- */
41
- function data(_izContext, srcPath) {
42
- const createSourceParams = createParamForCreateSource(srcPath);
43
- return [createSourceParams];
44
- }
45
-
46
- function createParamForCreateSource(srcPath) {
47
- let functionName = FUNCTION_NAME.changeRel;
48
- return {
49
- templatePath: templatePath,
50
- templateData: {
51
- functionName
52
- },
53
- setting: {
54
- savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
55
- saveFileName: upperCase(functionName) + '_' + upperCase(HANDLER.hdrApi),
56
- fileExtension: '.js',
57
- isAppend: false
58
- }
59
- };
60
- }
61
-
62
- module.exports = data;
@@ -1,59 +0,0 @@
1
- /* Copyright (C) 2020 Sven Mason <http://izara.io> This program is free
2
- software: you can redistribute it and/or modify it under the terms of the GNU
3
- Affero General Public License as published by the Free Software Foundation,
4
- either version 3 of the License, or (at your option) any later version. This
5
- program is distributed in the hope that it will be useful, but WITHOUT ANY
6
- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
7
- PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
8
- You should have received a copy of the GNU Affero General Public License along
9
- with this program. If not, see <http://www.gnu.org/licenses/>. */
10
- const izara = require("@izara_project/izara-middleware"); const middleware =
11
- izara.middlewareHandler; const callingFlowSharedLib =
12
- require('@izara_project/izara-core-library-calling-flow'); const {
13
- validateSchemaMiddleware } =
14
- require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs/index.js');
15
- const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName)
16
- %>_Main'); // validate event params in middleware before into function let
17
- validatorSchema = { type: "object", required: [ 'firstObject', 'secondObject',
18
- 'oldReltypeAndDirection', 'newRelType', ], properties: { firstObject: { type:
19
- 'object', required: ['objType', 'identifiers'], properties: { objType: { type:
20
- 'object', required: ['objectType', 'serviceTag'], properties: { serviceTag:
21
- izara.validatorSchema.stringNotEmpty(), objectType:
22
- izara.validatorSchema.stringNotEmpty(), } }, identifiers: { type: "object",
23
- minProperties: 1 }, } }, secondObject: { type: 'object', required: ['objType',
24
- 'identifiers'], properties: { objType: { type: 'object', required:
25
- ['objectType', 'serviceTag'], properties: { serviceTag:
26
- izara.validatorSchema.stringNotEmpty(), objectType:
27
- izara.validatorSchema.stringNotEmpty(), } }, identifiers: { type: "object",
28
- minProperties: 1 }, } }, oldReltypeAndDirection: { type: 'object', required:
29
- ['relType', 'relationshipDirection'], properties: { relType: { type: 'object',
30
- required: ['serviceTag', 'relationshipTag'], properties: { serviceTag:
31
- izara.validatorSchema.stringNotEmpty(), relationshipTag:
32
- izara.validatorSchema.stringNotEmpty(), } }, relationshipProperties: { type:
33
- 'object', }, relationshipDirection: { type: 'string', enum: ['from', 'to'] }, }
34
- }, newRelType: { type: 'object', required: ['serviceTag', 'relationshipTag'],
35
- properties: { serviceTag: izara.validatorSchema.stringNotEmpty(),
36
- relationshipTag: izara.validatorSchema.stringNotEmpty(), } }, settings: { type:
37
- 'object' } } }; //(<globalVariable> //</globalVariable>) // validate event
38
- params in middleware before into main function validatorSchema =
39
- callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(validatorSchema);
40
- middleware.setValidatorSchema(validatorSchema) // if need to validate authorizer
41
- or additional params , add code to hook tag below //(<afterValidateWith
42
- >) //(</afterValidateWith
43
- >) module.exports.main = middleware.wrap(async (event, context, callback) => {
44
- event._izContext.logger.debug('Event:', event); try { // invoke LambdaFunction
45
- let lambdaFunctionResponse = await <%- functionName %>.<%- functionName %>(
46
- event._izContext, //
47
- correlationId/logger/integrationTestDetail/uniqueRequestId/userId { firstObject:
48
- event.firstObject, secondObject: event.secondObject, relType: event.relType,
49
- relationshipDirection: event.relationshipDirection, relationshipProperties:
50
- event.relationshipProperties, },
51
- callingFlowSharedLib.addCallingFlowToPassOnProperties(event) ); // return error
52
- to client if (lambdaFunctionResponse instanceof Error) { return
53
- (izara.response.failure(lambdaFunctionResponse)); } // return success to client
54
- return (izara.response.success(lambdaFunctionResponse)); } catch (err) {
55
- event._izContext.logger.error('Error, <%- functionName %>HdrApi: ', err); return
56
- (izara.response.failure(err)); } }); <%_ function firstLetterUpperCase(text) {
57
- return text.charAt(0).toUpperCase() + text.slice(1) } _%> <%_ function
58
- firstLetterLowerCase(str) { return str.charAt(0).toLowerCase() + str.slice(1) }
59
- _%>
@@ -1,63 +0,0 @@
1
- /*
2
- Copyright (C) 2020 Sven Mason <http://izara.io>
3
-
4
- This program is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU Affero General Public License as
6
- published by the Free Software Foundation, either version 3 of the
7
- License, or (at your option) any later version.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU Affero General Public License for more details.
13
-
14
- You should have received a copy of the GNU Affero General Public License
15
- along with this program. If not, see <http://www.gnu.org/licenses/>.
16
- */
17
-
18
- import path from 'path';
19
- import { fileURLToPath } from 'url';
20
- const __filename = fileURLToPath(import.meta.url);
21
- const __dirname = path.dirname(__filename);
22
-
23
- const {
24
- ACTIONS,
25
- HANDLER
26
- } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
27
-
28
- const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
29
- require('../../../../../../../MainLibs/src/Consts.js').utils;
30
- const { SOURCE_PATH, FUNCTION_NAME } =
31
- require('../../../../../../../MainLibs/src/Consts.js').consts;
32
-
33
- const templatePath = path.join(__dirname, 'template.ejs');
34
-
35
- /**
36
- * create data for hdrInv template
37
- *
38
- * @return {{ templatePath, templateData, setting } }
39
- */
40
- function data(_izContext, srcPath) {
41
- const createSourceParams = createParamForCreateSource(srcPath);
42
- return [createSourceParams];
43
- }
44
-
45
- function createParamForCreateSource(srcPath) {
46
- let functionName = FUNCTION_NAME.changeRel;
47
- let queueName = functionName + upperCase(HANDLER.hdrDsq);
48
- return {
49
- templatePath: templatePath,
50
- templateData: {
51
- functionName,
52
- queueName
53
- },
54
- setting: {
55
- savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
56
- saveFileName: upperCase(functionName) + '_' + upperCase(HANDLER.hdrDsq),
57
- fileExtension: '.js',
58
- isAppend: false
59
- }
60
- };
61
- }
62
-
63
- module.exports = data;
@@ -1,202 +0,0 @@
1
- /*
2
- Copyright (C) 2020 Sven Mason <http://izara.io>
3
-
4
- This program is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU Affero General Public License as
6
- published by the Free Software Foundation, either version 3 of the
7
- License, or (at your option) any later version.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU Affero General Public License for more details.
13
-
14
- You should have received a copy of the GNU Affero General Public License
15
- along with this program. If not, see <http://www.gnu.org/licenses/>.
16
- */
17
-
18
-
19
-
20
- const izara = require("@izara_project/izara-middleware");
21
- const middleware = izara.middlewareHandler;
22
-
23
- const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
24
-
25
- // const CorrelationIds = require('@izara_project/izara-core-library-correlation-ids')
26
- // const IntegrationTestDetail = require('@izara_project/izara-core-library-integration-tests')
27
- const Logger = require('@izara_project/izara-core-library-logger');
28
- const recordHandlerSharedLib = require('@izara_project/izara-core-library-record-handler');
29
-
30
-
31
- const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>_Main');
32
- // validate event properties in body.Message of sqs event
33
- middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema(
34
- {
35
- type: "object",
36
- required: ['body', 'messageAttributes'],
37
- properties: {
38
- body: {
39
- type: 'object',
40
- },
41
- messageAttributes: {
42
- type: 'object'
43
- }
44
- }
45
- }
46
- ));
47
-
48
- // validate event params in middlewware before into function.
49
- let validatorSchema = {
50
- type: "object",
51
- required: [
52
- 'firstObject',
53
- 'secondObject',
54
- 'oldReltypeAndDirection',
55
- 'newRelType',
56
- ],
57
- properties: {
58
- firstObject: {
59
- type: 'object',
60
- required: ['objType', 'identifiers'],
61
- properties: {
62
- objType: {
63
- type: 'object',
64
- required: ['objectType', 'serviceTag'],
65
- properties: {
66
- serviceTag: izara.validatorSchema.stringNotEmpty(),
67
- objectType: izara.validatorSchema.stringNotEmpty(),
68
- }
69
- },
70
- identifiers: {
71
- type: "object",
72
- minProperties: 1
73
- },
74
- }
75
- },
76
- secondObject: {
77
- type: 'object',
78
- required: ['objType', 'identifiers'],
79
- properties: {
80
- objType: {
81
- type: 'object',
82
- required: ['objectType', 'serviceTag'],
83
- properties: {
84
- serviceTag: izara.validatorSchema.stringNotEmpty(),
85
- objectType: izara.validatorSchema.stringNotEmpty(),
86
- }
87
- },
88
- identifiers: {
89
- type: "object",
90
- minProperties: 1
91
- },
92
- }
93
- },
94
- oldReltypeAndDirection: {
95
- type: 'object',
96
- required: ['relType', 'relationshipDirection'],
97
- properties: {
98
- relType: {
99
- type: 'object',
100
- required: ['serviceTag', 'relationshipTag'],
101
- properties: {
102
- serviceTag: izara.validatorSchema.stringNotEmpty(),
103
- relationshipTag: izara.validatorSchema.stringNotEmpty(),
104
- }
105
- },
106
- relationshipProperties: {
107
- type: 'object',
108
- },
109
- relationshipDirection: {
110
- type: 'string',
111
- enum: ['from', 'to']
112
-
113
- },
114
- }
115
- },
116
- newRelType: {
117
- type: 'object',
118
- required: ['serviceTag', 'relationshipTag'],
119
- properties: {
120
- serviceTag: izara.validatorSchema.stringNotEmpty(),
121
- relationshipTag: izara.validatorSchema.stringNotEmpty(),
122
- }
123
- },
124
- settings: {
125
- type: 'object'
126
- }
127
- }
128
- };
129
-
130
-
131
- //(<globalVariable>
132
- //</globalVariable>)
133
-
134
- // validate event params in middleware before into main function
135
- validatorSchema = callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(validatorSchema);
136
- // if need to validate authorizer or additional params , add code to hook tag below
137
-
138
- //(<afterValidateWith>)
139
- //(</afterValidateWith>)
140
-
141
-
142
- module.exports.main = middleware.wrap(async (event, context, callback) => {
143
- Logger.debug('event:', event);
144
- Logger.debug('context:', context);
145
- try {
146
-
147
- let recordPromises = []; // final return
148
-
149
- // loop each record and send to mainFunction
150
- await Promise.all(event.Records.map(async record => { // promise.all for map() function
151
-
152
- // --- reforming record.body for Dsq request
153
- record = recordHandlerSharedLib.reformatDsqMessage(record._izContext, record);
154
- record._izContext.logger.debug('record LambdaFunctionHdrDsq after reform', record);
155
-
156
- let passOnProperties = []
157
-
158
- // --- validate message (and MessageAttributes)
159
- await recordHandlerSharedLib.validateRecord(
160
- record, // one record will send to mainFunction
161
- "<%- queueName %>", // queue name that need to retry or send to dlq
162
- validatorSchema, // schema for record.Message
163
- // messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
164
- );
165
-
166
- // add argument (to invoke lambda) to passOnProperties[]
167
- passOnProperties.push(record.body.Message)
168
- passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message));
169
- //(<afterPutParamIntoMainFunction>)
170
- //(</afterPutParamIntoMainFunction>)
171
- record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
172
-
173
- // call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
174
- let recordPromise = recordHandlerSharedLib.recordHandler(
175
- record, // one record will send to mainFunction
176
- <%- functionName %>.<%- functionName %>, // mainFunction that need to invoke.
177
- "<%- queueName %>", // queue name that need to retry or send to dlq
178
- passOnProperties, // all parameters that mainFunction needed.
179
- );
180
- record._izContext.logger.debug('after recordPromise in handler');
181
- recordPromises.push(recordPromise); // push promise to recordPromises
182
- })) //end record
183
-
184
- Logger.debug('before Promise.all(recordPromises) in handler');
185
- try {
186
- await Promise.all(recordPromises); // await all promises
187
- return event.Records // return all for local test
188
- } catch {
189
- Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
190
- }
191
- Logger.debug('after Promise.all(recordPromises) in handler');
192
- } catch (err) {
193
- Logger.error('Unhandled Error, updateRelationshipHdrDsq:', err);
194
- throw (err);
195
- }
196
- });
197
- <%_ function firstLetterUpperCase(text) {
198
- return text.charAt(0).toUpperCase() + text.slice(1)
199
- } _%>
200
- <%_ function firstLetterLowerCase(str) {
201
- return str.charAt(0).toLowerCase() + str.slice(1)
202
- } _%>
@@ -1,64 +0,0 @@
1
- /*
2
- Copyright (C) 2020 Sven Mason <http://izara.io>
3
-
4
- This program is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU Affero General Public License as
6
- published by the Free Software Foundation, either version 3 of the
7
- License, or (at your option) any later version.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU Affero General Public License for more details.
13
-
14
- You should have received a copy of the GNU Affero General Public License
15
- along with this program. If not, see <http://www.gnu.org/licenses/>.
16
- */
17
-
18
- import path from 'path';
19
- import { fileURLToPath } from 'url';
20
- const __filename = fileURLToPath(import.meta.url);
21
- const __dirname = path.dirname(__filename);
22
-
23
- const {
24
- ACTIONS,
25
- HANDLER
26
- } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
27
-
28
- const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
29
- require('../../../../../../../MainLibs/src/Consts.js').utils;
30
- const { SOURCE_PATH, FUNCTION_NAME } =
31
- require('../../../../../../../MainLibs/src/Consts.js').consts;
32
-
33
- const templatePath = path.join(__dirname, 'template.ejs');
34
-
35
- /**
36
- * receive objectSchema
37
- * create data for hdrInv template
38
- *
39
- * @return {{ templatePath, templateData, setting } }
40
- */
41
- function data(_izContext, srcPath) {
42
- const createSourceParams = createParamForCreateSource(srcPath);
43
- return [createSourceParams];
44
- }
45
-
46
- function createParamForCreateSource(srcPath) {
47
- let functionName = FUNCTION_NAME.changeRel;
48
- let handler = HANDLER.hdrInv;
49
- return {
50
- templatePath: templatePath,
51
- templateData: {
52
- functionName,
53
- handler
54
- },
55
- setting: {
56
- savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
57
- saveFileName: upperCase(functionName) + '_' + upperCase(handler),
58
- fileExtension: '.js',
59
- isAppend: false
60
- }
61
- };
62
- }
63
-
64
- module.exports = data;
@@ -1,144 +0,0 @@
1
- /*
2
- Copyright (C) 2020 Sven Mason <http://izara.io>
3
-
4
- This program is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU Affero General Public License as
6
- published by the Free Software Foundation, either version 3 of the
7
- License, or (at your option) any later version.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU Affero General Public License for more details.
13
-
14
- You should have received a copy of the GNU Affero General Public License
15
- along with this program. If not, see <http://www.gnu.org/licenses/>.
16
- */
17
-
18
-
19
-
20
- const izara = require("@izara_project/izara-middleware");
21
- const middleware = izara.middlewareHandler;
22
-
23
- const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
24
-
25
- // const CorrelationIds = require('@izara_project/izara-core-library-correlation-ids')
26
- // const Logger = require('@izara_project/izara-core-library-logger');
27
- // const IntegrationTestDetail = require('@izara_project/izara-core-library-integration-tests')
28
-
29
- const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>_Main');
30
-
31
- // validate event params in middlewware before into function.
32
- let validatorSchema = {
33
- type: "object",
34
- required: [
35
- 'firstObject',
36
- 'secondObject',
37
- 'oldReltypeAndDirection',
38
- 'newRelType',
39
- ],
40
- properties: {
41
- firstObject: {
42
- type: 'object',
43
- required: ['objType', 'identifiers'],
44
- properties: {
45
- objType: {
46
- type: 'object',
47
- required: ['objectType', 'serviceTag'],
48
- properties: {
49
- serviceTag: izara.validatorSchema.stringNotEmpty(),
50
- objectType: izara.validatorSchema.stringNotEmpty(),
51
- }
52
- },
53
- identifiers: {
54
- type: "object",
55
- minProperties: 1
56
- },
57
- }
58
- },
59
- secondObject: {
60
- type: 'object',
61
- required: ['objType', 'identifiers'],
62
- properties: {
63
- objType: {
64
- type: 'object',
65
- required: ['objectType', 'serviceTag'],
66
- properties: {
67
- serviceTag: izara.validatorSchema.stringNotEmpty(),
68
- objectType: izara.validatorSchema.stringNotEmpty(),
69
- }
70
- },
71
- identifiers: {
72
- type: "object",
73
- minProperties: 1
74
- },
75
- }
76
- },
77
- oldReltypeAndDirection: {
78
- type: 'object',
79
- required: ['relType', 'relationshipDirection'],
80
- properties: {
81
- relType: {
82
- type: 'object',
83
- required: ['serviceTag', 'relationshipTag'],
84
- properties: {
85
- serviceTag: izara.validatorSchema.stringNotEmpty(),
86
- relationshipTag: izara.validatorSchema.stringNotEmpty(),
87
- }
88
- },
89
- relationshipProperties: {
90
- type: 'object',
91
- },
92
- relationshipDirection: {
93
- type: 'string',
94
- enum: ['from', 'to']
95
-
96
- },
97
- }
98
- },
99
- newRelType: {
100
- type: 'object',
101
- required: ['serviceTag', 'relationshipTag'],
102
- properties: {
103
- serviceTag: izara.validatorSchema.stringNotEmpty(),
104
- relationshipTag: izara.validatorSchema.stringNotEmpty(),
105
- }
106
- },
107
- settings: {
108
- type: 'object'
109
- }
110
- }
111
- };
112
-
113
- validatorSchema = callingFlowSharedLib.addOptionalCallingFlowToValidatorSchema(validatorSchema); // is Ok callinfFlow
114
- middleware.setValidatorSchema(validatorSchema)
115
-
116
- module.exports.main = middleware.wrap(async (event, context, callback) => {
117
- event._izContext.logger.debug('Event:', event);
118
- event._izContext.logger.debug('context:', context);
119
-
120
- try {
121
- // invoke LambdaFunction
122
- return await <%- functionName %>.<%- functionName %>(
123
- event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId
124
- {
125
- firstObject: event.firstObject,
126
- secondObject: event.secondObject,
127
- relType: event.relType,
128
- relationshipDirection: event.relationshipDirection,
129
- relationshipProperties: event.relationshipProperties,
130
- },
131
- callingFlowSharedLib.addCallingFlowToPassOnProperties(event)
132
- );
133
-
134
- } catch (err) {
135
- event._izContext.logger.error('Error, <%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handler) %> : ', err);
136
- throw (err);
137
- }
138
- });
139
- <%_ function firstLetterUpperCase(text) {
140
- return text.charAt(0).toUpperCase() + text.slice(1)
141
- } _%>
142
- <%_ function firstLetterLowerCase(str) {
143
- return str.charAt(0).toLowerCase() + str.slice(1)
144
- } _%>
@@ -1,64 +0,0 @@
1
- /*
2
- Copyright (C) 2020 Sven Mason <http://izara.io>
3
-
4
- This program is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU Affero General Public License as
6
- published by the Free Software Foundation, either version 3 of the
7
- License, or (at your option) any later version.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU Affero General Public License for more details.
13
-
14
- You should have received a copy of the GNU Affero General Public License
15
- along with this program. If not, see <http://www.gnu.org/licenses/>.
16
- */
17
-
18
- import path from 'path';
19
- import { fileURLToPath } from 'url';
20
- const __filename = fileURLToPath(import.meta.url);
21
- const __dirname = path.dirname(__filename);
22
-
23
- const {
24
- ACTIONS,
25
- HANDLER
26
- } = require('@izara_project/izara-core-library-service-schemas/src/Consts');
27
-
28
- const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } =
29
- require('../../../../../../../MainLibs/src/Consts.js').utils;
30
- const { SOURCE_PATH, FUNCTION_NAME } =
31
- require('../../../../../../../MainLibs/src/Consts.js').consts;
32
-
33
- const templatePath = path.join(__dirname, 'template.ejs');
34
-
35
- /**
36
- * receive objectSchema
37
- * create data for sqs template
38
- *
39
- * @return {{ templatePath, templateData, setting } }
40
- */
41
- function data(_izContext, srcPath) {
42
- const createSourceParams = createParamForCreateSource(srcPath);
43
- return [createSourceParams];
44
- }
45
-
46
- function createParamForCreateSource(srcPath) {
47
- let functionName = FUNCTION_NAME.changeRel;
48
- let queueName = functionName + upperCase(HANDLER.hdrSqs);
49
- return {
50
- templatePath: templatePath,
51
- templateData: {
52
- functionName,
53
- queueName
54
- },
55
- setting: {
56
- savePath: path.join(srcPath, SOURCE_PATH.relationshipPerAction),
57
- saveFileName: upperCase(functionName) + '_' + upperCase(HANDLER.hdrSqs),
58
- fileExtension: '.js',
59
- isAppend: false
60
- }
61
- };
62
- }
63
-
64
- module.exports = data;