@izara_project/izara-market-library-service-schemas 1.0.83 → 1.0.85

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 (839) hide show
  1. package/index.js +0 -1
  2. package/package.json +3 -4
  3. package/src/GenerateCodeLibs/index.js +3 -8
  4. package/src/GenerateCodeLibs/src/Consts.js +73 -75
  5. package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +341 -1918
  6. package/src/MainLibs/index.js +4 -10
  7. package/src/MainLibs/src/Consts.js +765 -312
  8. package/src/MainLibs/src/GenerateCodeUtils.js +25 -15
  9. package/src/MainLibs/src/Utils.js +16 -12
  10. package/src/SourceManager/index.js +3 -7
  11. package/src/SourceManager/src/CreateSource.js +113 -54
  12. package/src/SourceManager/src/Utils.js +26 -23
  13. package/src/reStructure/GenerateCode.js +47 -28
  14. package/src/reStructure/GenerateResources.js +11 -17
  15. package/src/reStructure/GenerateSchema.js +44 -30
  16. package/src/reStructure/GenerateTests.js +23 -24
  17. package/src/reStructure/IntTestConfig.js +3 -7
  18. package/src/reStructure/SchemaConfig.js +3 -7
  19. package/src/reStructure/TemplateConfig.js +11 -12
  20. package/src/reStructure/TemplateData/Auth/generateAuthYml/data.js +4 -10
  21. package/src/reStructure/TemplateData/Auth/generateTemplateData.js +6 -5
  22. package/src/reStructure/TemplateData/EndpointPerService/generateTemplateData.js +40 -30
  23. package/src/reStructure/TemplateData/EndpointPerService/handler/api/data.js +14 -15
  24. package/src/reStructure/TemplateData/EndpointPerService/handler/api/template.ejs +1 -1
  25. package/src/reStructure/TemplateData/EndpointPerService/handler/dsq/data.js +12 -12
  26. package/src/reStructure/TemplateData/EndpointPerService/handler/dsq/template.ejs +3 -3
  27. package/src/reStructure/TemplateData/EndpointPerService/handler/inv/data.js +21 -13
  28. package/src/reStructure/TemplateData/EndpointPerService/handler/inv/template.ejs +1 -1
  29. package/src/reStructure/TemplateData/EndpointPerService/handler/sqs/data.js +24 -16
  30. package/src/reStructure/TemplateData/EndpointPerService/handler/sqs/template.ejs +3 -3
  31. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/backupTemplate.ejs +1 -1
  32. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/data.js +8 -12
  33. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +17 -4
  34. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/data.js +11 -15
  35. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +3 -3
  36. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/data.js +9 -13
  37. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/template.ejs +3 -3
  38. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/data.js +8 -12
  39. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +19 -6
  40. package/src/reStructure/TemplateData/EndpointPerService/yaml/data.js +128 -79
  41. package/src/reStructure/TemplateData/IntTest/generateResources/generateResources.js +49 -36
  42. package/src/reStructure/TemplateData/IntTest/generateTests/events/data.js +50 -25
  43. package/src/reStructure/TemplateData/IntTest/generateTests/generateTemplate.js +21 -18
  44. package/src/reStructure/TemplateData/IntTest/generateTests/pathIntTest/data.js +20 -10
  45. package/src/reStructure/TemplateData/IntTest/generateTests/pathIntTest/template.ejs +4 -4
  46. package/src/reStructure/TemplateData/IntTest/generateTests/tests/data.js +66 -38
  47. package/src/reStructure/TemplateData/IntTest/libs/libs.js +1 -1
  48. package/src/reStructure/TemplateData/IntTest/upload/uploadIntTest.js +26 -23
  49. package/src/reStructure/TemplateData/externalService/functionNameConfig/data.js +41 -41
  50. package/src/reStructure/TemplateData/externalService/functionNameConfig/templateIntTesting.ejs +2 -2
  51. package/src/reStructure/TemplateData/externalService/generateTemplateData.js +27 -8
  52. package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +190 -75
  53. package/src/reStructure/TemplateData/externalService/lambdaRole/template.ejs +2 -2
  54. package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +111 -63
  55. package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/template.ejs +7 -3
  56. package/src/reStructure/TemplateData/findData/findDataYaml/data.js +51 -37
  57. package/src/reStructure/TemplateData/findData/generateTemplateData.js +16 -9
  58. package/src/reStructure/TemplateData/findData/handler/data.js +9 -15
  59. package/src/reStructure/TemplateData/findData/handler/template.ejs +1 -1
  60. package/src/reStructure/TemplateData/findData/mainFunction/data.js +99 -76
  61. package/src/reStructure/TemplateData/findData/mainFunction/template.ejs +1 -1
  62. package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/functionYaml/data.js +22 -20
  63. package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/handler/data.js +19 -14
  64. package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/handler/template.ejs +1 -1
  65. package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/mainFunction/data.js +20 -18
  66. package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/mainFunction/template.ejs +1 -1
  67. package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/queue/data.js +14 -15
  68. package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/data.js +24 -19
  69. package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/handler/data.js +17 -16
  70. package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/handler/template.ejs +1 -1
  71. package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/data.js +14 -13
  72. package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +1 -1
  73. package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/queue/data.js +13 -20
  74. package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js +23 -28
  75. package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/data.js +18 -18
  76. package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +1 -1
  77. package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/data.js +17 -16
  78. package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +1 -1
  79. package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/data.js +21 -21
  80. package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/handler/data.js +18 -18
  81. package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/handler/template.ejs +1 -1
  82. package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/data.js +17 -16
  83. package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +1 -1
  84. package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/data.js +16 -22
  85. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/data.js +26 -21
  86. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/handler/data.js +16 -14
  87. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/handler/template.ejs +1 -1
  88. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/data.js +18 -16
  89. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +1 -1
  90. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/queue/data.js +11 -16
  91. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/data.js +39 -25
  92. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/data.js +16 -14
  93. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/template.ejs +1 -1
  94. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/data.js +14 -13
  95. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +1 -1
  96. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/data.js +17 -20
  97. package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/data.js +25 -23
  98. package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/data.js +15 -15
  99. package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/template.ejs +1 -1
  100. package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/ProcessCsvtemplate.ejs +1 -1
  101. package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/data.js +12 -12
  102. package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +1 -1
  103. package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/queue/data.js +19 -26
  104. package/src/reStructure/TemplateData/flowSchema/components/upload/relate/S3/data.js +12 -15
  105. package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/data.js +11 -12
  106. package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/template.ejs +1 -1
  107. package/src/reStructure/TemplateData/flowSchema/components/upload/relate/sns-out/data.js +12 -13
  108. package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +20 -24
  109. package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/data.js +10 -13
  110. package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/template.ejs +1 -1
  111. package/src/reStructure/TemplateData/flowSchema/components/websocket/dynamoDb/ReservedTableData.js +25 -27
  112. package/src/reStructure/TemplateData/flowSchema/components/websocket/dynamoDb/WebSocketTaskData.js +25 -27
  113. package/src/reStructure/TemplateData/flowSchema/components/websocket/dynamoDb/userUploadRecords.js +19 -24
  114. package/src/reStructure/TemplateData/flowSchema/dynamoDb/data.js +43 -34
  115. package/src/reStructure/TemplateData/flowSchema/eventBridge/functionYaml/data.js +31 -24
  116. package/src/reStructure/TemplateData/flowSchema/eventBridge/handler/inv/data.js +27 -26
  117. package/src/reStructure/TemplateData/flowSchema/eventBridge/handler/inv/template.ejs +1 -1
  118. package/src/reStructure/TemplateData/flowSchema/eventBridge/mainFunction/data.js +25 -24
  119. package/src/reStructure/TemplateData/flowSchema/eventBridge/mainFunction/template.ejs +1 -1
  120. package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/functionYaml/data.js +22 -22
  121. package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/handler/data.js +16 -12
  122. package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/handler/template.ejs +1 -1
  123. package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/mainFunction/data.js +15 -14
  124. package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/mainFunction/template.ejs +1 -1
  125. package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/functionYaml/data.js +42 -35
  126. package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/handler/data.js +14 -13
  127. package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/handler/template.ejs +1 -1
  128. package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +12 -20
  129. package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/data.js +14 -21
  130. package/src/reStructure/TemplateData/flowSchema/flowSchemaMainFunction/data.js +52 -22
  131. package/src/reStructure/TemplateData/flowSchema/flowSchemaMainFunction/template.ejs +1 -1
  132. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/data.js +25 -19
  133. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/data.js +18 -17
  134. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/template.ejs +1 -1
  135. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/data.js +17 -16
  136. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/template.ejs +1 -1
  137. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +36 -26
  138. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +17 -16
  139. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/template.ejs +1 -1
  140. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +22 -29
  141. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/data.js +15 -11
  142. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +1 -1
  143. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data.js +14 -14
  144. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +1 -1
  145. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +17 -20
  146. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +16 -17
  147. package/src/reStructure/TemplateData/flowSchema/flowStep/functionYaml/data.js +53 -25
  148. package/src/reStructure/TemplateData/flowSchema/flowStep/handler/data.js +38 -21
  149. package/src/reStructure/TemplateData/flowSchema/flowStep/handler/template.ejs +1 -1
  150. package/src/reStructure/TemplateData/flowSchema/flowStep/mainFunction/data.js +34 -21
  151. package/src/reStructure/TemplateData/flowSchema/flowStep/mainFunction/template.ejs +1 -1
  152. package/src/reStructure/TemplateData/flowSchema/flowStep/sns-in/data.js +24 -25
  153. package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +444 -143
  154. package/src/reStructure/TemplateData/flowSchema/lambdaSync/Api/functionYaml/data.js +14 -11
  155. package/src/reStructure/TemplateData/flowSchema/lambdaSync/Api/handler/data.js +15 -15
  156. package/src/reStructure/TemplateData/flowSchema/lambdaSync/Api/handler/template.ejs +1 -1
  157. package/src/reStructure/TemplateData/flowSchema/lambdaSync/Inv/functionYaml/data.js +15 -11
  158. package/src/reStructure/TemplateData/flowSchema/lambdaSync/Inv/handler/data.js +15 -15
  159. package/src/reStructure/TemplateData/flowSchema/lambdaSync/Inv/handler/template.ejs +1 -1
  160. package/src/reStructure/TemplateData/flowSchema/register/complete/functionYaml/data.js +34 -36
  161. package/src/reStructure/TemplateData/flowSchema/register/complete/handler/data.js +22 -26
  162. package/src/reStructure/TemplateData/flowSchema/register/complete/handler/template.ejs +1 -1
  163. package/src/reStructure/TemplateData/flowSchema/register/complete/mainFunction/data.js +17 -17
  164. package/src/reStructure/TemplateData/flowSchema/register/complete/mainFunction/template.ejs +1 -1
  165. package/src/reStructure/TemplateData/flowSchema/register/dynamoDB/register.js +35 -32
  166. package/src/reStructure/TemplateData/flowSchema/register/sns-in/data.js +21 -20
  167. package/src/reStructure/TemplateData/flowSchema/register/subscriptionOutAll/data.js +21 -18
  168. package/src/reStructure/TemplateData/flowSchema/register/wbs/functionYaml/data.js +33 -39
  169. package/src/reStructure/TemplateData/flowSchema/register/wbs/handler/data.js +10 -12
  170. package/src/reStructure/TemplateData/flowSchema/register/wbs/handler/template.ejs +1 -1
  171. package/src/reStructure/TemplateData/flowSchema/register/wbs/mainFunction/data.js +9 -12
  172. package/src/reStructure/TemplateData/flowSchema/register/wbs/mainFunction/template.ejs +1 -1
  173. package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/FunctionYaml/data.js +44 -26
  174. package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/Handler/data.js +18 -15
  175. package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/Handler/template.ejs +1 -1
  176. package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/MainFunction/data.js +16 -14
  177. package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/MainFunction/template.ejs +1 -1
  178. package/src/reStructure/TemplateData/flowSchema/statusFieldComponent/sns/data.js +13 -17
  179. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/functionYaml/data.js +40 -24
  180. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/data.js +23 -18
  181. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/handler/template.ejs +1 -1
  182. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/mainFunction/data.js +22 -16
  183. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/checkTriggerCacheComplete/mainFunction/template.ejs +1 -1
  184. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/functionYaml/data.js +42 -26
  185. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/data.js +18 -15
  186. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/handler/template.ejs +2 -1
  187. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/mainFunction/data.js +17 -12
  188. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/processTriggerCache/mainFunction/template.ejs +1 -1
  189. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/functionYaml/data.js +38 -25
  190. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/data.js +23 -15
  191. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/handler/template.ejs +1 -1
  192. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/data.js +19 -18
  193. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheComplete/mainFunction/template.ejs +1 -1
  194. package/src/reStructure/TemplateData/flowSchema/triggerCacheComponent/triggerCacheQueue/data.js +24 -18
  195. package/src/reStructure/TemplateData/flowSchema/webSocketComplete/functionYaml/data.js +35 -29
  196. package/src/reStructure/TemplateData/flowSchema/webSocketComplete/handler/data.js +12 -16
  197. package/src/reStructure/TemplateData/flowSchema/webSocketComplete/handler/template.ejs +1 -1
  198. package/src/reStructure/TemplateData/flowSchema/webSocketComplete/mainFunction/data.js +9 -13
  199. package/src/reStructure/TemplateData/flowSchema/webSocketComplete/mainFunction/template.ejs +1 -1
  200. package/src/reStructure/TemplateData/flowSchema/webSocketComplete/sqs/data.js +20 -30
  201. package/src/reStructure/TemplateData/generateRole/createSharedResource.js +193 -79
  202. package/src/reStructure/TemplateData/generateRole/data.js +26 -24
  203. package/src/reStructure/TemplateData/perActionComplete/create/handler/data.js +10 -18
  204. package/src/reStructure/TemplateData/perActionComplete/create/handler/template.ejs +1 -1
  205. package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/createObjectComplete_main.js +88 -64
  206. package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/data.js +10 -17
  207. package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +1 -1
  208. package/src/reStructure/TemplateData/perActionComplete/create/sns-in-sqs/data.js +11 -20
  209. package/src/reStructure/TemplateData/perActionComplete/create/sns-out/data.js +14 -19
  210. package/src/reStructure/TemplateData/perActionComplete/create/yaml/data.js +18 -24
  211. package/src/reStructure/TemplateData/perActionComplete/delete/handler/data.js +11 -20
  212. package/src/reStructure/TemplateData/perActionComplete/delete/handler/template.ejs +1 -1
  213. package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/data.js +10 -17
  214. package/src/reStructure/TemplateData/perActionComplete/delete/mainFunction/template.ejs +1 -1
  215. package/src/reStructure/TemplateData/perActionComplete/delete/sns-in-sqs/data.js +11 -19
  216. package/src/reStructure/TemplateData/perActionComplete/delete/sns-out/data.js +14 -20
  217. package/src/reStructure/TemplateData/perActionComplete/delete/yaml/data.js +18 -24
  218. package/src/reStructure/TemplateData/perActionComplete/generateTemplateData.js +63 -56
  219. package/src/reStructure/TemplateData/perActionComplete/get/handler/data.js +11 -18
  220. package/src/reStructure/TemplateData/perActionComplete/get/handler/template.ejs +1 -1
  221. package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/data.js +11 -16
  222. package/src/reStructure/TemplateData/perActionComplete/get/mainFunction/template.ejs +1 -1
  223. package/src/reStructure/TemplateData/perActionComplete/get/sns-in-sqs/data.js +11 -19
  224. package/src/reStructure/TemplateData/perActionComplete/get/sns-out/data.js +14 -18
  225. package/src/reStructure/TemplateData/perActionComplete/get/yaml/data.js +19 -25
  226. package/src/reStructure/TemplateData/perActionComplete/update/handler/data.js +11 -19
  227. package/src/reStructure/TemplateData/perActionComplete/update/handler/template.ejs +1 -1
  228. package/src/reStructure/TemplateData/perActionComplete/update/mainFunction/data.js +10 -18
  229. package/src/reStructure/TemplateData/perActionComplete/update/mainFunction/template.ejs +1 -1
  230. package/src/reStructure/TemplateData/perActionComplete/update/sns-in-sqs/data.js +11 -20
  231. package/src/reStructure/TemplateData/perActionComplete/update/sns-out/data.js +14 -18
  232. package/src/reStructure/TemplateData/perActionComplete/update/yaml/data.js +19 -26
  233. package/src/reStructure/TemplateData/perActionEndpoint/generateTemplateData.js +34 -18
  234. package/src/reStructure/TemplateData/perActionEndpoint/handler/api/data.js +32 -16
  235. package/src/reStructure/TemplateData/perActionEndpoint/handler/api/template.ejs +1 -1
  236. package/src/reStructure/TemplateData/perActionEndpoint/handler/dsq/data.js +44 -21
  237. package/src/reStructure/TemplateData/perActionEndpoint/handler/dsq/template.ejs +1 -1
  238. package/src/reStructure/TemplateData/perActionEndpoint/handler/inv/data.js +42 -18
  239. package/src/reStructure/TemplateData/perActionEndpoint/handler/inv/template.ejs +1 -1
  240. package/src/reStructure/TemplateData/perActionEndpoint/handler/sqs/data.js +40 -18
  241. package/src/reStructure/TemplateData/perActionEndpoint/handler/sqs/template.ejs +1 -1
  242. package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocket/data.js +32 -13
  243. package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocket/template.ejs +1 -1
  244. package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocketConnect/data.js +9 -10
  245. package/src/reStructure/TemplateData/perActionEndpoint/handler/webSocketConnect/template.ejs +1 -1
  246. package/src/reStructure/TemplateData/perActionEndpoint/libs/data.js +13 -13
  247. package/src/reStructure/TemplateData/perActionEndpoint/libs/template.ejs +1 -1
  248. package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/create/data.js +31 -14
  249. package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/create/template.ejs +1 -1
  250. package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/delete/data.js +30 -13
  251. package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/delete/template.ejs +1 -1
  252. package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/get/data.js +30 -14
  253. package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/update/data.js +33 -18
  254. package/src/reStructure/TemplateData/perActionEndpoint/yaml/api/data.js +61 -38
  255. package/src/reStructure/TemplateData/perActionEndpoint/yaml/dsq/data.js +72 -46
  256. package/src/reStructure/TemplateData/perActionEndpoint/yaml/inv/data.js +56 -38
  257. package/src/reStructure/TemplateData/perActionEndpoint/yaml/sqs/data.js +76 -48
  258. package/src/reStructure/TemplateData/perActionEndpoint/yaml/wbs/data.js +53 -34
  259. package/src/reStructure/TemplateData/perActionEndpoint/yaml/webSocketConnect/data.js +9 -10
  260. package/src/reStructure/TemplateData/processLogical/generateTemplateData.js +10 -5
  261. package/src/reStructure/TemplateData/processLogical/handler/data.js +9 -15
  262. package/src/reStructure/TemplateData/processLogical/handler/template.ejs +1 -1
  263. package/src/reStructure/TemplateData/processLogical/mainFunction/data.js +5 -11
  264. package/src/reStructure/TemplateData/processLogical/mainFunction/template.ejs +1 -1
  265. package/src/reStructure/TemplateData/processLogical/yaml/data.js +39 -31
  266. package/src/reStructure/TemplateData/processLogicalPagination/DsqYaml/data.js +6 -10
  267. package/src/reStructure/TemplateData/processLogicalPagination/generateTemplateData.js +15 -6
  268. package/src/reStructure/TemplateData/processLogicalPagination/handler/dsq/data.js +3 -7
  269. package/src/reStructure/TemplateData/processLogicalPagination/handler/dsq/template.ejs +1 -1
  270. package/src/reStructure/TemplateData/processLogicalPagination/handler/sqs/data.js +3 -7
  271. package/src/reStructure/TemplateData/processLogicalPagination/handler/sqs/template.ejs +1 -1
  272. package/src/reStructure/TemplateData/processLogicalPagination/mainFunction/data.js +4 -8
  273. package/src/reStructure/TemplateData/processLogicalPagination/mainFunction/template.ejs +1 -1
  274. package/src/reStructure/TemplateData/processLogicalPagination/yaml/dsq/data.js +40 -38
  275. package/src/reStructure/TemplateData/processLogicalPagination/yaml/sqs/data.js +42 -35
  276. package/src/reStructure/TemplateData/propertyValueSchema/generateTemplateData.js +7 -7
  277. package/src/reStructure/TemplateData/propertyValueSchema/objectPropertyValueSchema/data.js +89 -49
  278. package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/data.js +65 -47
  279. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/api/data.js +46 -26
  280. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/data.js +57 -33
  281. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/dsq/data.js +46 -25
  282. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/inv/data.js +46 -26
  283. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/sqs/data.js +47 -26
  284. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/data.js +14 -12
  285. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/template.ejs +1 -1
  286. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/data.js +17 -24
  287. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/data.js +16 -14
  288. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/template.ejs +1 -1
  289. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/data.js +15 -13
  290. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/template.ejs +1 -1
  291. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/data.js +15 -13
  292. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/template.ejs +1 -1
  293. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/apiTemplate.ejs +1 -1
  294. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/dsqTemplate.ejs +2 -2
  295. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/invTemplate.ejs +1 -1
  296. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/templateByHandler/sqsTemplate.ejs +3 -4
  297. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/data.js +8 -14
  298. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/template.ejs +2 -2
  299. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/sns-in-sqs/data.js +18 -27
  300. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/functionYaml/data.js +20 -28
  301. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/data.js +11 -17
  302. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/handler/sqs/template.ejs +1 -1
  303. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/data.js +10 -15
  304. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/mainFunction/template.ejs +1 -1
  305. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/sns-in-sqs/data.js +11 -16
  306. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/complete/sns-out/data.js +10 -15
  307. package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/api/data.js +61 -30
  308. package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/data.js +77 -38
  309. package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +61 -29
  310. package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +61 -31
  311. package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +62 -30
  312. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/api/data.js +14 -12
  313. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/api/template.ejs +1 -1
  314. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/data.js +17 -24
  315. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/dsq/data.js +16 -14
  316. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/dsq/template.ejs +1 -1
  317. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/inv/data.js +15 -13
  318. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/inv/template.ejs +1 -1
  319. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/sqs/data.js +15 -13
  320. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/sqs/template.ejs +1 -1
  321. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/apiTemplate.ejs +1 -1
  322. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
  323. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/invTemplate.ejs +1 -1
  324. package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
  325. package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/data.js +10 -16
  326. package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +1 -1
  327. package/src/reStructure/TemplateData/relationshipPerAction/create/action/sns-in-sqs/data.js +18 -27
  328. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js +21 -26
  329. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/data.js +8 -10
  330. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/handler/sqs/template.ejs +1 -1
  331. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/data.js +7 -9
  332. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +1 -1
  333. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/data.js +9 -12
  334. package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-out/data.js +8 -9
  335. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js +62 -31
  336. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/data.js +75 -37
  337. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +62 -30
  338. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +62 -32
  339. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +62 -32
  340. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/api/data.js +14 -12
  341. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/api/template.ejs +1 -1
  342. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/data.js +16 -19
  343. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/dsq/data.js +16 -14
  344. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/dsq/template.ejs +1 -1
  345. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/inv/data.js +15 -13
  346. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/inv/template.ejs +1 -1
  347. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/sqs/data.js +15 -13
  348. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/sqs/template.ejs +1 -1
  349. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/apiTemplate.ejs +1 -1
  350. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
  351. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/invTemplate.ejs +1 -1
  352. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
  353. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/data.js +12 -12
  354. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +1 -1
  355. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/data.js +18 -22
  356. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js +20 -21
  357. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/data.js +10 -12
  358. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/handler/sqs/template.ejs +1 -1
  359. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/data.js +9 -12
  360. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +1 -1
  361. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-in-sqs/data.js +9 -10
  362. package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-out/data.js +8 -9
  363. package/src/reStructure/TemplateData/relationshipPerAction/generateTemplateData.js +218 -63
  364. package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/api/data.js +53 -28
  365. package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/data.js +75 -37
  366. package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/data.js +62 -30
  367. package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/inv/data.js +53 -29
  368. package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/data.js +53 -27
  369. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/api/data.js +14 -12
  370. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/api/template.ejs +1 -1
  371. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/data.js +16 -19
  372. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/dsq/data.js +16 -14
  373. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/dsq/template.ejs +1 -1
  374. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/inv/data.js +15 -13
  375. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/inv/template.ejs +1 -1
  376. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/sqs/data.js +15 -13
  377. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/sqs/template.ejs +1 -1
  378. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/apiTemplate.ejs +1 -1
  379. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
  380. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/invTemplate.ejs +1 -1
  381. package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
  382. package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/data.js +8 -11
  383. package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +2 -2
  384. package/src/reStructure/TemplateData/relationshipPerAction/get/action/sns-in-sqs/data.js +18 -22
  385. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +18 -19
  386. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/data.js +9 -11
  387. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs +1 -1
  388. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/data.js +8 -10
  389. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +1 -1
  390. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/sns-in-sqs/data.js +10 -11
  391. package/src/reStructure/TemplateData/relationshipPerAction/get/complete/sns-out/data.js +8 -9
  392. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/data.js +60 -32
  393. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/data.js +16 -19
  394. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/apiTemplate.ejs +1 -1
  395. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
  396. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/invTemplate.ejs +1 -1
  397. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
  398. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/data.js +9 -12
  399. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/template.ejs +2 -2
  400. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/sns-in-sqs/data.js +19 -23
  401. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/functionYaml/data.js +22 -27
  402. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/data.js +7 -9
  403. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/handler/sqs/template.ejs +1 -1
  404. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/data.js +6 -7
  405. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/mainFunction/template.ejs +1 -1
  406. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/sns-in-sqs/data.js +10 -11
  407. package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/sns-out/data.js +7 -8
  408. package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/api/data.js +54 -34
  409. package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/data.js +69 -37
  410. package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +62 -34
  411. package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js +53 -34
  412. package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js +54 -33
  413. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/api/data.js +13 -15
  414. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/api/template.ejs +1 -1
  415. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/data.js +14 -17
  416. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/dsq/data.js +13 -12
  417. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/dsq/template.ejs +1 -1
  418. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/inv/data.js +13 -13
  419. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/inv/template.ejs +1 -1
  420. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/sqs/data.js +13 -11
  421. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/sqs/template.ejs +1 -1
  422. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/apiTemplate.ejs +1 -1
  423. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/dsqTemplate.ejs +1 -1
  424. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/invTemplate.ejs +1 -1
  425. package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/sqsTemplate.ejs +1 -1
  426. package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/data.js +10 -20
  427. package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +2 -2
  428. package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-in-sqs/data.js +13 -14
  429. package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-out/data.js +15 -10
  430. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +20 -22
  431. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/handler/sqs/data.js +10 -12
  432. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/handler/sqs/template.ejs +1 -1
  433. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/data.js +10 -18
  434. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +1 -1
  435. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-in-sqs/data.js +9 -11
  436. package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-out/data.js +8 -9
  437. package/src/reStructure/TemplateData/resourceYaml/CreateSourceData.js +24 -17
  438. package/src/reStructure/TemplateData/resourceYaml/dynamodb/defaultDynamoDbTable.js +48 -51
  439. package/src/reStructure/TemplateData/resourceYaml/dynamodb/generateDynamoPerLink.js +31 -19
  440. package/src/reStructure/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +55 -66
  441. package/src/reStructure/TemplateData/resourceYaml/filterGenerateResource/data.js +72 -31
  442. package/src/reStructure/TemplateData/resourceYaml/generateTemplateData.js +58 -24
  443. package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +14 -14
  444. package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/snsAndSqsPerActionData.js +29 -23
  445. package/src/reStructure/TemplateData/resourceYaml/sns-out/data.js +24 -21
  446. package/src/reStructure/TemplateData/resourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +8 -11
  447. package/src/reStructure/libs/GenerateCodeLibs.js +8 -12
  448. package/src/reStructure/libs/ValidateAddOnDataStructure.js +33 -22
  449. package/src/CheckPermission/CheckPermission.js +0 -142
  450. package/src/TemplateManager/index.js +0 -23
  451. package/src/TemplateManager/src/FindData/FindDataYaml/data.js +0 -183
  452. package/src/TemplateManager/src/FindData/FindDataYaml/template.ejs +0 -14
  453. package/src/TemplateManager/src/FindData/GetByStorage/getByDynamo.ejs +0 -53
  454. package/src/TemplateManager/src/FindData/GetByStorage/getByGraph.ejs +0 -100
  455. package/src/TemplateManager/src/FindData/Handler/data.js +0 -47
  456. package/src/TemplateManager/src/FindData/Handler/template.ejs +0 -140
  457. package/src/TemplateManager/src/FindData/mainFunction/data.js +0 -280
  458. package/src/TemplateManager/src/FindData/mainFunction/template.ejs +0 -151
  459. package/src/TemplateManager/src/GenerateCode(Old).js +0 -135
  460. package/src/TemplateManager/src/GenerateCode.js +0 -670
  461. package/src/TemplateManager/src/GenerateSchema.js +0 -103
  462. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +0 -106
  463. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/template.ejs +0 -20
  464. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/data.js +0 -59
  465. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/handler/template.ejs +0 -130
  466. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/createObjectComplete_main.js +0 -172
  467. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/data.js +0 -53
  468. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/mainFunction/template.ejs +0 -170
  469. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-in-sqs/data.js +0 -58
  470. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-in-sqs/template.ejs +0 -47
  471. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-out/data.js +0 -62
  472. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/sns-out/template.ejs +0 -10
  473. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/data.js +0 -102
  474. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/template.ejs +0 -20
  475. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/handler/data.js +0 -59
  476. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/handler/template.ejs +0 -129
  477. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/mainFunction/data.js +0 -53
  478. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/mainFunction/template.ejs +0 -93
  479. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/sns-out/data.js +0 -62
  480. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/sqs-in-sns/data.js +0 -58
  481. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/sqs-in-sns/template.ejs +0 -47
  482. package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/functionYaml/data.js +0 -106
  483. package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/functionYaml/template.ejs +0 -20
  484. package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/handler/data.js +0 -59
  485. package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/handler/template.ejs +0 -129
  486. package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/mainFunction/data.js +0 -53
  487. package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/mainFunction/template.ejs +0 -130
  488. package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/sns-out/data.js +0 -62
  489. package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/sqs-in-sns/data.js +0 -58
  490. package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/sqs-in-sns/template.ejs +0 -47
  491. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/data.js +0 -106
  492. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/template.ejs +0 -20
  493. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/handler/data.js +0 -59
  494. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/handler/template.ejs +0 -129
  495. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/data.js +0 -53
  496. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/mainFunction/template.ejs +0 -130
  497. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/sns-out/data.js +0 -62
  498. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/sqs-in-sns/data.js +0 -58
  499. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/sqs-in-sns/template.ejs +0 -47
  500. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/data.js +0 -179
  501. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/request.json +0 -14
  502. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/template.ejs +0 -20
  503. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/data.js +0 -188
  504. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/request.json +0 -19
  505. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/template.ejs +0 -17
  506. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/data.js +0 -172
  507. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/example req.js +0 -15
  508. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/request.json +0 -14
  509. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/template.ejs +0 -13
  510. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/data.js +0 -189
  511. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/request.json +0 -19
  512. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/template.ejs +0 -17
  513. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrWbs/data.js +0 -171
  514. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrWbs/request.json +0 -19
  515. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrWbs/template.ejs +0 -29
  516. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/webSocketConnect/data.js +0 -60
  517. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/webSocketConnect/template.ejs +0 -10
  518. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/data.js +0 -86
  519. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/request.json +0 -7
  520. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrApi/template.ejs +0 -36
  521. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/data.js +0 -88
  522. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/request.json +0 -7
  523. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrDsq/template.ejs +0 -55
  524. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/data.js +0 -87
  525. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/request.json +0 -7
  526. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrInv/template.ejs +0 -37
  527. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/data.js +0 -87
  528. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/request.json +0 -7
  529. package/src/TemplateManager/src/PerActionEndpoint/Handler/HdrSqs/template.ejs +0 -57
  530. package/src/TemplateManager/src/PerActionEndpoint/Handler/WebSocket/data.js +0 -76
  531. package/src/TemplateManager/src/PerActionEndpoint/Handler/WebSocket/template.ejs +0 -60
  532. package/src/TemplateManager/src/PerActionEndpoint/Handler/WebSocketConnect/data.js +0 -56
  533. package/src/TemplateManager/src/PerActionEndpoint/Handler/WebSocketConnect/template.ejs +0 -55
  534. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/data.js +0 -69
  535. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/request.json +0 -0
  536. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/template.ejs +0 -337
  537. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/data.js +0 -69
  538. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/template.ejs +0 -98
  539. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/data.js +0 -69
  540. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/request.json +0 -5
  541. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/template.ejs +0 -114
  542. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/testParam.json +0 -5
  543. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/data.js +0 -63
  544. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/request.json +0 -0
  545. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/template.ejs +0 -164
  546. package/src/TemplateManager/src/PerActionEndpoint/libs/data.js +0 -48
  547. package/src/TemplateManager/src/PerActionEndpoint/libs/template.ejs +0 -46
  548. package/src/TemplateManager/src/ProcessLogical/Handler/data.js +0 -50
  549. package/src/TemplateManager/src/ProcessLogical/Handler/template.ejs +0 -129
  550. package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/data.js +0 -160
  551. package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/template.ejs +0 -12
  552. package/src/TemplateManager/src/ProcessLogical/mainFunction/data.js +0 -47
  553. package/src/TemplateManager/src/ProcessLogical/mainFunction/template.ejs +0 -429
  554. package/src/TemplateManager/src/ProcessLogicalPagination/DsqYaml/data.js +0 -50
  555. package/src/TemplateManager/src/ProcessLogicalPagination/DsqYaml/template.ejs +0 -32
  556. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/data.js +0 -154
  557. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/template.ejs +0 -12
  558. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/data.js +0 -157
  559. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/template.ejs +0 -12
  560. package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrDsq/data.js +0 -48
  561. package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrDsq/template.ejs +0 -163
  562. package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrSqs/data.js +0 -48
  563. package/src/TemplateManager/src/ProcessLogicalPagination/Handler/HdrSqs/template.ejs +0 -146
  564. package/src/TemplateManager/src/ProcessLogicalPagination/mainFunction/data.js +0 -48
  565. package/src/TemplateManager/src/ProcessLogicalPagination/mainFunction/template.ejs +0 -212
  566. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js +0 -99
  567. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/template.ejs +0 -20
  568. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/data.js +0 -112
  569. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/template.ejs +0 -17
  570. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/data.js +0 -98
  571. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/template.ejs +0 -13
  572. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/data.js +0 -111
  573. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/template.ejs +0 -17
  574. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/mainFunction/data.js +0 -60
  575. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/mainFunction/template.ejs +0 -380
  576. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrApi/data.js +0 -58
  577. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrApi/request.json +0 -0
  578. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrApi/template.ejs +0 -57
  579. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrDsq/data.js +0 -59
  580. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrDsq/request.json +0 -0
  581. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrDsq/template.ejs +0 -184
  582. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrInv/data.js +0 -60
  583. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrInv/request.json +0 -0
  584. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrInv/template.ejs +0 -126
  585. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrSqs/data.js +0 -60
  586. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrSqs/request.json +0 -0
  587. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/HdrSqs/template.ejs +0 -75
  588. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/perAction/request.json +0 -30
  589. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/sns-in-sqs/data.js +0 -78
  590. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/sns-in-sqs/snsTemplate.ejs +0 -59
  591. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/sns-in-sqs/sqsTemplate.ejs +0 -43
  592. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/functionYaml/data.js +0 -111
  593. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/functionYaml/request.json +0 -0
  594. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/functionYaml/template.ejs +0 -20
  595. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/handler/HdrSqs/data.js +0 -61
  596. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/handler/HdrSqs/request.json +0 -0
  597. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/handler/HdrSqs/template.ejs +0 -125
  598. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/mainFunction/data.js +0 -56
  599. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/mainFunction/request.json +0 -0
  600. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/mainFunction/template.ejs +0 -141
  601. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-in-sqs/data.js +0 -72
  602. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-in-sqs/request.json +0 -0
  603. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-in-sqs/template.ejs +0 -47
  604. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-out/data.js +0 -72
  605. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-out/request.json +0 -0
  606. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/sns-out/template.ejs +0 -10
  607. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/data.js +0 -99
  608. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/template.ejs +0 -20
  609. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/data.js +0 -112
  610. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/template.ejs +0 -17
  611. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/data.js +0 -98
  612. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/template.ejs +0 -13
  613. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/data.js +0 -112
  614. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/template.ejs +0 -17
  615. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction/data.js +0 -60
  616. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/mainFunction/template.ejs +0 -337
  617. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/data.js +0 -58
  618. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/request.json +0 -0
  619. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrApi/template.ejs +0 -56
  620. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq/data.js +0 -59
  621. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq/request.json +0 -0
  622. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrDsq/template.ejs +0 -184
  623. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv/data.js +0 -60
  624. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv/request.json +0 -0
  625. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrInv/template.ejs +0 -126
  626. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs/data.js +0 -60
  627. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs/request.json +0 -0
  628. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/HdrSqs/template.ejs +0 -74
  629. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/perAction/request.json +0 -30
  630. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/data.js +0 -78
  631. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/snsTemplate.ejs +0 -59
  632. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/sns-in-sqs/sqsTemplate.ejs +0 -43
  633. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/data.js +0 -111
  634. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/request.json +0 -0
  635. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/template.ejs +0 -20
  636. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler/HdrSqs/data.js +0 -61
  637. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler/HdrSqs/request.json +0 -0
  638. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/handler/HdrSqs/template.ejs +0 -125
  639. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/data.js +0 -56
  640. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/request.json +0 -0
  641. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/mainFunction/template.ejs +0 -140
  642. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/data.js +0 -72
  643. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/request.json +0 -0
  644. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-in-sqs/template.ejs +0 -47
  645. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/data.js +0 -72
  646. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/request.json +0 -0
  647. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/sns-out/template.ejs +0 -10
  648. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/data.js +0 -111
  649. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/request.json +0 -3
  650. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/template.ejs +0 -20
  651. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/data.js +0 -62
  652. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/request.json +0 -0
  653. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/handler/HdrSqs/template.ejs +0 -127
  654. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/mainFunction/data.js +0 -56
  655. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/mainFunction/request.json +0 -1
  656. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/mainFunction/template.ejs +0 -143
  657. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-in-sqs/data.js +0 -72
  658. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-in-sqs/request.json +0 -3
  659. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-in-sqs/template.ejs +0 -46
  660. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-out/data.js +0 -71
  661. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-out/request.json +0 -3
  662. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/sns-out/template.ejs +0 -10
  663. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/data.js +0 -100
  664. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/request.json +0 -0
  665. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/template.ejs +0 -20
  666. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/data.js +0 -111
  667. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/request.json +0 -0
  668. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/template.ejs +0 -17
  669. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/data.js +0 -103
  670. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/request.json +0 -0
  671. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/template.ejs +0 -13
  672. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/data.js +0 -115
  673. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/request.json +0 -0
  674. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/template.ejs +0 -17
  675. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/mainFunction/data.js +0 -64
  676. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/mainFunction/request.json +0 -1
  677. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/mainFunction/template.ejs +0 -340
  678. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi/data.js +0 -59
  679. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi/request.json +0 -7
  680. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrApi/template.ejs +0 -57
  681. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrDsq/data.js +0 -59
  682. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrDsq/request.json +0 -7
  683. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrDsq/template.ejs +0 -184
  684. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrInv/data.js +0 -62
  685. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrInv/request.json +0 -5
  686. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrInv/template.ejs +0 -145
  687. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/data.js +0 -59
  688. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/request.json +0 -7
  689. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/HdrSqs/template.ejs +0 -72
  690. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/perAction/request.json +0 -30
  691. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/data.js +0 -90
  692. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/request.json +0 -3
  693. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/snsTemplate.ejs +0 -59
  694. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-in-sqs/sqsTemplate.ejs +0 -43
  695. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-out/data.js +0 -70
  696. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/sns-out/request.json +0 -3
  697. package/src/TemplateManager/src/ResourceYaml/CreateSourceData.js +0 -76
  698. package/src/TemplateManager/src/ResourceYaml/dynamodb/defaultDynamoDbTable.js +0 -146
  699. package/src/TemplateManager/src/ResourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +0 -178
  700. package/src/TemplateManager/src/ResourceYaml/dynamodb/request.json +0 -7
  701. package/src/TemplateManager/src/ResourceYaml/dynamodb/template.ejs +0 -31
  702. package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +0 -96
  703. package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/request.json +0 -4
  704. package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/snsAndSqsPerActiondata.js +0 -108
  705. package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/snsTemplate.ejs +0 -59
  706. package/src/TemplateManager/src/ResourceYaml/sns-in-sqs/sqsTemplate.ejs +0 -43
  707. package/src/TemplateManager/src/ResourceYaml/sns-out/data.js +0 -89
  708. package/src/TemplateManager/src/ResourceYaml/sns-out/defaultSnsOutForFindDataAndProcessLogical.js +0 -75
  709. package/src/TemplateManager/src/ResourceYaml/sns-out/request.json +0 -3
  710. package/src/TemplateManager/src/ResourceYaml/sns-out/template.ejs +0 -10
  711. package/src/TemplateManager/src/Role/createSharedResource.js +0 -272
  712. package/src/TemplateManager/src/Role/sharedResourceTemplate.ejs +0 -58
  713. package/src/TemplateManager/src/attributeTree/objectSchema/data.js +0 -128
  714. package/src/TemplateManager/src/attributeTree/objectSchema/template.ejs +0 -21
  715. package/src/TemplateManager/src/attributeTree/refRelationshipSchema/data.js +0 -36
  716. package/src/TemplateManager/src/attributeTree/refRelationshipSchema/template.ejs +0 -0
  717. package/src/TemplateManager/src/attributeTree/relationshipSchema/data.js +0 -206
  718. package/src/TemplateManager/src/attributeTree/relationshipSchema/template.ejs +0 -7
  719. package/src/TemplateManager/src/attributeTreeSchema/generateTemplateData.js +0 -103
  720. package/src/TemplateManager/src/attributeTreeSchema/mainAttributeTree/attributeLinkTemplate.ejs +0 -17
  721. package/src/TemplateManager/src/attributeTreeSchema/mainAttributeTree/data.js +0 -134
  722. package/src/TemplateManager/src/attributeTreeSchema/mainAttributeTree/request.json +0 -11
  723. package/src/TemplateManager/src/attributeTreeSchema/referenceRelationshipSchema/data.js +0 -84
  724. package/src/TemplateManager/src/attributeTreeSchema/referenceRelationshipSchema/tempReferenceRelationshipSchema.ejs +0 -9
  725. package/src/TemplateManager/src/attributeTreeSchema/relationshipSchema/data.js +0 -172
  726. package/src/TemplateManager/src/attributeTreeSchema/relationshipSchema/template.ejs +0 -7
  727. package/src/TemplateManager/src/externalService/FunctionNameConfig/data.js +0 -163
  728. package/src/TemplateManager/src/externalService/FunctionNameConfig/template.ejs +0 -14
  729. package/src/TemplateManager/src/externalService/FunctionNameConfig/templateIntTesting.ejs +0 -31
  730. package/src/TemplateManager/src/externalService/FunctionNameConfig/templateYaml.ejs +0 -10
  731. package/src/TemplateManager/src/externalService/LambdaRole/data.js +0 -420
  732. package/src/TemplateManager/src/externalService/LambdaRole/request.json +0 -18
  733. package/src/TemplateManager/src/externalService/LambdaRole/template.ejs +0 -57
  734. package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +0 -160
  735. package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/request.json +0 -12
  736. package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/template.ejs +0 -28
  737. package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/dynamoDb/ReservedTableData.js +0 -65
  738. package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/dynamoDb/WebSocketTaskData.js +0 -65
  739. package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/webSocketConnect/functionYaml/data.js +0 -74
  740. package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/webSocketConnect/functionYaml/template.ejs +0 -29
  741. package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/webSocketConnect/handler/data.js +0 -55
  742. package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/webSocketConnect/handler/template.ejs +0 -68
  743. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/functionYaml/data.js +0 -77
  744. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/functionYaml/template.ejs +0 -37
  745. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/handler/data.js +0 -47
  746. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/handler/template.ejs +0 -103
  747. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/mainFunction/data.js +0 -46
  748. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/mainFunction/template.ejs +0 -0
  749. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/data.js +0 -36
  750. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/template.ejs +0 -0
  751. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/data.js +0 -35
  752. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/template.ejs +0 -0
  753. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/data.js +0 -35
  754. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/template.ejs +0 -0
  755. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/data.js +0 -35
  756. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/template.ejs +0 -0
  757. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/data.js +0 -35
  758. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/template.ejs +0 -0
  759. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/functionYaml/data.js +0 -102
  760. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/functionYaml/template.ejs +0 -30
  761. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/handler/data.js +0 -58
  762. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/handler/template.ejs +0 -126
  763. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/mainFunction/data.js +0 -51
  764. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/mainFunction/template.ejs +0 -121
  765. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/queue/data.js +0 -64
  766. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/queue/template.ejs +0 -45
  767. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/functionYaml/data.js +0 -128
  768. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/functionYaml/template.ejs +0 -37
  769. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/data.js +0 -75
  770. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/template.ejs +0 -120
  771. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/mainFunction/data.js +0 -55
  772. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/mainFunction/template.ejs +0 -133
  773. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/functionYaml/data.js +0 -102
  774. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/functionYaml/template.ejs +0 -30
  775. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/handler/data.js +0 -58
  776. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/handler/template.ejs +0 -103
  777. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/mainFunction/data.js +0 -55
  778. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/mainFunction/template.ejs +0 -86
  779. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/sns-sqs/data.js +0 -72
  780. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/sns-sqs/template.ejs +0 -49
  781. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/functionYaml/data.js +0 -85
  782. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/functionYaml/template.ejs +0 -27
  783. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/handler/data.js +0 -57
  784. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/handler/template.ejs +0 -120
  785. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/data.js +0 -51
  786. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/template.ejs +0 -164
  787. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/sqs/data.js +0 -65
  788. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/sqs/template.ejs +0 -53
  789. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/functionYaml/data.js +0 -112
  790. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/functionYaml/template.ejs +0 -30
  791. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/handler/data.js +0 -57
  792. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/handler/template.ejs +0 -126
  793. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/data.js +0 -54
  794. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/template.ejs +0 -254
  795. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/queue/data.js +0 -64
  796. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/queue/template.ejs +0 -45
  797. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/data.js +0 -94
  798. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/templateAsyncHandler.ejs +0 -110
  799. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/templateSyncHandler.ejs +0 -49
  800. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/hookLogic/data.js +0 -44
  801. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/mainFunction/data.js +0 -66
  802. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/mainFunction/template.ejs +0 -7
  803. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/data.js +0 -73
  804. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/snsTemplate.ejs +0 -59
  805. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/sqsTemplate.ejs +0 -43
  806. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/functionYaml/data.js +0 -102
  807. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/functionYaml/template.ejs +0 -43
  808. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/data.js +0 -94
  809. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/templateAsyncHandler.ejs +0 -110
  810. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/templateSyncHandler.ejs +0 -49
  811. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/hookLogic/data.js +0 -65
  812. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/mainFunction/data.js +0 -67
  813. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/mainFunction/template.ejs +0 -30
  814. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/queue/data.js +0 -125
  815. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/queue/snsTemplate.ejs +0 -59
  816. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/queue/sqsTemplate.ejs +0 -43
  817. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrDsq/data.js +0 -87
  818. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrDsq/template.ejs +0 -30
  819. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrS3/data.js +0 -112
  820. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrS3/template.ejs +0 -38
  821. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerDsq/data.js +0 -45
  822. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerDsq/template.ejs +0 -151
  823. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerS3/data.js +0 -43
  824. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerS3/template.ejs +0 -68
  825. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/data.js +0 -43
  826. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/template.ejs +0 -392
  827. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/data.js +0 -77
  828. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/dsqTemplatePath.ejs +0 -32
  829. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/s3Template.ejs +0 -59
  830. package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/S3/data.js +0 -51
  831. package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/S3/template.ejs +0 -13
  832. package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/data.js +0 -42
  833. package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/template.ejs +0 -137
  834. package/src/TemplateManager/src/libs/Consts.js +0 -485
  835. package/src/TemplateManager/src/libs/GenerateCodeUtils.js +0 -59
  836. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/api/request.json +0 -0
  837. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/dsq/request.json +0 -0
  838. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/inv/request.json +0 -0
  839. package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/handler/sqs/request.json +0 -0
