@izara_project/izara-market-library-service-schemas 1.0.18 → 1.0.20

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 (179) hide show
  1. package/package.json +2 -2
  2. package/src/GenerateCodeLibs/src/Consts.js +32 -2
  3. package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +3 -61
  4. package/src/SourceManager/src/Utils.js +40 -1
  5. package/src/TemplateManager/src/FindData/FindDataYaml/data.js +4 -1
  6. package/src/TemplateManager/src/FindData/FindDataYaml/template.ejs +1 -14
  7. package/src/TemplateManager/src/GenerateCode.js +152 -46
  8. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +23 -3
  9. package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/template.ejs +1 -14
  10. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/data.js +22 -3
  11. package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/template.ejs +1 -14
  12. package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/functionYaml/data.js +23 -3
  13. package/src/TemplateManager/src/OutPerActionComplete/OutGetComplete/functionYaml/template.ejs +1 -14
  14. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/data.js +23 -3
  15. package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/template.ejs +1 -14
  16. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/data.js +6 -6
  17. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrApi/template.ejs +1 -14
  18. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/data.js +2 -1
  19. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrDsq/template.ejs +1 -14
  20. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/data.js +1 -1
  21. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrInv/template.ejs +1 -14
  22. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/data.js +3 -1
  23. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrSqs/template.ejs +1 -14
  24. package/src/TemplateManager/src/PerActionEndpoint/FunctionYaml/HdrWbs/data.js +1 -1
  25. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/template.ejs +65 -26
  26. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/template.ejs +0 -1
  27. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/template.ejs +13 -11
  28. package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/template.ejs +34 -18
  29. package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler/mainFunction → PerActionEndpoint/libs}/data.js +12 -23
  30. package/src/TemplateManager/src/PerActionEndpoint/libs/template.ejs +46 -0
  31. package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/data.js +18 -2
  32. package/src/TemplateManager/src/ProcessLogical/ProcessLogicalYaml/template.ejs +1 -14
  33. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/data.js +20 -3
  34. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrDsq/template.ejs +1 -14
  35. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/data.js +21 -3
  36. package/src/TemplateManager/src/ProcessLogicalPagination/FunctionYaml/HdrSqs/template.ejs +1 -14
  37. package/src/TemplateManager/src/ProcessLogicalPagination/mainFunction/template.ejs +1 -1
  38. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/data.js +16 -2
  39. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrApi/template.ejs +1 -14
  40. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/data.js +17 -2
  41. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrDsq/template.ejs +1 -14
  42. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/data.js +16 -2
  43. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrInv/template.ejs +1 -14
  44. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/data.js +18 -3
  45. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationship/functionYaml/HdrSqs/template.ejs +1 -14
  46. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/functionYaml/data.js +18 -3
  47. package/src/TemplateManager/src/RelationshipPerAction/CreateRelationship/createRelationshipComplete/functionYaml/template.ejs +1 -14
  48. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/data.js +15 -2
  49. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrApi/template.ejs +1 -14
  50. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/data.js +17 -2
  51. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrDsq/template.ejs +1 -14
  52. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/data.js +16 -2
  53. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrInv/template.ejs +1 -14
  54. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/data.js +18 -3
  55. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationship/functionYaml/HdrSqs/template.ejs +1 -14
  56. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/data.js +18 -3
  57. package/src/TemplateManager/src/RelationshipPerAction/DeleteRelationship/DeleteRelationshipComplete/functionYaml/template.ejs +1 -14
  58. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/data.js +19 -4
  59. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRalationshipComplete/functionYaml/template.ejs +1 -14
  60. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/data.js +19 -2
  61. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrApi/template.ejs +1 -14
  62. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/data.js +19 -2
  63. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrDsq/template.ejs +1 -14
  64. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/data.js +20 -2
  65. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrInv/template.ejs +1 -14
  66. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/data.js +20 -2
  67. package/src/TemplateManager/src/RelationshipPerAction/UpdateRelationshipSchema/updateRelationship/functionYaml/HdrSqs/template.ejs +1 -14
  68. package/src/TemplateManager/src/Role/createSharedResource.js +270 -0
  69. package/src/TemplateManager/src/Role/sharedResourceTemplate.ejs +58 -0
  70. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrDsq/data.js +1 -1
  71. package/src/TemplateManager/src/TranslateIdReq/TranslateIds/functionYaml/HdrSqs/data.js +1 -1
  72. package/src/TemplateManager/src/externalService/LambdaRole/data.js +119 -9
  73. package/src/TemplateManager/src/externalService/LambdaRole/template.ejs +3 -4
  74. package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +31 -6
  75. package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/dynamoDb/ReservedTableData.js +65 -0
  76. package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/functionYaml/data.js +3 -2
  77. package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/handler/data.js +1 -1
  78. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/functionYaml/data.js +77 -0
  79. package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/FlowSchemaEndpoint/InProcessFlowSchema}/functionYaml/template.ejs +9 -3
  80. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/handler/data.js +47 -0
  81. package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/FlowSchemaEndpoint/InProcessFlowSchema}/handler/template.ejs +25 -52
  82. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/mainFunction/data.js +46 -0
  83. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/mainFunction/template.ejs +0 -0
  84. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/data.js +36 -0
  85. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/template.ejs +0 -0
  86. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/data.js +35 -0
  87. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/template.ejs +0 -0
  88. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/data.js +35 -0
  89. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/template.ejs +0 -0
  90. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/data.js +35 -0
  91. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/template.ejs +0 -0
  92. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/data.js +35 -0
  93. package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/template.ejs +0 -0
  94. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/functionYaml/data.js +102 -0
  95. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/functionYaml/template.ejs +30 -0
  96. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/handler/data.js +58 -0
  97. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/handler/template.ejs +126 -0
  98. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/mainFunction/data.js +51 -0
  99. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/mainFunction/template.ejs +121 -0
  100. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/queue/data.js +64 -0
  101. package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/queue/template.ejs +45 -0
  102. package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/UploadS3Case/createObject}/functionYaml/data.js +42 -13
  103. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/functionYaml/template.ejs +37 -0
  104. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/data.js +75 -0
  105. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/template.ejs +120 -0
  106. package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler/handler → flowSchema/UploadS3Case/createObject/mainFunction}/data.js +11 -15
  107. package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/UploadS3Case/createObject}/mainFunction/template.ejs +4 -4
  108. package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/functionYaml/data.js +6 -4
  109. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/functionYaml/template.ejs +30 -0
  110. package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/handler/data.js +1 -1
  111. package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/handler/template.ejs +10 -10
  112. package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/mainFunction/data.js +3 -4
  113. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/mainFunction/template.ejs +86 -0
  114. package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/sns-sqs/data.js +4 -2
  115. package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/sns-sqs/template.ejs +49 -0
  116. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/functionYaml/data.js +85 -0
  117. package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc}/functionYaml/template.ejs +1 -1
  118. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/handler/data.js +57 -0
  119. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/handler/template.ejs +120 -0
  120. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/data.js +51 -0
  121. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/template.ejs +164 -0
  122. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/sqs/data.js +65 -0
  123. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/sqs/template.ejs +53 -0
  124. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/functionYaml/data.js +112 -0
  125. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/functionYaml/template.ejs +30 -0
  126. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/handler/data.js +57 -0
  127. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/handler/template.ejs +126 -0
  128. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/data.js +54 -0
  129. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/template.ejs +254 -0
  130. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/queue/data.js +64 -0
  131. package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/queue/template.ejs +45 -0
  132. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/data.js +94 -0
  133. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/templateAsyncHandler.ejs +110 -0
  134. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/templateSyncHandler.ejs +49 -0
  135. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/hookLogic/data.js +44 -0
  136. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/mainFunction/data.js +66 -0
  137. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/mainFunction/template.ejs +7 -0
  138. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/data.js +73 -0
  139. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/snsTemplate.ejs +59 -0
  140. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/sqsTemplate.ejs +43 -0
  141. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/functionYaml/data.js +102 -0
  142. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/functionYaml/template.ejs +43 -0
  143. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/data.js +94 -0
  144. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/templateAsyncHandler.ejs +110 -0
  145. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/handler/templateSyncHandler.ejs +49 -0
  146. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/hookLogic/data.js +65 -0
  147. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/mainFunction/data.js +67 -0
  148. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/mainFunction/template.ejs +30 -0
  149. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/queue/data.js +125 -0
  150. package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode(old)/queue/snsTemplate.ejs +59 -0
  151. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrDsq/data.js +87 -0
  152. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrDsq/template.ejs +30 -0
  153. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrS3/data.js +112 -0
  154. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrS3/template.ejs +38 -0
  155. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerDsq/data.js +45 -0
  156. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerDsq/template.ejs +151 -0
  157. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerS3/data.js +43 -0
  158. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerS3/template.ejs +68 -0
  159. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/data.js +43 -0
  160. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/template.ejs +392 -0
  161. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/data.js +77 -0
  162. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/dsqTemplatePath.ejs +32 -0
  163. package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/s3Template.ejs +59 -0
  164. package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/S3/data.js +51 -0
  165. package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/S3/template.ejs +13 -0
  166. package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/data.js +42 -0
  167. package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/template.ejs +137 -0
  168. package/src/TemplateManager/src/libs/Consts.js +89 -34
  169. package/src/TemplateManager/src/reStructureExample/GenerateCodeTest.js +31 -0
  170. package/src/TemplateManager/src/reStructureExample/TemplateConfig.js +11 -0
  171. package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/data.js +0 -0
  172. package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/generateCodeShared.js +1 -0
  173. package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/generatePerAction.js +5 -0
  174. package/src/TemplateManager/src/reStructureExample/TemplateData/perAction/template.ejs +0 -0
  175. package/src/TemplateManager/src/flowTag/webSocket/webSocketComplete/mainFunction/template.ejs +0 -180
  176. /package/src/TemplateManager/src/{flowTag/resources/dynamoDb/data.js → flowSchema/DefaultWebSocketResource/dynamoDb/WebSocketTaskData.js} +0 -0
  177. /package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/functionYaml/template.ejs +0 -0
  178. /package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/handler/template.ejs +0 -0
  179. /package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete/sns-sqs/template.ejs → flowSchema/UploadS3Case/hookCode(old)/queue/sqsTemplate.ejs} +0 -0
