@izara_project/izara-market-library-service-schemas 1.0.18 → 1.0.19
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.
- package/package.json +2 -2
- package/src/GenerateCodeLibs/src/Consts.js +32 -2
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +3 -61
- package/src/SourceManager/src/Utils.js +16 -1
- package/src/TemplateManager/src/GenerateCode.js +134 -45
- package/src/TemplateManager/src/OutPerActionComplete/OutCreateComplete/functionYaml/data.js +1 -1
- package/src/TemplateManager/src/OutPerActionComplete/OutDeleteComplete/functionYaml/data.js +1 -1
- package/src/TemplateManager/src/OutPerActionComplete/OutUpdateComplete/functionYaml/data.js +1 -1
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Create/template.ejs +42 -23
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Delete/template.ejs +0 -1
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Get/template.ejs +13 -11
- package/src/TemplateManager/src/PerActionEndpoint/MainFunction/Update/template.ejs +34 -18
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler/mainFunction → PerActionEndpoint/libs}/data.js +12 -23
- package/src/TemplateManager/src/PerActionEndpoint/libs/template.ejs +46 -0
- package/src/TemplateManager/src/externalService/LambdaRole/data.js +114 -4
- package/src/TemplateManager/src/externalService/LambdaRole/template.ejs +3 -4
- package/src/TemplateManager/src/externalService/SnsTopicSubscriotions/data.js +31 -6
- package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/dynamoDb/ReservedTableData.js +65 -0
- package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/functionYaml/data.js +3 -2
- package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/handler/data.js +1 -1
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/functionYaml/data.js +77 -0
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/FlowSchemaEndpoint/InProcessFlowSchema}/functionYaml/template.ejs +9 -3
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/handler/data.js +47 -0
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/FlowSchemaEndpoint/InProcessFlowSchema}/handler/template.ejs +25 -52
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/mainFunction/data.js +46 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/mainFunction/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/data.js +36 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/InProcessFlowSchema/sns-sqs/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/data.js +35 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/functionYaml/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/data.js +35 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/handler/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/data.js +35 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/mainFunction/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/data.js +35 -0
- package/src/TemplateManager/src/flowSchema/FlowSchemaEndpoint/OutComplete/sns-sqs/template.ejs +0 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/functionYaml/data.js +102 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/functionYaml/template.ejs +30 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/handler/data.js +58 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/handler/template.ejs +126 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/mainFunction/data.js +51 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/mainFunction/template.ejs +121 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/queue/data.js +64 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/confirmReservedAfterUpload/queue/template.ejs +45 -0
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/UploadS3Case/createObject}/functionYaml/data.js +35 -12
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/functionYaml/template.ejs +37 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/data.js +72 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObject/handler/template.ejs +107 -0
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler/handler → flowSchema/UploadS3Case/createObject/mainFunction}/data.js +11 -15
- package/src/TemplateManager/src/{flowTag/webSocket/websocketHandler → flowSchema/UploadS3Case/createObject}/mainFunction/template.ejs +4 -4
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/functionYaml/data.js +6 -4
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/functionYaml/template.ejs +30 -0
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/handler/data.js +1 -1
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/handler/template.ejs +10 -10
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/mainFunction/data.js +3 -4
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/mainFunction/template.ejs +86 -0
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createObjectComplete}/sns-sqs/data.js +4 -2
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createObjectComplete/sns-sqs/template.ejs +49 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/functionYaml/data.js +85 -0
- package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete → flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc}/functionYaml/template.ejs +1 -1
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/handler/data.js +57 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/handler/template.ejs +120 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/data.js +51 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/mainFunction/template.ejs +164 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/sqs/data.js +65 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/getsignUrlsAcc/sqs/template.ejs +53 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/functionYaml/data.js +112 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/functionYaml/template.ejs +30 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/handler/data.js +57 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/handler/template.ejs +126 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/data.js +54 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/mainFunction/template.ejs +254 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/queue/data.js +64 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/createPresignUrl/reservedLimitComplete/queue/template.ejs +45 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/data.js +94 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/templateAsyncHandler.ejs +110 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/handler/templateSyncHandler.ejs +49 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/hookLogic/data.js +44 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/mainFunction/data.js +66 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/mainFunction/template.ejs +7 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/data.js +73 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/hookCode/queue/snsTemplate.ejs +59 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrDsq/data.js +87 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrDsq/template.ejs +30 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrS3/data.js +112 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/functionYml/HdrS3/template.ejs +38 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerDsq/data.js +45 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerDsq/template.ejs +151 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerS3/data.js +43 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/handler/handlerS3/template.ejs +68 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/data.js +43 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/mainFunction/template.ejs +392 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/data.js +77 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/dsqTemplatePath.ejs +32 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/processFileS3AfterUpload/queue/s3Template.ejs +59 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/S3/data.js +51 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/S3/template.ejs +13 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/data.js +42 -0
- package/src/TemplateManager/src/flowSchema/UploadS3Case/relate/libs/template.ejs +137 -0
- package/src/TemplateManager/src/libs/Consts.js +57 -28
- package/src/TemplateManager/src/flowTag/webSocket/webSocketComplete/mainFunction/template.ejs +0 -180
- /package/src/TemplateManager/src/{flowTag/resources/dynamoDb/data.js → flowSchema/DefaultWebSocketResource/dynamoDb/WebSocketTaskData.js} +0 -0
- /package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/functionYaml/template.ejs +0 -0
- /package/src/TemplateManager/src/{flowTag/webSocket → flowSchema/DefaultWebSocketResource}/webSocketConnect/handler/template.ejs +0 -0
- /package/src/TemplateManager/src/{flowTag/webSocket/webSocketComplete/sns-sqs/template.ejs → flowSchema/UploadS3Case/hookCode/queue/sqsTemplate.ejs} +0 -0
|
@@ -38,18 +38,21 @@ const {
|
|
|
38
38
|
createGetDataDetails,
|
|
39
39
|
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
40
40
|
|
|
41
|
+
const { createObjTypeConcat } = require('@izara_project/izara-core-library-service-schemas/src/Utils');
|
|
41
42
|
|
|
42
43
|
const izaraShared = require('@izara_project/izara-shared');
|
|
43
44
|
const dynamodbSharedLib = izaraShared.dynamodbSharedLib;
|
|
44
45
|
const graphSharedLib = izaraShared.graphSharedLib;
|
|
45
46
|
const callingFlowSharedLib = izaraShared.callingFlowSharedLib;
|
|
46
47
|
const snsSharedLib = izaraShared.snsSharedLib;
|
|
48
|
+
const lambdaSharedLib = izaraShared.lambdaSharedLib;
|
|
47
49
|
|
|
48
50
|
const externalRequest = require('@izara_project/izara-core-library-external-request');
|
|
49
51
|
const sns = externalRequest.sns
|
|
50
52
|
|
|
51
53
|
const NoRetryError = require('@izara_project/izara-core-library-core/src/NoRetryError');
|
|
52
54
|
const { TOPIC_NAME_GENERATE_CODE } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts');
|
|
55
|
+
const coreConsts = require("@izara_project/izara-core-library-core/src/Consts");
|
|
53
56
|
|
|
54
57
|
/**
|
|
55
58
|
*
|
|
@@ -82,25 +85,24 @@ module.exports.<%- functionName %>Main = async (
|
|
|
82
85
|
const returnSystemFieldsName = requestParams.additionalRequest?.setting?.returnSystemFieldsName || false;
|
|
83
86
|
const throwWhenNotFoundSomeRecord = requestParams.additionalRequest?.setting?.throwWhenNotFoundSomeRecord || true;
|
|
84
87
|
|
|
85
|
-
|
|
86
88
|
const OBJECT_TYPE = "<%- objectType %>";
|
|
87
89
|
const SERVICE_TAG = process.env.iz_serviceTag;
|
|
88
90
|
|
|
89
91
|
//(<beforeQuery>)
|
|
90
92
|
//(</beforeQuery>)
|
|
91
93
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
let objectSchema = await getObjSchemaS3WithHierarchy(
|
|
95
|
+
_izContext,
|
|
96
|
+
{
|
|
97
|
+
objectType: OBJECT_TYPE,
|
|
98
|
+
serviceTag: SERVICE_TAG
|
|
99
|
+
}
|
|
100
|
+
);
|
|
99
101
|
|
|
100
|
-
|
|
102
|
+
_izContext.logger.debug("objectSchema: ", objectSchema);
|
|
101
103
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
let getDataDetails = await createGetDataDetails(_izContext, objectSchema);
|
|
105
|
+
_izContext.logger.debug("getDataDetails:", getDataDetails)
|
|
104
106
|
|
|
105
107
|
// start to get data
|
|
106
108
|
let getResults = []; // for collect result data from
|
|
@@ -28,7 +28,8 @@ const consts = require('@izara_project/izara-core-library-service-schemas/src/Co
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
const {
|
|
31
|
-
dynamoDbIdentifiersByStorageResource,
|
|
31
|
+
dynamoDbIdentifiersByStorageResource,
|
|
32
|
+
createFieldForUpdateDynamoDb
|
|
32
33
|
} = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/GenerateCodeLibs');
|
|
33
34
|
|
|
34
35
|
const izaraShared = require('@izara_project/izara-shared');
|
|
@@ -74,9 +75,11 @@ module.exports.<%- functionName %>Main = async (
|
|
|
74
75
|
_izContext.logger.debug("<%- functionName %> callingFlowConfig", callingFlowConfig)
|
|
75
76
|
|
|
76
77
|
let errorFounds = [];
|
|
77
|
-
const userId = _izContext.correlationIds.get(coreConsts.BASE_USER_ID)
|
|
78
|
+
const userId = _izContext.correlationIds.get(coreConsts.BASE_USER_ID);
|
|
79
|
+
const targetId = _izContext.correlationIds.get(coreConsts.TARGET_ID);
|
|
80
|
+
|
|
78
81
|
if (!userId) {
|
|
79
|
-
errorFounds.push("Not
|
|
82
|
+
errorFounds.push("Not have userId")
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
const OBJECT_TYPE = "<%- objectType %>"
|
|
@@ -102,6 +105,10 @@ module.exports.<%- functionName %>Main = async (
|
|
|
102
105
|
)
|
|
103
106
|
_izContext.logger.debug("objectSchema", objectSchema);
|
|
104
107
|
|
|
108
|
+
if (objectSchema.hasOwnProperty("belongTo") && !targetId) {
|
|
109
|
+
errorFounds.push('not have targetId')
|
|
110
|
+
}
|
|
111
|
+
|
|
105
112
|
let updateDataDetails = await createUpdateDataDetail(_izContext, objectSchema);
|
|
106
113
|
|
|
107
114
|
_izContext.logger.debug("updateDataDetails", updateDataDetails);
|
|
@@ -121,9 +128,13 @@ module.exports.<%- functionName %>Main = async (
|
|
|
121
128
|
if (!updateVersionedData.hasOwnProperty(fieldSetting.versionedDataLabel)) {
|
|
122
129
|
updateVersionedData[fieldSetting.versionedDataLabel] = {};
|
|
123
130
|
}
|
|
124
|
-
Object.assign(updateVersionedData[fieldSetting.versionedDataLabel], {
|
|
131
|
+
Object.assign(updateVersionedData[fieldSetting.versionedDataLabel], {
|
|
132
|
+
[fieldProp]: requestParams.objInstanceFull.fields[fieldProp]
|
|
133
|
+
})
|
|
125
134
|
} else {
|
|
126
|
-
Object.assign(updateMainNodeData, {
|
|
135
|
+
Object.assign(updateMainNodeData, {
|
|
136
|
+
[fieldProp]: requestParams.objInstanceFull.fields[fieldProp]
|
|
137
|
+
})
|
|
127
138
|
}
|
|
128
139
|
}
|
|
129
140
|
_izContext.logger.debug("updateMainNodeData::", updateMainNodeData);
|
|
@@ -149,7 +160,7 @@ module.exports.<%- functionName %>Main = async (
|
|
|
149
160
|
}
|
|
150
161
|
// check mainNode Data should not exists
|
|
151
162
|
if (Object.keys(updateMainNodeData).length) {
|
|
152
|
-
|
|
163
|
+
errorFounds.push("cannot update mainNode if have versionedDataIds");
|
|
153
164
|
}
|
|
154
165
|
}
|
|
155
166
|
|
|
@@ -215,10 +226,10 @@ module.exports.<%- functionName %>Main = async (
|
|
|
215
226
|
awaitingStepIds,
|
|
216
227
|
asyncFlowSharedLib.createPendingStepId(
|
|
217
228
|
hash(
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
229
|
+
{
|
|
230
|
+
identifiers,
|
|
231
|
+
fields,
|
|
232
|
+
})
|
|
222
233
|
)
|
|
223
234
|
)
|
|
224
235
|
_izContext.logger.debug("awaitingMultipleStep", awaitingMultipleStep)
|
|
@@ -253,7 +264,7 @@ module.exports.<%- functionName %>Main = async (
|
|
|
253
264
|
let updateNodeMessageBody = {
|
|
254
265
|
Message: JSON.stringify(updateNodeParams),
|
|
255
266
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
256
|
-
TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GRAPH_HANDLER.inUpdateNode, storageTag,)
|
|
267
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GRAPH_HANDLER.inUpdateNode, storageTag, )
|
|
257
268
|
}
|
|
258
269
|
|
|
259
270
|
_izContext.logger.debug('requset param before send to topic InUpdateNode:::', updateNodeMessageBody);
|
|
@@ -275,12 +286,16 @@ module.exports.<%- functionName %>Main = async (
|
|
|
275
286
|
_izContext.logger.debug("identifiersForUpdateData", identifiersForUpdateData)
|
|
276
287
|
_izContext.logger.debug("fieldForUpdateTableDynamo", fieldForUpdateTableDynamo)
|
|
277
288
|
|
|
278
|
-
await dynamodbSharedLib.updateItem(
|
|
289
|
+
let updateItem = await dynamodbSharedLib.updateItem(
|
|
279
290
|
_izContext,
|
|
280
291
|
await dynamodbSharedLib.tableName(_izContext, updateDataDetail.tableName),
|
|
281
292
|
identifiersForUpdateData,
|
|
282
|
-
fieldForUpdateTableDynamo
|
|
293
|
+
fieldForUpdateTableDynamo,
|
|
294
|
+
{
|
|
295
|
+
returnValues: "ALL_NEW"
|
|
296
|
+
}
|
|
283
297
|
)
|
|
298
|
+
_izContext.logger.debug("updateItem:", updateItem);
|
|
284
299
|
|
|
285
300
|
if (awaitingStepIds.length == 0) {
|
|
286
301
|
let messageObject = {
|
|
@@ -288,15 +303,16 @@ module.exports.<%- functionName %>Main = async (
|
|
|
288
303
|
objectType: OBJECT_TYPE,
|
|
289
304
|
serviceTag: SERVICE_TAG
|
|
290
305
|
},
|
|
291
|
-
|
|
292
|
-
identifiers: identifiersForUpdateData,
|
|
293
|
-
fields: fieldForUpdateTableDynamo
|
|
294
|
-
}
|
|
306
|
+
updateItem
|
|
295
307
|
}
|
|
296
308
|
|
|
297
309
|
if (callingFlowConfig[callingFlowSharedLib.consts.CALLINGFLOWPROPERTIES_PROPERTYNAME]) {
|
|
298
310
|
_izContext.logger.debug("HAVE CALLINGFLOW");
|
|
299
|
-
|
|
311
|
+
|
|
312
|
+
messageObject = callingFlowSharedLib.addPassBackPropertiesToSnsResponseMessageObject(callingFlowConfig, messageObject);
|
|
313
|
+
let messageAttributes = callingFlowSharedLib.addCallingFlowToSnsResponseMessageAttributes(callingFlowConfig, {});
|
|
314
|
+
|
|
315
|
+
_izContext.logger.debug("after create callingFlow", messageObject)
|
|
300
316
|
let outUpdateNodeCompleteTopic = await snsSharedLib.snsTopicArn(_izContext, TOPIC_NAME_GENERATE_CODE.outUpdateNodeComplete);
|
|
301
317
|
let messageParams = {
|
|
302
318
|
Message: JSON.stringify(messageObject),
|
|
@@ -16,44 +16,33 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
|
+
|
|
19
20
|
const path = require('path');
|
|
20
21
|
const fs = require('fs');
|
|
21
22
|
|
|
22
23
|
const { ACTIONS, HANDLER } = require('@izara_project/izara-core-library-service-schemas/src/Consts')
|
|
23
24
|
|
|
24
|
-
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase
|
|
25
|
-
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH } = require("
|
|
26
|
-
|
|
27
|
-
const templatePath = path.join(__dirname, "template.ejs")
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* receive objectSchema
|
|
31
|
-
* create data for WebScoket handler template
|
|
32
|
-
*
|
|
33
|
-
* @param {Object} objectSchema
|
|
34
|
-
* @return {{templatePath, templateData,setting}}
|
|
35
|
-
*/
|
|
25
|
+
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils")
|
|
26
|
+
const { DEFAULT_HANDLER_PER_ACTION, SOURCE_PATH } = require("../../libs/Consts");
|
|
36
27
|
|
|
28
|
+
const templatePath = path.join(__dirname, "./template.ejs")
|
|
37
29
|
|
|
38
30
|
function data(_izContext, srcPath) {
|
|
31
|
+
return [createSourceParams(_izContext, srcPath)]
|
|
32
|
+
};
|
|
39
33
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function createParamsForCreateSource(_izContext, srcPath) {
|
|
46
|
-
let functionName = "FlowSchema"
|
|
34
|
+
function createSourceParams(_izContext, srcPath) {
|
|
47
35
|
|
|
48
36
|
return {
|
|
49
37
|
templatePath: templatePath,
|
|
50
38
|
templateData: {},
|
|
51
39
|
setting: {
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
saveFileName: "GenerateCodeLibs",
|
|
41
|
+
savePath: path.join(srcPath, SOURCE_PATH.generateCodeLib),
|
|
54
42
|
fileExtension: ".js",
|
|
55
43
|
isAppend: false
|
|
56
44
|
}
|
|
57
45
|
}
|
|
58
|
-
}
|
|
59
|
-
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
module.exports = data;
|
|
@@ -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
|
+
|
|
20
|
+
const externalRequest = require('@izara_project/izara-core-library-external-request');
|
|
21
|
+
const lambda = externalRequest.lambda;
|
|
22
|
+
|
|
23
|
+
const inMemoryCacheLib = require('@izara_project/izara-shared/src/InMemoryCacheLib');
|
|
24
|
+
const hash = require('object-hash')
|
|
25
|
+
|
|
26
|
+
async function checkPermission(_izContext, functionName, payload) {
|
|
27
|
+
return await lambda.invokeSync(_izContext, functionName, payload)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const checkPermissionWithCache = inMemoryCacheLib.inMemoryCacheLib(
|
|
31
|
+
checkPermission, // fn
|
|
32
|
+
{ // setting
|
|
33
|
+
max: 100,
|
|
34
|
+
maxAge: 86400000,
|
|
35
|
+
promise: true,
|
|
36
|
+
profileName: 'checkPermission',
|
|
37
|
+
normalizer: function (args) {
|
|
38
|
+
return hash([args[1], args[2]])
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
module.exports = {
|
|
44
|
+
checkPermission,
|
|
45
|
+
checkPermissionWithCache
|
|
46
|
+
}
|
|
@@ -25,12 +25,12 @@ const { getGraphServiceNameFromGraphServerTagWithCache,
|
|
|
25
25
|
} = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig')
|
|
26
26
|
|
|
27
27
|
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils")
|
|
28
|
-
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, RESOURCE_CLASSES, SOURCE_PATH, externalResourceName, externalResourceSns, getGraphServiceNameFromAllRelSchema, SAVE_FILE_NAME, LAMBDA_RESOURCE, SNS_RESOURCE, getGraphServiceNameFromObjectSchema, shortNameHandler, SHORT_FUNCTION_NAME, defaultIamRolePerAction } = require("../../libs/Consts");
|
|
28
|
+
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, RESOURCE_CLASSES, SOURCE_PATH, externalResourceName, externalResourceSns, getGraphServiceNameFromAllRelSchema, SAVE_FILE_NAME, LAMBDA_RESOURCE, SNS_RESOURCE, getGraphServiceNameFromObjectSchema, shortNameHandler, SHORT_FUNCTION_NAME, defaultIamRolePerAction, resourceNames } = require("../../libs/Consts");
|
|
29
29
|
// const templatePath = path.join(__dirname, "./template.ejs");
|
|
30
30
|
const templatePath = path.join(__dirname, "./template.ejs");
|
|
31
31
|
const { getAllLocalRelationshipSchemas } = require('@izara_project/izara-core-library-service-schemas/src/GetObjectSchema')
|
|
32
|
-
|
|
33
|
-
const createExternalLambdaRole = async (_izContext, allObjSchemas, allRelSchemas, srcPath) => {
|
|
32
|
+
const { EXTERNAL_SERVICE_NAME } = require("../../../../GenerateCodeLibs/src/Consts")
|
|
33
|
+
const createExternalLambdaRole = async (_izContext, allObjSchemas, allRelSchemas, allLocalFlowSchemas, srcPath) => {
|
|
34
34
|
const allRelationshipSchemas = getAllLocalRelationshipSchemas(_izContext, srcPath)
|
|
35
35
|
// console.log("allRelationshipSchemas", allRelationshipSchemas);
|
|
36
36
|
const externalLambdaIamRoleArray = [];
|
|
@@ -88,7 +88,25 @@ const createExternalLambdaRole = async (_izContext, allObjSchemas, allRelSchemas
|
|
|
88
88
|
externalLambdaIamRoleProcessLogical && externalLambdaIamRoleArray.push(externalLambdaIamRoleProcessLogical)
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
if (allLocalFlowSchemas) {
|
|
92
|
+
for (const localFlowSchema of allLocalFlowSchemas) {
|
|
93
|
+
if (localFlowSchema.hasOwnProperty("uploadS3") && localFlowSchema.uploadS3 === true) {
|
|
94
|
+
const externalLambdaIamRoleGetPresignUrl = await externalLambdaIamRoleDataGetPresignUrl(_izContext);
|
|
95
|
+
externalLambdaIamRoleGetPresignUrl && externalLambdaIamRoleArray.push(externalLambdaIamRoleGetPresignUrl);
|
|
96
|
+
|
|
97
|
+
const externalLambdaIamRoleReservedLimitComplete = await externalLambdaIamRoleDataReservedLimitComplete(_izContext);
|
|
98
|
+
externalLambdaIamRoleReservedLimitComplete && externalLambdaIamRoleArray.push(externalLambdaIamRoleReservedLimitComplete);
|
|
99
|
+
|
|
100
|
+
const externalLambdaIamRoleProcessAfterUpload = await externalLambdaIamRoleDataProcessAfterUpload(_izContext);
|
|
101
|
+
externalLambdaIamRoleProcessAfterUpload && externalLambdaIamRoleArray.push(externalLambdaIamRoleProcessAfterUpload);
|
|
102
|
+
|
|
103
|
+
const externalLambdaIamRoleConfirmReservedAfterUpload = await externalLambdaIamRoleDataConfirmReservedAfterUpload(_izContext);
|
|
104
|
+
externalLambdaIamRoleConfirmReservedAfterUpload && externalLambdaIamRoleArray.push(externalLambdaIamRoleConfirmReservedAfterUpload);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// console.log("externalLambdaIamRoleArray", externalLambdaIamRoleArray)
|
|
92
110
|
// console.log("createSourceArrayIamRole", JSON.stringify(externalLambdaIamRoleArray))
|
|
93
111
|
// return externalLambdaIamRoleArray
|
|
94
112
|
|
|
@@ -297,4 +315,96 @@ async function externalLambdaIamRoleDataProcessLogical(_izContext, allObjectSche
|
|
|
297
315
|
}
|
|
298
316
|
}
|
|
299
317
|
|
|
318
|
+
function externalLambdaIamRoleDataGetPresignUrl(_izContext) {
|
|
319
|
+
let functionName = "GetPresignUrl" + upperCase(shortNameHandler(HANDLER.hdrSqs));
|
|
320
|
+
let additionalResourcePermission = [];
|
|
321
|
+
|
|
322
|
+
additionalResourcePermission.push(
|
|
323
|
+
createIamRole(
|
|
324
|
+
{
|
|
325
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
326
|
+
},
|
|
327
|
+
[
|
|
328
|
+
externalResourceSns("InReservedDynamicUsage", EXTERNAL_SERVICE_NAME.accountLimits)
|
|
329
|
+
]
|
|
330
|
+
),
|
|
331
|
+
createIamRole(
|
|
332
|
+
{
|
|
333
|
+
[RESOURCE_CLASSES.lambda]: [LAMBDA_RESOURCE.invokeFunction]
|
|
334
|
+
},
|
|
335
|
+
[
|
|
336
|
+
externalResourceName(RESOURCE_CLASSES.lambda, "StaticLimitProcessHdrInv", EXTERNAL_SERVICE_NAME.accountLimits)
|
|
337
|
+
]
|
|
338
|
+
)
|
|
339
|
+
)
|
|
340
|
+
// console.log("additionalResourcePermission GetPresignUrl::", JSON.stringify(additionalResourcePermission))
|
|
341
|
+
return {
|
|
342
|
+
functionName,
|
|
343
|
+
additionalResourcePermission
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
function externalLambdaIamRoleDataReservedLimitComplete(_izContext) {
|
|
348
|
+
let functionName = "ReservedLimitComp" + upperCase(shortNameHandler(HANDLER.hdrSqs));
|
|
349
|
+
let additionalResourcePermission = [];
|
|
350
|
+
|
|
351
|
+
additionalResourcePermission.push(
|
|
352
|
+
createIamRole(
|
|
353
|
+
{
|
|
354
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
355
|
+
},
|
|
356
|
+
[
|
|
357
|
+
externalResourceSns("InCancelUsage", EXTERNAL_SERVICE_NAME.accountLimits)
|
|
358
|
+
]
|
|
359
|
+
)
|
|
360
|
+
)
|
|
361
|
+
return {
|
|
362
|
+
functionName,
|
|
363
|
+
additionalResourcePermission
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function externalLambdaIamRoleDataConfirmReservedAfterUpload(_izContext) {
|
|
368
|
+
let functionName = "ConfirmNewReserved" + upperCase(shortNameHandler(HANDLER.hdrSqs));
|
|
369
|
+
let additionalResourcePermission = []
|
|
370
|
+
|
|
371
|
+
additionalResourcePermission.push(
|
|
372
|
+
createIamRole(
|
|
373
|
+
{
|
|
374
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
375
|
+
},
|
|
376
|
+
[
|
|
377
|
+
externalResourceSns("OutReservedDynamicUsageComplet", EXTERNAL_SERVICE_NAME.accountLimits),
|
|
378
|
+
externalResourceSns("InConfirmUsage", EXTERNAL_SERVICE_NAME.accountLimits)
|
|
379
|
+
]
|
|
380
|
+
),
|
|
381
|
+
)
|
|
382
|
+
return {
|
|
383
|
+
functionName,
|
|
384
|
+
additionalResourcePermission
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function externalLambdaIamRoleDataProcessAfterUpload(_izContext) {
|
|
389
|
+
let functionName = "ProcessAfterUploadS3" + shortNameHandler(upperCase("HdrS3"));
|
|
390
|
+
let additionalResourcePermission = []
|
|
391
|
+
|
|
392
|
+
additionalResourcePermission.push(
|
|
393
|
+
createIamRole(
|
|
394
|
+
{
|
|
395
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
396
|
+
},
|
|
397
|
+
[
|
|
398
|
+
externalResourceSns("InCancelUsage", EXTERNAL_SERVICE_NAME.accountLimits),
|
|
399
|
+
externalResourceSns("InConfirmUsage", EXTERNAL_SERVICE_NAME.accountLimits),
|
|
400
|
+
externalResourceSns("InReservedDynamicUsage", EXTERNAL_SERVICE_NAME.accountLimits),
|
|
401
|
+
]
|
|
402
|
+
)
|
|
403
|
+
)
|
|
404
|
+
return {
|
|
405
|
+
functionName,
|
|
406
|
+
additionalResourcePermission
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
300
410
|
module.exports = createExternalLambdaRole;
|
|
@@ -41,12 +41,11 @@ module.exports.generatedLambdaRole = async () => {
|
|
|
41
41
|
<%_ resourcePermission.action[resourcePerAction].forEach(permission => { _%>
|
|
42
42
|
"<%- resourcePerAction %>:<%- permission %>",
|
|
43
43
|
],
|
|
44
|
-
"Resource":
|
|
44
|
+
"Resource":[
|
|
45
45
|
<%_ resourcePermission.resource.forEach(resource => { _%>
|
|
46
|
-
[
|
|
47
46
|
`<%- resource _%>`,
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
<%_ }) _%>
|
|
48
|
+
]
|
|
50
49
|
<%_ }) _%>
|
|
51
50
|
<%_ }) _%>
|
|
52
51
|
}<% if(resourceIdx < data.additionalResourcePermission.length-1) {_%>, <%_} %>
|
|
@@ -23,14 +23,11 @@ const { ACTIONS, HANDLER, STORAGE_TYPES } = require('@izara_project/izara-core-l
|
|
|
23
23
|
const { getGraphServiceNameFromGraphServerTagWithCache, getServiceNameWithCache } = require('@izara_project/izara-core-library-service-schemas/src/ServiceConfig')
|
|
24
24
|
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../MainLibs/src/Utils")
|
|
25
25
|
const { DEFAULT_HANDLER_PER_ACTION, createIamRole, resourceNames, RESOURCE_CLASSES, DEFAULT_LAMBDA_ROLE_PER_ACTION, SOURCE_PATH, externalResourceName, getGraphServiceNameFromAllRelSchema, FUNCTION_NAME, SAVE_FILE_NAME, getGraphServiceNameFromObjectSchema } = require("../../libs/Consts");
|
|
26
|
-
const {
|
|
27
|
-
TOPIC_NAME_GRAPH_HANDLER,
|
|
28
|
-
TOPIC_NAME_GENERATE_CODE
|
|
29
|
-
} = require('../../../../GenerateCodeLibs/src/Consts')
|
|
26
|
+
const { TOPIC_NAME_GRAPH_HANDLER, TOPIC_NAME_GENERATE_CODE, EXTERNAL_SERVICE_NAME, TOPIC_NAME_EXTERNAL_SERVICE } = require('../../../../GenerateCodeLibs/src/Consts')
|
|
30
27
|
const templatePath = path.join(__dirname, "./template.ejs");
|
|
31
28
|
|
|
32
29
|
|
|
33
|
-
const createExternalSnsSubscriptions = async (_izContext, allObjSchemas, allRelSchemas, srcPath) => {
|
|
30
|
+
const createExternalSnsSubscriptions = async (_izContext, allObjSchemas, allRelSchemas, allLocalFlowSchemas, srcPath) => {
|
|
34
31
|
const snsServiceConfigArray = [];
|
|
35
32
|
|
|
36
33
|
const snsServiceConfigUpdateRelationshipComplete = await snsSubScriptionUpdateRelationshipComplete(_izContext, allRelSchemas)
|
|
@@ -51,7 +48,18 @@ const createExternalSnsSubscriptions = async (_izContext, allObjSchemas, allRelS
|
|
|
51
48
|
const snsServiceConfigDeleteNodeComplete = await snsSubscriptionDeleteNodeComplate(_izContext, allObjSchemas)
|
|
52
49
|
snsServiceConfigDeleteNodeComplete && snsServiceConfigArray.push(snsServiceConfigDeleteNodeComplete);
|
|
53
50
|
|
|
51
|
+
if (allLocalFlowSchemas) {
|
|
52
|
+
for (const flowSchema of allLocalFlowSchemas) {
|
|
53
|
+
if (flowSchema.hasOwnProperty("uploadS3") && flowSchema.uploadS3 === true) {
|
|
54
|
+
const snsServiceConfigForReservedDynamicUsage = await snsSubscriptionReservedLimitCompleteForReservedDynamicUsage(_izContext);
|
|
55
|
+
snsServiceConfigForReservedDynamicUsage && snsServiceConfigArray.push(snsServiceConfigForReservedDynamicUsage);
|
|
54
56
|
|
|
57
|
+
const snsServiceConfigForConfirmReserved = await snsSubscriptionConfirmReserved(_izContext);
|
|
58
|
+
snsServiceConfigForConfirmReserved && snsServiceConfigArray.push(snsServiceConfigForConfirmReserved);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// console.log("snsServiceConfigArray::", snsServiceConfigArray)
|
|
55
63
|
|
|
56
64
|
return {
|
|
57
65
|
templatePath: templatePath,
|
|
@@ -129,7 +137,24 @@ async function snsSubscriptionDeleteRelatipnshipComplete(_izContext, allRelSchem
|
|
|
129
137
|
sqsEndpoint: TOPIC_NAME_GENERATE_CODE.deleteRelComplete
|
|
130
138
|
}
|
|
131
139
|
}
|
|
132
|
-
// not done yet wait for comfirmation
|
|
133
140
|
|
|
141
|
+
function snsSubscriptionReservedLimitCompleteForReservedDynamicUsage(_izContext) {
|
|
142
|
+
let serviceNames = [EXTERNAL_SERVICE_NAME.accountLimits]
|
|
143
|
+
return {
|
|
144
|
+
serviceNames: serviceNames,
|
|
145
|
+
topicName: TOPIC_NAME_EXTERNAL_SERVICE.reservedDynamicUsageComplete,
|
|
146
|
+
sqsEndpoint: TOPIC_NAME_GENERATE_CODE.reservedLimitComplete + upperCase(HANDLER.hdrSqs)
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
function snsSubscriptionConfirmReserved(_izContext) {
|
|
152
|
+
let serviceNames = [EXTERNAL_SERVICE_NAME.accountLimits];
|
|
153
|
+
return {
|
|
154
|
+
serviceNames: serviceNames,
|
|
155
|
+
topicName: TOPIC_NAME_EXTERNAL_SERVICE.reservedDynamicUsageComplete,
|
|
156
|
+
sqsEndpoint: "ConfirmNewReserved" + upperCase(HANDLER.hdrSqs)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
134
159
|
|
|
135
160
|
module.exports = createExternalSnsSubscriptions;
|
package/src/TemplateManager/src/flowSchema/DefaultWebSocketResource/dynamoDb/ReservedTableData.js
ADDED
|
@@ -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,
|
|
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
|
|
22
|
+
const { SOURCE_PATH } = require("../../../../libs/Consts");
|
|
23
23
|
|
|
24
24
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
25
25
|
|