@@ -15,971 +15,28 @@ You should have received a copy of the GNU Affero General Public License
15
15
  along with this program.If not, see < http://www.gnu.org/licenses/>.
16
16
  */
17
17
 
18
- 'use strict';
19
-
20
18
  import lodash from 'lodash';
21
19
  import { objectHash as hash } from '@izara_project/izara-shared-core';
22
- import { NoRetryError, inMemoryCacheLib, validator as validateObject } from '@izara_project/izara-core-library-core';
20
+
23
21
  import { sns, sqs } from '@izara_project/izara-core-library-external-request';
24
- import { getObjectSchema, validator as validatorSchema, serviceConfig, utils, consts as coreConsts, explodedReqParams, deliminatorTree } from '@izara_project/izara-core-library-service-schemas'
25
- import Logger from "@izara_project/izara-core-library-logger";
22
+ import {
23
+ getObjectSchema,
24
+ consts as coreConsts,
25
+ } from '@izara_project/izara-core-library-service-schemas';
26
26
 
27
27
  import { validateObjType } from '@izara_project/izara-shared-service-schemas';
28
28
 
29
29
  // core libs
30
30
  import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
31
- import asyncFlowSharedLib from '@izara_project/izara-core-library-asynchronous-flow'
31
+ import asyncFlowSharedLib from '@izara_project/izara-core-library-asynchronous-flow';
32
32
  import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow';
