@izara_project/izara-market-library-service-schemas 1.0.30 → 1.0.32

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 (103) hide show
  1. package/package.json +9 -9
  2. package/src/GenerateCodeLibs/src/Consts.js +29 -13
  3. package/src/MainLibs/src/Consts.js +16 -6
  4. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +3 -6
  5. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +2 -3
  6. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/template.ejs +2 -2
  7. package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +3 -3
  8. package/src/reStructure/TemplateData/EndpointPerService/yaml/data.js +10 -8
  9. package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +5 -5
  10. package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +22 -0
  11. package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/data.js +4 -4
  12. package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/handler/data.js +4 -4
  13. package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/data.js +2 -2
  14. package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +1 -1
  15. package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js +2 -2
  16. package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/data.js +1 -1
  17. package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +1 -1
  18. package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/data.js +1 -1
  19. package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/data.js +4 -4
  20. package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/handler/data.js +4 -4
  21. package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/data.js +4 -4
  22. package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/template.ejs +1 -1
  23. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/data.js +4 -4
  24. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/handler/data.js +4 -4
  25. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/data.js +1 -1
  26. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +1 -2
  27. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/data.js +4 -4
  28. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/data.js +4 -4
  29. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/data.js +4 -4
  30. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +1 -1
  31. package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/sqs/template.ejs +18 -18
  32. package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/data.js +1 -1
  33. package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/data.js +4 -4
  34. package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/data.js +4 -4
  35. package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +1 -1
  36. package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/data.js +1 -1
  37. package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +3 -3
  38. package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/template.ejs +2 -0
  39. package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/data.js +3 -2
  40. package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/template.ejs +4 -16
  41. package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +73 -0
  42. package/src/reStructure/TemplateData/flowSchema/{legacy/hookCode-old/queue/sqsTemplate.ejs → externalTopic/sns-in-sqs/template.ejs} +21 -11
  43. package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/data.js +75 -0
  44. package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/template.ejs +10 -0
  45. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/functionYaml/data.js +83 -0
  46. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/functionYaml/template.ejs +17 -0
  47. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/handler/data.js +65 -0
  48. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/handler/template copy.ejs +125 -0
  49. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/handler/template.ejs +130 -0
  50. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/mainFunction/data.js +61 -0
  51. package/src/reStructure/TemplateData/flowSchema/externalTopic/sqs/mainFunction/template.ejs +70 -0
  52. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/data.js +147 -0
  53. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/functionYaml/template.ejs +18 -0
  54. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/handler/data.js +64 -0
  55. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/handler/template.ejs +86 -0
  56. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/data.js +60 -0
  57. package/src/reStructure/TemplateData/flowSchema/externalTopic/websocket/mainFunction/template.ejs +74 -0
  58. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +107 -0
  59. package/src/reStructure/TemplateData/flowSchema/{components/schema/inProcess → flowSchemaOwnTopic/EndpointComponent}/functionYaml/template.ejs +1 -14
  60. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +57 -0
  61. package/src/reStructure/TemplateData/flowSchema/{legacy/hookCode-old/handler/templateAsyncHandler.ejs → flowSchemaOwnTopic/EndpointComponent/handler/template.ejs} +11 -37
  62. package/src/reStructure/TemplateData/flowSchema/{components/schema/inProcess → flowSchemaOwnTopic/EndpointComponent}/mainFunction/data.js +20 -13
  63. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/template.ejs +73 -0
  64. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/functionYaml/data.js +117 -0
  65. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/functionYaml/template.ejs +24 -0
  66. package/src/reStructure/TemplateData/flowSchema/{legacy/hookCode-old/mainFunction → flowSchemaOwnTopic/FlowSchemaCompleteComponent/handler}/data.js +15 -24
  67. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/handler/template.ejs +84 -0
  68. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/mainFunction/data.js +52 -0
  69. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaCompleteComponent/mainFunction/template.ejs +88 -0
  70. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +117 -0
  71. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/template.ejs +24 -0
  72. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/data.js +57 -0
  73. package/src/reStructure/TemplateData/flowSchema/{components/schema/inProcess → flowSchemaOwnTopic/FlowSchemaComponent}/handler/template.ejs +16 -33
  74. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data.js +66 -0
  75. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +104 -0
  76. package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +96 -0
  77. package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +167 -99
  78. package/src/reStructure/TemplateData/generateRole/createSharedResource.js +20 -0
  79. package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +3 -3
  80. package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +3 -3
  81. package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +13 -14
  82. package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +3 -3
  83. package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/functionYaml/data.js +0 -76
  84. package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/handler/data.js +0 -46
  85. package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/sns-sqs/data.js +0 -35
  86. package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/sns-sqs/template.ejs +0 -0
  87. package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/functionYaml/data.js +0 -34
  88. package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/functionYaml/template.ejs +0 -0
  89. package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/handler/data.js +0 -34
  90. package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/handler/template.ejs +0 -0
  91. package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/mainFunction/data.js +0 -34
  92. package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/mainFunction/template.ejs +0 -0
  93. package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/sns-sqs/data.js +0 -34
  94. package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/sns-sqs/template.ejs +0 -0
  95. package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/functionYaml/data.js +0 -101
  96. package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/functionYaml/template.ejs +0 -43
  97. package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/handler/data.js +0 -93
  98. package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/handler/templateSyncHandler.ejs +0 -49
  99. package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/hookLogic/data.js +0 -64
  100. package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/mainFunction/template.ejs +0 -30
  101. package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/queue/data.js +0 -124
  102. package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/queue/snsTemplate.ejs +0 -59
  103. /package/src/reStructure/TemplateData/flowSchema/{components/schema/inProcess/mainFunction → flowSchemaOwnTopic/sns-in}/template.ejs +0 -0