@@ -0,0 +1,65 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const path = require('path');
20
+ const fs = require('fs');
21
+ const { SOURCE_PATH, SAVE_FILE_NAME } = require('../../../libs/Consts');
22
+
23
+
24
+
25
+ const templatePath = path.join(__dirname, "../../../ResourceYaml/dynamodb/template.ejs")
26
+
27
+ function data(_izContext, srcPath) {
28
+ let resultForCreateSources = [];
29
+ const reservedDataTables = [
30
+ {
31
+ tableName: "ReservedDataMain",
32
+ attributes: [
33
+ {
34
+ keyType: "partitionKey",
35
+ AttributeName: "servicePendingId",
36
+ AttributeType: "S"
37
+ },
38
+ {
39
+ keyType: "sortKey",
40
+ AttributeName: "reservedDataId",
41
+ AttributeType: "S"
42
+ }
43
+ ]
44
+ }
45
+ ];
46
+
47
+ for (let reservedDataTable of reservedDataTables) {
48
+ resultForCreateSources.push(
49
+ {
50
+ templatePath: templatePath,
51
+ templateData: reservedDataTable,
52
+ setting: {
53
+ initialData: 'Resources:\n',
54
+ savePath: path.join(srcPath, SOURCE_PATH.resourceYaml),
55
+ saveFileName: SAVE_FILE_NAME.dynamoDbYaml,
56
+ fileExtension: ".yml",
57
+ isAppend: true
58
+ }
59
+ }
60
+ )
61
+ }
62
+ return resultForCreateSources;
63
+ }
64
+
65
+ module.exports = data;
@@ -19,7 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19
19
  const path = require('path');