33
- import sqsSharedLib from '@izara_project/izara-core-library-sqs';
34
33
  import snsSharedLib from '@izara_project/izara-core-library-sns';
35
34
  import graphSharedLibs from '@izara_project/izara-core-library-graph-service';
36
35
  import lambdaSharedLib from '@izara_project/izara-core-library-lambda';
37
- import consts from './Consts.js'
38
- const { TOPIC_NAME_GENERATE_CODE, TOPIC_NAME_GRAPH_HANDLER, PREFIX } = consts
39
-
40
- const nodeLabelRegexPattern = "^[a-zA-Z0-9_-]+(?:\:[a-zA-Z0-9_-]+)?$"
41
-
42
- const schemaFunctionPerAction = {
43
- [coreConsts.ACTIONS.create]: validatorSchema.generateValidatorSchemaForCreate,
44
- [coreConsts.ACTIONS.update]: validatorSchema.generateValidatorSchemaForUpdate,
45
- [coreConsts.ACTIONS.get]: validatorSchema.generateValidatorSchemaForIdentifier,
46
- [coreConsts.ACTIONS.delete]: validatorSchema.generateValidatorSchemaForIdentifier,
47
- }
48
-
49
- const explodeDataPerAction = {
50
- [coreConsts.ACTIONS.create]: explodedReqParams.explodedDataForCreate,
51
- [coreConsts.ACTIONS.get]: explodedReqParams.explodedDataForIdentifiers,
52
- [coreConsts.ACTIONS.update]: explodedReqParams.explodedDataForUpdate,
53
- [coreConsts.ACTIONS.delete]: explodedReqParams.explodedDataForIdentifiers
54
- }
55
-
56
-
57
- /*
58
- ---------- Contain function use for generated code ----------
59
- */
60
-
61
- /**
62
- *
63
- * @param {middleware} middleware
64
- * @param {string} objectType - name of ObjectType
65
- * @param {string} action - action type of Lambda create | update | get | delete
66
- */
67
- function validateSchemaMiddleware(
68
- middleware,
69
- // objectType,
70
- action,
71
- bucketName = process.env.iz_serviceSchemaBucketName
72
- // setting = {}
73
- ) {
74
-
75
- if (!schemaFunctionPerAction[action] || !explodeDataPerAction[action]) {
76
- throw new NoRetryError(`Not found function for generateValidatorSchema or explodeDataPerAction of action:${action}`);
77
- }
78
- // Logger.debug("setting in generateCodeLibs", setting)
79
- middleware.setServiceSchema(
80
- schemaFunctionPerAction[action],
81
- explodeDataPerAction[action],
82
- {
83
- // objectType: objectType,
84
- // specificFieldNames: setting?.specificFieldNames ? setting.specificFieldNames : [],
85
- action: action,
86
- bucketName: bucketName
87
- },
88
- );
89
- }
90
-
91
- /**
92
- * use to validate record for Lambda handler hdrSqs/hdrDsq
93
- * Note!: cannot throw error when use this function outside recordHandler
94
- *
95
- * @param {object} record - one record from sqs
96
- * @param {string} lambdaFunctionName - name of Lambda used to build SQS/DLQ // QueueName
97
- * @param {string} objectType - name of ObjectType
98
- * @param {string} action - action type of Lambda create | update | get | delete
99
- * @param {object} [setting]
100
- * @param {string[]} [setting.specificFieldNames] - optional - specific fieldNames use as param in generateValidatorFunction
101
- */
102
- async function validateSchemaPerRecord(
103
- record,
104
- lambdaFunctionName,
105
- objType,
106
- action,
107
- setting = { bucketName: process.env.iz_serviceSchemaBucketName, specificFieldNames: [] }
108
- ) {
109
- try {
110
- record._izContext.logger.debug("validateSchemaPerRecord: ",
111
- record,
112
- lambdaFunctionName,
113
- objType,
114
- action,
115
- setting
116
- )
117
-
118
- if (!schemaFunctionPerAction[action] || !explodeDataPerAction[action]) {
119
- throw new Error(`Not found function for generateValidatorSchema or function for explodeData of action:${action}`);
120
- }
121
-
122
- const objectSchema = await getObjectSchema.getObjSchemaS3WithHierarchy(record._izContext, objType);
123
-
124
- if (!objectSchema) {
125
- throw new Error("not have objectSchema in service");
126
- }
127
-
128
- const generateValidatorFunction = schemaFunctionPerAction[action];
129
- const explodeDataFunction = explodeDataPerAction[action]
130
-
131
- const generatedSchema = await generateValidatorFunction(record._izContext, objType, setting);
132
- record._izContext.logger.debug(`generatedSchema in validateSchemaPerRecord : `, generatedSchema);
133
-
134
-
135
- const explodedDataRequestParams = await explodeDataFunction(
136
- record._izContext,
137
- record.body.Message,
138
- objectSchema,
139
- setting
140
- );
141
-
142
-
143
- record._izContext.logger.debug('explodedDataRequestParams in validateSchemaPerRecord : ', JSON.stringify(explodedDataRequestParams));
144
-
145
-
146
- let validateStatus = validateObject(generatedSchema, explodedDataRequestParams);
147
- record._izContext.logger.debug('validateStatus : ', validateStatus);
148
-
149
- // if not pass validate will sent message to dlq and throw NoRetryError
150
- if (!validateStatus.pass) {
151
- await messageToDlq(record, `Invalid: ${validateStatus.error}`, await sqsSharedLib.sqsQueueUrlDLQ(record._izContext, lambdaFunctionName));
152
- record._izError = new Error(validateStatus.error)
153
- }
154
- } catch (error) {
155
- record._izContext.logger.debug("validate PerSchema Record error", error)
156
- await messageToDlq(record, error.message, await sqsSharedLib.sqsQueueUrlDLQ(record._izContext, lambdaFunctionName));
157
- record._izError = new Error(error)
158
- }
159
-
160
- }
161
-
162
- /**
163
- * use to create validation for initialize request
164
- *
165
- * @param {object} _izContext
166
- * @param {object} flowType
167
- * @param {object} flowType.flowTag
168
- * @param {object} flowType.serviceTag
169
- * @returns {object}
170
- */
171
-
172
- async function validationForWebSocket(
173
- _izContext,
174
- flowType
175
- ) {
176
- _izContext.logger.debug("validator schema for flowTag", {
177
- flowType
178
- })
179
- let flowSchema = await getObjectSchema.getFlowSchemaS3(_izContext, flowType)
180
-
181
- let validatorSchemaForFlowSchema = flowSchema.initializeRequest.initializeRequestProperties
182
- _izContext.logger.debug("validatorSchemaForFlowSchema:", validatorSchemaForFlowSchema)
183
-
184
-
185
- }
186
-
187
- /**
188
- *
189
- * @param {middleware} middleware
190
- * @param {string} objectType - name of ObjectType
191
- * @param {string} action - action type of Lambda create | update | get | delete
192
- */
193
- function validatorSchemaMiddlewareByAction(
194
- middleware,
195
- // objectType,
196
- action,
197
- setting = {}
198
- ) {
199
-
200
- // if (!schemaFunctionPerAction[action] || !explodeDataPerAction[action]) {
201
- // throw new NoRetryError(`Not found function for generateValidatorSchema or explodeDataPerAction of action:${action}`);
202
- // }
203
- console.log("before send to middleware", {
204
- middleware,
205
- // objectType,
206
- action,
207
- setting
208
- })
209
- Logger.debug("setting in generateCodeLibs", setting)
210
- middleware.setServiceSchema(
211
- // schemaFunctionPerAction[action],
212
- // explodeDataPerAction[action],
213
- {
214
- // objectType: objectType,
215
- specificFieldNames: setting?.specificFieldNames ? setting.specificFieldNames : [],
216
- action: action
217
- },
218
- );
219
- }
220
- // /**
221
- // * use to validate record for Lambda handler hdrSqs/hdrDsq
222
- // * Note!: cannot throw error when use this function outside recordHandler
223
-
224
- // * @param {string} objectType - name of ObjectType
225
- // * @param {string} action - action type of Lambda create | update | get | delete
226
- // * @param {object} [setting]
227
- // */
228
- // async function validateSchemaPerWebSocket(
229
- // _izContext,
230
- // requestParams,
231
- // objectType,
232
- // action,
233
- // setting = {}
234
- // ) {
235
- // _izContext.logger.debug("validateSchema Per WebSocketFunction", {
236
- // objectType,
237
- // requestParams,
238
- // action,
239
- // setting
240
- // })
241
- // try {
242
- // if (action === "update") {
243
- // setting.updateScenario = "versionedData"
244
- // }
245
-
246
- // const objType = utils.createObjType(objectType)
247
- // _izContext.logger.debug("objType in validatorSchema per WebSocket", objType)
248
-
249
- // const objectSchema = await getObjectSchema.getObjSchemaS3WithHierarchy(_izContext, objType);
250
- // _izContext.logger.debug("objectSchema", objectSchema)
251
- // const generateValidatorSchema = schemaFunctionPerAction[action];
252
- // const explodeDataFunction = explodeDataPerAction[action];
253
-
254
- // const generateValidatorSchemaPerWebSocket = await generateValidatorSchema(_izContext, objType, setting);
255
- // _izContext.logger.debug("Generate Validator Schema For WebSocket :", generateValidatorSchemaPerWebSocket);
256
-
257
- // const explodedDataPerWebSocket = await explodeDataFunction(_izContext, requestParams, objectSchema, setting);
258
-
259
- // _izContext.logger.debug("exploded RequestParams Data in GeneratorValidatorSchema :", explodedDataPerWebSocket);
260
-
261
-
262
- // let validateStatus = validateObject(_izContext, generateValidatorSchemaPerWebSocket, explodedDataPerWebSocket);
263
- // _izContext.logger.debug('validateStatus : ', validateStatus);
264
-
265
- // if (!validateStatus.pass) {
266
- // const validatorError = new Error(`validation failed: ${validateStatus.error}`)
267
- // throw validatorError;
268
- // }
269
- // } catch (err) {
270
- // _izContext.logger.error("Error in validateSchemaPerWebSocket:", err);
271
- // throw err;
272
- // }
273
- // }
274
-
275
- async function sendMsgOutComplete(_izContext, topicName, messageObj, callingFlowConfig) {
276
-
277
- try {
278
- // add callingFlow to message
279
- messageObj = callingFlowSharedLib.addPassBackPropertiesToSnsResponseMessageObject(callingFlowConfig, messageObj);
280
- let messageAttributes = callingFlowSharedLib.addCallingFlowToSnsResponseMessageAttributes(callingFlowConfig, {});
281
-
282
- let sendMessageOutComplete = {
283
- Message: JSON.stringify(messageObj),
284
- MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
285
- TopicArn: await snsSharedLib.snsTopicArn(_izContext, topicName),
286
- };
287
-
288
- _izContext.logger.debug(`Send message to ${topicName} :`, sendMessageOutComplete);
289
- await sns.publishAsync(_izContext, sendMessageOutComplete);
290
- return;
291
- } catch (error) {
292
- throw error;
293
- }
294
-
295
- }
296
-
297
-
298
-
299
-
300
- /**
301
- * @param {object} record - One record from sqs.
302
- * @param {string} messageFailError - The message error.
303
- * @param {object} lambdaFunctionName - Queue anme what to send to dlq./name of Lambda being invoked, used to build SQS/DLQ
304
- *
305
- */
306
- async function messageToDlq(record, messageFailError, queueUrl) {
307
-
308
- let messageBody = record.body
309
-
310
- let params = {
311
- QueueUrl: queueUrl,
312
- MessageAttributes: {
313
- messageFailError: {
314
- DataType: "String",
315
- StringValue: messageFailError
316
- }
317
- },
318
- MessageBody: JSON.stringify(messageBody),
319
- };
320
-
321
- record._izContext.logger.debug('messageToDlq, params before sending DLQ', params);
322
-
323
- await sqs.sendMessage(record._izContext, params);
324
- record._izContext.logger.debug("----- messageToDlq sendMessage success -----");
325
- };
326
-
327
-
328
- // {
329
- // [storageTag]: {
330
- // storageType: 'graph',
331
- // graphServiceTag: 'GraphHandler',
332
- // fieldNames: [ 'companyName', 'companyId' ],
333
- // versionedDatas: {
334
- // ceo: [ 'name', 'ceoAddress', 'salary' ],
335
- // branch: [ 'branchAddress', 'branchId' ]
336
- // }
337
- // versionedDataLabels:[],
338
- // }
339
- // }
340
-
341
-
342
- /**
343
- * helper function for get endpoint
344
- * create get data detail for each storageTag
345
- *
346
- * @param {Object} _izContext
347
- * @param {Object} objectSchema
348
- */
349
- async function createGetDataDetails(_izContext, objectSchema, settings = { bucketName: process.env.iz_serviceSchemaBucketName }) {
350
-
351
- // group versionedData per storageTag
352
- // or should group versionedData per graph serviceTag
353
- let versionedDataPerStorageTag = {}
354
- if (objectSchema?.addOnDataStructure?.length) {
355
- for (let addOn of objectSchema.addOnDataStructure) {
356
- if (addOn.type !== "versionedData") {
357
- continue;
358
- }
359
-
360
- if (!versionedDataPerStorageTag.hasOwnProperty(addOn.storageResourceTag)) {
361
- versionedDataPerStorageTag[addOn.storageResourceTag] = [];
362
- }
363
-
364
- versionedDataPerStorageTag[addOn.storageResourceTag].push(addOn);
365
- }
366
- }
367
-
368
- _izContext.logger.debug("versionedDataPerStorageTag: ", versionedDataPerStorageTag);
369
-
370
-
371
- let getGraphDataDetails = {};
372
- let getDynamoDbDataDetails = {};
373
-
374
-
375
- // reference to graph serviceTag that already used
376
- let graphStorageTagPerGraphServiceTag = {} // {serviceTag:storageTag,... }
377
-
378
-
379
- for (let [storageTag, storageData] of Object.entries(objectSchema.storageResources)) {
380
-
381
- // collect fieldNames per storageTag
382
- let storageTagFieldNames = [];
383
- for (let [fieldName, fieldNameData] of Object.entries(objectSchema.fieldNames)) {
384
- // if (fieldName.startsWith("versionedDataField")) {
385
- // continue;
386
- // }
387
-
388
- if (fieldNameData.storageResourceTags.includes(storageTag)) {
389
- storageTagFieldNames.push(fieldName);
390
- }
391
- }
392
-
393
- if (storageData.storageType === coreConsts.STORAGE_TYPES.graph) {
394
-
395
- let useStorageTag = storageTag;
396
- let graphServiceTag = await serviceConfig.getGraphServiceTagWithCache(_izContext, storageData.graphServerTag, settings.bucketName);
397
-
398
- // check duplicate graph serviceTag
399
- if (!graphStorageTagPerGraphServiceTag.hasOwnProperty(graphServiceTag)) {
400
- graphStorageTagPerGraphServiceTag[graphServiceTag] = storageTag;
401
- } else {
402
- // overwrite useStorageTag if graphServiceTag already used
403
- _izContext.logger.debug("current storageTag: ", storageTag);
404
- _izContext.logger.debug("use storageTag: ", useStorageTag);
405
-
406
- useStorageTag = graphStorageTagPerGraphServiceTag[graphServiceTag];
407
- }
408
-
409
-
410
- if (!getGraphDataDetails.hasOwnProperty(useStorageTag)) {
411
- getGraphDataDetails[useStorageTag] = {
412
- storageType: storageData.storageType,
413
- graphServiceTag: graphServiceTag,
414
- fieldNames: storageTagFieldNames
415
- }
416
- } else {
417
- getGraphDataDetails[useStorageTag].fieldNames =
418
- [...new Set(getGraphDataDetails[useStorageTag].fieldNames.concat(storageTagFieldNames))];
419
- }
420
-
421
-
422
- // add versionedData fieldNames
423
- if (versionedDataPerStorageTag.hasOwnProperty(storageTag)) {
424
- if (!getGraphDataDetails[useStorageTag].hasOwnProperty("versionedDatas")) {
425
- getGraphDataDetails[useStorageTag].versionedDatas = {};
426
- }
427
-
428
- for (let versionedData of versionedDataPerStorageTag[storageTag]) {
429
- _izContext.logger.debug("versionedData.fieldNames", versionedData.fieldNames)
430
- let versionedDataFieldNames = Object.keys(versionedData.fieldNames);
431
- Object.assign(
432
- getGraphDataDetails[useStorageTag].versionedDatas,
433
- { [versionedData.versionedDataLabel]: versionedDataFieldNames }
434
- )
435
- }
436
- }
437
-
438
- } else if (storageData.storageType === coreConsts.STORAGE_TYPES.dynamoDB) {
439
- let serviceTag = storageData.serviceTag || process.env.iz_serviceTag
440
- Object.assign(getDynamoDbDataDetails, {
441
- [storageTag]: {
442
- storageType: storageData.storageType,
443
- tableName: storageData.tableName,
444
- serviceTag: serviceTag,
445
- fieldNames: storageTagFieldNames
446
- }
447
- })
448
-
449
- if (storageData.groupByPartitionKeyField) {
450
- Object.assign(
451
- getDynamoDbDataDetails[storageTag],
452
- {
453
- groupByPartitionKeyField: storageData.groupByPartitionKeyField
454
- }
455
- )
456
- }
457
-
458
-
459
- } else {
460
- throw new NoRetryError("Unhanled storageType");
461
- }
462
- }
463
-
464
- _izContext.logger.debug("getGraphDataDetail: ", getGraphDataDetails);
465
- _izContext.logger.debug("getDynamoDbData: ", getDynamoDbDataDetails);
466
-
467
-
468
- //-------- sort descending order of fieldNames.length --------
469
- let sortedGetGraphWithVersionedData = Object.entries(getGraphDataDetails)
470
- .filter((getGraphDetail) => getGraphDetail[1].hasOwnProperty("versionedDatas"))
471
- .sort((storageDataA, storageDataB) =>
472
- storageDataB[1].fieldNames.length - storageDataA[1].fieldNames.length
473
- );
474
-
475
- _izContext.logger.debug("sortedGetGraphWithVersionedData: ", sortedGetGraphWithVersionedData);
476
-
477
-
478
- let sortedGetGraphWithoutVersionedData = Object.entries(getGraphDataDetails)
479
- .filter((getGraphDetail) => !getGraphDetail[1].hasOwnProperty("versionedDatas"))
480
- .sort((storageDataA, storageDataB) =>
481
- storageDataB[1].fieldNames.length - storageDataA[1].fieldNames.length
482
- );
483
-
484
- _izContext.logger.debug("sortedGetGraphWithoutVersionedData: ", sortedGetGraphWithoutVersionedData);
485
-
486
-
487
- let sortedGetDynamoDbData = Object.entries(getDynamoDbDataDetails).sort((storageDataA, storageDataB) =>
488
- storageDataB[1].fieldNames.length - storageDataA[1].fieldNames.length
489
- );
490
-
491
- _izContext.logger.debug("sortedGetDynamoDbData: ", sortedGetDynamoDbData);
492
-
493
-
494
- // after sort data then filter duplicate fieldName
495
- let allSortedGetDataDetails = [...sortedGetGraphWithVersionedData, ...sortedGetDynamoDbData, ...sortedGetGraphWithoutVersionedData];
496
- _izContext.logger.debug("allSortedGetDataDetails: ", allSortedGetDataDetails);
497
-
498
-
499
- let usedFieldName = [];
500
- for (let [storageTag, getDataDetail] of allSortedGetDataDetails) {
501
- let remainsFieldNames = [];
502
- while (getDataDetail.fieldNames.length) {
503
- let checkedFiedName = getDataDetail.fieldNames.pop();
504
- if (!usedFieldName.includes(checkedFiedName)) {
505
- usedFieldName.push(checkedFiedName);
506
- remainsFieldNames.push(checkedFiedName);
507
- }
508
- }
509
-
510
- getDataDetail.fieldNames = remainsFieldNames;
511
- }
512
-
513
- _izContext.logger.debug("newSortedArray after: ", allSortedGetDataDetails);
514
-
515
-
516
- let getDataDetailResults = Object.fromEntries(
517
- allSortedGetDataDetails.filter(([storageTag, getDataDetail]) => {
518
- return (getDataDetail.fieldNames.length || getDataDetail.hasOwnProperty("versionedDatas"));
519
- })
520
- );
521
-
522
- _izContext.logger.debug("getDataDetailResults: ", getDataDetailResults);
523
-
524
- for (const getDataDetail of Object.values(getDataDetailResults)) {
525
- if (getDataDetail.hasOwnProperty("versionedDatas")) {
526
- getDataDetail.versionedDataLabels = [];
527
- for (let [versionedDataLabel, fieldNames] of Object.entries(getDataDetail.versionedDatas)) {
528
- getDataDetail.versionedDataLabels.push(versionedDataLabel)
529
- getDataDetail.fieldNames.push(...fieldNames);
530
- }
531
- }
532
- }
533
-
534
- return getDataDetailResults;
535
- }
536
-
537
-
538
- /**
539
- * create dynamoDb identifiers using request param and objectSchema
540
- *
541
- * @param {Object} _izContext
542
- * @param {Object} objectSchema
543
- * @param {Object} reqIdentifiers - input identifier from calling function
544
- */
545
- async function generateDynamoDbIdentifiers(_izContext, objectSchema, reqIdentifiers, bucketName = process.env.iz_serviceSchemaBucketName) {
546
-
547
- // start create identifiers for dynamo
548
- let dynamoIdentifiers = {};
549
-
550
- for (let identifier of objectSchema.identifiers) {
551
- if (identifier.name) {
552
- let deliminator = identifier.deliminator || coreConsts.DEFAULT_IDENTIFIER_DELIMINATOR;
553
- let currentDeliminatorAmount = 0;
554
-
555
- let concatenateValue = [];
556
- for (let fieldName of identifier.fieldNames) {
557
- concatenateValue.push(reqIdentifiers[fieldName]);
558
-
559
- let deliminatorTreeFieldName = await deliminatorTree.generateDeliminatorTreePerFieldName(_izContext, fieldName, objectSchema.fieldNames[fieldName], {}, bucketName);
560
- _izContext.logger.debug("deliminatorTreeFieldName: ", deliminatorTreeFieldName);
561
-
562
- if (deliminatorTreeFieldName[fieldName]?.deliminatorList?.[deliminator]) {
563
- currentDeliminatorAmount = Math.max(
564
- currentDeliminatorAmount,
565
- deliminatorTreeFieldName[fieldName].deliminatorList[deliminator]
566
- );
567
- }
568
- }
569
-
570
- Object.assign(
571
- dynamoIdentifiers,
572
- {
573
- [identifier.name]: concatenateValue.join(deliminator.repeat(currentDeliminatorAmount + 1))
574
- }
575
- );
576
- } else {
577
- Object.assign(
578
- dynamoIdentifiers,
579
- {
580
- [identifier.fieldName]: reqIdentifiers[identifier.fieldName]
581
- }
582
- )
583
- }
584
- }
585
-
586
- _izContext.logger.debug("dynamoIdentifiers: ", dynamoIdentifiers);
587
-
588
- return dynamoIdentifiers;
589
- }
590
-
591
-
592
- /**
593
- * create dynamoDb identifiers using request param and objectSchema
594
- *
595
- * @param {Object} _izContext
596
- * @param {Object} objectSchema
597
- * @param {Object} reqIdentifiers - input identifier from calling function
598
- */
599
- const generateDynamoDbIdentifiersWithCache = inMemoryCacheLib(
600
- generateDynamoDbIdentifiers, // fn
601
- { // setting
602
- max: 20, maxAge: 86400000, promise: true, profileName: 'generateDynamoDbIdentifiers',
603
- normalizer: function (args) {
604
- return hash([args[1], args[2]])
605
- }
606
- }
607
- )
608
-
609
- /**
610
- *
611
- * @param {Object} _izContext
612
- * @param {Object} objectSchema
613
- * @param {Object} dynamoStorageResource
614
- * @param {Object} reqIdentifiers
615
- */
616
- async function dynamoDbIdentifiersByStorageResource(_izContext, objectSchema, dynamoStorageResource, reqIdentifiers, bucketName = process.env.iz_serviceSchemaBucketName) {
617
-
618
- let dynamoIdentifiers = await generateDynamoDbIdentifiersWithCache(_izContext, objectSchema, reqIdentifiers, bucketName)
619
-
620
- let identifiersByStorageResource = {};
621
-
622
- if (dynamoStorageResource.groupByPartitionKeyField) {
623
-
624
- let deliminatorTreeIdentifiers = await deliminatorTree.generateDeliminatorTreeIdentifier(_izContext, objectSchema, bucketName);
625
- _izContext.logger.debug("deliminatorTree: ", deliminatorTreeIdentifiers);
626
-
627
- let compositeKeyDeliminator = objectSchema.compositeKeyDeliminator || coreConsts.DEFAULT_IDENTIFIER_DELIMINATOR;
628
-
629
- let currentDeliminatorAmount = 0;
630
-
631
- for (let currentDeliminator of Object.values(deliminatorTreeIdentifiers)) {
632
- if (currentDeliminator.deliminator === compositeKeyDeliminator) {
633
- if (currentDeliminatorAmount < currentDeliminator.deliminatorList[compositeKeyDeliminator]) {
634
- currentDeliminatorAmount = currentDeliminator.deliminatorList[compositeKeyDeliminator];
635
- }
636
- }
637
- }
638
-
639
- // sort dynamoDbIdentifiers data by objectSchema
640
- let sortedIdentifiersValue = [];
641
- for (let identifier of objectSchema.identifiers) {
642
- let identifierName = identifier.fieldName || identifier.name;
643
- sortedIdentifiersValue.push(dynamoIdentifiers[identifierName]);
644
- }
645
-
646
- let newIdentifierValue = sortedIdentifiersValue.join(compositeKeyDeliminator.repeat(currentDeliminatorAmount + 1));
647
-
648
- identifiersByStorageResource = {
649
- [dynamoStorageResource.groupByPartitionKeyField]: newIdentifierValue
650
- };
651
-
652
- } else {
653
- identifiersByStorageResource = dynamoIdentifiers;
654
- }
655
-
656
- return identifiersByStorageResource;
657
- }
658
-
659
-
660
- /**
661
- * receive result from multiple database and create data format depend on returnFormat setting
662
- *
663
- * @param {object} _izContext
664
- * @param {object[]} getResults
665
- * @param {object} objectSchema
666
- * @returns
667
- */
668
- function collectGetData(_izContext, getResults, objectSchema, returnSystemFieldsName) {
669
- _izContext.logger.debug("collectGetData: ", {
670
- getResults,
671
- objectSchema,
672
- returnSystemFieldsName
673
- });
674
-
675
-
676
- let collectedData = {
677
- identifiers: {},
678
- fields: {}
679
- }
680
-
681
- if (returnSystemFieldsName) {
682
- Object.assign(collectedData, { versionDataSystemFields: {} })
683
- }
684
- const identifierFieldNames = new Set(utils.getUsedFieldNamesOfIdentifiers(_izContext, objectSchema.identifiers));
685
-
686
- let addedFieldNames = new Set();
687
-
688
- // if isFound === true then return null from this function
689
- let isFound = false;
690
-
691
- for (const [getData, getDataDetail] of getResults) {
692
- if (!getData || !Object.keys(getData).length) {
693
- continue;
694
- }
695
-
696
- // this process will add result from graph and dynamo to collectedData object by add identifiers and fieldName from getData
697
- if (getDataDetail.storageType === coreConsts.STORAGE_TYPES.graph) {
698
- if (getData.returnValue.queryResults.refactoredNodes.objInstanceFull && Object.keys(getData.returnValue.queryResults.refactoredNodes.objInstanceFull).length) {
699
- for (const getDetailFieldName of getDataDetail.fieldNames) {
700
- if (addedFieldNames.has(getDetailFieldName)) {
701
- continue;
702
- }
703
-
704
- if (getData.returnValue.queryResults.refactoredNodes.objInstanceFull.identifiers.hasOwnProperty(getDetailFieldName)) {
705
- Object.assign(
706
- collectedData.identifiers,
707
- { [getDetailFieldName]: getData.returnValue.queryResults.refactoredNodes.objInstanceFull.identifiers[getDetailFieldName] }
708
- );
709
- addedFieldNames.add(getDetailFieldName);
710
- isFound = true;
711
- } else if (getData.returnValue.queryResults.refactoredNodes.objInstanceFull.fields.hasOwnProperty(getDetailFieldName)) {
712
- Object.assign(
713
- collectedData.fields,
714
- { [getDetailFieldName]: getData.returnValue.queryResults.refactoredNodes.objInstanceFull.fields[getDetailFieldName] }
715
- );
716
- addedFieldNames.add(getDetailFieldName);
717
- isFound = true;
718
- }
719
- }
720
- }
721
- if (getData.returnValue.queryResults.refactoredNodes.versionDataSystemFields || returnSystemFieldsName == true) {
722
- Object.assign(collectedData.versionDataSystemFields, getData.returnValue.queryResults.refactoredNodes.versionDataSystemFields)
723
- }
724
- } else if (getDataDetail.storageType === coreConsts.STORAGE_TYPES.dynamoDB) {
725
- for (const getDetailFieldName of getDataDetail.fieldNames) {
726
- if (addedFieldNames.has(getDetailFieldName)) {
727
- continue;
728
- }
729
-
730
- if (getData.hasOwnProperty(getDetailFieldName)) {
731
- if (identifierFieldNames.has(getDetailFieldName)) {
732
- Object.assign(
733
- collectedData.identifiers,
734
- { [getDetailFieldName]: getData[getDetailFieldName] }
735
- );
736
- addedFieldNames.add(getDetailFieldName);
737
- isFound = true;
738
- } else {
739
- Object.assign(
740
- collectedData.fields,
741
- { [getDetailFieldName]: getData[getDetailFieldName] }
742
- );
743
- addedFieldNames.add(getDetailFieldName);
744
- isFound = true;
745
- }
746
- }
747
- }
748
- } else {
749
- throw new NoRetryError("collectGetData unhandled storageType");
750
- }
751
- }
752
-
753
- if (isFound) {
754
- return collectedData;
755
- } else {
756
- return null;
757
- }
758
- }
759
-
760
-
761
- async function createUpdateDataDetail(_izContext, objectSchema, settings = { bucketName: process.env.iz_serviceSchemaBucketName }) {
762
- let getGraphDataDetails = {};
763
- let getDynamoDbDataDetails = {};
764
- let allUpdateDataDetail = {};
765
- for (let [storageTag, storageProperties] of Object.entries(objectSchema.storageResources)) {
766
- let storageFieldNames = [];
767
- for (let [fieldName, fieldNameProperties] of Object.entries(objectSchema.fieldNames)) {
768
- if (fieldNameProperties.storageResourceTags.includes(storageTag)) {
769
- let versionedDataLabel = fieldNameProperties.versionedDataLabel
770
- if (!fieldName.includes(versionedDataLabel)) { // not get fieldNames VersionedData_VersionedDataLabel_VersionedDataFieldNames
771
- storageFieldNames.push(fieldName)
772
- }
773
- }
774
- }
775
- if (storageProperties.storageType === coreConsts.STORAGE_TYPES.graph) {
776
- let graphStorageTagPerGraphServiceTag = {}
777
- let useStorageTag = storageTag;
778
- let graphServiceName = await serviceConfig.getGraphServiceTagWithCache(_izContext, storageProperties.graphServerTag, settings.bucketName)
779
- if (!graphStorageTagPerGraphServiceTag.hasOwnProperty(graphServiceName)) {
780
- graphStorageTagPerGraphServiceTag[graphServiceName] = storageTag;
781
- _izContext.logger.debug("graphStorageTagPerGraphServiceTag", graphStorageTagPerGraphServiceTag)
782
- } else {
783
- _izContext.logger.debug("current storageTag", storageTag)
784
- _izContext.logger.debug("used storageTag", useStorageTag)
785
- useStorageTag = graphStorageTagPerGraphServiceTag[graphServiceName]
786
- }
787
- if (!getGraphDataDetails.hasOwnProperty(useStorageTag)) {
788
- getGraphDataDetails[graphServiceName] =
789
- {
790
- storageType: storageProperties.storageType,
791
- fieldNames: storageFieldNames
792
- }
793
- } else {
794
- getGraphDataDetails[graphServiceName].fieldNames = [...new Set(getGraphDataDetails[useStorageTag].fieldNames.concat(storageFieldNames))]
795
- }
796
- } else if (storageProperties.storageType === coreConsts.STORAGE_TYPES.dynamoDB) {
797
- let serviceTag = storageProperties.serviceTag || process.env.iz_serviceTag;
798
- Object.assign(getDynamoDbDataDetails, {
799
- [storageTag]: {
800
- storageType: storageProperties.storageType,
801
- tableName: storageProperties.tableName,
802
- serviceTag: serviceTag,
803
- fieldNames: storageFieldNames
804
- }
805
- })
806
-
807
- if (storageTag.groupByPartitionKeyField) {
808
- Object.assign(
809
- getDynamoDbDataDetails[storageTag],
810
- {
811
- groupByPartitionKeyField: storageProperties.groupByPartitionKeyField
812
- }
813
- )
814
- }
815
- }
816
- }
817
-
818
- _izContext.logger.debug("getGraphDataDetails", getGraphDataDetails);
819
- _izContext.logger.debug("getDynamoDataDetail", getDynamoDbDataDetails);
820
-
821
- Object.assign(allUpdateDataDetail, getDynamoDbDataDetails, getGraphDataDetails);
822
- return allUpdateDataDetail
823
- }
824
-
825
- async function createDataDetailsLib(_izContext, objectSchemas, settings = { bucketName: process.env.iz_serviceSchemaBucketName }) {
826
- _izContext.logger.debug("Lib: createDataDetailsLib:", { objectSchemas: objectSchemas });
827
- /**
828
- * TODO: crate DataDetail now will get parent objectSchema if have extendObjType
829
- * will split fieldNames for each serviceTag and storageREsourceTags
830
- * */
831
-
832
- let createDataDetails = {};
833
-
834
- let storageResources = objectSchemas.storageResources;
835
- _izContext.logger.debug("storageResources:", storageResources);
836
-
837
- for (let [keyFieldName, settingFieldName] of Object.entries(objectSchemas.fieldNames)) {
838
- // _izContext.logger.debug("Loop fieldNamesObjectSchemas", { keyFieldName });
839
-
840
- for (let eachStorageResourceTag of settingFieldName.storageResourceTags) {
841
- // _izContext.logger.debug("Loop eachStorageResourceTags", eachStorageResourceTag);
842
-
843
- if (!storageResources.hasOwnProperty(eachStorageResourceTag)) {
844
- throw new Error("storageResources is'n exist"); // should be validate in step upload in s3
845
- } else {
846
- if (storageResources[eachStorageResourceTag].storageType == coreConsts.STORAGE_TYPES.dynamoDB) {
847
- if (createDataDetails.hasOwnProperty(eachStorageResourceTag)) {
848
- // _izContext.logger.debug("SAME STG DB", eachStorageResourceTag);
849
- createDataDetails[eachStorageResourceTag].fieldNames.push(keyFieldName);
850
-
851
- } else {
852
- Object.assign(createDataDetails, {
853
- [eachStorageResourceTag]: {
854
- storageType: coreConsts.STORAGE_TYPES.dynamoDB,
855
- tableName: storageResources[eachStorageResourceTag].tableName,
856
- serviceTag: storageResources[eachStorageResourceTag].serviceTag || process.env.iz_serviceTag,
857
- fieldNames: [keyFieldName]
858
- }
859
- });
860
-
861
- if (storageResources[eachStorageResourceTag].hasOwnProperty("groupByPartitionKeyField")) {
862
- Object.assign(createDataDetails[eachStorageResourceTag], {
863
- groupByPartitionKeyField: storageResources[eachStorageResourceTag].groupByPartitionKeyField
864
- });
865
- }
866
- }
867
- } else if (storageResources[eachStorageResourceTag].storageType == coreConsts.STORAGE_TYPES.graph) {
868
- let checkGraphServerTags = await serviceConfig.getGraphServiceTagWithCache(
869
- _izContext,
870
- storageResources[eachStorageResourceTag].graphServerTag,
871
- settings.bucketName
872
- );
873
- if (checkGraphServerTags) {
874
- if (createDataDetails.hasOwnProperty(checkGraphServerTags)) {
875
- // _izContext.logger.debug("SAME STG", checkGraphServerTags);
876
- createDataDetails[checkGraphServerTags].fieldNames.push(keyFieldName)
877
-
878
- } else {
879
- // _izContext.logger.debug("NEW STG", checkGraphServerTags);
880
- Object.assign(createDataDetails, {
881
- [checkGraphServerTags]: {
882
- storageType: coreConsts.STORAGE_TYPES.graph,
883
- fieldNames: [keyFieldName]
884
- }
885
- });
886
- };
887
- };
888
- } else if (storageResources[eachStorageResourceTag].storageType === coreConsts.STORAGE_TYPES.externalTopic) {
889
- let topicName = storageResources[eachStorageResourceTag].serviceTag + storageResources[eachStorageResourceTag].stage + storageResources[eachStorageResourceTag].topicName
890
- Object.assign(createDataDetails, {
891
- [topicName]: {
892
- storageType: coreConsts.STORAGE_TYPES.externalTopic,
893
- fieldNames: [keyFieldName],
894
- accountId: storageResources[eachStorageResourceTag].accountId,
895
- region: storageResources[eachStorageResourceTag].region,
896
- serviceTag: storageResources[eachStorageResourceTag].serviceTag,
897
- stage: storageResources[eachStorageResourceTag].stage
898
- }
899
- });
900
- }
901
- };
902
- }; // end loop storageResourceTags
903
- }; // end loop
904
-
905
- return createDataDetails;
906
- };
907
-
908
- async function createDeleteDataDetail(_izContext, objectSchema, settings = { bucketName: process.env.iz_serviceSchemaBucketName }) {
909
- let deleteDynamoDataDetail = {};
910
- let deleteGraphDataDetail = {};
911
- let allDeleteDataDetail = {};
912
-
913
- for (let [storageTag, storageProperties] of Object.entries(objectSchema.storageResources)) {
914
- if (storageProperties.storageType === coreConsts.STORAGE_TYPES.dynamoDB) {
915
- let serviceTag = storageProperties.serviceTag || process.env.iz_serviceTag;
916
- Object.assign(deleteDynamoDataDetail, {
917
- [storageTag]: {
918
- storageType: storageProperties.storageType,
919
- serviceTag: serviceTag,
920
- tableName: storageProperties.tableName
921
- }
922
- })
923
- if (storageProperties.groupByPartitionKeyField) {
924
- Object.assign(
925
- deleteDynamoDataDetail[storageTag],
926
- {
927
- groupByPartitionKeyField: storageProperties.groupByPartitionKeyField
928
- }
929
- )
930
- }
931
- } else if (storageProperties.storageType === coreConsts.STORAGE_TYPES.graph) {
932
- let dataDetailPerGraphStorage = {};
933
- let useStorageTag = storageTag
934
- let graphServiceName = await serviceConfig.getGraphServiceTagWithCache(_izContext, storageProperties.graphServerTag, settings.bucketName);
935
- if (!dataDetailPerGraphStorage.hasOwnProperty(graphServiceName)) {
936
- dataDetailPerGraphStorage[graphServiceName] = storageTag;
937
- } else {
938
- useStorageTag = dataDetailPerGraphStorage[graphServiceName]
939
- }
940
- if (!deleteGraphDataDetail.hasOwnProperty(useStorageTag)) {
941
- deleteGraphDataDetail[graphServiceName] =
942
- {
943
- storageType: storageProperties.storageType,
944
- }
945
- }
946
- }
947
- }
948
- _izContext.logger.debug("deleteGraphDataDetail", deleteGraphDataDetail);
949
- _izContext.logger.debug("deleteDynamoDataDetail", deleteDynamoDataDetail);
950
- Object.assign(allDeleteDataDetail, deleteGraphDataDetail, deleteDynamoDataDetail)
951
-
952
- _izContext.logger.debug("allDeleteDataDetail", allDeleteDataDetail)
953
- return allDeleteDataDetail
954
- }
955
-
956
- function createFieldForUpdateDynamoDb(_izContext, objectSchema, dynamoDataDetail, fields) {
957
- _izContext.logger.debug("createFieldForUpdateDynamoDb", {
958
- objectSchema,
959
- dynamoDataDetail,
960
- fields
961
- })
962
-
963
- let fieldsForUpdateDynamo = {};
964
-
965
- for (let [fieldName, fieldSetting] of Object.entries(objectSchema.fieldNames)) {
966
- if (fieldSetting.canUpdate == true || !fieldSetting.hasOwnProperty("canUpdate")) {
967
- if (dynamoDataDetail.fieldNames.includes(fieldName)) {
968
- if (fields[fieldName]) {
969
- if (!fieldsForUpdateDynamo.hasOwnProperty(fields[fieldName])) {
970
- _izContext.logger.debug("assign new fieldName", (fields[fieldName]))
971
- Object.assign(fieldsForUpdateDynamo, {
972
- [fieldName]: fields[fieldName]
973
- }
974
- )
975
- }
976
- }
977
- }
978
- }
979
- }
980
- return fieldsForUpdateDynamo
981
- }
36
+ import consts from './Consts.js';
37
+ const { TOPIC_NAME_GENERATE_CODE, TOPIC_NAME_GRAPH_HANDLER, PREFIX } = consts;
982
38
 