@@ -32,7 +32,8 @@ const createWebSocketDynamoDb = require('./components/websocket/dynamoDb/WebSock
32
32
  const createReservedDataMainTable = require('./components/websocket/dynamoDb/ReservedTableData');
33
33
  const createBucketS3 = require('./components/upload/relate/S3/data');
34
34
  const createWebSocketGenerateCodeLibs = require('./components/upload/relate/libs/data');
35
-
35
+ const createWebSocketConnectYaml = require('./components/websocket/connect/functionYaml/data')
36
+ const createWebSocketConnectHandler = require('./components/websocket/connect/handler/data')
36
37
  // CreateObject components
37
38
  const createFunctionYamlCreateObjectWebSocket = require('./components/upload/createObject/functionYaml/data');
38
39
  const createHandlerCreateObjectWebSocket = require('./components/upload/createObject/handler/data');
@@ -46,7 +47,7 @@ const createWebSocketCreateObjectCompleteMainFunction = require('./components/up
46
47
 
47
48
  // PreSign URL components
48
49
  const createReservedLimitFunctionYaml = require('./components/upload/preSignUrl/reservedLimit/functionYaml/data');
49
- const createReservedLimitlHandler = require('./components/upload/preSignUrl/reservedLimit/handler/data');
50
+ const createReservedLimitHandler = require('./components/upload/preSignUrl/reservedLimit/handler/data');
50
51
  const createReservedLimitMainFunction = require('./components/upload/preSignUrl/reservedLimit/mainFunction/data');
51
52
  const createReservedLimitQueueName = require('./components/upload/preSignUrl/reservedLimit/sqs/data');
52
53
 
@@ -55,6 +56,7 @@ const createPresignUrlFunctionYaml = require('./components/upload/preSignUrl/cre
55
56
  const createPresignUrlHandler = require('./components/upload/preSignUrl/createPresignUrl/handler/data');
56
57
  const createPresignUrlMainFunction = require('./components/upload/preSignUrl/createPresignUrl/mainFunction/data');
57
58
  const createPresignUrlQueueName = require('./components/upload/preSignUrl/createPresignUrl/queue/data');
59
+ // const createReservedLimitQueueName = require('./components/upload/preSignUrl/reservedLimit/sqs/data');
58
60
 
59
61
  // Process uploaded file components
60
62
  const createProcessAfterUploadS3FunctionYmlS3 = require('./components/upload/processFile/functionYml/HdrS3/data');
@@ -68,6 +70,29 @@ const createConfirmAfterUploadS3Handler = require('./components/upload/confirmRe
68
70
  const createConfirmAfterUploadS3MainFunction = require('./components/upload/confirmReserved/mainFunction/data');
69
71
  const createConfirmAfterUploadS3Queue = require('./components/upload/confirmReserved/queue/data');
70
72
 
73
+ // ** External Topic ** //
74
+ const createExternalWebsocketFunctionYaml = require('./externalTopic/websocket/functionYaml/data');
75
+ const createExternalWebsocketHandler = require('./externalTopic/websocket/handler/data');
76
+ const createExternalWebsocketMainFunction = require('./externalTopic/websocket/mainFunction/data');
77
+ const createExternalSqsFunctionYaml = require('./externalTopic/sqs/functionYaml/data');
78
+ const createExternalSqsHandler = require('./externalTopic/sqs/handler/data');
79
+ const createExternalSqsMainFunction = require('./externalTopic/sqs/mainFunction/data');
80
+ const createExternalTopicSnsInSqs = require('./externalTopic/sns-in-sqs/data');
81
+ const createExternalTopicSnsOut = require('./externalTopic/sns-out/data');
82
+
83
+ // flowSchema OwnTopic component
84
+ const createFlowSchemaOwnTopicFunctionYaml = require('./flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data')
85
+ const createFlowSchemaOwnTopicHandler = require('./flowSchemaOwnTopic/FlowSchemaComponent/handler/data')
86
+ const createFlowSchemaOwnTopicMainFunction = require('./flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data')
87
+
88
+ // flowSchema OwnTopicComplete component
89
+ const createFlowSchemaOwnTopicCompleteFunctionYaml = require("./flowSchemaOwnTopic/FlowSchemaCompleteComponent/functionYaml/data")
90
+ const createFlowSchemaOwnTopicCompleteHandler = require("./flowSchemaOwnTopic/FlowSchemaCompleteComponent/handler/data")
91
+ const createFlowSchemaOwnTopicCompleteMainFunction = require("./flowSchemaOwnTopic/FlowSchemaCompleteComponent/mainFunction/data")
92
+
93
+ const createFlowSchemaOwnTopicEndpointFuntionYaml = require('./flowSchemaOwnTopic/EndpointComponent/functionYaml/data')
94
+ const createFlowSchemaOwnTopicEndpointHandler = require('./flowSchemaOwnTopic/EndpointComponent/handler/data')
95
+ const createFlowSchemaOwnTopicEndpointMainFunction = require('./flowSchemaOwnTopic/EndpointComponent/mainFunction/data')
71
96
  /**
72
97
  * Generates code with templates for different actions
73
98
  * @param {Object} _izContext - Context object
@@ -82,130 +107,173 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
82
107
 
83
108
  // default webSocket setting
84
109
  const webSocketTaskTable = createWebSocketDynamoDb(_izContext, saveFilePath);
85
- // const webSocketConnectYaml = createWebSocketConnectYaml(_izContext, saveFilePath);
86
- // const webSocketConnectHandler = createWebSocketConnectHandler(_izContext, saveFilePath);
110
+ const webSocketConnectYaml = createWebSocketConnectYaml(_izContext, saveFilePath);
111
+ const webSocketConnectHandler = createWebSocketConnectHandler(_izContext, saveFilePath);
87
112
 
88
- const webSocketResource = [...webSocketTaskTable
89
- // ...webSocketConnectYaml, ...webSocketConnectHandler,
90
- ]
113
+ const webSocketResource = [...webSocketTaskTable, ...webSocketConnectYaml, ...webSocketConnectHandler]
91
114
  if (allLocalFlowSchemas.records.length) {
115
+ const webSocketGenerateCodeLibs = createWebSocketGenerateCodeLibs(_izContext, saveFilePath)
92
116
  createSourceParams.push(
93
- ...webSocketResource
117
+ ...webSocketResource,
118
+ ...webSocketGenerateCodeLibs
119
+
94
120
  )
95
121
  }
96
122
 
97
123
  for (const flowSchema of allLocalFlowSchemas.records) {
98
- // console.log("flowSchema::", flowSchema)
99
- const reservedDataTable = createReservedDataMainTable(_izContext, saveFilePath);
100
- const bucketS3 = createBucketS3(_izContext, flowSchema, saveFilePath)
124
+ console.log("flowSchema in Generate TemplateData", flowSchema);
125
+ for (const event of flowSchema.event) {
126
+ if (event.includes("s3")) {
127
+ const reservedDataTable = createReservedDataMainTable(_izContext, saveFilePath);
128
+ const bucketS3 = createBucketS3(_izContext, flowSchema, saveFilePath)
129
+
130
+ const functionYamlCreateObjectWebSocket = createFunctionYamlCreateObjectWebSocket(_izContext, flowSchema, saveFilePath);
131
+ const handlerCreateObjectWebSocket = createHandlerCreateObjectWebSocket(_izContext, flowSchema, saveFilePath);
132
+ const mainFunctionCreateObjectWebSocket = await createMainFunctionCreateObjectWebSocket(_izContext, flowSchema, saveFilePath);
133
+ const webSocketCreateObjectCompleteFunctionYaml = createWebSocketCreateObjectCompleteFunctionYaml(_izContext, flowSchema, saveFilePath);
134
+ const webSocketCreateObjectCompleteQueue = createWebSocketCreateObjectCompleteQueue(_izContext, saveFilePath);
135
+ const webSocketCreateObjectCompleteMainFunction = createWebSocketCreateObjectCompleteMainFunction(_izContext, flowSchema, saveFilePath)
136
+ const webSocketCreateObjectCompleteHandler = createWebSocketCreateObjectCompleteHandler(_izContext, flowSchema, saveFilePath);
137
+
138
+ // const webSocketCreateObjectStordCache = createWebSocketCreateObjectStoredCache(_izContext, saveFilePath);
139
+
140
+ const getPreSignUrlFunctionYaml = createReservedLimitFunctionYaml(_izContext, flowSchema, saveFilePath);
141
+ const getPreSignUrlHandler = createReservedLimitHandler(_izContext, flowSchema, saveFilePath);
142
+ const getPreSignUrlMainFunction = createReservedLimitMainFunction(_izContext, flowSchema, saveFilePath);
143
+ const getPreSignUrlQueue = createReservedLimitQueueName(_izContext, saveFilePath);
144
+
145
+ const reservedLimitCompleteFunctionYaml = createPresignUrlFunctionYaml(_izContext, flowSchema, saveFilePath);
146
+ const reservedLimitCompleteMainFunction = createPresignUrlMainFunction(_izContext, flowSchema, saveFilePath);
147
+ const reservedLimitCompleteHandler = createPresignUrlHandler(_izContext, flowSchema, saveFilePath);
148
+ const reservedLimitCompleteQueue = createPresignUrlQueueName(_izContext, saveFilePath);
149
+
150
+ const processAfterUploadFunctionYmlS3 = createProcessAfterUploadS3FunctionYmlS3(_izContext, flowSchema, saveFilePath);
151
+ // const processAfterUploadFunctionYamlHdrDsq = createProcessAfterUploadS3FunctionYmlDsq(_izContext, saveFilePath);
152
+ const processAfterUploadSqs = createProcessAfterUploadS3Queue(_izContext, saveFilePath);
153
+ const processAfterUploadHandlerS3 = createProcessAfterUploadS3HandlerS3(_izContext, flowSchema, saveFilePath);
154
+ // const processAfterUploadHandlerDsq = createProcessAfterUploadS3HandlerDsq(_izContext, saveFilePath);
155
+ const processAfterUploadMainFunction = createProcessAfterUploadS3MainFunction(_izContext, flowSchema, saveFilePath);
156
+
157
+ const confirmReservedAfterUploadFunctionYaml = createConfirmAfterUploadS3FunctionYaml(_izContext, flowSchema, saveFilePath);
158
+ const confirmReservedAfterUploadHandler = createConfirmAfterUploadS3Handler(_izContext, flowSchema, saveFilePath);
159
+ const confirmReservedAfterUploadMainFunction = createConfirmAfterUploadS3MainFunction(_izContext, flowSchema, saveFilePath);
160
+ const confirmReservedAfterUploadQueue = createConfirmAfterUploadS3Queue(_izContext, saveFilePath);
161
+
162
+ const webSocketFunctions = [
163
+ ...functionYamlCreateObjectWebSocket,
164
+ ...handlerCreateObjectWebSocket,
165
+ ...mainFunctionCreateObjectWebSocket,
166
+ ...webSocketCreateObjectCompleteFunctionYaml,
167
+ ...webSocketCreateObjectCompleteQueue,
168
+ ...webSocketCreateObjectCompleteMainFunction,
169
+ ...webSocketCreateObjectCompleteHandler
170
+ ];
101
171
 
172
+ const getPreSignUrlResources = [
173
+ ...getPreSignUrlFunctionYaml,
174
+ ...getPreSignUrlHandler,
175
+ ...getPreSignUrlMainFunction,
176
+ ...getPreSignUrlQueue
177
+ ];
102
178
 
103
- const functionYamlCreateObjectWebSocket = createFunctionYamlCreateObjectWebSocket(_izContext, flowSchema, saveFilePath);
104
- const handlerCreateObjectWebSocket = createHandlerCreateObjectWebSocket(_izContext, flowSchema, saveFilePath);
105
- const mainFunctionCreateObjectWebSocket = await createMainFunctionCreateObjectWebSocket(_izContext, flowSchema, saveFilePath);
106
- const webSocketCreateObjectCompleteFunctionYaml = createWebSocketCreateObjectCompleteFunctionYaml(_izContext, saveFilePath);
107
- const webSocketCreateObjectCompleteQueue = createWebSocketCreateObjectCompleteQueue(_izContext, saveFilePath);
108
- const webSocketCreateObjectCompleteMainFunction = createWebSocketCreateObjectCompleteMainFunction(_izContext, saveFilePath)
109
- const webSocketCreateObjectCompleteHandler = createWebSocketCreateObjectCompleteHandler(_izContext, saveFilePath);
179
+ const reservedLimitResources = [
180
+ ...reservedLimitCompleteFunctionYaml,
181
+ ...reservedLimitCompleteHandler,
182
+ ...reservedLimitCompleteMainFunction,
183
+ ...reservedLimitCompleteQueue
184
+ ];
110
185
 
111
- // const webSocketCreateObjectStordCache = createWebSocketCreateObjectStoredCache(_izContext, saveFilePath);
112
- const webSocketGenerateCodeLibs = createWebSocketGenerateCodeLibs(_izContext, saveFilePath)
186
+ const processAfterUploadResources = [
187
+ ...processAfterUploadFunctionYmlS3,
188
+ ...processAfterUploadSqs,
189
+ ...processAfterUploadHandlerS3,
190
+ ...processAfterUploadMainFunction
191
+ // Commented resources kept for reference
192
+ // ...processAfterUploadHandlerDsq,
193
+ // ...processAfterUploadFunctionYamlHdrDsq
194
+ ];
113
195
 
114
- const getPreSignUrlFunctionYaml = createReservedLimitFunctionYaml(_izContext, saveFilePath);
115
- const getPreSignUrlHandler = createReservedLimitlHandler(_izContext, saveFilePath);
116
- const getPreSignUrlMainFunction = createReservedLimitMainFunction(_izContext, saveFilePath);
117
- const getPreSignUrlQueue = createReservedLimitQueueName(_izContext, saveFilePath);
118
-
119
- const reservedLimitCompleteFunctionYaml = createPresignUrlFunctionYaml(_izContext, saveFilePath);
120
- const reservedLimitCompleteMainFunction = createPresignUrlMainFunction(_izContext, flowSchema, saveFilePath);
121
- const reservedLimitCompleteHandler = createPresignUrlHandler(_izContext, saveFilePath);
122
- const reservedLimitCompleteQueue = createPresignUrlQueueName(_izContext, saveFilePath);
123
-
124
- const processAfterUploadFunctionYmlS3 = createProcessAfterUploadS3FunctionYmlS3(_izContext, flowSchema, saveFilePath);
125
- // const processAfterUploadFunctionYamlHdrDsq = createProcessAfterUploadS3FunctionYmlDsq(_izContext, saveFilePath);
126
- const processAfterUploadSqs = createProcessAfterUploadS3Queue(_izContext, saveFilePath);
127
- const processAfterUploadHandlerS3 = createProcessAfterUploadS3HandlerS3(_izContext, saveFilePath);
128
- // const processAfterUploadHandlerDsq = createProcessAfterUploadS3HandlerDsq(_izContext, saveFilePath);
129
- const processAfterUploadMainFunction = createProcessAfterUploadS3MainFunction(_izContext, saveFilePath);
130
-
131
- const confirmReservedAfterUploadFunctionYaml = createConfirmAfterUploadS3FunctionYaml(_izContext, saveFilePath);
132
- const confirmReservedAfterUploadHandler = createConfirmAfterUploadS3Handler(_izContext, saveFilePath);
133
- const confirmReservedAfterUploadMainFunction = createConfirmAfterUploadS3MainFunction(_izContext, saveFilePath);
134
- const confirmReservedAfterUploadQueue = createConfirmAfterUploadS3Queue(_izContext, saveFilePath);
135
-
136
- // Group related resources for better organization
137
- const webSocketFunctions = [
138
- ...functionYamlCreateObjectWebSocket,
139
- ...handlerCreateObjectWebSocket,
140
- ...mainFunctionCreateObjectWebSocket,
141
- ...webSocketCreateObjectCompleteFunctionYaml,
142
- ...webSocketCreateObjectCompleteQueue,
143
- ...webSocketCreateObjectCompleteMainFunction,
144
- ...webSocketCreateObjectCompleteHandler
145
- ];
146
-
147
- const getPreSignUrlResources = [
148
- ...getPreSignUrlFunctionYaml,
149
- ...getPreSignUrlHandler,
150
- ...getPreSignUrlMainFunction,
151
- ...getPreSignUrlQueue
152
- ];
153
-
154
- const reservedLimitResources = [
155
- ...reservedLimitCompleteFunctionYaml,
156
- ...reservedLimitCompleteHandler,
157
- ...reservedLimitCompleteMainFunction,
158
- ...reservedLimitCompleteQueue
159
- ];
160
-
161
- const processAfterUploadResources = [
162
- ...processAfterUploadFunctionYmlS3,
163
- ...processAfterUploadSqs,
164
- ...processAfterUploadHandlerS3,
165
- ...processAfterUploadMainFunction
166
- // Commented resources kept for reference
167
- // ...processAfterUploadHandlerDsq,
168
- // ...processAfterUploadFunctionYamlHdrDsq
169
- ];
170
-
171
- const confirmAfterUploadResources = [
172
- ...confirmReservedAfterUploadFunctionYaml,
173
- ...confirmReservedAfterUploadHandler,
174
- ...confirmReservedAfterUploadMainFunction,
175
- ...confirmReservedAfterUploadQueue
176
- ];
196
+ const confirmAfterUploadResources = [
197
+ ...confirmReservedAfterUploadFunctionYaml,
198
+ ...confirmReservedAfterUploadHandler,
199
+ ...confirmReservedAfterUploadMainFunction,
200
+ ...confirmReservedAfterUploadQueue
201
+ ];
177
202
 
178
- for (const event of flowSchema.event) {
179
- if (event.includes("s3")) {
180
- // Group all resources related to S3 upload functionality
181
203
  const webSocketUploadS3Resources = [
182
204
  ...webSocketFunctions,
183
- ...webSocketGenerateCodeLibs,
184
- ...reservedDataTable
205
+ ...reservedDataTable,
206
+ ...bucketS3,
185
207
  ];
208
+ console.log("event s3 generated")
186
209
 
187
-
188
- // Add all resources to the parameters array
189
210
  createSourceParams.push(
190
211
  ...webSocketUploadS3Resources,
191
212
  ...getPreSignUrlResources,
192
213
  ...reservedLimitResources,
193
- ...bucketS3,
194
214
  ...processAfterUploadResources,
195
- ...confirmAfterUploadResources
215
+ ...confirmAfterUploadResources,
196
216
  );
197
- }
198
217
 
199
- // if (flowSchema.hasOwnProperty("initializeRequest") && flowSchema.hasOwnProperty("response")) {
200
- // const webSocketEndpointResource = []
201
- // createSourceParams.push(...webSocketEndpointResource)
202
- // }
218
+ } else if (event.includes("extTopic")) {
219
+ // ** External Topic ** //
220
+ const externalTopicSnsInSqs = createExternalTopicSnsInSqs(_izContext, flowSchema, saveFilePath);
221
+ const externalTopicSnsOut = createExternalTopicSnsOut(_izContext, flowSchema, saveFilePath);
222
+ const externalWebsocketFunctionYaml = createExternalWebsocketFunctionYaml(_izContext, flowSchema, saveFilePath);
223
+ const externalWebsocketHandler = createExternalWebsocketHandler(_izContext, flowSchema, saveFilePath);
224
+ const externalWebsocketMainFunction = createExternalWebsocketMainFunction(_izContext, flowSchema, saveFilePath);
225
+ const externalSqsFunctionYaml = createExternalSqsFunctionYaml(_izContext, flowSchema, saveFilePath);
226
+ const externalSqsHandler = createExternalSqsHandler(_izContext, flowSchema, saveFilePath);
227
+ const externalSqsMainFunction = createExternalSqsMainFunction(_izContext, flowSchema, saveFilePath);
228
+
229
+ // Group related resources for better organization
230
+ const externalTopic = [
231
+ ...externalWebsocketFunctionYaml,
232
+ ...externalWebsocketHandler,
233
+ ...externalWebsocketMainFunction,
234
+ ...externalSqsFunctionYaml,
235
+ ...externalSqsHandler,
236
+ ...externalSqsMainFunction,
237
+ ...externalTopicSnsInSqs,
238
+ ...externalTopicSnsOut
239
+ ];
240
+
241
+ console.log("event externalTopic generated")
242
+ createSourceParams.push(...externalTopic)
243
+
244
+ } else if (event.includes("ownTopic")) {
245
+
246
+ // flowSchema OwnTopic components
247
+ const flowSchemaOwnTopicFunctionYaml = createFlowSchemaOwnTopicFunctionYaml(_izContext, flowSchema, saveFilePath);
248
+ const flowSchemaOwnTopicHandler = createFlowSchemaOwnTopicHandler(_izContext, flowSchema, saveFilePath);
249
+ const flowSchemaOwnTopicMainFunction = createFlowSchemaOwnTopicMainFunction(_izContext, flowSchema, saveFilePath);
250
+ const flowSchemaOwnTopicComponent = [...flowSchemaOwnTopicFunctionYaml, ...flowSchemaOwnTopicHandler, ...flowSchemaOwnTopicMainFunction]
251
+ // flowSchema OwnTopic Complete component
252
+ const flowSchemaOwnTopicCompleteFunctionYaml = createFlowSchemaOwnTopicCompleteFunctionYaml(_izContext, flowSchema, saveFilePath);
253
+ const flowSchemaOwnTopicCompleteHandler = createFlowSchemaOwnTopicCompleteHandler(_izContext, flowSchema, saveFilePath);
254
+ const flowSchemaOwnTopicCompleteMainFunction = createFlowSchemaOwnTopicCompleteMainFunction(_izContext, flowSchema, saveFilePath);
255
+ const flowSchemaOwnTopicCompleteComponent = [...flowSchemaOwnTopicCompleteFunctionYaml, ...flowSchemaOwnTopicCompleteHandler, ...flowSchemaOwnTopicCompleteMainFunction]
256
+ // flowSchemaOwnTopic Endpoint
257
+ const flowSchemaOwnTopicEndpointFuntionYaml = createFlowSchemaOwnTopicEndpointFuntionYaml(_izContext, flowSchema, saveFilePath);
258
+ const flowSchemaOwnTopicEndpointHandler = createFlowSchemaOwnTopicEndpointHandler(_izContext, flowSchema, saveFilePath);
259
+ const flowSchemaOwnTopicEndpointMainFunction = createFlowSchemaOwnTopicEndpointMainFunction(_izContext, flowSchema, saveFilePath);
260
+ const flowSchemaOwnTopicEndpointComponent = [...flowSchemaOwnTopicEndpointFuntionYaml, ...flowSchemaOwnTopicEndpointHandler, ...flowSchemaOwnTopicEndpointMainFunction]
261
+
262
+ // Group the resources
263
+ const ownTopicResources = [
264
+ ...flowSchemaOwnTopicComponent, ...flowSchemaOwnTopicCompleteComponent, ...flowSchemaOwnTopicEndpointComponent
265
+ ];
266
+
267
+ console.log("event ownTopic generated")
268
+ createSourceParams.push(...ownTopicResources);
269
+
270
+
271
+ }
203
272
  }
204
273
  }
205
-
206
274
  return createSourceParams;
207
275
  } catch (error) {
208
- _izContext.logger.error('Error generating code with template perActionComplete:', error);
276
+ _izContext.logger.error('Error generating code with template flowSchema:', error);
209
277
  return [];
210
278
  }
211
279
  }
@@ -110,6 +110,14 @@ const createSharedResource = (_izContext, createSourceParams, srcPath) => {
110
110
  handlerType: [],
111
111
  resources: {}
112
112
  },
113
+ [SOURCE_GENERATE_IAM_ROLE.FlowSchemaOwnTopic]: {
114
+ handlerType: [],
115
+ resources: {}
116
+ },
117
+ [SOURCE_GENERATE_IAM_ROLE.ExternalTopicRole]: {
118
+ handlerType: [],
119
+ resources: {}
120
+ },
113
121
  Other: []
114
122
  };
115
123
  const objectTypeList = [];
@@ -197,6 +205,18 @@ const createSharedResource = (_izContext, createSourceParams, srcPath) => {
197
205
  templateData.additionalResourcePermission,
198
206
  groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.perActionEndpoint].resources
199
207
  )
208
+ } else if (templateData.roleName.includes(SOURCE_GENERATE_IAM_ROLE.FlowSchemaOwnTopic)) {
209
+ groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.FlowSchemaOwnTopic].handlerType.push(templateData);
210
+ processResourcePermissions(
211
+ templateData.additionalResourcePermission,
212
+ groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.FlowSchemaOwnTopic].resources
213
+ )
214
+ } else if (templateData.roleName.includes(SOURCE_GENERATE_IAM_ROLE.ExternalTopicRole)) {
215
+ groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.ExternalTopicRole].handlerType.push(templateData);
216
+ processResourcePermissions(
217
+ templateData.additionalResourcePermission,
218
+ groupedByObjectType[SOURCE_GENERATE_IAM_ROLE.ExternalTopicRole].resources
219
+ )
200
220
  }
201
221
  else {
202
222
  // Handle other items
@@ -270,7 +270,7 @@ module.exports.createRelationship = async (
270
270
  let messageParams = {
271
271
  Message: JSON.stringify(createRelCompleteMsg),
272
272
  MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
273
- TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete),
273
+ TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete),
274
274
  };
275
275
 
276
276
  _izContext.logger.debug("messageParams OutCreateRelationshipComplete ::::::: ", messageParams);
@@ -376,7 +376,7 @@ module.exports.createRelationship = async (
376
376
 
377
377
  let messageToInCreateRelationship = {
378
378
  Message: JSON.stringify(createRelMessageBody),
379
- TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GRAPH_HANDLER.inCreateRel, storageResource.graphServiceTag),
379
+ TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GRAPH_HANDLER.inCreateRel, storageResource.graphServiceTag),
380
380
  };
381
381
  _izContext.logger.debug("RequestParams before send to sqs messageToInUpdateRelationship ::::::: ", messageToInCreateRelationship);
382
382
  await sns.publishAsync(_izContext, messageToInCreateRelationship);
@@ -403,7 +403,7 @@ module.exports.createRelationship = async (
403
403
  let sendMessageToOutCreateRelComplete = {
404
404
  Message: JSON.stringify(messageObject),
405
405
  MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
406
- TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete)
406
+ TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete)
407
407
  }
408
408
  _izContext.logger.debug("send Message to outCreateRelationshipComplete :::", sendMessageToOutCreateRelComplete);
409
409
  await sns.publishAsync(_izContext, sendMessageToOutCreateRelComplete);
@@ -236,7 +236,7 @@ module.exports.deleteRelationship = async (
236
236
  let messageParams = {
237
237
  Message: JSON.stringify(deleteRelCompleteMsg),
238
238
  MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
239
- TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outDeleteRelComplete),
239
+ TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outDeleteRelComplete),
240
240
  };
241
241
 
242
242
  _izContext.logger.debug("messageParams OutCreateRelationshipComplete ::::::: ", messageParams);
@@ -336,7 +336,7 @@ module.exports.deleteRelationship = async (
336
336
 
337
337
  let messageToInUpdateRelationship = {
338
338
  Message: JSON.stringify(deleteRelMessageBody),
339
- TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GRAPH_HANDLER.inDeleteRel, storageResource.graphServiceTag),
339
+ TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GRAPH_HANDLER.inDeleteRel, storageResource.graphServiceTag),
340
340
  };
341
341
  _izContext.logger.debug("RequestParams before send to sqs messageToInUpdateRelationship ::::::: ", messageToInUpdateRelationship);
342
342
  await sns.publishAsync(_izContext, messageToInUpdateRelationship);
@@ -363,7 +363,7 @@ module.exports.deleteRelationship = async (
363
363
  let sendMessageToOutDeleteRelComplete = {
364
364
  Message: JSON.stringify(messageObject),
365
365
  MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
366
- TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outDeleteRelComplete)
366
+ TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outDeleteRelComplete)
367
367
  }
368
368
  _izContext.logger.debug("send Message to outCreateRelationshipComplete :::", sendMessageToOutDeleteRelComplete);
369
369
  await sns.publishAsync(_izContext, sendMessageToOutDeleteRelComplete);
@@ -86,14 +86,14 @@ module.exports.getRelationship = async (
86
86
  relType,
87
87
  relId,
88
88
  relationshipDirection,
89
- //(<requestparamCreateRel>)
90
- //(</requestparamCreateRel>)
89
+ //(<requestparamGetRel>)
90
+ //(</requestparamGetRel>)
91
91
  } = requestParams;
92
92
 
93
93
  let errorsFound = [];
94
94
 
95
- //(<beforeValidateCreateRel>)
96
- //(</beforeValidateCreateRel>).
95
+ //(<beforeValidateGetRel>)
96
+ //(</beforeValidateGetRel>).
97
97
  // validate object and identifiers
98
98
  async function validateIdentifiersExists(_izContext, objType, identifiersObject) {
99
99
 
@@ -125,11 +125,11 @@ module.exports.getRelationship = async (
125
125
  await validateIdentifiersExists(_izContext, secondObject.objType, secondObject.identifiers);
126
126
  // finished validate object and identifiers
127
127
 
128
- //(<afterValidateCreateRel>)
129
- //(</afterValidateCreateRel>)
128
+ //(<afterValidateGetRel>)
129
+ //(</afterValidateGetRel>)
130
130
 
131
- //(<beforeGetRelCreateRel>)
132
- //(</beforeGetRelCreateRel>)
131
+ //(<beforeGetRel>)
132
+ //(</beforeGetRel>)
133
133
 
134
134
  const relationshipSchema = await getRelationshipSchemaWithCache(_izContext, relType);
135
135
  _izContext.logger.debug("relationshipSchema: ", relationshipSchema);
@@ -205,8 +205,8 @@ module.exports.getRelationship = async (
205
205
  secondObject: secondObject,
206
206
  relType: relType,
207
207
  relationshipDirection,
208
- //(<inCreateRelCompleteMsgCrateRel>)
209
- //(</inCreateRelCompleteMsgCrateRel>)
208
+ //(<inGetRelCompleteMsgCrateRel>)
209
+ //(</inGetRelCompleteMsgCrateRel>)
210
210
  status: 'error',
211
211
  errorFounds: errorsFound
212
212
  };
@@ -221,7 +221,7 @@ module.exports.getRelationship = async (
221
221
  let messageParams = {
222
222
  Message: JSON.stringify(getRelCompleteMsg),
223
223
  MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
224
- TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete),
224
+ TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outGetRelComplete),
225
225
  };
226
226
 
227
227
  _izContext.logger.debug("messageParams OutCreateRelationshipComplete ::::::: ", messageParams);
@@ -276,8 +276,7 @@ module.exports.getRelationship = async (
276
276
  )
277
277
  result = getResultFromDynamo;
278
278
  }
279
- }
280
- )
279
+ })
281
280
  )
282
281
 
283
282
  let messageObject = {
@@ -297,7 +296,7 @@ module.exports.getRelationship = async (
297
296
  let sendMessageToOutGetRelComplete = {
298
297
  Message: JSON.stringify(messageObject),
299
298
  MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
300
- TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outGetRelComplete)
299
+ TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outGetRelComplete)
301
300
  }
302
301
  _izContext.logger.debug("send Message to outCreateRelationshipComplete :::", sendMessageToOutGetRelComplete);
303
302
  await sns.publishAsync(_izContext, sendMessageToOutGetRelComplete);
@@ -235,7 +235,7 @@ module.exports.updateRelationship = async (
235
235
  let messageParams = {
236
236
  Message: JSON.stringify(updateCompleteMsg),
237
237
  MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
238
- TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outUpdateRelComplete),
238
+ TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outUpdateRelComplete),
239
239
  };
240
240
 
241
241
  _izContext.logger.debug("messageParams OutUpdateRelationshipComplete ::::::: ", messageParams);
@@ -338,7 +338,7 @@ module.exports.updateRelationship = async (
338
338
 
339
339
  let messageToInUpdateRelationship = {
340
340
  Message: JSON.stringify(updateRelMessageBody),
341
- TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GRAPH_HANDLER.inUpdateRel, storageResource.graphServiceTag),
341
+ TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GRAPH_HANDLER.inUpdateRel, storageResource.graphServiceTag),
342
342
  };
343
343
  _izContext.logger.debug("RequestParams before send to sqs messageToInUpdateRelationship ::::::: ", messageToInUpdateRelationship);
344
344
  await sns.publishAsync(_izContext, messageToInUpdateRelationship);
@@ -364,7 +364,7 @@ module.exports.updateRelationship = async (
364
364
  let sendMessageToOutCreateRelComplete = {
365
365
  Message: JSON.stringify(messageObject),
366
366
  MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
367
- TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete)
367
+ TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete)
368
368
  }
369
369
  _izContext.logger.debug("send Message to outCreateRelationshipComplete :::", sendMessageToOutCreateRelComplete);
370
370
  await sns.publishAsync(_izContext, sendMessageToOutCreateRelComplete);
@@ -1,76 +0,0 @@
1
- /*
2
- Copyright (C) 2020 Sven Mason <http://izara.io>
3
-
4
- This program is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU Affero General Public License as
6
- published by the Free Software Foundation, either version 3 of the
7
- License, or (at your option) any later version.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU Affero General Public License for more details.
13
-
14
- You should have received a copy of the GNU Affero General Public License
15
- along with this program. If not, see <http://www.gnu.org/licenses/>.
16
- */
17
-
18
- 'use strict';
19
- const path = require('path');
20
-
21
- const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils");
22
- const { SOURCE_PATH, defaultIamRolePerAction, shortNameHandler, SAVE_FILE_NAME, createIamRole, RESOURCE_CLASSES, SNS_RESOURCE, resourceNames, DYNAMO_RESOURCE } = require('../../../../libs/Consts');
23
- const templatePath = path.join(__dirname, "./template.ejs")
24
-
25
-
26
- function data(_izContext, flowSchema, srcPath) {
27
- return [createSourceParams(_izContext, srcPath)]
28
- }
29
-
30
- function createSourceParams(_izContext, flowSchema, srcPath) {
31
- let functionName = "InProcessWebSocket";
32
- let handlerType = "HdrWbs"
33
- let additionalResourcePermission = defaultIamRolePerAction();
34
- let functionNameConfig = upperCase(functionName) + upperCase(shortNameHandler(handlerType))
35
-
36
- additionalResourcePermission.push(
37
- createIamRole(
38
- {
39
- [RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
40
- },
41
- [
42
- resourceNames(RESOURCE_CLASSES.sns, `InProcess${flowSchema.flowTag}`)
43
- ]
44
- ),
45
- createIamRole(
46
- {
47
- [RESOURCE_CLASSES.dynamoDbTable]: [
48
- DYNAMO_RESOURCE.putItem,
49
- DYNAMO_RESOURCE.deleteItem
50
- ]
51
- },
52
- resourceNames(RESOURCE_CLASSES.dynamoDbTable, "WebSocketTask")
53
- )
54
- )
55
-
56
- return {
57
- templatePath: templatePath,
58
- templateData: {
59
- functionName,
60
- handlerType,
61
- functionNameConfig,
62
- additionalResourcePermission,
63
- resourceLocation: SOURCE_PATH.resourceLocationWebSocket,
64
- route: flowSchema.flowTag
65
- },
66
- setting: {
67
- savePath: path.join(srcPath, SOURCE_PATH.appYaml),
68
- saveFileName: upperCase(SAVE_FILE_NAME.flowSchema),
69
- fileExtension: '.yml',
70
- isAppend: true
71
- }
72
- }
73
- }
74
-
75
-
76
- module.exports = data;
@@ -1,46 +0,0 @@
1
- /*
2
- Copyright (C) 2020 Sven Mason <http://izara.io>
3
-
4
- This program is free software: you can redistribute it and/or modify
5
- it under the terms of the GNU Affero General Public License as
6
- published by the Free Software Foundation, either version 3 of the
7
- License, or (at your option) any later version.
8
-
9
- This program is distributed in the hope that it will be useful,
10
- but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- GNU Affero General Public License for more details.
13
-
14
- You should have received a copy of the GNU Affero General Public License
15
- along with this program. If not, see <http://www.gnu.org/licenses/>.
16
- */
17
-
18
- 'use strict';
19
- const path = require('path');
20
-
21
- const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../MainLibs/src/Utils");
22
- const { SOURCE_PATH } = require('../../../../libs/Consts');
23
- const templatePath = path.join(__dirname, './template.ejs')
24
-
25
- function data(_izContext, srcPath) {
26
- return [createSourceParams(_izContext, srcPath)]
27
- }
28
-
29
- function createSourceParams(_izContext, srcPath) {
30
- let functionName = "InProcessWebSocket";
31
- let handlerType = "HdrWbs";
32
-
33
- return {
34
- templatePath: templatePath,
35
- templateData: {},
36
- setting: {
37
- savePath: path.join(srcPath, SOURCE_PATH.webSocket),
38
- saveFileName: upperCase(functionName) + upperCase(handlerType),
39
- fileExtension: ".js",
40
- isAppend: true
41
- }
42
- }
43
- }
44
-
45
-
46
- module.exports = data;