20
20
  const fs = require('fs');
21
21
 
22
- const { SOURCE_PATH, SAVE_FILE_NAME, ACTIONS, HANDLER, defaultIamRolePerAction, createIamRole, RESOURCE_CLASSES, DYNAMO_RESOURCE, resourceNames } = require("../../../../libs/Consts");
22
+ const { SOURCE_PATH, SAVE_FILE_NAME, defaultIamRolePerAction, createIamRole, RESOURCE_CLASSES, DYNAMO_RESOURCE, resourceNames } = require("../../../../libs/Consts");
23
+ const { firstLetterUpperCase: upperCase } = require('../../../../../../MainLibs/src/Utils');
23
24
 
24
25
  const templatePath = path.join(__dirname, "./template.ejs")
25
26
 
@@ -64,7 +65,7 @@ function createWebSocketConnectYaml(_izContext, srcPath) {
64
65
  },
65
66
  setting: {
66
67
  savePath: path.join(srcPath, SOURCE_PATH.appYaml),
67
- saveFileName: SAVE_FILE_NAME.flowSchema,
68
+ saveFileName: upperCase(SAVE_FILE_NAME.flowSchema),
68
69
  fileExtension: ".yml",
69
70
  isAppend: true
70
71
  }
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19
19
  const path = require('path');