39
+ const nodeLabelRegexPattern = '^[a-zA-Z0-9_-]+(?:\:[a-zA-Z0-9_-]+)?$';
983
40
 
984
41
  /**
985
42
  *
@@ -996,15 +53,27 @@ function createFieldForUpdateDynamoDb(_izContext, objectSchema, dynamoDataDetail
996
53
  * @param {Object} storageResources
997
54
  * @param {Boolean} topLevelParent
998
55
  */
999
- function createBasicRelationshipsProperties(from, to, storageResources, baseDirection, topLevelParent = false) {
1000
- validateObjType.validateObjType({ objectType: from.objectType, serviceTag: from.serviceTag });
1001
- validateObjType.validateObjType({ objectType: to.objectType, serviceTag: to.serviceTag });
56
+ function createBasicRelationshipsProperties(
57
+ from,
58
+ to,
59
+ storageResources,
60
+ baseDirection,
61
+ topLevelParent = false
62
+ ) {
63
+ validateObjType.validateObjType({
64
+ objectType: from.objectType,
65
+ serviceTag: from.serviceTag
66
+ });
67
+ validateObjType.validateObjType({
68
+ objectType: to.objectType,
69
+ serviceTag: to.serviceTag
70
+ });
1002
71
 
1003
72
  let otherDirection;
1004
- if (baseDirection === "to") {
1005
- otherDirection = "from"
1006
- } else if (baseDirection === "from") {
1007
- otherDirection = "to"
73
+ if (baseDirection === 'to') {
74
+ otherDirection = 'from';
75
+ } else if (baseDirection === 'from') {
76
+ otherDirection = 'to';
1008
77
  }
1009
78
 
1010
79
  let relationshipProperties = {
@@ -1042,51 +111,66 @@ function createBasicRelationshipsProperties(from, to, storageResources, baseDire
1042
111
  requiredOnCreate: to.requiredOnCreate
1043
112
  }
1044
113
  }
1045
- ],
1046
- }
114
+ ]
115
+ };
1047
116
 
