@izara_project/izara-market-library-service-schemas 1.0.29 → 1.0.31
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 +1 -1
- package/src/GenerateCodeLibs/src/Consts.js +11 -9
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +54 -21
- package/src/MainLibs/src/Consts.js +43 -20
- package/src/reStructure/GenerateCode.js +2 -1
- package/src/reStructure/TemplateConfig.js +5 -1
- package/src/reStructure/TemplateData/EndpointPerService/generateTemplateData.js +108 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/api/data.js +76 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/api/request.json +7 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/api/template.ejs +73 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/dsq/data.js +81 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/dsq/request.json +7 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/dsq/template.ejs +125 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/inv/data.js +70 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/inv/request.json +7 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/inv/template.ejs +73 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/sqs/data.js +79 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/sqs/request.json +7 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/sqs/template.ejs +126 -0
- package/src/reStructure/TemplateData/{flowSchema/components/schema/inProcess/handler → EndpointPerService/mainFunction/create}/data.js +20 -13
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +624 -0
- package/src/reStructure/TemplateData/{flowSchema/components/schema/inProcess/mainFunction → EndpointPerService/mainFunction/delete}/data.js +18 -11
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +176 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/data.js +56 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/get/template.ejs +234 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/data.js +56 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +330 -0
- package/src/reStructure/TemplateData/EndpointPerService/yaml/data.js +177 -0
- package/src/reStructure/TemplateData/EndpointPerService/yaml/template.ejs +26 -0
- package/src/reStructure/TemplateData/externalService/generateTemplateData.js +1 -1
- package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +91 -249
- package/src/reStructure/TemplateData/externalService/lambdaRole/template.ejs +1 -1
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +10 -8
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/template.ejs +1 -1
- package/src/reStructure/TemplateData/findData/findDataYaml/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/data.js +8 -7
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/handler/data.js +4 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js +5 -31
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/data.js +4 -22
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +3 -31
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/data.js +6 -6
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/handler/data.js +4 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/mainFunction/data.js +4 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/sns-sqs/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{getSignUrls → createPresignUrl}/functionYaml/data.js +45 -14
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{getSignUrls → createPresignUrl}/functionYaml/template.ejs +3 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{getSignUrls → createPresignUrl}/handler/data.js +6 -6
- package/src/reStructure/TemplateData/flowSchema/{legacy/hookCode-old/handler/templateAsyncHandler.ejs → components/upload/preSignUrl/createPresignUrl/handler/template.ejs} +26 -11
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{getSignUrls → createPresignUrl}/mainFunction/data.js +11 -8
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +253 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{reservedLimit → createPresignUrl}/queue/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/data.js +14 -42
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/functionYaml/template.ejs +0 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/data.js +6 -6
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/template.ejs +40 -45
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/data.js +5 -8
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +100 -190
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{getSignUrls → reservedLimit}/sqs/data.js +4 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{getSignUrls → reservedLimit}/sqs/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/functionYml/HdrS3/data.js +9 -7
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/data.js +4 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/data.js +4 -4
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/queue/s3Template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/S3/data.js +5 -2
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +3 -3
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/template.ejs +2 -0
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/data.js +3 -2
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/template.ejs +4 -16
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowSchema/functionYaml/data.js +115 -0
- package/src/reStructure/TemplateData/flowSchema/{components/schema/inProcess → flowSchemaOwnTopic/flowSchema}/functionYaml/template.ejs +1 -20
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowSchema/handler/data.js +70 -0
- package/src/reStructure/TemplateData/flowSchema/{components/schema/inProcess → flowSchemaOwnTopic/flowSchema}/handler/template.ejs +14 -32
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowSchema/mainFunction/data.js +64 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowSchema/mainFunction/template.ejs +104 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowSchemaComplete/functionYaml/data.js +115 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowSchemaComplete/functionYaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowSchemaComplete/handler/data.js +71 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowSchemaComplete/handler/template.ejs +85 -0
- package/src/reStructure/TemplateData/flowSchema/{components/upload/hook/hookLogic → flowSchemaOwnTopic/flowSchemaComplete/mainFunction}/data.js +30 -10
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/flowSchemaComplete/mainFunction/template.ejs +105 -0
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +78 -55
- package/src/reStructure/TemplateData/generateRole/createSharedResource.js +21 -1
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +35 -44
- package/src/reStructure/TemplateData/perActionComplete/create/sns-out/template.ejs +1 -1
- package/src/reStructure/TemplateData/perActionComplete/create/yaml/data.js +4 -5
- package/src/reStructure/TemplateData/perActionComplete/delete/yaml/data.js +5 -4
- package/src/reStructure/TemplateData/perActionComplete/generateTemplateData.js +15 -2
- package/src/reStructure/TemplateData/perActionComplete/get/yaml/data.js +7 -4
- package/src/reStructure/TemplateData/perActionComplete/update/sns-out/data.js +1 -1
- package/src/reStructure/TemplateData/perActionComplete/update/yaml/data.js +5 -4
- package/src/reStructure/TemplateData/processLogical/yaml/data.js +3 -3
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/dsq/data.js +1 -1
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/sqs/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/api/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/sns-in-sqs/snsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-in-sqs/template.ejs +0 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/sns-out/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/api/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/sns-in-sqs/snsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/sns-out/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/api/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/inv/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/data.js +4 -4
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/sns-in-sqs/snsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/sns-out/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/api/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js +4 -4
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/sns-in-sqs/snsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/sns-out/template.ejs +1 -1
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/defaultDynamoDbTable.js +1 -1
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/generateDynamoPerLink.js +1 -1
- package/src/reStructure/TemplateData/resourceYaml/dynamodb/mainResourcePerObjectSchemaData.js +1 -1
- package/src/reStructure/TemplateData/resourceYaml/generateTemplateData.js +6 -12
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/defaultSnsInSqsForFindDataAndProcessLogical.js +1 -1
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/snsAndSqsPerActionData.js +22 -49
- package/src/reStructure/TemplateData/resourceYaml/sns-in-sqs/snsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/resourceYaml/sns-out/data.js +8 -24
- package/src/reStructure/TemplateData/resourceYaml/sns-out/template.ejs +1 -1
- package/src/reStructure/TemplateData/testTemplate/template.ejs +0 -5
- package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/functionYaml/data.js +0 -76
- package/src/reStructure/TemplateData/flowSchema/components/schema/inProcess/sns-sqs/data.js +0 -35
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/functionYaml/data.js +0 -34
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/functionYaml/template.ejs +0 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/handler/data.js +0 -34
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/handler/template.ejs +0 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/mainFunction/data.js +0 -34
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/mainFunction/template.ejs +0 -0
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/sns-sqs/data.js +0 -34
- package/src/reStructure/TemplateData/flowSchema/components/schema/outComplete/sns-sqs/template.ejs +0 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/handler/data.js +0 -93
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/handler/templateAsyncHandler.ejs +0 -110
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/handler/templateSyncHandler.ejs +0 -49
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/mainFunction/data.js +0 -65
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/mainFunction/template.ejs +0 -7
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/queue/data.js +0 -72
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/queue/snsTemplate.ejs +0 -59
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/queue/sqsTemplate.ejs +0 -43
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/handler/template.ejs +0 -120
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/getSignUrls/mainFunction/template.ejs +0 -163
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/functionYaml/data.js +0 -101
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/functionYaml/template.ejs +0 -43
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/handler/data.js +0 -93
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/handler/templateSyncHandler.ejs +0 -49
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/hookLogic/data.js +0 -64
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/mainFunction/data.js +0 -66
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/mainFunction/template.ejs +0 -30
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/queue/data.js +0 -124
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/queue/snsTemplate.ejs +0 -59
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/queue/sqsTemplate.ejs +0 -43
- package/src/reStructure/TemplateData/relationshipPerAction.zip +0 -0
- /package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{reservedLimit → createPresignUrl}/queue/template.ejs +0 -0
- /package/src/reStructure/TemplateData/flowSchema/{components/schema/inProcess/mainFunction/template.ejs → flowSchemaOwnTopic/sns-in/data.js} +0 -0
- /package/src/reStructure/TemplateData/flowSchema/{components/schema/inProcess/sns-sqs/template.ejs → flowSchemaOwnTopic/sns-out/data.js} +0 -0
|
@@ -17,237 +17,147 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
-
const asyncFlowSharedLib = require('@izara_project/izara-core-library-asynchronous-flow');
|
|
21
|
-
const snsSharedLib = require('@izara_project/izara-core-library-sns');
|
|
22
20
|
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
23
21
|
const lambdaSharedLib = require('@izara_project/izara-core-library-lambda');
|
|
24
|
-
const
|
|
22
|
+
const snsSharedLib = require('@izara_project/izara-core-library-sns');
|
|
25
23
|
|
|
26
24
|
const externalRequest = require('@izara_project/izara-core-library-external-request')
|
|
27
|
-
const lambda = externalRequest.lambda;
|
|
28
25
|
const sns = externalRequest.sns;
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const { createPresignedPost } = require('@aws-sdk/s3-presigned-post');
|
|
33
|
-
const consts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
|
|
34
|
-
|
|
35
|
-
const { postToConnection } = require("../../libs/source/ImportDataLib");
|
|
26
|
+
const lambda = externalRequest.lambda
|
|
27
|
+
const consts = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts')
|
|
28
|
+
const coreConsts = require('@izara_project/izara-middleware/src/MiddlewareCore/Consts')
|
|
36
29
|
const hash = require('object-hash');
|
|
37
|
-
const
|
|
38
|
-
const coreConsts = require('@izara_project/izara-core-library-core/src/Consts');
|
|
39
|
-
const { getNestObject } = require("../../libs/source/ImportDataLib");
|
|
40
|
-
const { EXTERNAL_SERVICE_NAME } = require('@izara_project/izara-market-library-service-schemas/src/GenerateCodeLibs/src/Consts');
|
|
30
|
+
const importDataLibs = require('../../libs/source/ImportDataLib')
|
|
41
31
|
/**
|
|
42
32
|
* description of function.
|
|
43
33
|
* @param {Object} _izContext
|
|
44
34
|
* @param {CorrelationIds} _izContext.correlationIds - property of _izContext
|
|
45
35
|
* @param {Logger} _izContext.logger - property of _izContext
|
|
46
|
-
* @param {
|
|
47
|
-
* @param {
|
|
48
|
-
* @param {
|
|
49
|
-
* @param {
|
|
50
|
-
* @param {
|
|
36
|
+
* @param {string} userId - from client
|
|
37
|
+
* @param {string} imageImportConfigId - from client
|
|
38
|
+
* @param {string} fileName - name of image
|
|
39
|
+
* @param {string} imageType - type of image
|
|
40
|
+
* @param {numeric} imageSize - size of image
|
|
51
41
|
*
|
|
52
|
-
* @returns {object}
|
|
42
|
+
* @returns {object} return imageImportId
|
|
53
43
|
*/
|
|
54
|
-
|
|
55
|
-
module.exports.reservedLimitComplete = async (
|
|
44
|
+
module.exports.reservedLimit = async (
|
|
56
45
|
_izContext,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
passBackProperties
|
|
46
|
+
objType,
|
|
47
|
+
objInstaceFull,
|
|
48
|
+
callingFlowConfig = {}
|
|
61
49
|
) => {
|
|
62
50
|
|
|
63
51
|
try {
|
|
64
52
|
|
|
65
|
-
_izContext.logger.debug('-----
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
passBackProperties: passBackProperties
|
|
53
|
+
_izContext.logger.debug('----- reservedLimit event params ----- ', {
|
|
54
|
+
objType,
|
|
55
|
+
objInstaceFull,
|
|
56
|
+
callingFlowConfig
|
|
70
57
|
});
|
|
71
|
-
|
|
72
|
-
const servicePendingId = passBackProperties.passBackProperties.identifier.servicePendingId; // importBatchId
|
|
73
|
-
const reservedDataId = passBackProperties.passBackProperties.identifier.reservedDataId;
|
|
74
|
-
const objType = passBackProperties.passBackProperties.objType
|
|
75
|
-
|
|
76
|
-
const correlationId = _izContext.correlationIds.get(consts.X_CORRELATION_ID)
|
|
77
|
-
const connectionId = _izContext.correlationIds.get(consts.CONNECTION_ID)
|
|
78
|
-
|
|
79
|
-
// getImportBatchMain from table
|
|
80
|
-
let importBatchMain = await lambda.invokeSync(_izContext,
|
|
81
|
-
await lambdaSharedLib.lambdaFunctionName(_izContext, "ImportBatchMainGetHdrInv"),
|
|
82
|
-
{
|
|
83
|
-
identifiers: {
|
|
84
|
-
importBatchId: servicePendingId
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
)
|
|
88
|
-
_izContext.logger.debug("importBatchMain", importBatchMain);
|
|
89
|
-
|
|
90
58
|
const {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
const {
|
|
95
|
-
importBatchStatus,
|
|
59
|
+
userId,
|
|
60
|
+
submittedByUserId,
|
|
96
61
|
importConfigId,
|
|
62
|
+
importBatchStatus,
|
|
63
|
+
importType,
|
|
97
64
|
fileName,
|
|
98
65
|
fileSize,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
} =
|
|
104
|
-
|
|
105
|
-
let
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
uniqueIdentify: uniqueIdentify
|
|
119
|
-
}
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
if (passStatus === false) { // if passStatus false post message to client
|
|
123
|
-
// use correlationId to get connectionId and use connectionId to post message to client
|
|
124
|
-
|
|
125
|
-
_izContext.logger.debug("reserved has reach limit");
|
|
126
|
-
|
|
127
|
-
errorsFound.push("reserved has reach limit")
|
|
128
|
-
// update importBatchMainTable
|
|
129
|
-
let updateImportBatchMainMsg = {
|
|
130
|
-
objInstanceFull: {
|
|
131
|
-
identifiers: {
|
|
132
|
-
importBatchId: importBatchId
|
|
133
|
-
},
|
|
134
|
-
fields: {
|
|
135
|
-
importBatchStatus: "error",
|
|
136
|
-
errorsFound: errorsFound
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
let sendMessageToUpdateImportBatch = {
|
|
142
|
-
Message: JSON.stringify(updateImportBatchMainMsg),
|
|
143
|
-
TopicArn: await snsSharedLib.snsTopicArn(_izContext, `InImportBatchMainUpdate`)
|
|
144
|
-
}
|
|
145
|
-
_izContext.logger.debug("sendMessageToUpdateImportBatch", sendMessageToUpdateImportBatch);
|
|
146
|
-
|
|
147
|
-
// cancel reserved
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
let cancelReservedMsg = {
|
|
151
|
-
userId: userId,
|
|
152
|
-
limitTag: returnMessage.limitTag,
|
|
153
|
-
uniqueIdentify: uniqueIdentify
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
let sendMessageToCancelReserved = {
|
|
157
|
-
Message: JSON.stringify(cancelReservedMsg),
|
|
158
|
-
TopicArn: await snsSharedLib.snsTopicArn(_izContext, 'InCancelUsage', EXTERNAL_SERVICE_NAME.accountLimits)
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
_izContext.logger.debug("sendMessageToCancelReserved", sendMessageToCancelReserved);
|
|
162
|
-
await sns.publishAsync(_izContext, sendMessageToCancelReserved);
|
|
163
|
-
|
|
164
|
-
await postToConnection({ message: "reserved has reach limit" }, connectionId)
|
|
165
|
-
// after post message delete websocket task
|
|
166
|
-
await dynamodbSharedLib.deleteItem(_izContext,
|
|
167
|
-
await dynamodbSharedLib.tableName(_izContext, "WebSocketTask"),
|
|
168
|
-
{
|
|
169
|
-
taskKey: correlationId,
|
|
170
|
-
connectionId: connectionId
|
|
171
|
-
}
|
|
172
|
-
)
|
|
66
|
+
startTime
|
|
67
|
+
} = objInstaceFull.fields
|
|
68
|
+
const {
|
|
69
|
+
importBatchId
|
|
70
|
+
} = objInstaceFull.identifiers
|
|
71
|
+
|
|
72
|
+
let connectionId = _izContext.correlationIds.get(coreConsts.CONNECTION_ID)
|
|
73
|
+
//* hard code
|
|
74
|
+
// _izContext['userId'] = 'this-is-uuid-for-user-superUserA'
|
|
75
|
+
|
|
76
|
+
// get static
|
|
77
|
+
let payloadBeforeInvokeStaticLimit = {
|
|
78
|
+
userId: userId,
|
|
79
|
+
limitTag: consts.LIMIT_TAG.uploadData,
|
|
80
|
+
value: fileSize,
|
|
81
|
+
rbacType: consts.RBAC_TYPE.appLevel,
|
|
82
|
+
targetUserId: submittedByUserId,
|
|
83
|
+
callingFlow: "BasDev",
|
|
84
|
+
callingFlowProperties: {}
|
|
173
85
|
}
|
|
174
86
|
|
|
175
|
-
|
|
176
|
-
|
|
87
|
+
let res = await importDataLibs.getDataFromInvokeFunctionWithCache(_izContext,
|
|
88
|
+
await lambdaSharedLib.lambdaFunctionName(_izContext, "StaticLimitProcessHdrInv", consts.EXTERNAL_SERVICE_NAME.accountLimits),
|
|
89
|
+
payloadBeforeInvokeStaticLimit
|
|
90
|
+
)
|
|
91
|
+
// let res = await lambda.invokeSync(_izContext,
|
|
92
|
+
// await lambdaSharedLib.lambdaFunctionName(_izContext, "StaticLimitProcessHdrInv", consts.EXTERNAL_SERVICE_NAME.accountLimits),
|
|
93
|
+
// payloadBeforeInvokeStaticLimit
|
|
94
|
+
// )
|
|
177
95
|
|
|
178
|
-
|
|
96
|
+
_izContext.logger.debug("res::", res);
|
|
179
97
|
|
|
180
|
-
|
|
181
|
-
|
|
98
|
+
if (res.passStatus === false) {
|
|
99
|
+
importDataLibs.postToConnection({ message: "static limit over" }, connectionId)
|
|
100
|
+
}
|
|
182
101
|
|
|
183
|
-
// create PresignUrl
|
|
184
|
-
let createPresignUrlParam = {
|
|
185
|
-
Bucket: "<%- bucketName %>",
|
|
186
|
-
Key: Key,
|
|
187
|
-
Conditions: [
|
|
188
|
-
["content-length-range", 0, maximumSize],
|
|
189
|
-
["starts-with", "$Content-Type", "file/csv"],
|
|
190
|
-
["eq", "$x-amz-meta-importBatchId", importBatchId]
|
|
191
|
-
],
|
|
192
|
-
fields: {},
|
|
193
|
-
expires: 86400
|
|
194
|
-
};
|
|
195
|
-
_izContext.logger.debug('createPresignUrlParam', createPresignUrlParam);
|
|
196
102
|
|
|
197
|
-
|
|
103
|
+
// reservedDynamic
|
|
198
104
|
|
|
199
|
-
|
|
200
|
-
|
|
105
|
+
let sendMsgReservedDynamic = {
|
|
106
|
+
userId: userId,
|
|
107
|
+
limitTag: consts.LIMIT_TAG.uploadData,
|
|
108
|
+
value: fileSize,
|
|
109
|
+
rbacType: consts.RBAC_TYPE.appLevel,
|
|
110
|
+
usedTimestamp: startTime,
|
|
111
|
+
targetUserId: submittedByUserId
|
|
112
|
+
}
|
|
201
113
|
|
|
202
|
-
|
|
114
|
+
const reservedDataId = `${consts.ACCOUNTLIMIT_TAG.reservedDynamic}_${userId}_${consts.LIMIT_TAG.uploadData}`
|
|
203
115
|
|
|
204
|
-
|
|
205
|
-
|
|
116
|
+
let callingFlowProperties = {
|
|
117
|
+
identifier: {
|
|
118
|
+
servicePendingId: importBatchId,
|
|
119
|
+
reservedDataId: reservedDataId
|
|
120
|
+
},
|
|
121
|
+
importConfigId: importConfigId,
|
|
122
|
+
objType: objType
|
|
123
|
+
}
|
|
206
124
|
|
|
207
|
-
|
|
208
|
-
objInstanceFull: {
|
|
209
|
-
identifiers: {
|
|
210
|
-
importBatchId: importBatchId
|
|
211
|
-
},
|
|
212
|
-
fields: {
|
|
213
|
-
importBatchStatus: "waitingToUpload",
|
|
214
|
-
expiryTimestamp: (startTime + (createPresignUrlParam.expires * 1000))
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
125
|
+
_izContext.logger.debug("callingFlowProperties", callingFlowProperties);
|
|
218
126
|
|
|
219
|
-
|
|
220
|
-
|
|
127
|
+
if (callingFlowConfig) {
|
|
128
|
+
sendMsgReservedDynamic = callingFlowSharedLib.addCallingFlowToSnsRequestMessageObject(
|
|
129
|
+
sendMsgReservedDynamic,
|
|
221
130
|
callingFlowSharedLib.addParentCallingFlowConfig(
|
|
222
|
-
|
|
223
|
-
callingFlowSharedLib.createCallingFlowConfig(
|
|
224
|
-
await lambdaSharedLib.lambdaFunctionName(_izContext,
|
|
131
|
+
callingFlowConfig,
|
|
132
|
+
callingFlowSharedLib.createCallingFlowConfig(
|
|
133
|
+
await lambdaSharedLib.lambdaFunctionName(_izContext, "ReservedLimitCompleteHdrSqs"),
|
|
134
|
+
callingFlowProperties
|
|
225
135
|
)
|
|
226
136
|
)
|
|
137
|
+
)
|
|
138
|
+
} else {
|
|
139
|
+
sendMsgReservedDynamic = callingFlowSharedLib.addCallingFlowToSnsRequestMessageObject(
|
|
140
|
+
sendMsgReservedDynamic,
|
|
141
|
+
callingFlowSharedLib.createCallingFlowConfig(
|
|
142
|
+
await lambdaSharedLib.lambdaFunctionName(_izContext, "ReservedLimitCompleteHdrSqs"),
|
|
143
|
+
callingFlowProperties
|
|
144
|
+
)
|
|
227
145
|
);
|
|
146
|
+
}
|
|
228
147
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
await dynamodbSharedLib.tableName(_izContext, "WebSocketTask"),
|
|
240
|
-
{
|
|
241
|
-
taskKey: correlationId,
|
|
242
|
-
connectionId: connectionId
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
uploadUrl: uploadUrl
|
|
246
|
-
}
|
|
247
|
-
)
|
|
148
|
+
let sendMessageToReservedDynamic = {
|
|
149
|
+
Message: JSON.stringify(sendMsgReservedDynamic),
|
|
150
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, "InReservedDynamicUsage", consts.EXTERNAL_SERVICE_NAME.accountLimits)
|
|
151
|
+
};
|
|
152
|
+
_izContext.logger.debug("sendMessageToReservedDynamic", sendMessageToReservedDynamic);
|
|
153
|
+
await sns.publishAsync(_izContext, sendMessageToReservedDynamic);
|
|
154
|
+
|
|
155
|
+
return {
|
|
156
|
+
objType,
|
|
157
|
+
objInstaceFull,
|
|
248
158
|
}
|
|
249
159
|
} catch (err) {
|
|
250
|
-
_izContext.logger.error('error
|
|
160
|
+
_izContext.logger.error('error GetSignedUrlAccountLimit: ', err);
|
|
251
161
|
throw (err)
|
|
252
162
|
}
|
|
253
163
|
}
|
|
@@ -19,9 +19,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
19
19
|
|
|
20
20
|
const path = require("path")
|
|
21
21
|
|
|
22
|
-
const { SOURCE_PATH, SAVE_FILE_NAME } = require('../../../../../../../../MainLibs/src/Consts');
|
|
22
|
+
const { SOURCE_PATH, SAVE_FILE_NAME, FUNCTION_NAME } = require('../../../../../../../../MainLibs/src/Consts');
|
|
23
23
|
const { TOPIC_NAME_GENERATE_CODE } = require("../../../../../../../../GenerateCodeLibs/src/Consts");
|
|
24
|
-
|
|
24
|
+
const { firstLetterUpperCase: upperCase } = require("../../../../../../../../MainLibs/src/Utils");
|
|
25
25
|
const templatePath = path.join(__dirname, './template.ejs');
|
|
26
26
|
|
|
27
27
|
|
|
@@ -48,8 +48,8 @@ function data(_izContext, srcPath) {
|
|
|
48
48
|
|
|
49
49
|
WebSocketSqsQueueNames.push(
|
|
50
50
|
{
|
|
51
|
-
queueName:
|
|
52
|
-
subscription:
|
|
51
|
+
queueName: upperCase(FUNCTION_NAME.reservedLimit),
|
|
52
|
+
subscription: "Out" + upperCase(FUNCTION_NAME.createObjectComplete)
|
|
53
53
|
}
|
|
54
54
|
)
|
|
55
55
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
##===== SNS Subscription
|
|
2
2
|
##===== [Topic In]
|
|
3
|
-
Subscription<%-
|
|
3
|
+
Subscription<%- queueName %>:
|
|
4
4
|
Type: AWS::SNS::Subscription
|
|
5
5
|
Properties:
|
|
6
|
-
TopicArn: !Ref
|
|
6
|
+
TopicArn: !Ref <%- subscription %>
|
|
7
7
|
Endpoint: "arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- queueName %>HdrSqs"
|
|
8
8
|
Protocol: "sqs"
|
|
9
9
|
##===== [Queue]
|
|
@@ -34,7 +34,9 @@ const {
|
|
|
34
34
|
shortNameHandler,
|
|
35
35
|
FUNCTION_NAME,
|
|
36
36
|
LAMBDA_RESOURCE,
|
|
37
|
-
SOURCE_GENERATE_IAM_ROLE
|
|
37
|
+
SOURCE_GENERATE_IAM_ROLE,
|
|
38
|
+
ACTIONS,
|
|
39
|
+
HANDLER
|
|
38
40
|
} = require('../../../../../../../../MainLibs/src/Consts');
|
|
39
41
|
|
|
40
42
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
@@ -75,8 +77,8 @@ function createSourceParam(_izContext, flowSchema, srcPath) {
|
|
|
75
77
|
]
|
|
76
78
|
},
|
|
77
79
|
[
|
|
78
|
-
resourceNames(RESOURCE_CLASSES.sqs, functionName
|
|
79
|
-
resourceNames(RESOURCE_CLASSES.sqs, functionName +
|
|
80
|
+
resourceNames(RESOURCE_CLASSES.sqs, functionName),
|
|
81
|
+
resourceNames(RESOURCE_CLASSES.sqs, functionName + "DLQ")
|
|
80
82
|
]
|
|
81
83
|
),
|
|
82
84
|
createIamRole(
|
|
@@ -84,7 +86,7 @@ function createSourceParam(_izContext, flowSchema, srcPath) {
|
|
|
84
86
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
85
87
|
},
|
|
86
88
|
[
|
|
87
|
-
resourceNames(RESOURCE_CLASSES.sns,
|
|
89
|
+
resourceNames(RESOURCE_CLASSES.sns, functionName + "_In")
|
|
88
90
|
]
|
|
89
91
|
),
|
|
90
92
|
createIamRole(
|
|
@@ -93,8 +95,8 @@ function createSourceParam(_izContext, flowSchema, srcPath) {
|
|
|
93
95
|
[RESOURCE_CLASSES.lambda]: [LAMBDA_RESOURCE.invokeFunction]
|
|
94
96
|
},
|
|
95
97
|
[
|
|
96
|
-
resourceNames(RESOURCE_CLASSES.sns, "
|
|
97
|
-
resourceNames(RESOURCE_CLASSES.lambda,
|
|
98
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(ACTIONS.update) + "_In"),
|
|
99
|
+
resourceNames(RESOURCE_CLASSES.lambda, upperCase(ACTIONS.get) + upperCase(HANDLER.hdrInv)),
|
|
98
100
|
]
|
|
99
101
|
),
|
|
100
102
|
createIamRole(
|
|
@@ -112,7 +114,7 @@ function createSourceParam(_izContext, flowSchema, srcPath) {
|
|
|
112
114
|
functionName,
|
|
113
115
|
handlerType,
|
|
114
116
|
additionalResourcePermission,
|
|
115
|
-
resourceLocation: SOURCE_PATH.resourceLocationWebSocket,
|
|
117
|
+
resourceLocation: path.join(SOURCE_PATH.resourceLocationWebSocket, flowSchema.flowTag, "source/"),
|
|
116
118
|
bucketName,
|
|
117
119
|
functionNameConfig: upperCase(functionName) + upperCase(shortNameHandler(handlerType)),
|
|
118
120
|
roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role
|
|
@@ -38,18 +38,18 @@ const {
|
|
|
38
38
|
|
|
39
39
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
40
40
|
|
|
41
|
-
function data(_izContext, srcPath) {
|
|
42
|
-
return [createSourceData(_izContext, srcPath)]
|
|
41
|
+
function data(_izContext, flowSchema, srcPath) {
|
|
42
|
+
return [createSourceData(_izContext, flowSchema, srcPath)]
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
function createSourceData(_izContext, srcPath) {
|
|
45
|
+
function createSourceData(_izContext, flowSchema, srcPath) {
|
|
46
46
|
let functionName = FUNCTION_NAME.processAfterUploadS3
|
|
47
47
|
let handlerType = "HdrS3"
|
|
48
48
|
return {
|
|
49
49
|
templatePath: templatePath,
|
|
50
50
|
templateData: {},
|
|
51
51
|
setting: {
|
|
52
|
-
savePath: path.join(srcPath, SOURCE_PATH.webSocket),
|
|
52
|
+
savePath: path.join(srcPath, SOURCE_PATH.webSocket, flowSchema.flowTag, "source/"),
|
|
53
53
|
saveFileName: `${upperCase(functionName)}_${upperCase(handlerType)}`,
|
|
54
54
|
fileExtension: ".js",
|
|
55
55
|
}
|
package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/data.js
CHANGED
|
@@ -38,18 +38,18 @@ const {
|
|
|
38
38
|
|
|
39
39
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
40
40
|
|
|
41
|
-
function data(_izContext, srcPath) {
|
|
42
|
-
return [createSourceParams(_izContext, srcPath)]
|
|
41
|
+
function data(_izContext, flowSchema, srcPath) {
|
|
42
|
+
return [createSourceParams(_izContext, flowSchema, srcPath)]
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
function createSourceParams(_izContext, srcPath) {
|
|
45
|
+
function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
46
46
|
let functionName = upperCase(FUNCTION_NAME.processAfterUploadS3)
|
|
47
47
|
return {
|
|
48
48
|
templatePath: templatePath,
|
|
49
49
|
templateData: {},
|
|
50
50
|
setting: {
|
|
51
51
|
saveFileName: `${functionName}_Main`,
|
|
52
|
-
savePath: path.join(srcPath, SOURCE_PATH.webSocket),
|
|
52
|
+
savePath: path.join(srcPath, SOURCE_PATH.webSocket, flowSchema.flowTag, "source/"),
|
|
53
53
|
fileExtension: ".js",
|
|
54
54
|
}
|
|
55
55
|
}
|
package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/queue/s3Template.ejs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Type: AWS::SNS::Topic
|
|
4
4
|
Properties:
|
|
5
5
|
DisplayName: "SNS Message in ProcessImageAfterUploadHdrSqs"
|
|
6
|
-
TopicName: ${self:custom.
|
|
6
|
+
TopicName: ${self:custom.iz_serviceTag}_${self:custom.iz_stage}_<%- queueName %>_In
|
|
7
7
|
# ----- [Subscription]
|
|
8
8
|
SNSSubscriptionIn<%- queueName %>:
|
|
9
9
|
Type: AWS::SNS::Subscription
|
|
@@ -23,8 +23,11 @@ const { SOURCE_PATH, SAVE_FILE_NAME } = require('../../../../../../../MainLibs/s
|
|
|
23
23
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
24
24
|
|
|
25
25
|
function data(_izContext, flowSchema, srcPath) {
|
|
26
|
-
|
|
27
|
-
if (flowSchema.createBucket
|
|
26
|
+
let createBucket = false
|
|
27
|
+
if (flowSchema.createBucket) {
|
|
28
|
+
createBucket = true
|
|
29
|
+
}
|
|
30
|
+
if (!createBucket) {
|
|
28
31
|
return []
|
|
29
32
|
} else {
|
|
30
33
|
return [createSourceParams(_izContext, flowSchema, srcPath)]
|
package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js
CHANGED
|
@@ -18,8 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
18
18
|
'use strict';
|
|
19
19
|
const path = require('path');
|
|
20
20
|
|
|
21
|
-
const { SOURCE_PATH, SAVE_FILE_NAME, defaultIamRolePerAction, createIamRole, RESOURCE_CLASSES, DYNAMO_RESOURCE, resourceNames, SOURCE_GENERATE_IAM_ROLE } = require("
|
|
22
|
-
const { firstLetterUpperCase: upperCase } = require('
|
|
21
|
+
const { SOURCE_PATH, SAVE_FILE_NAME, defaultIamRolePerAction, createIamRole, RESOURCE_CLASSES, DYNAMO_RESOURCE, resourceNames, SOURCE_GENERATE_IAM_ROLE } = require("../../../../../../../MainLibs/src/Consts");
|
|
22
|
+
const { firstLetterUpperCase: upperCase } = require('../../../../../../../MainLibs/src/Utils');
|
|
23
23
|
|
|
24
24
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
25
25
|
|
|
@@ -59,7 +59,7 @@ function createWebSocketConnectYaml(_izContext, srcPath) {
|
|
|
59
59
|
templatePath: templatePath,
|
|
60
60
|
templateData: {
|
|
61
61
|
functionName,
|
|
62
|
-
resourceLocation:
|
|
62
|
+
resourceLocation: "src/generatedCode/FlowSchema/WebSocketConnect/source/",
|
|
63
63
|
additionalResourcePermission,
|
|
64
64
|
roleName: SOURCE_GENERATE_IAM_ROLE.FlowSchemaUploadS3Role
|
|
65
65
|
|
package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/data.js
CHANGED
|
@@ -18,7 +18,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
18
18
|
'use strict';
|
|
19
19
|
const path = require('path');
|
|
20
20
|
|
|
21
|
-
const { SOURCE_PATH } = require("
|
|
21
|
+
const { SOURCE_PATH, SAVE_FILE_NAME, defaultIamRolePerAction, createIamRole, RESOURCE_CLASSES, DYNAMO_RESOURCE, resourceNames, SOURCE_GENERATE_IAM_ROLE } = require("../../../../../../../MainLibs/src/Consts");
|
|
22
|
+
const { firstLetterUpperCase: upperCase } = require('../../../../../../../MainLibs/src/Utils');
|
|
22
23
|
|
|
23
24
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
24
25
|
|
|
@@ -44,7 +45,7 @@ function createWebSocketConnectYaml(_izContext, srcPath) {
|
|
|
44
45
|
functionName,
|
|
45
46
|
},
|
|
46
47
|
setting: {
|
|
47
|
-
savePath: path.join(srcPath,
|
|
48
|
+
savePath: path.join(srcPath, "../src/generatedCode/FlowSchema/WebSocketConnect/source/"),
|
|
48
49
|
saveFileName: functionName,
|
|
49
50
|
fileExtension: ".js",
|
|
50
51
|
isAppend: false
|
package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/handler/template.ejs
CHANGED
|
@@ -32,25 +32,13 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
32
32
|
switch (eventType) {
|
|
33
33
|
case 'CONNECT':
|
|
34
34
|
console.log('Connect websocket')
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
// await dynamodbSharedLib.tableName(event._izContext, "WebSocketTask"),
|
|
38
|
-
// {
|
|
39
|
-
// taskKey: "connect" + connectionId,
|
|
40
|
-
// connectionId: connectionId,
|
|
41
|
-
// }
|
|
42
|
-
// )
|
|
35
|
+
//(<additionalParams>)
|
|
36
|
+
//(</additionalParams>)
|
|
43
37
|
break
|
|
44
38
|
case 'DISCONNECT':
|
|
45
39
|
console.log('Websocket are Disconnection')
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
// await dynamodbSharedLib.tableName(event._izContext, "WebSocketTask"),
|
|
49
|
-
// {
|
|
50
|
-
// taskKey: "connect" + connectionId,
|
|
51
|
-
// connectionid: connectionId
|
|
52
|
-
// }
|
|
53
|
-
// );
|
|
40
|
+
//(<additionalParams>)
|
|
41
|
+
//(</additionalParams>)
|
|
54
42
|
break
|
|
55
43
|
case '$default':
|
|
56
44
|
console.log('Received unknown route:', route)
|