20
20
  const fs = require('fs');
21
21
 
22
- const { SOURCE_PATH, SAVE_FILE_NAME, ACTIONS, HANDLER, defaultIamRolePerAction, createIamRole, RESOURCE_CLASSES, DYNAMO_RESOURCE, resourceNames } = require("../../../../libs/Consts");
22
+ const { SOURCE_PATH } = require("../../../../libs/Consts");
23
23
 
24
24
  const templatePath = path.join(__dirname, "./template.ejs")
25
25
 
@@ -0,0 +1,77 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const path = require('path');
20
+ const fs = require('fs');
21
+
22
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils");
23
+ const { SOURCE_PATH, defaultIamRolePerAction, shortNameHandler, SAVE_FILE_NAME, createIamRole, RESOURCE_CLASSES, SNS_RESOURCE, resourceNames, DYNAMO_RESOURCE } = require('../../../../libs/Consts');
24
+ const templatePath = path.join(__dirname, "./template.ejs")
25
+
26
+
27
+ function data(_izContext, flowSchema, srcPath) {
28
+ return [createSourceParams(_izContext, srcPath)]
29
+ }
30
+
31
+ function createSourceParams(_izContext, flowSchema, srcPath) {
32
+ let functionName = "InProcessWebSocket";
33
+ let handlerType = "HdrWbs"
34
+ let additionalResourcePermission = defaultIamRolePerAction();
35
+ let functionNameConfig = upperCase(functionName) + upperCase(shortNameHandler(handlerType))
36
+
37
+ additionalResourcePermission.push(
38
+ createIamRole(
39
+ {
40
+ [RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
41
+ },
42
+ [
43
+ resourceNames(RESOURCE_CLASSES.sns, `InProcess${flowSchema.flowTag}`)
44
+ ]
45
+ ),
46
+ createIamRole(
47
+ {
48
+ [RESOURCE_CLASSES.dynamoDbTable]: [
49
+ DYNAMO_RESOURCE.putItem,
50
+ DYNAMO_RESOURCE.deleteItem
51
+ ]
52
+ },
53
+ resourceNames(RESOURCE_CLASSES.dynamoDbTable, "WebSocketTask")
54
+ )
55
+ )
56
+
57
+ return {
58
+ templatePath: templatePath,
59
+ templateData: {
60
+ functionName,
61
+ handlerType,
62
+ functionNameConfig,
63
+ additionalResourcePermission,
64
+ resourceLocation: SOURCE_PATH.resourceLocationWebSocket,
65
+ route: flowSchema.flowTag
66
+ },
67
+ setting: {
68
+ savePath: path.join(srcPath, SOURCE_PATH.appYaml),
69
+ saveFileName: upperCase(SAVE_FILE_NAME.flowSchema),
70
+ fileExtension: '.yml',
71
+ isAppend: true
72
+ }
73
+ }
74
+ }
75
+
76
+
77
+ module.exports = data;
@@ -1,11 +1,17 @@
1
1
  <%_ const join = require('path').join; _%>
2
- <%- firstLetterUpperCase(functionName) %><%- handlerType -%>:
2
+ <%- firstLetterUpperCase(functionNameConfig) %>:
3
3
  handler: <%- join(resourceLocation, `${firstLetterUpperCase(functionName)}_${firstLetterUpperCase(handlerType)}.main`)%>
4
- name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %>
4
+ name: ${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>
5
5
  events:
6
+ - websocket:
7
+ route: $connect
8
+ - websocket:
9
+ route: $disconnect
10
+ - websocket:
11
+ route: $default
6
12
  - websocket:
7
13
  route: <%- route %>
8
- # authorizer: ${self:custom.iz_authorizerAppLevel}
14
+ # authorizer: ${self:custom.iz_authorizerAppLevel}
9
15
  # identifierResource: 'route.request.header.Auth'
10
16
  iamRoleStatements:
11
17
  <%_ additionalResourcePermission.forEach(resourcePermission => { _%>
@@ -0,0 +1,47 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const path = require('path');
20
+ const fs = require('fs');
21
+
22
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils");
23
+ const { SOURCE_PATH } = require('../../../../libs/Consts');
24
+ const templatePath = path.join(__dirname, './template.ejs')
25
+
26
+ function data(_izContext, srcPath) {
27
+ return [createSourceParams(_izContext, srcPath)]
28
+ }
29
+
30
+ function createSourceParams(_izContext, srcPath) {
31
+ let functionName = "InProcessWebSocket";
32
+ let handlerType = "HdrWbs";
33
+
34
+ return {
35
+ templatePath: templatePath,
36
+ templateData: {},
37
+ setting: {
38
+ savePath: path.join(srcPath, SOURCE_PATH.webSocket),
39
+ saveFileName: upperCase(functionName) + upperCase(handlerType),
40
+ fileExtension: ".js",
41
+ isAppend: true
42
+ }
43
+ }
44
+ }
45
+
46
+
47
+ module.exports = data;
@@ -25,47 +25,56 @@ const izaraShared = require('@izara_project/izara-shared')
25
25
  const dynamodbSharedLib = izaraShared.dynamodbSharedLib
26
26
  const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
27
27
  const hash = require('object-hash')
28
+ // const coreConsts = require("@izara_project/izara-core-library-core/src/Consts");
29
+ const consts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
30
+ const { postToConnection } = require("../../libs/source/ImportDataLib");
31
+ const createObject = require('./CreateObjectS3_Main');
28
32
 
29
- const { ApiGatewayManagementApiClient, PostToConnectionCommand } = require("@aws-sdk/client-apigatewaymanagementapi");
30
- const flowSchema = require('./FlowSchema_Main');
31
-
32
- const client = new ApiGatewayManagementApiClient({
33
- endpoint: `https://${process.env.iz_webSocketEndpoint}`
34
- })
35
33
  module.exports.main = middleware.wrap(async (event, context, callback) => {
36
34
 
37
35
  event._izContext.logger.debug('Event:', event);
38
36
 
39
37
  try {
40
38
 
41
- let eventParams = JSON.parse(event.body)
42
-
43
39
  if (event.requestContext) {
44
40
  const route = event.requestContext.routeKey;
45
41
  const connectionId = event.requestContext.connectionId;
46
42
 
47
43
  switch (route) {
48
- case null:
49
- console.log('Received unknown route:', route)
44
+ case "$connect":
45
+ console.log("webSocket Connect");
46
+ break
47
+ case "$disconnect":
48
+ console.log("webSocket Disconnect");
49
+ break
50
+ case '$default':
51
+ console.log('Received unknown route:', route);
50
52
  break
51
53
  case 'webSocket':
52
- console.log("event in route", event)
53
- let callingFlow = eventParams?.callingFlow ? eventParams.callingFlow : {}
54
- console.log("eventParams::", eventParams)
55
- await flowSchema.flowSchema(
54
+ console.log("event in route webSocket", event);
55
+
56
+ let eventParams = JSON.parse(event.body)
57
+
58
+ let callingFlow = eventParams?.callingFlow ? eventParams.callingFlow : {};
59
+
60
+ await createObject.createObject(
56
61
  event._izContext,
57
62
  eventParams,
58
63
  //(<additionalParams>)
64
+ event,
59
65
  //(</additionalParams>)
60
66
  callingFlowSharedLib.addCallingFlowToPassOnProperties(callingFlow)
61
67
  )
62
68
 
69
+ let correlationId = event._izContext.correlationIds.get(consts.X_CORRELATION_ID)
70
+ event._izContext.logger.debug("correlationId", correlationId)
71
+
63
72
  // if (returnValueFlowSchema) {
64
73
  await dynamodbSharedLib.putItem(
65
74
  event._izContext,
66
75
  await dynamodbSharedLib.tableName(event._izContext, "WebSocketTask"),
67
76
  {
68
- taskKey: "uploadS3Data" + hash(connectionId),
77
+ taskKey: correlationId,
69
78
  connectionId: connectionId,
70
79
  }
71
80
  )
@@ -91,40 +100,4 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
91
100
  await postToConnection({ message: err.message }, connId);
92
101
  return (izara.response.failure(err));
93
102
  }
94
- });
95
-
96
- async function postMessage(data, connectionId) {
97
- const params = {
98
- ConnectionId: connectionId,
99
- Data: JSON.stringify(data),
100
- }
101
- return api.postToConnection(params).promise();
102
- };
103
-
104
- async function sendErrorMessage(errorMessage, connectionId) {
105
- const params = {
106
- ConnectionId: connectionId,
107
- Data: JSON.stringify(errorMessage)
108
- }
109
- return api.postToConnection(params).promise();
110
- }
111
-
112
- const postToConnection = async (message, connectionId) => {
113
- try {
114
- const messageParams = JSON.stringify(message)
115
- const command = new PostToConnectionCommand({
116
- ConnectionId: connectionId,
117
- Data: Buffer.from(messageParams)
118
- })
119
- // console.log("command::", command)
120
- // console.log("client::", client)
121
- await client.send(command);
122
- console.log(`send Message: ${JSON.stringify(message)} to ${connectionId} 1`)
123
- } catch (err) {
124
- if (err.name === "GoneException") {
125
- console.log(`message send to connectionIds ${connectionId} is no longer connect`)
126
- } else {
127
- console.error(`Error post message: ${err}`)
128
- }
129
- }
130
- }
103
+ });
@@ -0,0 +1,46 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const path = require('path');
20
+ const fs = require('fs');
21
+
22
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils");
23
+ const { SOURCE_PATH } = require('../../../../libs/Consts');
24
+ const templatePath = path.join(__dirname, './template.ejs')
25
+
26
+
27
+ function data(_izContext, srcPath) {
28
+ return [createSourceParams(_izContext, srcPath)]
29
+ }
30
+
31
+ function createSourceParams(_izContext, srcPath) {
32
+ let functionName = "InProcessWebSocket";
33
+ return {
34
+ templatePath: templatePath,
35
+ templateData: {},
36
+ setting: {
37
+ savePath: path.join(srcPath, SOURCE_PATH.webSocket),
38
+ saveFileName: `${functionName}_Main`,
39
+ fileExtension: ".js",
40
+ isAppend: false
41
+ }
42
+ }
43
+ }
44
+
45
+
46
+ module.exports = data;
@@ -0,0 +1,36 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const path = require('path');
20
+ const fs = require('fs');
21
+
22
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils");
23
+ const { SOURCE_PATH } = require('../../../../libs/Consts');
24
+ const templatePath = path.join(__dirname, './template.ejs')
25
+
26
+
27
+ function data(_izContext, srcPath) {
28
+ return [createSourceParams(_izContext, srcPath)]
29
+ }
30
+
31
+ function createSourceParams(_izContext, srcPath) {
32
+
33
+ }
34
+
35
+
36
+ module.exports = data;
@@ -0,0 +1,35 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const path = require('path');
20
+ const fs = require('fs');
21
+
22
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils");
23
+ const { SOURCE_PATH } = require('../../libs/Consts');
24
+
25
+
26
+ function data(_izContext, srcPath) {
27
+ return [createSourceParams(_izContext, srcPath)]
28
+ }
29
+
30
+ function createSourceParams(_izContext, srcPath) {
31
+
32
+ }
33
+
34
+
35
+ module.exports = data;
@@ -0,0 +1,35 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const path = require('path');
20
+ const fs = require('fs');
21
+
22
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils");
23
+ const { SOURCE_PATH } = require('../../libs/Consts');
24
+
25
+
26
+ function data(_izContext, srcPath) {
27
+ return [createSourceParams(_izContext, srcPath)]
28
+ }
29
+
30
+ function createSourceParams(_izContext, srcPath) {
31
+
32
+ }
33
+
34
+
35
+ module.exports = data;
@@ -0,0 +1,35 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const path = require('path');
20
+ const fs = require('fs');
21
+
22
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils");
23
+ const { SOURCE_PATH } = require('../../libs/Consts');
24
+
25
+
26
+ function data(_izContext, srcPath) {
27
+ return [createSourceParams(_izContext, srcPath)]
28
+ }
29
+
30
+ function createSourceParams(_izContext, srcPath) {
31
+
32
+ }
33
+
34
+
35
+ module.exports = data;
@@ -0,0 +1,35 @@
1
+ /*
2
+ Copyright (C) 2020 Sven Mason <http://izara.io>
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU Affero General Public License as
6
+ published by the Free Software Foundation, either version 3 of the
7
+ License, or (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU Affero General Public License for more details.
13
+
14
+ You should have received a copy of the GNU Affero General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ 'use strict';
19
+ const path = require('path');
20
+ const fs = require('fs');
21
+
22
+ const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils");
23
+ const { SOURCE_PATH } = require('../../libs/Consts');
24
+
25
+
26
+ function data(_izContext, srcPath) {
27
+ return [createSourceParams(_izContext, srcPath)]
28
+ }
29
+
30
+ function createSourceParams(_izContext, srcPath) {
31
+
32
+ }
33
+
34
+
35
+ module.exports = data;