1048
117
  if (topLevelParent === true) {
1049
- relationshipProperties.links.push(
1050
- {
1051
- storageResourceTags: Object.keys(storageResources),
1052
- from: {
1053
- objType: {
1054
- serviceTag: to.serviceTag,
1055
- objectType: to.objectType
1056
- },
1057
- linkType: "one",
1058
- direction: "from",
1059
- requiredOnCreate: false
118
+ relationshipProperties.links.push({
119
+ storageResourceTags: Object.keys(storageResources),
120
+ from: {
121
+ objType: {
122
+ serviceTag: to.serviceTag,
123
+ objectType: to.objectType
1060
124
  },
1061
- to: {
1062
- objType: {
1063
- serviceTag: to.serviceTag,
1064
- objectType: to.objectType
1065
- },
1066
- linkType: "many",
1067
- direction: "to",
1068
- requiredOnCreate: false
1069
- }
125
+ linkType: 'one',
126
+ direction: 'from',
127
+ requiredOnCreate: false
128
+ },
129
+ to: {
130
+ objType: {
131
+ serviceTag: to.serviceTag,
132
+ objectType: to.objectType
133
+ },
134
+ linkType: 'many',
135
+ direction: 'to',
136
+ requiredOnCreate: false
1070
137
  }
1071
- )
138
+ });
1072
139
  }
1073
- return relationshipProperties
140
+ return relationshipProperties;
1074
141
  }
1075
142
 
1076
- function createFieldNamesFromRequestParamsByObjectSchema(_izContext, requestParams, objectSchema) {
143
+ function createFieldNamesFromRequestParamsByObjectSchema(
144
+ _izContext,
145
+ requestParams,
146
+ objectSchema
147
+ ) {
1077
148
  let createFieldNameParams = {};
1078
- _izContext.logger.debug("createFieldNamesFromRequestParamsByObjectSchema ::", { requestParams, objectSchema })
149
+ _izContext.logger.debug(
150
+ 'createFieldNamesFromRequestParamsByObjectSchema ::',
151
+ { requestParams, objectSchema }
152
+ );
1079
153
  for (const fieldName of Object.keys(objectSchema.fieldNames)) {
1080
154
  if (Object.keys(requestParams).includes(fieldName)) {
1081
155
  if (!createFieldNameParams.hasOwnProperty(fieldName)) {
1082
- Object.assign(createFieldNameParams, { [fieldName]: requestParams[fieldName] })
156
+ Object.assign(createFieldNameParams, {
157
+ [fieldName]: requestParams[fieldName]
158
+ });
1083
159
  }
1084
160
  }
1085
161
  }
1086
- return createFieldNameParams
162
+ return createFieldNameParams;
1087
163
  }
1088
164
 
1089
- async function sharedCreateEndpoint(_izContext, objType, requestParams, callingFlowConfig, settings = { userAgent: false, directInvoke: false, parentObject }) {
165
+ async function sharedCreateEndpoint(_izContext,
166
+ objType,
167
+ requestParams,
168
+ callingFlowConfig,
169
+ settings = {
170
+ userAgent: false,
171
+ directInvoke: false,
172
+ parentObject: {}
173
+ }) {
1090
174
  let objectSchemas = await getObjectSchema.getObjectSchemaCombineFieldNamesWithCache(_izContext, objType)
1091
175
  let createDataDetails = await createDataDetailsLib(_izContext, objectSchemas)
1092
176
  _izContext.logger.debug("createDataDetails is =", createDataDetails);
@@ -1096,44 +180,66 @@ async function sharedCreateEndpoint(_izContext, objType, requestParams, callingF
1096
180
  let objInstanceFull = {
1097
181
  identifiers: {},
1098
182
  fields: {}
1099
- }
183
+ };
1100
184
 
1101
185
  for (let fieldName of Object.keys(requestParams.fieldNames)) {
1102
186
  if (objectSchemas.identifierFieldNames.includes(fieldName)) {
1103
- _izContext.logger.debug("identifiers is", fieldName);
187
+ _izContext.logger.debug('identifiers is', fieldName);
1104
188
  Object.assign(objInstanceFull.identifiers, {
1105
189
  [fieldName]: requestParams.fieldNames[fieldName]
1106
190
  });
1107
- };
1108
- };
191
+ }
192
+ }
1109
193
 
1110
194
  let objInstanceFullForDynamoDb = lodash.cloneDeep(objInstanceFull);
1111
195
  let objInstanceFullForGraph = lodash.cloneDeep(objInstanceFull);
1112
196
  let objInstanceFullForExternalTopic = lodash.cloneDeep(objInstanceFull);
1113
197
 
1114
- for (const [storageTag, createDataDetail] of Object.entries(createDataDetails)) {
198
+ for (const [storageTag, createDataDetail] of Object.entries(
199
+ createDataDetails
200
+ )) {
1115
201
  if (createDataDetail.storageType == coreConsts.STORAGE_TYPES.dynamoDB) {
1116
- _izContext.logger.debug("::::::DynamoDB::::::", { storageTag, objInstanceFull });
202
+ _izContext.logger.debug('::::::DynamoDB::::::', {
203
+ storageTag,
204
+ objInstanceFull
205
+ });
1117
206
 
1118
207
  if (settings.parentObject) {
1119
- if (createDataDetail.tableName.includes(firstLetterUpperCase(`${parentObject.objectType}Records`))) {
1120
- Object.assign(
1121
- objInstanceFullForDynamoDb.fields, {
1122
- [`${settings.parentObject.objectType}HandlerServiceTag`]: process.env.iz_serviceTag
1123
- })
208
+ if (
209
+ createDataDetail.tableName.includes(
210
+ firstLetterUpperCase(`${parentObject.objectType}Records`)
211
+ )
212
+ ) {
213
+ Object.assign(objInstanceFullForDynamoDb.fields, {
214
+ [`${settings.parentObject.objectType}HandlerServiceTag`]:
215
+ process.env.iz_serviceTag
216
+ });
1124
217
  }
1125
218
  }
1126
219
 
1127
- Object.assign(objInstanceFullForDynamoDb.fields, createObjInstanceFullFieldsByStorageTag(_izContext, storageTag, createDataDetail))
1128
- _izContext.logger.debug("objInstanceFull before create item in dynamoDB", objInstanceFullForDynamoDb)
220
+ Object.assign(
221
+ objInstanceFullForDynamoDb.fields,
222
+ createObjInstanceFullFieldsByStorageTag(
223
+ _izContext,
224
+ storageTag,
225
+ createDataDetail
226
+ )
227
+ );
228
+ _izContext.logger.debug(
229
+ 'objInstanceFull before create item in dynamoDB',
230
+ objInstanceFullForDynamoDb
231
+ );
1129
232
 
1130
233
  let identifiersForCreateData = await dynamoDbIdentifiersByStorageResource(
1131
234
  _izContext,
1132
235
  objectSchemas,
1133
236
  createDataDetail,
1134
237
  objInstanceFullForDynamoDb.identifiers
1135
- )
1136
- _izContext.logger.debug("identifiersForCreateData", identifiersForCreateData);
238
+ );
239
+ _izContext.logger.debug(
240
+ 'identifiersForCreateData',
241
+ identifiersForCreateData
242
+ );
1137
243
 
1138
244
  await dynamodbSharedLib.putItem(
1139
245
  _izContext,
@@ -1148,7 +254,7 @@ async function sharedCreateEndpoint(_izContext, objType, requestParams, callingF
1148
254
  }
1149
255
  );
1150
256
 
1151
- objInstanceFullForDynamoDb.fields = {} // prevent using fieldNames from other tableName
257
+ objInstanceFullForDynamoDb.fields = {}; // prevent using fieldNames from other tableName
1152
258
  if (allAwaitingStepsId.length == 0) {
1153
259
  let messageObject = {
1154
260
  objType: objType,
@@ -1156,49 +262,85 @@ async function sharedCreateEndpoint(_izContext, objType, requestParams, callingF
1156
262
  identifiers: objInstanceFullForDynamoDb.identifiers,
1157
263
  fields: objInstanceFullForDynamoDb.fields
1158
264
  }
1159
- }
265
+ };
1160
266
 
1161
- if (callingFlowConfig[callingFlowSharedLib.coreConsts.CALLINGFLOW_PROPERTYNAME]) {
267
+ if (
268
+ callingFlowConfig[
269
+ callingFlowSharedLib.consts.CALLINGFLOW_PROPERTYNAME
270
+ ]
271
+ ) {
1162
272
  // send message to SNS OutCreateNodeComplete
1163
- _izContext.logger.debug("HAVE CallingFlow");
1164
- messageObject = callingFlowSharedLib.addPassBackPropertiesToSnsResponseMessageObject(callingFlowConfig, messageObject);
273
+ _izContext.logger.debug('HAVE CallingFlow');
274
+ messageObject =
275
+ callingFlowSharedLib.addPassBackPropertiesToSnsResponseMessageObject(
276
+ callingFlowConfig,
277
+ messageObject
278
+ );
1165
279
 
1166
- let messageAttributes = callingFlowSharedLib.addCallingFlowToSnsResponseMessageAttributes(callingFlowConfig, {});
1167
- let outCreateNodeCompleteTopic = await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateNodeComplete)
280
+ let messageAttributes =
281
+ callingFlowSharedLib.addCallingFlowToSnsResponseMessageAttributes(
282
+ callingFlowConfig,
283
+ {}
284
+ );
285
+ let outCreateNodeCompleteTopic =
286
+ await snsSharedLib.snsTopicArnByFlowSchema(
287
+ _izContext,
288
+ TOPIC_NAME_GENERATE_CODE.outCreateNodeComplete
289
+ );
1168
290
  let messageParams = {
1169
291
  Message: JSON.stringify(messageObject),
1170
- MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
1171
- TopicArn: outCreateNodeCompleteTopic,
292
+ MessageAttributes: sns.createStringMessageAttributes(
293
+ _izContext,
294
+ messageAttributes
295
+ ),
296
+ TopicArn: outCreateNodeCompleteTopic
1172
297
  };
1173
298
 
1174
- _izContext.logger.debug("messageParams OutCreateNode ::::::: ", messageParams);
299
+ _izContext.logger.debug(
300
+ 'messageParams OutCreateNode ::::::: ',
301
+ messageParams
302
+ );
1175
303
  await sns.publishAsync(_izContext, messageParams);
1176
304
  }
1177
305
  return {
1178
306
  objType: objType,
1179
307
  objInstanceFull: objInstanceFullForDynamoDb,
1180
308
  relationships: requestParams.relationships || [],
1181
- status: "complete",
309
+ status: 'complete',
1182
310
  errorsFound: []
1183
- }
311
+ };
1184
312
  }
1185
-
1186
313
  } else if (createDataDetail.storageType == coreConsts.STORAGE_TYPES.graph) {
1187
- _izContext.logger.debug("::::::Graph::::::", { storageTag, objInstanceFull });
314
+ _izContext.logger.debug('::::::Graph::::::', {
315
+ storageTag,
316
+ objInstanceFull
317
+ });
1188
318
 
1189
- Object.assign(objInstanceFullForGraph.fields, createObjInstanceFullFieldsByStorageTag(_izContext, storageTag, createDataDetail))
1190
- _izContext.logger.debug("objInstanceFull before send to Graph", objInstanceFullForGraph)
319
+ Object.assign(
320
+ objInstanceFullForGraph.fields,
321
+ createObjInstanceFullFieldsByStorageTag(
322
+ _izContext,
323
+ storageTag,
324
+ createDataDetail
325
+ )
326
+ );
327
+ _izContext.logger.debug(
328
+ 'objInstanceFull before send to Graph',
329
+ objInstanceFullForGraph
330
+ );
1191
331
 
1192
332
  // allStorageTagComplete = false;
1193
- allAwaitingStepsId.push(await asyncFlowSharedLib.createAwaitingStepId(
1194
- (hash({
1195
- objType: objType,
1196
- graphServerTag: storageTag,
1197
- identifiers: objInstanceFullForGraph.identifiers,
1198
- callingFlowProperties: callingFlowConfig.callingFlowProperties || {}
1199
- })),
1200
- PREFIX.CREATE_OBJECT_ASYNC
1201
- ));
333
+ allAwaitingStepsId.push(
334
+ await asyncFlowSharedLib.createAwaitingStepId(
335
+ hash({
336
+ objType: objType,
337
+ graphServerTag: storageTag,
338
+ identifiers: objInstanceFullForGraph.identifiers,
339
+ callingFlowProperties: callingFlowConfig.callingFlowProperties || {}
340
+ }),
341
+ PREFIX.CREATE_OBJECT_ASYNC
342
+ )
343
+ );
1202
344
  listOfObjectForCreates.push({
1203
345
  [storageTag]: {
1204
346
  objInstanceFull: {
@@ -1209,42 +351,71 @@ async function sharedCreateEndpoint(_izContext, objType, requestParams, callingF
1209
351
  }
1210
352
  });
1211
353
 
1212
- _izContext.logger.debug("FIRST", listOfObjectForCreates)
1213
-
1214
- } else if (createDataDetail.storageType === coreConsts.STORAGE_TYPES.externalTopic) {
1215
- _izContext.logger.debug("::::::externalTopic::::::", { storageTag, createDataDetail });
1216
- Object.assign(objInstanceFullForExternalTopic.fields, createObjInstanceFullFieldsByStorageTag(_izContext, storageTag, createDataDetail))
1217
- _izContext.logger.debug("objInstanceFull before send to external topic", objInstanceFullForExternalTopic)
354
+ _izContext.logger.debug('FIRST', listOfObjectForCreates);
355
+ } else if (
356
+ createDataDetail.storageType === coreConsts.STORAGE_TYPES.externalTopic
357
+ ) {
358
+ _izContext.logger.debug('::::::externalTopic::::::', {
359
+ storageTag,
360
+ createDataDetail
361
+ });
362
+ Object.assign(
363
+ objInstanceFullForExternalTopic.fields,
364
+ createObjInstanceFullFieldsByStorageTag(
365
+ _izContext,
366
+ storageTag,
367
+ createDataDetail
368
+ )
369
+ );
370
+ _izContext.logger.debug(
371
+ 'objInstanceFull before send to external topic',
372
+ objInstanceFullForExternalTopic
373
+ );
1218
374
 
1219
- allAwaitingStepsId.push(await asyncFlowSharedLib.createAwaitingStepId(
1220
- (hash({
1221
- objType: objType,
1222
- graphServerTag: storageTag,
1223
- identifiers: objInstanceFullForGraph.identifiers,
1224
- callingFlowProperties: callingFlowConfig.callingFlowProperties || {}
1225
- })),
1226
- PREFIX.CREATE_OBJECT_EXTERNAL_TOPIC
1227
- ));
375
+ allAwaitingStepsId.push(
376
+ await asyncFlowSharedLib.createAwaitingStepId(
377
+ hash({
378
+ objType: objType,
379
+ graphServerTag: storageTag,
380
+ identifiers: objInstanceFullForGraph.identifiers,
381
+ callingFlowProperties: callingFlowConfig.callingFlowProperties || {}
382
+ }),
383
+ PREFIX.CREATE_OBJECT_EXTERNAL_TOPIC
384
+ )
385
+ );
1228
386
 
1229
387
  let sendToCreateExternalTopic = {
1230
- Message: JSON.stringify({ objType, objInstanceFull: objInstanceFullForExternalTopic, relationships: requestParams.relationships }),
388
+ Message: JSON.stringify({
389
+ objType,
390
+ objInstanceFull: objInstanceFullForExternalTopic,
391
+ relationships: requestParams.relationships
392
+ }),
1231
393
  TopicArn: `arn:aws:sns:${createDataDetail.region}:${createDataDetail.accountId}:${createDataDetail.serviceTag}_${createDataDetail.stage}_Create_In`
1232
394
  };
1233
- _izContext.logger.debug("Request params before send to create endpoint:", sendToCreateExternalTopic);
395
+ _izContext.logger.debug(
396
+ 'Request params before send to create endpoint:',
397
+ sendToCreateExternalTopic
398
+ );
1234
399
 
1235
- await sns.publishAsync(_izContext, sendToCreateExternalTopic)
1236
- return sendToCreateExternalTopic
400
+ await sns.publishAsync(_izContext, sendToCreateExternalTopic);
401
+ return sendToCreateExternalTopic;
1237
402
  }
1238
- };
1239
- _izContext.logger.debug("[1]listOfObjectForCreates:::", listOfObjectForCreates);
403
+ }
404
+ _izContext.logger.debug(
405
+ '[1]listOfObjectForCreates:::',
406
+ listOfObjectForCreates
407
+ );
1240
408
 
1241
409
  /// step save awaitingMultipleStep of storageType graph ...........................................................
1242
410
  if (!settings.userAgent) {
1243
- _izContext.logger.debug("not api will create awaitingStep")
411
+ _izContext.logger.debug('not api will create awaitingStep');
1244
412
  await asyncFlowSharedLib.createAwaitingMultipleSteps(
1245
413
  _izContext,
1246
414
  allAwaitingStepsId,
1247
- asyncFlowSharedLib.createPendingStepId((hash({ objType: objType, identifiers: objInstanceFull.identifiers })), PREFIX.CREATE_OBJECT_ASYNC_COMPLETE)
415
+ asyncFlowSharedLib.createPendingStepId(
416
+ hash({ objType: objType, identifiers: objInstanceFull.identifiers }),
417
+ PREFIX.CREATE_OBJECT_ASYNC_COMPLETE
418
+ )
1248
419
  );
1249
420
  }
1250
421
  //............................................................................................................
@@ -1252,28 +423,34 @@ async function sharedCreateEndpoint(_izContext, objType, requestParams, callingF
1252
423
  // process storageType : graph
1253
424
  let messageObject = {};
1254
425
  for (let objectCreate of listOfObjectForCreates) {
1255
-
1256
- for (let [graphServiceName, objectForCreate] of Object.entries(objectCreate)) {
1257
- _izContext.logger.debug("Loop each graph:", {
426
+ for (let [graphServiceName, objectForCreate] of Object.entries(
427
+ objectCreate
428
+ )) {
429
+ _izContext.logger.debug('Loop each graph:', {
1258
430
  [graphServiceName]: objectForCreate
1259
431
  });
1260
432
 
1261
- if (objectForCreate.allStorageTagComplete == false) { // needless check because in listOfObjectForCreates push case graph only!
433
+ if (objectForCreate.allStorageTagComplete == false) {
434
+ // needless check because in listOfObjectForCreates push case graph only!
1262
435
  messageObject = {
1263
436
  objType: objType,
1264
437
  objInstanceFull: objectForCreate.objInstanceFull,
1265
438
  relationships: requestParams.relationships || []
1266
439
  };
1267
- };
440
+ }
1268
441
 
1269
- _izContext.logger.debug("SENT MESSAGE EACH GRAPH::::", { graphServiceName, messageObject, callingFlowConfig })
442
+ _izContext.logger.debug('SENT MESSAGE EACH GRAPH::::', {
443
+ graphServiceName,
444
+ messageObject,
445
+ callingFlowConfig
446
+ });
1270
447
 
1271
448
  Object.assign(messageObject, {
1272
449
  settings: { updatePropertiesOnMatch: false },
1273
- originTimestamp: Date.now(),
450
+ originTimestamp: Date.now()
1274
451
  });
1275
452
  if (settings.userAgent) {
1276
- _izContext.logger.debug("have userAgent will invoke GraphHandler")
453
+ _izContext.logger.debug('have userAgent will invoke GraphHandler');
1277
454
  let createNodeResult = await graphSharedLibs.createNodeV2(
1278
455
  _izContext,
1279
456
  graphServiceName,
@@ -1284,11 +461,12 @@ async function sharedCreateEndpoint(_izContext, objType, requestParams, callingF
1284
461
  {
1285
462
  updatePropertiesOnMatch: false
1286
463
  }
1287
- )
1288
- return createNodeResult
1289
-
464
+ );
465
+ return createNodeResult;
1290
466
  } else if (settings.directInvoke) {
1291
- _izContext.logger.debug("Direction Invoke case will invoke GraphHandlerInv")
467
+ _izContext.logger.debug(
468
+ 'Direction Invoke case will invoke GraphHandlerInv'
469
+ );
1292
470
  let createNodeResult = await graphSharedLibs.createNodeV2(
1293
471
  _izContext,
1294
472
  graphServiceName,
@@ -1303,48 +481,76 @@ async function sharedCreateEndpoint(_izContext, objType, requestParams, callingF
1303
481
 
1304
482
  return createNodeResult;
1305
483
  } else {
1306
- _izContext.logger.debug("not have userAgent will send Message to GraphHandler")
1307
- messageObject = callingFlowSharedLib.addCallingFlowToSnsRequestMessageObject(
1308
- messageObject,
1309
- callingFlowSharedLib.addParentCallingFlowConfig(
1310
- callingFlowConfig, // receive parent callingFlowConfig.
1311
- callingFlowSharedLib.createCallingFlowConfig( // calling flow own service
1312
- await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.createNodeComplete), {}
1313
- )
1314
- )
484
+ _izContext.logger.debug(
485
+ 'not have userAgent will send Message to GraphHandler'
1315
486
  );
487
+ messageObject =
488
+ callingFlowSharedLib.addCallingFlowToSnsRequestMessageObject(
489
+ messageObject,
490
+ callingFlowSharedLib.addParentCallingFlowConfig(
491
+ callingFlowConfig, // receive parent callingFlowConfig.
492
+ callingFlowSharedLib.createCallingFlowConfig(
493
+ // calling flow own service
494
+ await lambdaSharedLib.lambdaFunctionName(
495
+ _izContext,
496
+ TOPIC_NAME_GENERATE_CODE.createNodeComplete
497
+ ),
498
+ {}
499
+ )
500
+ )
501
+ );
1316
502
 
1317
503
  let messageToCreateObject = {
1318
504
  Message: JSON.stringify(messageObject),
1319
- TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GRAPH_HANDLER.inCreateNode, graphServiceName)
505
+ TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(
506
+ _izContext,
507
+ TOPIC_NAME_GRAPH_HANDLER.inCreateNode,
508
+ graphServiceName
509
+ )
1320
510
  };
1321
- _izContext.logger.debug("RequestParams before send to sqs messageToCreateObject ::::::: ", messageToCreateObject);
511
+ _izContext.logger.debug(
512
+ 'RequestParams before send to sqs messageToCreateObject ::::::: ',
513
+ messageToCreateObject
514
+ );
1322
515
  await sns.publishAsync(_izContext, messageToCreateObject);
1323
516
 
1324
- return messageObject
517
+ return messageObject;
1325
518
  }
1326
- };
1327
- };
519
+ }
520
+ }
1328
521
 
1329
- function createObjInstanceFullFieldsByStorageTag(_izContext, storageTag, createDataDetail) {
522
+ function createObjInstanceFullFieldsByStorageTag(
523
+ _izContext,
524
+ storageTag,
525
+ createDataDetail
526
+ ) {
1330
527
  let fields = {};
1331
528
  for (let fieldName of Object.keys(requestParams.fieldNames)) {
1332
- if ((createDataDetails[storageTag].fieldNames.includes(fieldName)) &&
1333
- (createDataDetail.fieldNames.includes(fieldName))) {
529
+ if (
530
+ createDataDetails[storageTag].fieldNames.includes(fieldName) &&
531
+ createDataDetail.fieldNames.includes(fieldName)
532
+ ) {
1334
533
  if (!objInstanceFull.identifiers.hasOwnProperty(fieldName)) {
1335
534
  if (!fields.hasOwnProperty(fieldName)) {
1336
535
  Object.assign(fields, {
1337
536
  [fieldName]: requestParams.fieldNames[fieldName]
1338
- })
537
+ });
1339
538
  }
1340
539
  }
1341
540
  }
1342
541
  }
1343
- return fields
542
+ return fields;
1344
543
  }
1345
544
  }
1346
545
 
1347
- async function sharedCreateCompleteEndpoint(_izContext, returnValue, status, errorsFound, graphServiceTag, passBackProperties) {
546
+ async function sharedCreateCompleteEndpoint(
547
+ _izContext,
548
+ returnValue,
549
+ status,
550
+ errorsFound,
551
+ graphServiceTag,
552
+ passBackProperties
553
+ ) {
1348
554
  let existsNode = null;
1349
555
  let createNodeFinished = false;
1350
556
  if (Object.keys(returnValue.queryResult.returnCreateNode.existsNode).length) {
@@ -1353,65 +559,88 @@ async function sharedCreateCompleteEndpoint(_izContext, returnValue, status, err
1353
559
  objectType: returnValue.requestParams.objType.objectType,
1354
560
  serviceTag: returnValue.requestParams.objType.serviceTag
1355
561
  },
1356
- objInstanceFull: returnValue.queryResult.returnCreateNode.existsNode.objInstanceFull
1357
- }
562
+ objInstanceFull:
563
+ returnValue.queryResult.returnCreateNode.existsNode.objInstanceFull
564
+ };
1358
565
  }
1359
566
 
1360
567
  let awaitingStepId = await asyncFlowSharedLib.createAwaitingStepId(
1361
- (hash({
568
+ hash({
1362
569
  objType: returnValue.requestParams.objType,
1363
570
  graphServerTag: graphServiceTag,
1364
571
  identifiers: returnValue.requestParams.objInstanceFull.identifiers,
1365
- callingFlowProperties: passBackProperties.passBackProperties.parentPassBackProperties.callingFlowProperties || {}
1366
- })),
572
+ callingFlowProperties:
573
+ passBackProperties.passBackProperties.parentPassBackProperties
574
+ .callingFlowProperties || {}
575
+ }),
1367
576
  PREFIX.CREATE_OBJECT_ASYNC
1368
- )
1369
- _izContext.logger.debug("awaitingStepId:", awaitingStepId);
577
+ );
578
+ _izContext.logger.debug('awaitingStepId:', awaitingStepId);
1370
579
 
1371
580
  let recordAwaitingSteps = await dynamodbSharedLib.query(
1372
581
  _izContext,
1373
- await dynamodbSharedLib.tableName(_izContext, "AwaitingMultipleSteps"),
582
+ await dynamodbSharedLib.tableName(_izContext, 'AwaitingMultipleSteps'),
1374
583
  {
1375
584
  awaitingStepId: awaitingStepId
1376
585
  }
1377
586
  );
1378
- _izContext.logger.debug("record awaitingSteps::", recordAwaitingSteps);
587
+ _izContext.logger.debug('record awaitingSteps::', recordAwaitingSteps);
1379
588
 
1380
589
  await Promise.all(
1381
590
  recordAwaitingSteps.Items.map(async ({ pendingStepId }) => {
1382
- if (await asyncFlowSharedLib.checkAllAwaitingStepsFinished(
1383
- _izContext,
1384
- pendingStepId,
1385
- awaitingStepId,
1386
- errorsFound
1387
- )) {
1388
- _izContext.logger.debug("finish all awaitingStep");
591
+ if (
592
+ await asyncFlowSharedLib.checkAllAwaitingStepsFinished(
593
+ _izContext,
594
+ pendingStepId,
595
+ awaitingStepId,
596
+ errorsFound
597
+ )
598
+ ) {
599
+ _izContext.logger.debug('finish all awaitingStep');
1389
600
 
1390
601
  let messageObject = {
1391
602
  objType: {
1392
603
  objectType: returnValue.requestParams.objType.objectType,
1393
604
  serviceTag: returnValue.requestParams.objType.serviceTag
1394
605
  },
1395
- objInstanceFull: returnValue.queryResult.returnCreateNode.objInstanceFull,
606
+ objInstanceFull:
607
+ returnValue.queryResult.returnCreateNode.objInstanceFull,
1396
608
  relationships: returnValue.queryResult.returnCreateNode.relationships,
1397
609
  existsNode: existsNode,
1398
610
  status: status,
1399
611
  errorsFound: errorsFound
1400
- }
612
+ };
1401
613
 
1402
- messageObject = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, messageObject)
1403
- let messageAttributes = callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(passBackProperties, {})
614
+ messageObject =
615
+ callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(
616
+ passBackProperties,
617
+ messageObject
618
+ );
619
+ let messageAttributes =
620
+ callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(
621
+ passBackProperties,
622
+ {}
623
+ );
1404
624
 
1405
625
  let sendMessageOutCreateObjectComplete = {
1406
626
  Message: JSON.stringify(messageObject),
1407
- MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
1408
- TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateNodeComplete)
627
+ MessageAttributes: sns.createStringMessageAttributes(
628
+ _izContext,
629
+ messageAttributes
630
+ ),
631
+ TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(
632
+ _izContext,
633
+ TOPIC_NAME_GENERATE_CODE.outCreateNodeComplete
634
+ )
1409
635
  };
1410
- _izContext.logger.debug("Send message to OutCreateObjectComplete :::>", sendMessageOutCreateObjectComplete)
636
+ _izContext.logger.debug(
637
+ 'Send message to OutCreateObjectComplete :::>',
638
+ sendMessageOutCreateObjectComplete
639
+ );
1411
640
  await sns.publishAsync(_izContext, sendMessageOutCreateObjectComplete);
1412
- createNodeFinished = true
641
+ createNodeFinished = true;
1413
642
  } else {
1414
- createNodeFinished = false
643
+ createNodeFinished = false;
1415
644
  }
1416
645
 
1417
646
  await asyncFlowSharedLib.removeAwaitingMultipleStep(
@@ -1420,820 +649,14 @@ async function sharedCreateCompleteEndpoint(_izContext, returnValue, status, err
1420
649
  pendingStepId,
1421
650
  errorsFound
1422
651
  );
1423
-
1424
652
  })
1425
- )
1426
- return createNodeFinished
653
+ );
654
+ return createNodeFinished;
1427
655
  }
