@izara_project/izara-market-library-service-schemas 1.0.28 → 1.0.30
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 +10 -9
- package/src/GenerateCodeLibs/src/GenerateCodeLibs.js +54 -21
- package/src/MainLibs/src/Consts.js +36 -18
- 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/EndpointPerService/mainFunction/create/data.js +53 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +624 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/data.js +52 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +177 -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 +175 -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 +4 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/functionYaml/data.js +3 -29
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/data.js +3 -21
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/handler/template.ejs +3 -31
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/data.js +2 -2
- 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 +41 -10
- 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 +2 -2
- package/src/reStructure/TemplateData/flowSchema/components/upload/{hook/handler/templateAsyncHandler.ejs → preSignUrl/createPresignUrl/handler/template.ejs} +26 -11
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/{getSignUrls → createPresignUrl}/mainFunction/data.js +10 -7
- 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 +10 -38
- 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 +2 -2
- 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 +7 -10
- 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 +8 -6
- 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/generateTemplateData.js +41 -38
- package/src/reStructure/TemplateData/flowSchema/legacy/hookCode-old/queue/snsTemplate.ejs +1 -1
- package/src/reStructure/TemplateData/generateRole/createSharedResource.js +11 -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 +16 -14
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/dsq/data.js +16 -14
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/inv/data.js +16 -15
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/sqs/data.js +18 -16
- 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 +16 -14
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/dsq/data.js +16 -15
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/inv/data.js +17 -14
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/sqs/data.js +18 -16
- 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 +16 -14
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/dsq/data.js +17 -14
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/inv/data.js +16 -14
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/sqs/data.js +20 -17
- 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 +16 -14
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/dsq/data.js +16 -14
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/inv/data.js +16 -14
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/sqs/data.js +19 -18
- 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 +40 -38
- 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/upload/hook/handler/data.js +0 -93
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/handler/templateSyncHandler.ejs +0 -49
- package/src/reStructure/TemplateData/flowSchema/components/upload/hook/hookLogic/data.js +0 -43
- 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/components/upload/preSignUrl/{reservedLimit → createPresignUrl}/queue/template.ejs +0 -0
|
@@ -6,9 +6,6 @@
|
|
|
6
6
|
- sqs:
|
|
7
7
|
arn: arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:${self:custom.iz_resourcePrefix}<%- functionName %><%- firstLetterUpperCase(handlerType) %>
|
|
8
8
|
batchSize: 10
|
|
9
|
-
filterPatterns: #**** need to update serverless framwork upper v.2.69.1
|
|
10
|
-
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%- firstLetterUpperCase(functionName) %><%- firstLetterUpperCase(handlerType) %>"]}}} # functionName of callingFlow
|
|
11
|
-
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
12
9
|
role: <%- roleName %>Role
|
|
13
10
|
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
14
11
|
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
|
@@ -22,7 +22,7 @@ const path = require('path');
|
|
|
22
22
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
23
23
|
const { firstLetterLowerCase: lowerCase, firstLetterUpperCase: upperCase } = require("../../../../../../../../MainLibs/src/Utils")
|
|
24
24
|
|
|
25
|
-
const { HANDLER, SOURCE_PATH } = require('../../../../../../../../MainLibs/src/Consts');
|
|
25
|
+
const { HANDLER, SOURCE_PATH, FUNCTION_NAME } = require('../../../../../../../../MainLibs/src/Consts');
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* receive objectSchema
|
|
@@ -36,7 +36,7 @@ function data(_izContext, srcPath) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
function createSourceParams(_izContext, srcPath) {
|
|
39
|
-
let functionName =
|
|
39
|
+
let functionName = upperCase(FUNCTION_NAME.reservedLimit);
|
|
40
40
|
let handlerType = upperCase(HANDLER.hdrSqs);
|
|
41
41
|
|
|
42
42
|
return {
|
|
@@ -17,56 +17,51 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
17
17
|
|
|
18
18
|
'use strict';
|
|
19
19
|
|
|
20
|
-
// const AWS = require('aws-sdk');
|
|
21
|
-
// const sqs = new AWS.SQS({ apiVersion: '2012-11-05' });
|
|
22
|
-
|
|
23
20
|
const izara = require("@izara_project/izara-middleware");
|
|
24
21
|
const middleware = izara.middlewareHandler;
|
|
22
|
+
const izaraShared = require('@izara_project/izara-shared');
|
|
25
23
|
const recordHandlerSharedLib = require('@izara_project/izara-core-library-record-handler');
|
|
26
|
-
const Logger = require('@izara_project/izara-core-library-logger');
|
|
27
24
|
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
25
|
+
const Logger = require('@izara_project/izara-core-library-logger');
|
|
28
26
|
|
|
29
|
-
const
|
|
27
|
+
const reservedLimit = require('./ReservedLimit_Main');
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
29
|
+
middleware.setServiceSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
33
30
|
|
|
34
|
-
// set schema for record.body.Message
|
|
35
31
|
let perRecordsValidatorSchema = {
|
|
36
32
|
type: "object",
|
|
37
|
-
required: [
|
|
38
|
-
'returnMessage',
|
|
39
|
-
'errorsFound',
|
|
40
|
-
'passStatus'
|
|
41
|
-
],
|
|
33
|
+
required: ["objType", "objInstanceFull"],
|
|
42
34
|
properties: {
|
|
43
|
-
|
|
44
|
-
type: "object"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
objType: {
|
|
36
|
+
type: "object",
|
|
37
|
+
required: ["objectType", "serviceTag"],
|
|
38
|
+
properties: {
|
|
39
|
+
objectType: {
|
|
40
|
+
type: "string",
|
|
41
|
+
pattern: "^[a-zA-Z0-9_-]+$"
|
|
42
|
+
},
|
|
43
|
+
serviceTag: {
|
|
44
|
+
type: "string",
|
|
45
|
+
pattern: "^[a-zA-Z0-9_-]+$"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
48
|
},
|
|
49
|
-
|
|
50
|
-
type:
|
|
49
|
+
objInstaceFull: {
|
|
50
|
+
type: "object",
|
|
51
|
+
properties: {
|
|
52
|
+
identifiers: {
|
|
53
|
+
type: "object",
|
|
54
|
+
minProperties: 1
|
|
55
|
+
},
|
|
56
|
+
fields: {
|
|
57
|
+
type: "object"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
51
60
|
}
|
|
52
61
|
}
|
|
53
62
|
};
|
|
54
63
|
|
|
55
|
-
|
|
56
|
-
// const messageAttributeValidatorSchema = {
|
|
57
|
-
// type: "object",
|
|
58
|
-
// required: ['msgAtrrParam1', 'msgAtrrParam2'],
|
|
59
|
-
// properties: {
|
|
60
|
-
// msgAtrrParam1: {
|
|
61
|
-
// type: "string"
|
|
62
|
-
// },
|
|
63
|
-
// msgAtrrParam2: {
|
|
64
|
-
// type: "object"
|
|
65
|
-
// }
|
|
66
|
-
// }
|
|
67
|
-
// };
|
|
68
|
-
|
|
69
|
-
perRecordsValidatorSchema = callingFlowSharedLib.addOptionalPassBackPropertiesToValidatorSchema(perRecordsValidatorSchema)
|
|
64
|
+
perRecordsValidatorSchema = callingFlowSharedLib.addOptionalPassBackPropertiesToValidatorSchema(perRecordsValidatorSchema);
|
|
70
65
|
|
|
71
66
|
module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
72
67
|
|
|
@@ -80,26 +75,26 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
80
75
|
let passOnProperties = []
|
|
81
76
|
record._izContext.logger.debug('record ReceiveMsgOutHdrSqs', record);
|
|
82
77
|
|
|
83
|
-
//
|
|
78
|
+
//validate message (and MessageAttributes)
|
|
84
79
|
await recordHandlerSharedLib.validateRecord(
|
|
85
80
|
record, // one record will send to mainFunction
|
|
86
|
-
"
|
|
81
|
+
"GetPresignUrlHdrSqs", // queue name that need to retry or send to dlq
|
|
87
82
|
perRecordsValidatorSchema, // schema for record.Message
|
|
88
83
|
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
89
84
|
);
|
|
90
85
|
|
|
91
86
|
// add argument (to invoke lambda) to passOnProperties[]
|
|
92
|
-
passOnProperties.push(record.body.Message.
|
|
93
|
-
passOnProperties.push(record.body.Message.
|
|
94
|
-
passOnProperties.push(record.body.Message
|
|
95
|
-
passOnProperties.push(callingFlowSharedLib.
|
|
87
|
+
passOnProperties.push(record.body.Message.objType)
|
|
88
|
+
passOnProperties.push(record.body.Message.objInstanceFull)
|
|
89
|
+
passOnProperties.push(callingFlowSharedLib.addPassBackPropertiesToPassOnProperties(record.body.Message)) // is Ok PassBackProperties
|
|
90
|
+
// passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message)) // is Ok callinfFlow
|
|
96
91
|
record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
|
|
97
92
|
|
|
98
93
|
// call recordHandlerSharedLib.recordHandler with 3 parameters and return promise(resolve)
|
|
99
94
|
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
100
95
|
record, // one record will send to mainFunction
|
|
101
|
-
|
|
102
|
-
"
|
|
96
|
+
reservedLimit.reservedLimit, // mainFunction that need to invoke.
|
|
97
|
+
"GetPresignUrlHdrSqs", // queue name that need to retry or send to dlq
|
|
103
98
|
passOnProperties, // all parameters that mainFunction needed.
|
|
104
99
|
);
|
|
105
100
|
record._izContext.logger.debug('after recordPromise in handler');
|
|
@@ -111,7 +106,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
111
106
|
// --- main await all promises
|
|
112
107
|
await Promise.all(recordPromises); // await all promises
|
|
113
108
|
|
|
114
|
-
return event.Records // return all for local
|
|
109
|
+
return event.Records // return all for local testing
|
|
115
110
|
|
|
116
111
|
} catch {
|
|
117
112
|
Logger.debug('Promise.all(recordPromises) in handler threw error (at least one record did no resolve)');
|
|
@@ -119,7 +114,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
119
114
|
Logger.debug('after Promise.all(recordPromises) in handler');
|
|
120
115
|
|
|
121
116
|
} catch (err) {
|
|
122
|
-
Logger.error('Unhandled Error,
|
|
117
|
+
Logger.error('Unhandled Error, updateNodeCompleteHdrSqs: ', err);
|
|
123
118
|
throw (err);
|
|
124
119
|
}
|
|
125
120
|
});
|
|
@@ -20,8 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
const path = require('path');
|
|
21
21
|
|
|
22
22
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
23
|
-
|
|
24
|
-
const { SOURCE_PATH } = require('../../../../../../../../MainLibs/src/Consts');
|
|
23
|
+
const { firstLetterUpperCase: upperCase } = require('../../../../../../../../MainLibs/src/Utils')
|
|
24
|
+
const { SOURCE_PATH, FUNCTION_NAME } = require('../../../../../../../../MainLibs/src/Consts');
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* receive objectSchema
|
|
@@ -30,18 +30,15 @@ const { SOURCE_PATH } = require('../../../../../../../../MainLibs/src/Consts');
|
|
|
30
30
|
* @return {{ templatePath, templateData, setting } }
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
|
-
function data(_izContext,
|
|
34
|
-
return [createSourceParams(_izContext,
|
|
33
|
+
function data(_izContext, srcPath) {
|
|
34
|
+
return [createSourceParams(_izContext, srcPath)]
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
function createSourceParams(_izContext,
|
|
38
|
-
let functionName =
|
|
39
|
-
let bucketName = flowSchema.bucketName
|
|
37
|
+
function createSourceParams(_izContext, srcPath) {
|
|
38
|
+
let functionName = upperCase(FUNCTION_NAME.reservedLimit)
|
|
40
39
|
return {
|
|
41
40
|
templatePath: templatePath,
|
|
42
|
-
templateData: {
|
|
43
|
-
bucketName
|
|
44
|
-
},
|
|
41
|
+
templateData: {},
|
|
45
42
|
setting: {
|
|
46
43
|
saveFileName: `${functionName}_Main`,
|
|
47
44
|
savePath: path.join(srcPath, SOURCE_PATH.webSocket),
|
|
@@ -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(
|
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)]
|