@izara_project/izara-market-library-service-schemas 1.0.55 → 1.0.56
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/GenerateCodeLibs.js +1 -0
- package/src/reStructure/TemplateData/EndpointPerService/handler/api/template.ejs +13 -14
- package/src/reStructure/TemplateData/EndpointPerService/handler/dsq/template.ejs +14 -11
- package/src/reStructure/TemplateData/EndpointPerService/handler/inv/template.ejs +9 -11
- package/src/reStructure/TemplateData/EndpointPerService/handler/sqs/template.ejs +16 -13
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +15 -4
- package/src/reStructure/TemplateData/EndpointPerService/yaml/data.js +18 -15
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/handler/template.ejs +2 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/mainFunction/template.ejs +14 -10
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/data.js +20 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +8 -14
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/handler/template.ejs +2 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +45 -55
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/template.ejs +5 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/data.js +4 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +31 -40
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/handler/handlerS3/template.ejs +3 -17
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/ProcessCsvtemplate.ejs +391 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +9 -317
- package/src/reStructure/TemplateData/flowSchema/components/upload/relate/libs/template.ejs +5 -5
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/handler/template.ejs +28 -5
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +11 -11
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +16 -16
- package/src/reStructure/TemplateData/flowSchema/register/complete/handler/template.ejs +3 -0
- package/src/reStructure/TemplateData/flowSchema/register/complete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/handler/template.ejs +4 -0
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/mainFunction/template.ejs +36 -7
- package/src/reStructure/TemplateData/perActionEndpoint/handler/api/template.ejs +2 -2
- package/src/reStructure/TemplateData/perActionEndpoint/handler/dsq/template.ejs +2 -2
- package/src/reStructure/TemplateData/perActionEndpoint/handler/sqs/template.ejs +2 -2
- package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/data.js +1 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/api/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/dsq/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/sqs/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +6 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/api/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/dsq/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/sqs/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/api/template.ejs +23 -23
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/dsq/template.ejs +18 -16
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/inv/template.ejs +14 -12
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/sqs/template.ejs +21 -19
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +2 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/handler/sqs/template.ejs +3 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/api/template.ejs +24 -22
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/dsq/template.ejs +21 -17
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/inv/template.ejs +21 -19
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/sqs/template.ejs +20 -20
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/handler/sqs/template.ejs +1 -1
|
@@ -56,7 +56,9 @@ module.exports.createPresignUrl = async (
|
|
|
56
56
|
returnMessage,
|
|
57
57
|
errorsFound,
|
|
58
58
|
passStatus,
|
|
59
|
-
|
|
59
|
+
//(<additionalProperties>)
|
|
60
|
+
//(</additionalProperties>)
|
|
61
|
+
passBackProperties = {}
|
|
60
62
|
) => {
|
|
61
63
|
|
|
62
64
|
try {
|
|
@@ -75,32 +77,18 @@ module.exports.createPresignUrl = async (
|
|
|
75
77
|
const correlationId = _izContext.correlationIds.get(consts.X_CORRELATION_ID)
|
|
76
78
|
const connectionId = _izContext.correlationIds.get(consts.CONNECTION_ID)
|
|
77
79
|
|
|
78
|
-
|
|
79
|
-
let importBatchMain = await lambda.invokeSync(_izContext,
|
|
80
|
+
let getResult = await lambda.invokeSync(_izContext,
|
|
80
81
|
await lambdaSharedLib.lambdaFunctionName(_izContext, "GetHdrInv"),
|
|
81
82
|
{
|
|
82
|
-
identifiers: {
|
|
83
|
-
importBatchId: servicePendingId
|
|
84
|
-
},
|
|
85
83
|
objectType: objType.objectType
|
|
84
|
+
//(<identifiers>)
|
|
85
|
+
//(</identifiers>)
|
|
86
86
|
}
|
|
87
87
|
)
|
|
88
|
-
_izContext.logger.debug("
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
} = importBatchMain.identifiers
|
|
93
|
-
|
|
94
|
-
const {
|
|
95
|
-
importBatchStatus,
|
|
96
|
-
importConfigId,
|
|
97
|
-
fileName,
|
|
98
|
-
fileSize,
|
|
99
|
-
importType,
|
|
100
|
-
startTime,
|
|
101
|
-
submittedByUserId,
|
|
102
|
-
userId
|
|
103
|
-
} = importBatchMain.fields
|
|
88
|
+
_izContext.logger.debug("getResult", getResult);
|
|
89
|
+
|
|
90
|
+
//(<afterGetResult>)
|
|
91
|
+
//(</afterGetResult>)
|
|
104
92
|
|
|
105
93
|
let uniqueIdentify = getNestObject(
|
|
106
94
|
_izContext,
|
|
@@ -112,10 +100,8 @@ module.exports.createPresignUrl = async (
|
|
|
112
100
|
await dynamodbSharedLib.putItem(_izContext,
|
|
113
101
|
await dynamodbSharedLib.tableName(_izContext, "ReservedDataMain"),
|
|
114
102
|
{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
reservedValue: fileSize,
|
|
118
|
-
uniqueIdentify: uniqueIdentify
|
|
103
|
+
//(<createReservedDataMain>)
|
|
104
|
+
//(</createReservedDataMain>)
|
|
119
105
|
}
|
|
120
106
|
);
|
|
121
107
|
|
|
@@ -125,38 +111,38 @@ module.exports.createPresignUrl = async (
|
|
|
125
111
|
_izContext.logger.debug("reserved has reach limit");
|
|
126
112
|
|
|
127
113
|
errorsFound.push("reserved has reach limit")
|
|
128
|
-
// update
|
|
129
|
-
let
|
|
114
|
+
// update status
|
|
115
|
+
let updateStatusField = {
|
|
130
116
|
objInstanceFull: {
|
|
131
117
|
identifiers: {
|
|
132
|
-
|
|
118
|
+
//(<identifiers>)
|
|
119
|
+
//(</identifiers>)
|
|
133
120
|
},
|
|
134
121
|
fields: {
|
|
135
|
-
|
|
136
|
-
|
|
122
|
+
//(<fields>)
|
|
123
|
+
//(</fields>)
|
|
137
124
|
}
|
|
138
125
|
},
|
|
139
126
|
objType: objType.objectType
|
|
140
127
|
}
|
|
141
128
|
|
|
142
|
-
let
|
|
143
|
-
Message: JSON.stringify(
|
|
129
|
+
let sendMessageToUpdateEndpoint = {
|
|
130
|
+
Message: JSON.stringify(updateStatusField),
|
|
144
131
|
TopicArn: await snsSharedLib.snsTopicArn(_izContext, `Update_In`)
|
|
145
132
|
}
|
|
146
|
-
_izContext.logger.debug("
|
|
133
|
+
_izContext.logger.debug("sendMessageToUpdateEndpoint", sendMessageToUpdateEndpoint);
|
|
147
134
|
|
|
148
135
|
// cancel reserved
|
|
149
136
|
|
|
150
|
-
|
|
151
137
|
let cancelReservedMsg = {
|
|
152
|
-
userId:
|
|
138
|
+
userId: _izContext.correlationIds.get(coreConsts.BASE_USER_ID),
|
|
153
139
|
limitTag: returnMessage.limitTag,
|
|
154
140
|
uniqueIdentify: uniqueIdentify
|
|
155
141
|
};
|
|
156
142
|
|
|
157
143
|
let sendMessageToCancelReserved = {
|
|
158
144
|
Message: JSON.stringify(cancelReservedMsg),
|
|
159
|
-
TopicArn: await snsSharedLib.snsTopicArn(_izContext, '
|
|
145
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, 'CancelUsage_In', EXTERNAL_SERVICE_NAME.accountLimits)
|
|
160
146
|
};
|
|
161
147
|
|
|
162
148
|
_izContext.logger.debug("sendMessageToCancelReserved", sendMessageToCancelReserved);
|
|
@@ -173,22 +159,23 @@ module.exports.createPresignUrl = async (
|
|
|
173
159
|
)
|
|
174
160
|
}
|
|
175
161
|
|
|
176
|
-
//
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const Key = `${fileName}.${importType}`
|
|
162
|
+
//(<createKeyForUploadFile>)
|
|
163
|
+
const Key = `${fileName}.${importType}`
|
|
164
|
+
//(</createKeyForUploadFile>)
|
|
180
165
|
|
|
181
166
|
const maximumSize = fileSize * 1048576 // convert to byte unit for restrict
|
|
182
167
|
_izContext.logger.debug("maximumSize", maximumSize);
|
|
183
168
|
|
|
184
169
|
// create PresignUrl
|
|
185
170
|
let createPresignUrlParam = {
|
|
186
|
-
Bucket: "
|
|
171
|
+
Bucket: "<%- bucketName %>",
|
|
187
172
|
Key: Key,
|
|
188
173
|
Conditions: [
|
|
174
|
+
//(<conditionCreateUrlLink>)
|
|
189
175
|
["content-length-range", 0, maximumSize],
|
|
190
176
|
["starts-with", "$Content-Type", "file/csv"],
|
|
191
177
|
["eq", "$x-amz-meta-importBatchId", importBatchId]
|
|
178
|
+
//(</conditionCreateUrlLink>)
|
|
192
179
|
],
|
|
193
180
|
fields: {},
|
|
194
181
|
expires: 86400
|
|
@@ -197,15 +184,18 @@ module.exports.createPresignUrl = async (
|
|
|
197
184
|
|
|
198
185
|
const uploadUrl = await createPresignedPost(client, createPresignUrlParam);
|
|
199
186
|
|
|
200
|
-
|
|
201
|
-
|
|
187
|
+
//(<modifyUploadLinkField>)
|
|
188
|
+
uploadUrl.fields['x-amz-meta-importBatchId'] = importBatchId;
|
|
189
|
+
uploadUrl.fields['Content-Type'] = `file/${importType}`;
|
|
190
|
+
//(</modifyUploadLinkField>)
|
|
202
191
|
|
|
203
192
|
_izContext.logger.debug('uploadUrlLimitSize: ', uploadUrl) // return as object type = {url, fields}
|
|
204
193
|
|
|
205
194
|
// update to waiting to upload
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
195
|
+
//(<checkStatusField>)
|
|
196
|
+
if (status === "processing") {
|
|
197
|
+
//(</checkStatusField>)
|
|
198
|
+
let messageObject = {
|
|
209
199
|
objInstanceFull: {
|
|
210
200
|
identifiers: {
|
|
211
201
|
importBatchId: importBatchId
|
|
@@ -218,8 +208,8 @@ module.exports.createPresignUrl = async (
|
|
|
218
208
|
objectType: objType,objectType
|
|
219
209
|
}
|
|
220
210
|
|
|
221
|
-
|
|
222
|
-
|
|
211
|
+
messageObject = callingFlowSharedLib.addCallingFlowToSnsRequestMessageObject(
|
|
212
|
+
messageObject,
|
|
223
213
|
callingFlowSharedLib.addParentCallingFlowConfig(
|
|
224
214
|
returnMessage, // resive parent callingFlowConfig.
|
|
225
215
|
callingFlowSharedLib.createCallingFlowConfig( // calling flow own service
|
|
@@ -228,14 +218,14 @@ module.exports.createPresignUrl = async (
|
|
|
228
218
|
)
|
|
229
219
|
);
|
|
230
220
|
|
|
231
|
-
_izContext.logger.debug("after add callingFlow",
|
|
221
|
+
_izContext.logger.debug("after add callingFlow", messageObject)
|
|
232
222
|
|
|
233
|
-
let
|
|
234
|
-
Message: JSON.stringify(
|
|
235
|
-
TopicArn: await snsSharedLib.snsTopicArn(_izContext,
|
|
223
|
+
let sendMessageToUpdateEndpoint = {
|
|
224
|
+
Message: JSON.stringify(messageObject),
|
|
225
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, "Update_In")
|
|
236
226
|
}
|
|
237
|
-
_izContext.logger.debug("
|
|
238
|
-
await sns.publishAsync(_izContext,
|
|
227
|
+
_izContext.logger.debug("sendMessageToUpdateEndpoint", sendMessageToUpdateEndpoint);
|
|
228
|
+
await sns.publishAsync(_izContext, sendMessageToUpdateEndpoint);
|
|
239
229
|
|
|
240
230
|
await dynamodbSharedLib.updateItem(_izContext,
|
|
241
231
|
await dynamodbSharedLib.tableName(_izContext, "WebSocketTask"),
|
|
@@ -78,7 +78,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
78
78
|
//validate message (and MessageAttributes)
|
|
79
79
|
await recordHandlerSharedLib.validateRecord(
|
|
80
80
|
record, // one record will send to mainFunction
|
|
81
|
-
"
|
|
81
|
+
"ReservedLimitHdrSqs", // queue name that need to retry or send to dlq
|
|
82
82
|
perRecordsValidatorSchema, // schema for record.Message
|
|
83
83
|
// messageAttributeValidatorSchema // ----- for msgAttr default is null -> do not send this parameter if not want to validate msgAtt
|
|
84
84
|
);
|
|
@@ -86,6 +86,8 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
86
86
|
// add argument (to invoke lambda) to passOnProperties[]
|
|
87
87
|
passOnProperties.push(record.body.Message.objType)
|
|
88
88
|
passOnProperties.push(record.body.Message.objInstanceFull)
|
|
89
|
+
//(<additionalProperties>)
|
|
90
|
+
//(</additionalProperties>)
|
|
89
91
|
passOnProperties.push(callingFlowSharedLib.addPassBackPropertiesToPassOnProperties(record.body.Message)) // is Ok PassBackProperties
|
|
90
92
|
// passOnProperties.push(callingFlowSharedLib.addCallingFlowToPassOnProperties(record.body.Message)) // is Ok callinfFlow
|
|
91
93
|
record._izContext.logger.debug('passOnProperties in handler', passOnProperties);
|
|
@@ -94,7 +96,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
94
96
|
let recordPromise = recordHandlerSharedLib.recordHandler(
|
|
95
97
|
record, // one record will send to mainFunction
|
|
96
98
|
reservedLimit.reservedLimit, // mainFunction that need to invoke.
|
|
97
|
-
"
|
|
99
|
+
"ReservedLimitHdrSqs", // queue name that need to retry or send to dlq
|
|
98
100
|
passOnProperties, // all parameters that mainFunction needed.
|
|
99
101
|
);
|
|
100
102
|
record._izContext.logger.debug('after recordPromise in handler');
|
|
@@ -114,7 +116,7 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
114
116
|
Logger.debug('after Promise.all(recordPromises) in handler');
|
|
115
117
|
|
|
116
118
|
} catch (err) {
|
|
117
|
-
Logger.error('Unhandled Error,
|
|
119
|
+
Logger.error('Unhandled Error, ReservedLimitHdrSqs: ', err);
|
|
118
120
|
throw (err);
|
|
119
121
|
}
|
|
120
122
|
});
|
|
@@ -22,6 +22,7 @@ const path = require('path');
|
|
|
22
22
|
const templatePath = path.join(__dirname, "./template.ejs")
|
|
23
23
|
const { firstLetterUpperCase: upperCase } = require('../../../../../../../../MainLibs/src/Utils')
|
|
24
24
|
const { SOURCE_PATH, FUNCTION_NAME } = require('../../../../../../../../MainLibs/src/Consts');
|
|
25
|
+
const getObjectSchema = require('@izara_project/izara-core-library-service-schemas').getObjectSchema;
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* receive objectSchema
|
|
@@ -30,11 +31,11 @@ const { SOURCE_PATH, FUNCTION_NAME } = require('../../../../../../../../MainLibs
|
|
|
30
31
|
* @return {{ templatePath, templateData, setting } }
|
|
31
32
|
*/
|
|
32
33
|
|
|
33
|
-
function data(_izContext, flowSchema, srcPath) {
|
|
34
|
-
return [createSourceParams(_izContext, flowSchema, srcPath)]
|
|
34
|
+
async function data(_izContext, flowSchema, srcPath) {
|
|
35
|
+
return [await createSourceParams(_izContext, flowSchema, srcPath)]
|
|
35
36
|
}
|
|
36
37
|
|
|
37
|
-
function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
38
|
+
async function createSourceParams(_izContext, flowSchema, srcPath) {
|
|
38
39
|
let functionName = upperCase(FUNCTION_NAME.reservedLimit)
|
|
39
40
|
return {
|
|
40
41
|
templatePath: templatePath,
|
|
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20
20
|
const callingFlowSharedLib = require('@izara_project/izara-core-library-calling-flow');
|
|
21
21
|
const lambdaSharedLib = require('@izara_project/izara-core-library-lambda');
|
|
22
22
|
const snsSharedLib = require('@izara_project/izara-core-library-sns');
|
|
23
|
-
|
|
23
|
+
const asyncFlowSharedLib = require("@izara_project/izara-core-library-asynchronous-flow")
|
|
24
24
|
const externalRequest = require('@izara_project/izara-core-library-external-request')
|
|
25
25
|
const sns = externalRequest.sns;
|
|
26
26
|
const lambda = externalRequest.lambda
|
|
@@ -45,6 +45,8 @@ module.exports.reservedLimit = async (
|
|
|
45
45
|
_izContext,
|
|
46
46
|
objType,
|
|
47
47
|
objInstanceFull,
|
|
48
|
+
//(<additionalProperties>)
|
|
49
|
+
//(</additionalProperties>)
|
|
48
50
|
callingFlowConfig = {}
|
|
49
51
|
) => {
|
|
50
52
|
|
|
@@ -55,19 +57,9 @@ module.exports.reservedLimit = async (
|
|
|
55
57
|
objInstanceFull,
|
|
56
58
|
callingFlowConfig
|
|
57
59
|
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
importConfigId,
|
|
62
|
-
importBatchStatus,
|
|
63
|
-
importType,
|
|
64
|
-
fileName,
|
|
65
|
-
fileSize,
|
|
66
|
-
startTime
|
|
67
|
-
} = objInstanceFull.fields
|
|
68
|
-
const {
|
|
69
|
-
importBatchId
|
|
70
|
-
} = objInstanceFull.identifiers
|
|
60
|
+
|
|
61
|
+
//(<beforeReserved>)
|
|
62
|
+
//(</beforeReserved>)
|
|
71
63
|
|
|
72
64
|
let connectionId = _izContext.correlationIds.get(coreConsts.CONNECTION_ID)
|
|
73
65
|
//* hard code
|
|
@@ -75,23 +67,16 @@ module.exports.reservedLimit = async (
|
|
|
75
67
|
|
|
76
68
|
// get static
|
|
77
69
|
let payloadBeforeInvokeStaticLimit = {
|
|
78
|
-
userId:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
targetUserId: submittedByUserId,
|
|
83
|
-
callingFlow: "BasDev",
|
|
84
|
-
callingFlowProperties: {}
|
|
70
|
+
userId: _izContext.correlationIds.get(coreConsts.BASE_USER_ID),
|
|
71
|
+
targetUserId: _izContext.correlationIds.get(coreConsts.TARGET_ID),
|
|
72
|
+
//(<additionalPropertiesStaticLimit>)
|
|
73
|
+
//(</additionalPropertiesStaticLimit>)
|
|
85
74
|
}
|
|
86
75
|
|
|
87
|
-
let res = await importDataLibs.
|
|
76
|
+
let res = await importDataLibs.processStaticLimit(_izContext,
|
|
88
77
|
await lambdaSharedLib.lambdaFunctionName(_izContext, "StaticLimitProcessHdrInv", consts.EXTERNAL_SERVICE_NAME.accountLimits),
|
|
89
78
|
payloadBeforeInvokeStaticLimit
|
|
90
79
|
)
|
|
91
|
-
// let res = await lambda.invokeSync(_izContext,
|
|
92
|
-
// await lambdaSharedLib.lambdaFunctionName(_izContext, "StaticLimitProcessHdrInv", consts.EXTERNAL_SERVICE_NAME.accountLimits),
|
|
93
|
-
// payloadBeforeInvokeStaticLimit
|
|
94
|
-
// )
|
|
95
80
|
|
|
96
81
|
_izContext.logger.debug("res::", res);
|
|
97
82
|
|
|
@@ -99,27 +84,20 @@ module.exports.reservedLimit = async (
|
|
|
99
84
|
importDataLibs.postToConnection({ message: "static limit over" }, connectionId)
|
|
100
85
|
}
|
|
101
86
|
|
|
102
|
-
|
|
103
87
|
// reservedDynamic
|
|
104
88
|
|
|
105
89
|
let sendMsgReservedDynamic = {
|
|
106
|
-
userId:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
usedTimestamp: startTime,
|
|
111
|
-
targetUserId: submittedByUserId
|
|
90
|
+
userId: _izContext.correlationIds.get(coreConsts.BASE_USER_ID),
|
|
91
|
+
targetUserId: _izContext.correlationIds.get(coreConsts.TARGET_ID)
|
|
92
|
+
//(<additionalPropertiesReservedDynamic>)
|
|
93
|
+
//(</additionalPropertiesReservedDynamic>)
|
|
112
94
|
}
|
|
113
95
|
|
|
114
96
|
const reservedDataId = `${consts.ACCOUNTLIMIT_TAG.reservedDynamic}_${userId}_${consts.LIMIT_TAG.uploadData}`
|
|
115
97
|
|
|
116
98
|
let callingFlowProperties = {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
reservedDataId: reservedDataId
|
|
120
|
-
},
|
|
121
|
-
importConfigId: importConfigId,
|
|
122
|
-
objType: objType
|
|
99
|
+
//(<baseCallingFlowProperties>)
|
|
100
|
+
//(</baseCallingFlowProperties>)
|
|
123
101
|
}
|
|
124
102
|
|
|
125
103
|
_izContext.logger.debug("callingFlowProperties", callingFlowProperties);
|
|
@@ -149,9 +127,22 @@ module.exports.reservedLimit = async (
|
|
|
149
127
|
);
|
|
150
128
|
}
|
|
151
129
|
|
|
130
|
+
// create awaitingSteps
|
|
131
|
+
await asyncFlowSharedLib.createAwaitingStep(_izContext,
|
|
132
|
+
asyncFlowSharedLib.createAwaitingStepId(
|
|
133
|
+
//(<createAwaitStepId>)
|
|
134
|
+
//(</createAwaitStepId>)
|
|
135
|
+
),
|
|
136
|
+
asyncFlowSharedLib.createPendingStepId(
|
|
137
|
+
//(<createPendingStepId>)
|
|
138
|
+
//(</createPendingStepId>)
|
|
139
|
+
)
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
|
|
152
143
|
let sendMessageToReservedDynamic = {
|
|
153
144
|
Message: JSON.stringify(sendMsgReservedDynamic),
|
|
154
|
-
TopicArn: await snsSharedLib.snsTopicArn(_izContext, "
|
|
145
|
+
TopicArn: await snsSharedLib.snsTopicArn(_izContext, "ReservedDynamicUsage_In", consts.EXTERNAL_SERVICE_NAME.accountLimits)
|
|
155
146
|
};
|
|
156
147
|
_izContext.logger.debug("sendMessageToReservedDynamic", sendMessageToReservedDynamic);
|
|
157
148
|
await sns.publishAsync(_izContext, sendMessageToReservedDynamic);
|
|
@@ -37,6 +37,8 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
37
37
|
event._izContext, // correlationId/logger/integrationTestDetail/uniqueRequestId/userId
|
|
38
38
|
event.Records[0].s3.bucket,
|
|
39
39
|
event.Records[0].s3.object,
|
|
40
|
+
//(<additionalProperties>)
|
|
41
|
+
//(</additionalProperties>)
|
|
40
42
|
);
|
|
41
43
|
|
|
42
44
|
if (processImageResponse instanceof Error) {
|
|
@@ -49,20 +51,4 @@ module.exports.main = middleware.wrap(async (event, context, callback) => {
|
|
|
49
51
|
event._izContext.logger.error('Error, processAfterUploadHdrS3: ', err);
|
|
50
52
|
return (izara.response.failure(err));
|
|
51
53
|
}
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
//
|
|
55
|
-
// s3: {
|
|
56
|
-
// s3SchemaVersion: '1.0',
|
|
57
|
-
// configurationId: 'ImageStandardTestProcessImageFileHdrS3-68a737133cefb25bff959852b8f04754',
|
|
58
|
-
// bucket: {
|
|
59
|
-
// name: 'image-test-importdata',
|
|
60
|
-
// ownerIdentity: { principalId: 'A3CDE97VJKTOJ0' },
|
|
61
|
-
// arn: 'arn:aws:s3:::image-test-importdata'
|
|
62
|
-
// },
|
|
63
|
-
// object: {
|
|
64
|
-
// key: 'image_8733685.png',
|
|
65
|
-
// size: 2974746,
|
|
66
|
-
// eTag: '93e940d895c26ef90b7542da54d61898',
|
|
67
|
-
// sequencer: '00650D4EEAD0F63EB5'
|
|
68
|
-
// }
|
|
54
|
+
});
|