1428
656
 
1429
657
  export default {
1430
- sendMsgOutComplete,
1431
- messageToDlq,
1432
-
1433
- validateSchemaMiddleware,
1434
- validateSchemaPerRecord,
1435
- validatorSchemaMiddlewareByAction,
1436
-
1437
- createGetDataDetails,
1438
- collectGetData,
1439
-
1440
- generateDynamoDbIdentifiers,
1441
- generateDynamoDbIdentifiersWithCache,
1442
- dynamoDbIdentifiersByStorageResource,
1443
- createUpdateDataDetail,
1444
- createDataDetailsLib,
1445
- createDeleteDataDetail,
1446
-
1447
- createFieldForUpdateDynamoDb,
1448
658
  createBasicRelationshipsProperties,
1449
659
  createFieldNamesFromRequestParamsByObjectSchema,
1450
660
  sharedCreateEndpoint,
1451
- sharedCreateCompleteEndpoint
1452
- }
1453
-
1454
-
1455
-
1456
-
1457
-
1458
- // /**
1459
- // * filter request param depend on generatedValidatorSchema function
1460
- // * @param {object} _izContext
1461
- // * @param {object} requestParams - requestParams that need to filter
1462
- // * @param {string} action - use to match generateValidatorSchemaFunction
1463
- // * @param {string} objectType - objectType for search objectSchema
1464
- // * @param {string[]} specificFieldNames - setting of generateValidatorSchemaFunction
1465
- // */
1466
- // async function filterRequestParam(_izContext, requestParams, action, objectType, specificFieldNames) {
1467
-
1468
- // if (!validatorSchema.schemaFunctionPerAction[action]) {
1469
- // throw new NoRetryError(`Not found function for generateValidatorSchema of action:${action}`);
1470
- // }
1471
-
1472
- // // prepare variable
1473
- // const generateValidatorFunction = validatorSchema.schemaFunctionPerAction[action];
1474
-
1475
- // const generatedValidatorSchema = await generateValidatorFunction(_izContext, objectType, specificFieldNames);
1476
-
1477
- // // prepare new requestParams depend on properties of generatedValidatorSchema
1478
- // let newRequestParams = {}
1479
- // for (let validatorFieldName in generatedValidatorSchema.properties) {
1480
- // if (requestParams.hasOwnProperty(validatorFieldName)) {
1481
- // Object.assign(newRequestParams, { [validatorFieldName]: requestParams[validatorFieldName] })
1482
- // }
1483
- // }
1484
-
1485
- // // add additionalRequest to requestParams
1486
- // if (requestParams.hasOwnProperty("additionalRequest") && Object.keys(requestParams.additionalRequest).length) {
1487
- // Object.assign(newRequestParams, { additionalRequest: requestParams.additionalRequest });
1488
- // }
1489
-
1490
- // return newRequestParams
1491
- // }
1492
-
1493
-
1494
- // /**
1495
- // * reformat request for main function of each action
1496
- // * @param {Object} _izContext
1497
- // * @param {String} objectType
1498
- // * @param {String} action
1499
- // * @param {Object} requestParams
1500
- // * @returns
1501
- // */
1502
- // async function reformattedRequestParams(_izContext, objectType, action, requestParams) {
1503
- // _izContext.logger.debug("------ reformattedRequestParams ------");
1504
- // _izContext.logger.debug("objectType: ", objectType);
1505
- // _izContext.logger.debug("action: ", action);
1506
- // _izContext.logger.debug("requestParams: ", requestParams);
1507
-
1508
- // const objectSchema = await getObjectSchema.getLocalObjectSchemasWithHierarchy(_izContext, objectType).then(data => data.records[0]);
1509
- // _izContext.logger.debug("objectSchema in reformatted: ", objectSchema);
1510
-
1511
- // const identifierFieldNames = utils.getUsedFieldNamesOfIdentifiers(_izContext, objectSchema.identifiers);
1512
- // _izContext.logger.debug("identifierFieldNames: ", identifierFieldNames);
1513
-
1514
- // let versionedDatas = [];
1515
- // if (objectSchema?.addOnDataStructure?.length) {
1516
- // for (let eachAddOn of objectSchema.addOnDataStructure) {
1517
- // if (eachAddOn.type === "versionedData") {
1518
- // versionedDatas.push(eachAddOn);
1519
- // }
1520
- // }
1521
- // }
1522
-
1523
-
1524
-
1525
- // let reformattedReq
1526
-
1527
- // // reformat request depend on action
1528
- // switch (action) {
1529
- // case coreConsts.ACTIONS.create:
1530
- // _izContext.logger.debug("reformatted case create");
1531
-
1532
- // // initial format
1533
- // reformattedReq = {
1534
- // identifiers: {},
1535
- // createFieldNames: {},
1536
- // relationships: []
1537
- // };
1538
-
1539
- // let createFieldNames = Object.entries(objectSchema.fieldNames).reduce((returnFieldNames, [fieldName, fieldNameData]) => {
1540
- // if (identifierFieldNames.includes(fieldName)) {
1541
- // return returnFieldNames;
1542
- // }
1543
-
1544
- // if (fieldNameData.requiredOnCreate === true || fieldNameData.optionalOnCreate === true) {
1545
- // returnFieldNames.push(fieldName);
1546
- // }
1547
- // return returnFieldNames;
1548
- // }, [])
1549
-
1550
-
1551
-
1552
- // _izContext.logger.debug("createFieldNames: ", createFieldNames);
1553
-
1554
-
1555
- // for (const [reqFieldName, reqFieldData] of Object.entries(requestParams.fieldNames)) {
1556
- // if (identifierFieldNames.includes(reqFieldName)) {
1557
- // Object.assign(
1558
- // reformattedReq.identifiers,
1559
- // { [reqFieldName]: reqFieldData }
1560
- // );
1561
- // } else {
1562
- // if (createFieldNames.includes(reqFieldName)) {
1563
- // Object.assign(
1564
- // reformattedReq.createFieldNames,
1565
- // { [reqFieldName]: reqFieldData }
1566
- // );
1567
- // }
1568
- // }
1569
- // }
1570
-
1571
- // if (requestParams?.relationships?.length) {
1572
- // reformattedReq.relationships = reformattedReq.relationships.concat(requestParams.relationships)
1573
- // }
1574
-
1575
- // break;
1576
- // case coreConsts.ACTIONS.update:
1577
- // // code block
1578
- // break;
1579
- // case coreConsts.ACTIONS.get:
1580
- // // code block
1581
- // break;
1582
- // case coreConsts.ACTIONS.delete:
1583
- // // code block
1584
- // break;
1585
- // default:
1586
- // throw new NoRetryError(`reformattedRequestParams:unhandled action:${action}`)
1587
- // }
1588
-
1589
- // return reformattedReq;
1590
- // }
1591
-
1592
- // const reformattedRequestParamsWithCache = inMemoryCacheLib.inMemoryCacheLib(
1593
- // reformattedRequestParams, // fn
1594
- // {
1595
- // max: 100, maxAge: 86400000, promise: true, profileName: 'reformattedRequestParams',
1596
- // normalizer: function (args) {
1597
- // return hash([args[1], args[2], args[3]]);
1598
- // }
1599
- // }
1600
- // )
1601
-
1602
-
1603
-
1604
- // /**
1605
- // * filter identifiers from requestParams depend on objectSchema.identifiers
1606
- // * @param {object} _izContext
1607
- // * @param {object} objectSchema - objectSchema of objectType
1608
- // * @param {object} requestParams - requestParams from handler
1609
- // * @returns
1610
- // */
1611
- // function saperateIdentifierRequestParams(_izContext, objectSchema, requestParams) {
1612
-
1613
- // let usedIdentifierTypes = utils.selectIdentifierTypeByPriority(_izContext, [], objectSchema);
1614
-
1615
- // let identifierFieldNameList = utils.getUsedFieldNamesOfIdentifiers(_izContext, objectSchema.identifiers, usedIdentifierTypes);
1616
-
1617
-
1618
- // let identifiersObj = {};
1619
-
1620
- // for (let identifierFieldName of identifierFieldNameList) {
1621
- // if (requestParams.hasOwnProperty(identifierFieldName)) {
1622
- // Object.assign(identifiersObj, { [identifierFieldName]: requestParams[identifierFieldName] });
1623
- // } else {
1624
- // throw new NoRetryError(`missing ${identifierFieldName} in requestParams`);
1625
- // }
1626
- // }
1627
-
1628
-
1629
- // return identifiersObj;
1630
- // }
1631
-
1632
-
1633
-
1634
-
1635
- // /*
1636
- // Q?
1637
- // - when perform action in dynamodb some table need to concatenate
1638
- // - need to generate new identifier of dynamodb depend on storageResource
1639
-
1640
- // returnValue = {
1641
- // graph:{ // storageType
1642
- // graphHandler:{ // graph service name
1643
- // nodeLabel:"string" // generate node label here
1644
- // identifier: {
1645
- // prop1: value1,
1646
- // prop2: value2,
1647
- // },
1648
- // properties:{
1649
- // prop1: value1,
1650
- // prop2: value2,
1651
- // },
1652
- // versionedDataLabel:[
1653
- // // ...
1654
- // ],
1655
- // versionedDatas:[ // for [create | update] action
1656
- // {
1657
- // nodeLabel:"xxx",
1658
- // nodeProperties:{
1659
- // // ...versionedData node properties
1660
- // }
1661
- // hookProperties:["xxx", yyy]
1662
- // }
1663
- // ]
1664
- // nodePropertyLabel:{ // addOnDataStructure: type = nodePropertyLabel | attributeTree | , not implement yet
1665
- // // ...setting
1666
- // }
1667
- // },
1668
- // mediaGraph:{ // graph service name
1669
- // prop1:value1,
1670
- // prop2:value2,
1671
- // }
1672
- // },
1673
- // dynamoDb:{ // storageType
1674
- // table1:{ // tableName
1675
- // identifier: {
1676
- // prop1: value1,
1677
- // prop2: value2,
1678
- // },
1679
- // properties{
1680
- // prop1: value1,
1681
- // prop2: value2,
1682
- // }
1683
- // },
1684
- // table2:{ // tableName
1685
- // identifier: {
1686
- // prop1: value1,
1687
- // prop2: value2,
1688
- // },
1689
- // properties{
1690
- // prop1: value1,
1691
- // prop2: value2,
1692
- // }
1693
- // }
1694
- // }
1695
- // }
1696
- // */
1697
- // async function saperateRequestByStorageResources(_izContext, objectSchema, requestParams, action) {
1698
- // _izContext.logger.debug("Function: saperateRequestByStorageResources :", { requestParams, action })
1699
-
1700
- // // -------------- initial return value --------------
1701
-
1702
- // let returnValue = {}
1703
-
1704
- // for (let storageType of coreConsts.STORAGE_TYPE_LIST) {
1705
- // if (!returnValue.hasOwnProperty(storageType)) {
1706
- // returnValue[storageType] = {}
1707
- // }
1708
- // }
1709
-
1710
- // _izContext.logger.debug("initial returnValue: ", returnValue);
1711
-
1712
- // // -------------- initial return value --------------
1713
-
1714
-
1715
-
1716
- // // create identifier object from requestParams
1717
- // let identifierObj = saperateIdentifierRequestParams(_izContext, objectSchema, requestParams);
1718
-
1719
- // // separate requestParams by storageType
1720
- // for (let [storageTag, storageData] of Object.entries(objectSchema.storageResources)) {
1721
-
1722
- // if (storageData.storageType === coreConsts.STORAGE_TYPES.dynamoDB) {
1723
-
1724
- // // separate by tableName
1725
- // let dynamoRequestParams = await separateRequestByDynamoDb(
1726
- // _izContext,
1727
- // objectSchema,
1728
- // requestParams,
1729
- // identifierObj,
1730
- // storageTag,
1731
- // storageData
1732
- // );
1733
- // _izContext.logger.debug("dynamoRequestParams: ", dynamoRequestParams);
1734
-
1735
- // let tableName = storageData.tableName;
1736
- // if (returnValue[coreConsts.STORAGE_TYPES.dynamoDB][tableName]) {
1737
- // throw new NoRetryError(`Have duplicate tableName in storageTag:${storageTag}`);
1738
- // }
1739
-
1740
- // Object.assign(returnValue[coreConsts.STORAGE_TYPES.dynamoDB], { [tableName]: dynamoRequestParams });
1741
-
1742
- // } else if (storageData.storageType === coreConsts.STORAGE_TYPES.graph) {
1743
-
1744
- // // separate by GraphServiceName
1745
- // let graphRequestParams = await separateRequestByGraph(
1746
- // _izContext,
1747
- // objectSchema,
1748
- // requestParams,
1749
- // identifierObj,
1750
- // storageTag,
1751
- // storageData,
1752
- // action
1753
- // );
1754
- // _izContext.logger.debug("graphRequestParams: ", graphRequestParams);
1755
-
1756
- // let graphServiceName = await serviceConfig.getGraphServiceNameFromGraphServerTagWithCache(_izContext, storageData.graphServerTag);
1757
-
1758
-
1759
- // if (returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName]) {
1760
- // // have exists graphServiceName,
1761
- // // need to merge properties for multiple graphServerTag to one serviceName
1762
- // _izContext.logger.debug('exists serviceName');
1763
- // _izContext.logger.debug('graphRequestParams : ', graphRequestParams);
1764
- // _izContext.logger.debug('returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName]: ',
1765
- // returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName]
1766
- // );
1767
-
1768
- // // merge node properties
1769
- // for (let graphProperty in graphRequestParams.properties) {
1770
- // if (!returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName].properties.hasOwnProperty(graphProperty)) {
1771
- // Object.assign(
1772
- // returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName].properties,
1773
- // { [graphProperty]: graphRequestParams.properties[graphProperty] }
1774
- // );
1775
- // }
1776
- // }
1777
-
1778
-
1779
- // /*
1780
- // if versionedDatas exists in graphRequestParams
1781
- // - check versionedDatas exists in returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName]
1782
- // - if exists add versionedData in graphRequestParams to returnValue
1783
- // - if not exists create and add versionedDatas
1784
- // */
1785
-
1786
- // // merge graph versionedData
1787
- // if (graphRequestParams.versionedDatas?.length) {
1788
- // if (Array.isArray(returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName].versionedDatas)) {
1789
- // returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName].versionedDatas =
1790
- // returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName].versionedDatas.concat(graphRequestParams.versionedDatas)
1791
- // } else {
1792
- // returnValue[coreConsts.STORAGE_TYPES.graph][graphServiceName].versionedDatas = graphRequestParams.versionedDatas
1793
- // }
1794
- // }
1795
-
1796
-
1797
- // } else {
1798
- // // not exists graphServiceName
1799
- // Object.assign(returnValue[coreConsts.STORAGE_TYPES.graph], { [graphServiceName]: graphRequestParams });
1800
- // }
1801
-
1802
- // } else {
1803
- // throw new NoRetryError(`Don't know storageType:${storageData.type} in storageTag:${storageTag}`);
1804
- // }
1805
- // }
1806
-
1807
- // return returnValue
1808
-
1809
- // }
1810
-
1811
-
1812
-
1813
-
1814
-
1815
- // /**
1816
- // * helper function for separate requestParams depend on storageTag
1817
- // *
1818
- // * @param {Object} _izContext
1819
- // * @param {Object} objectSchema -
1820
- // * @param {Object} requestParams - requestParams from lambda
1821
- // * @param {Object} identifierObj - identifiers
1822
- // * @param {String} storageTag - storageTag of storageResource
1823
- // * @param {Object} storageData - data of storageResource
1824
- // * @returns {Object} - object of identifier and property for dynamodb
1825
- // */
1826
- // async function separateRequestByDynamoDb(_izContext, objectSchema, requestParams, identifierObj, storageTag, storageData) {
1827
- // _izContext.logger.debug('separateRequestByDynamoDb: ', {
1828
- // requestParams,
1829
- // identifierObj,
1830
- // storageTag,
1831
- // storageData
1832
- // });
1833
-
1834
-
1835
- // //----------------------- Filter requestParams ------------------------
1836
-
1837
- // // filter requestParams that includes in storageTag
1838
- // let filteredRequestParams = {}
1839
- // for (let [fieldName, fieldNameData] of Object.entries(objectSchema.fieldNames)) {
1840
- // if (fieldNameData.storageResourceTags.includes(storageTag) && requestParams.hasOwnProperty(fieldName)) {
1841
- // Object.assign(filteredRequestParams, { [fieldName]: requestParams[fieldName] });
1842
- // }
1843
- // }
1844
-
1845
- // //----------------------- End Filter requestParams ------------------------
1846
-
1847
-
1848
- // //----------------------- Create dynamoDb identifier object ------------------------
1849
-
1850
- // // use identifierObj to prepare dynamodb identifiers
1851
- // let usedIdentifierTypes = utils.selectIdentifierTypeByPriority(_izContext, [], objectSchema);
1852
-
1853
- // let deliminatorTree = await serviceSchemas.generateDeliminatorTree(_izContext, objectSchema, { objectType: objectSchema.objectType, serviceTag: process.env.iz_serviceTag }, usedIdentifierTypes);
1854
- // _izContext.logger.debug(`deliminatorTree objectType: ${objectSchema.objectType} : `, deliminatorTree)
1855
-
1856
- // let dynamoDbIdentifier = {};
1857
- // for (let identifier of objectSchema.identifiers) {
1858
-
1859
- // if (!usedIdentifierTypes.includes(identifier.type)) {
1860
- // continue;
1861
- // }
1862
-
1863
- // if (identifier.hasOwnProperty("fieldName")) {
1864
-
1865
- // Object.assign(dynamoDbIdentifier, { [identifier.fieldName]: identifierObj[identifier.fieldName] });
1866
-
1867
- // } else if (identifier.hasOwnProperty("name") && identifier.hasOwnProperty("fieldNames")) {
1868
-
1869
- // let deliminator = identifier.deliminator ? identifier.deliminator : "_";
1870
-
1871
- // // if deliminatorList exists overwrite deliminator
1872
- // if (deliminatorTree.identifiersToProcess?.[identifier.name]?.deliminatorList?.[deliminator]) {
1873
- // let deliminatorAmount = deliminatorTree[identifier.name].deliminatorList[deliminator];
1874
- // deliminator = deliminator.repeat(deliminatorAmount)
1875
- // }
1876
-
1877
- // let fieldNameDataList = [];
1878
- // for (let identifierFieldName of identifier.fieldNames) {
1879
- // fieldNameDataList.push(identifierObj[identifierFieldName]);
1880
- // }
1881
-
1882
- // Object.assign(dynamoDbIdentifier, { [identifier.name]: fieldNameDataList.join(deliminator) });
1883
-
1884
- // } else {
1885
- // throw new NoRetryError('separateRequestByDynamoDb: invalid identifier');
1886
- // }
1887
- // }
1888
-
1889
- // //----------------------- End Create dynamoDb identifier object ------------------------
1890
-
1891
-
1892
- // //----------------------- calculate composite deliminator amount ------------------------
1893
-
1894
- // let compositeDeliminator = objectSchema.compositeKeyDeliminator ? objectSchema.compositeKeyDeliminator : "_";
1895
-
1896
- // let compositeDeliminatorAmount = 0;
1897
- // for (let deliminatorDetail of Object.values(deliminatorTree.identifiersToProcess)) {
1898
- // if (deliminatorDetail?.deliminatorList?.[compositeDeliminator]) {
1899
- // compositeDeliminatorAmount = Math.max(compositeDeliminatorAmount, deliminatorDetail.deliminatorList[compositeDeliminator]);
1900
- // }
1901
- // }
1902
-
1903
- // compositeDeliminatorAmount + 1;
1904
-
1905
- // //----------------------- End calculate composite deliminator amount ------------------------
1906
-
1907
-
1908
- // //----------------------- create return value ------------------------
1909
-
1910
- // // initial returnValue
1911
- // let returnValue = {
1912
- // identifiers: {},
1913
- // properties: {}
1914
- // }
1915
-
1916
- // if (storageData.hasOwnProperty("groupByPartitionKeyField")) {
1917
- // // concatenate identifierObj
1918
- // let newIdentifier = Object.values(identifierObj).join(compositeDeliminator.repeat(compositeDeliminatorAmount));
1919
-
1920
- // Object.assign(returnValue.identifiers, { [storageData.groupByPartitionKeyField]: newIdentifier });
1921
- // Object.assign(returnValue.properties, filteredRequestParams);
1922
-
1923
- // } else {
1924
- // returnValue.identifiers = identifierObj;
1925
-
1926
- // for (let requestParamProperty in filteredRequestParams) {
1927
- // if (!identifierObj.hasOwnProperty(requestParamProperty)) {
1928
- // Object.assign(returnValue.properties, { [requestParamProperty]: filteredRequestParams[requestParamProperty] });
1929
- // }
1930
- // }
1931
-
1932
- // }
1933
-
1934
- // //----------------------- End create return value ------------------------
1935
-
1936
-
1937
- // return returnValue;
1938
- // }
1939
-
1940
-
1941
- // // helper function for separate requestParams fieldName per storageTag
1942
- // async function separateRequestByGraph(_izContext, objectSchema, requestParams, identifierObj, storageTag, storageData, action) {
1943
- // _izContext.logger.debug("separateRequestByGraph: ", {
1944
- // requestParams,
1945
- // identifierObj,
1946
- // storageTag,
1947
- // storageData,
1948
- // action
1949
- // });
1950
-
1951
-
1952
- // //----------------------- Filter requestParams ------------------------
1953
-
1954
- // // filter requestParams that includes in storageTag
1955
- // let filteredRequestParams = {}
1956
- // for (let [fieldName, fieldNameData] of Object.entries(objectSchema.fieldNames)) {
1957
- // if (fieldNameData.storageResourceTags.includes(storageTag) && requestParams.hasOwnProperty(fieldName)) {
1958
- // Object.assign(filteredRequestParams, { [fieldName]: requestParams[fieldName] });
1959
- // }
1960
- // }
1961
-
1962
- // //----------------------- End Filter requestParams ------------------------
1963
-
1964
-
1965
- // //----------------------- standard return value ------------------------
1966
-
1967
- // // initial returnValue
1968
- // let returnValue = {
1969
- // identifiers: {},
1970
- // properties: {}
1971
- // }
1972
-
1973
- // // add nodeLabel
1974
- // if (objectSchema.hasOwnProperty("extendObjType")) {
1975
- // let nodeLabel = `${objectSchema.objectType}:${objectSchema.extendObjType.objectType}`;
1976
- // Object.assign(returnValue, { nodeLabel: nodeLabel });
1977
- // } else {
1978
- // Object.assign(returnValue, { nodeLabel: objectSchema.objectType });
1979
- // }
1980
-
1981
- // // add identifiers
1982
- // returnValue.identifiers = identifierObj;
1983
-
1984
- // // add properties from requestParams if not exists in identifierObj
1985
- // for (let requestParamProperty in filteredRequestParams) {
1986
- // if (!identifierObj.hasOwnProperty(requestParamProperty)) {
1987
- // Object.assign(returnValue.properties, { [requestParamProperty]: filteredRequestParams[requestParamProperty] });
1988
- // }
1989
- // }
1990
-
1991
- // //----------------------- End standard return value ------------------------
1992
-
1993
-
1994
- // //----------------------- prepare additional return data per action ------------------------
1995
-
1996
- // if (action === coreConsts.ACTIONS.get) {
1997
-
1998
- // if (
1999
- // requestParams?.additionalRequest?.versionedDataLabel
2000
- // && Array.isArray(requestParams.additionalRequest.versionedDataLabel)
2001
- // && requestParams.additionalRequest.versionedDataLabel.length
2002
- // && objectSchema.addOnDataStructure
2003
- // && Array.isArray(objectSchema.addOnDataStructure)
2004
- // ) {
2005
- // // if versionedDataLabel exists in requestParams
2006
- // // add versionedDataLabel to returnValue if exists in storageResourceTag
2007
-
2008
- // // get addOnDataStructure versionedData depend on storageTag
2009
- // let allAddOnVersionedDataPerStorageTag = objectSchema.addOnDataStructure.filter(
2010
- // addOnVersionedData => (addOnVersionedData.type === "versionedData" && addOnVersionedData.storageResourceTag === storageTag)
2011
- // );
2012
-
2013
- // for (let addOnVersionedData of allAddOnVersionedDataPerStorageTag) {
2014
- // if (requestParams.additionalRequest.versionedDataLabel.includes(addOnVersionedData.versionedDataLabel)) {
2015
-
2016
- // if (!returnValue.hasOwnProperty("versionedDataLabel")) {
2017
- // returnValue.versionedDataLabel = []
2018
- // }
2019
-
2020
- // returnValue.versionedDataLabel.push(addOnVersionedData.versionedDataLabel)
2021
- // }
2022
- // }
2023
- // }
2024
-
2025
- // } else if (action === coreConsts.ACTIONS.create) {
2026
-
2027
-
2028
- // } else if (action === coreConsts.ACTIONS.update) {
2029
- // _izContext.logger.debug("filter versionedData update")
2030
- // _izContext.logger.debug("additionalReq: ", requestParams.additionalRequest.versionedDatas)
2031
- // _izContext.logger.debug("addOnDataStructure: ", objectSchema.addOnDataStructure)
2032
- // // {
2033
- // // // ...properties
2034
- // // additionalRequest: {
2035
- // // versionedDatas: [
2036
- // // {
2037
- // // nodeLabel: "nodeLabelName",
2038
- // // nodeProperties: {
2039
- // // // ...properties of versionedData
2040
- // // }
2041
- // // }
2042
- // // ]
2043
- // // // ...other additional request
2044
- // // }
2045
- // // }
2046
-
2047
- // // separate create versionedData request
2048
- // if (
2049
- // requestParams?.additionalRequest?.versionedDatas
2050
- // && Array.isArray(requestParams.additionalRequest.versionedDatas)
2051
- // && requestParams.additionalRequest.versionedDatas.length
2052
- // && objectSchema.addOnDataStructure
2053
- // && Array.isArray(objectSchema.addOnDataStructure)
2054
- // ) {
2055
-
2056
- // let versionedDataReqList = requestParams.additionalRequest.versionedDatas;
2057
-
2058
- // // get addOnDataStructure versionedData depend on storageTag from objectSchema
2059
- // let allAddOnVersionedDataPerStorageTag = objectSchema.addOnDataStructure.filter(
2060
- // addOnVersionedData => (addOnVersionedData.type === "versionedData" && addOnVersionedData.storageResourceTag === storageTag)
2061
- // );
2062
-
2063
- // _izContext.logger.debug('allAddOnVersionedDataPerStorageTag update: ', allAddOnVersionedDataPerStorageTag);
2064
-
2065
- // // check versionedData label in requestParams exists in allAddOnVersionedDataPerStorageTag
2066
- // // if exists validate and add versionedData to return label
2067
- // if (allAddOnVersionedDataPerStorageTag.length) {
2068
- // for (let versionedDataReq of versionedDataReqList) {
2069
- // // find exists versionedData Schema
2070
- // let versionedDataSchema = allAddOnVersionedDataPerStorageTag.find(
2071
- // addOnVersionedData => addOnVersionedData.versionedDataLabel === versionedDataReq.nodeLabel
2072
- // );
2073
-
2074
-
2075
-
2076
- // if (versionedDataSchema) {
2077
- // _izContext.logger.debug('exists versionedDataSchema: ', versionedDataSchema);
2078
-
2079
- // // validate versionedData
2080
-
2081
- // let versionedDataValidatorSchema = generateValidatorSchemaForVersionedData(_izContext, versionedDataSchema, action);
2082
- // _izContext.logger.debug("versionedData validator schema: ", versionedDataValidatorSchema);
2083
-
2084
-
2085
- // _izContext.logger.debug("versionedDataReq before validate: ", versionedDataReq)
2086
- // let validateVersionedDataStatus = validateObject(_izContext, versionedDataValidatorSchema, versionedDataReq);
2087
- // _izContext.logger.debug("versionedData validate status: ", validateVersionedDataStatus);
2088
-
2089
-
2090
- // if (validateVersionedDataStatus.pass === false) {
2091
- // throw new NoRetryError("Function:separateRequestByGraph: ", validateVersionedDataStatus.error);
2092
- // }
2093
-
2094
- // if (!returnValue.hasOwnProperty("versionedDatas")) {
2095
- // returnValue.versionedDatas = [];
2096
- // }
2097
- // // end validate versionedData
2098
-
2099
-
2100
- // let hookProperties = [];
2101
- // for (let fieldNameSetting of versionedDataSchema.fieldNames) {
2102
- // hookProperties.push(fieldNameSetting.fieldName);
2103
- // }
2104
-
2105
- // Object.assign(versionedDataReq, { hookProperties });
2106
-
2107
- // returnValue.versionedDatas.push(versionedDataReq);
2108
- // }
2109
- // }
2110
- // }
2111
-
2112
- // }
2113
-
2114
-
2115
- // } else if (action === coreConsts.ACTIONS.delete) {
2116
-
2117
- // } else {
2118
- // throw new NoRetryError("Function:separateRequestByGraph: invalid action")
2119
- // }
2120
-
2121
- // //----------------------- End prepare additional return data per action ------------------------
2122
-
2123
-
2124
- // _izContext.logger.debug("Function:separateRequestByGraph: return value: ", returnValue);
2125
- // return returnValue;
2126
- // }
2127
-
2128
-
2129
-
2130
- // function mergeReturnGetData(_izContext, dynamoDbData, graphData) {
2131
- // let mergedData = {
2132
- // properties: {}
2133
- // };
2134
-
2135
- // for (let dynamoDbDataDetail of dynamoDbData) {
2136
- // for (let [dynamoDataProp, dynamoDataValue] of Object.entries(dynamoDbDataDetail)) {
2137
- // if (!mergedData.properties.hasOwnProperty(dynamoDataProp)) {
2138
- // Object.assign(mergedData.properties, { [dynamoDataProp]: dynamoDataValue })
2139
- // }
2140
- // }
2141
-
2142
- // }
2143
-
2144
- // for (let graphDataDetail of graphData) {
2145
- // // add nodeProperties to mergedData
2146
- // for (let [graphDataProp, graphDataValue] of Object.entries(graphDataDetail.nodeProperties)) {
2147
- // if (!mergedData.properties.hasOwnProperty(graphDataProp)) {
2148
- // Object.assign(mergedData.properties, { [graphDataProp]: graphDataValue })
2149
- // }
2150
- // }
2151
-
2152
- // // add versionedData to mergedData
2153
- // for (let [graphDataProp, graphDataValue] of Object.entries(graphDataDetail)) {
2154
- // console.log({ graphDataProp, graphDataValue })
2155
- // if (graphDataProp === "nodeLabels" || graphDataProp === "nodeProperties") {
2156
- // continue;
2157
- // }
2158
-
2159
-
2160
- // if (Object.keys(graphDataValue.nodeProperties).length) {
2161
-
2162
- // if (!mergedData.versionedDataLabel) {
2163
- // mergedData.versionedDataLabel = {}
2164
- // }
2165
-
2166
- // Object.assign(mergedData.versionedDataLabel, { [graphDataValue.nodeLabels.join(":")]: graphDataValue.nodeProperties })
2167
- // }
2168
- // }
2169
- // }
2170
-
2171
- // return mergedData
2172
- // }
2173
-
2174
-
2175
-
2176
- // // this function not use for new version because versionedData will not saperate from request params
2177
- // function generateValidatorSchemaForVersionedData(_izContext, versionedObjDataSchema, action) {
2178
- // // input form of versionedData will be the same for create and update action
2179
-
2180
- // // initial versionedData validatorSchema
2181
- // let versionedDataValidatorSchema = {
2182
- // type: "object",
2183
- // required: ['nodeLabel', 'nodeProperties'],
2184
- // properties: {
2185
- // nodeLabel: {
2186
- // type: 'string',
2187
- // pattern: nodeLabelRegexPattern
2188
- // },
2189
- // nodeProperties: {
2190
- // type: 'object',
2191
- // required: [], // require fieldName
2192
- // additionalProperties: false,
2193
- // properties: {}
2194
- // }
2195
- // }
2196
- // }
2197
-
2198
- // // maybe not need to validate action get and delete because
2199
- // if (action === coreConsts.ACTIONS.create) {
2200
- // for (let versionedFieldName of versionedObjDataSchema.fieldNames) {
2201
- // if (versionedFieldName.requireOnCreate === true || versionedFieldName.optionalOnCreate === true) {
2202
- // // add require fieldName to require array in validatorSchema
2203
- // if (versionedFieldName.requireOnCreate === true) {
2204
- // versionedDataValidatorSchema.properties.nodeProperties.required.push(versionedFieldName.fieldName)
2205
- // }
2206
-
2207
- // // add validation to properties
2208
- // let versionedDataProperties = versionedDataValidatorSchema.properties.nodeProperties.properties;
2209
- // Object.assign(versionedDataProperties, {
2210
- // [versionedFieldName.fieldName]: {
2211
- // type: versionedFieldName.type,
2212
- // ...versionedFieldName.validation
2213
- // }
2214
- // })
2215
-
2216
- // }
2217
- // }
2218
- // } else if (action === coreConsts.ACTIONS.update) {
2219
- // for (let versionedFieldName of versionedObjDataSchema.fieldNames) {
2220
- // if (versionedFieldName.canUpdate === true || versionedFieldName.canUpdate === undefined) {
2221
-
2222
- // // add validation to properties
2223
- // let versionedDataProperties = versionedDataValidatorSchema.properties.nodeProperties.properties;
2224
- // Object.assign(versionedDataProperties, {
2225
- // [versionedFieldName.fieldName]: {
2226
- // type: versionedFieldName.type,
2227
- // ...versionedFieldName.validation
2228
- // }
2229
- // })
2230
-
2231
- // }
2232
- // }
2233
- // } else {
2234
- // throw new NoRetryError("Function:generateValidatorSchemaForVersionedData: invalid action")
2235
- // }
2236
-
2237
- // // return validator schema of versionedData
2238
- // return versionedDataValidatorSchema;
2239
- // }
661
+ sharedCreateCompleteEndpoint,
662
+ };