@izara_project/izara-market-library-service-schemas 1.0.84 → 1.0.86

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