@izara_project/izara-core-generate-service-code 1.0.38 → 1.0.40
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 +6 -6
- package/src/generateCode/generateFlowStepWithPlugIn/afterFirstFlowStep/recievePlugIn/handler/data.js +7 -1
- package/src/generateCode/generateFlowStepWithPlugIn/afterFirstFlowStep/recievePlugIn/handler/templateWebSocket.ejs +2 -0
- package/src/generateCode/generateFlowStepWithPlugIn/afterFirstFlowStep/recievePlugIn/mainFunction/data.js +7 -1
- package/src/generateCode/generateFlowStepWithPlugIn/afterFirstFlowStep/recievePlugIn/mainFunction/template.ejs +1 -1
- package/src/generateCode/generateFlowStepWithPlugIn/byConfig/handler/data.js +56 -0
- package/src/generateCode/generateFlowStepWithPlugIn/byConfig/handler/templateAwaitingStep.ejs +105 -0
- package/src/generateCode/generateFlowStepWithPlugIn/byConfig/handler/templatePaginated.ejs +137 -0
- package/src/generateCode/generateFlowStepWithPlugIn/byConfig/mainFunction/data.js +57 -0
- package/src/generateCode/generateFlowStepWithPlugIn/byConfig/mainFunction/templateAwaitingStep.ejs +129 -0
- package/src/generateCode/generateFlowStepWithPlugIn/byConfig/mainFunction/templatePaginated.ejs +59 -0
- package/src/generateCode/generateFlowStepWithPlugIn/byConfig/sns-sqs/data.js +50 -0
- package/src/generateCode/generateFlowStepWithPlugIn/byConfig/sns-sqs/queueNoTopic.ejs +43 -0
- package/src/generateCode/generateFlowStepWithPlugIn/byConfig/sns-sqs/snsTemplate.ejs +58 -0
- package/src/generateCode/generateFlowStepWithPlugIn/byConfig/sns-sqs/sqsTemplate.ejs +43 -0
- package/src/generateCode/generateFlowStepWithPlugIn/byConfig/yaml/data.js +47 -0
- package/src/generateCode/generateFlowStepWithPlugIn/byConfig/yaml/template.ejs +43 -0
- package/src/generateCode/generateFlowStepWithPlugIn/firstFlowStep/handler/data.js +7 -1
- package/src/generateCode/generateFlowStepWithPlugIn/firstFlowStep/mainFunction/data.js +45 -7
- package/src/generateCode/generateFlowStepWithPlugIn/firstFlowStep/mainFunction/template.ejs +5 -16
- package/src/generateCode/generateFlowStepWithPlugIn/firstFlowStep/mainFunction/templateByConfig/awaitingSteps.ejs +63 -0
- package/src/generateCode/generateFlowStepWithPlugIn/firstFlowStep/mainFunction/templateByConfig/templateSendPlugin.ejs +18 -0
- package/src/generateCode/generateFlowStepWithPlugIn/firstFlowStep/queueNtopic/sqsTemplate.ejs +7 -7
- package/src/generateCode/generateFlowStepWithPlugIn/firstFlowStep/topicOut/data.js +1 -1
- package/src/generateCode/generateFlowStepWithPlugIn/index(old).js +290 -0
- package/src/generateCode/generateFlowStepWithPlugIn/index.js +414 -151
- package/src/generateCode/generateInitialSetup/externalServiceComponent/lambdaRole/data.js +22 -0
- package/src/generateCode/generateInitialSetup/externalServiceComponent/snsTopicSubscriptions/data.js +16 -0
- package/src/generateCode/generateSchema/actionEndpointCompleteComponent/create/mainFunction/template.ejs +44 -4
- package/src/generateCode/generateSchema/actionEndpointComponent/mainFunction/create/main/template.ejs +58 -40
- package/src/libs/Consts.js +1 -1
- package/src/libs/Libs.js +22 -15
- package/src/generateCode/generateInitialSetup/externalServiceComponent/lambdaRole/request.json +0 -18
- package/src/generateCode/generateInitialSetup/externalServiceComponent/snsTopicSubscriptions/request.json +0 -12
|
@@ -20,7 +20,6 @@ import callingFlowSharedLib from '@izara_project/izara-core-library-calling-flow
|
|
|
20
20
|
import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
|
|
21
21
|
import snsSharedLib from '@izara_project/izara-core-library-sns';
|
|
22
22
|
import { sns } from '@izara_project/izara-core-library-external-request';
|
|
23
|
-
import _ from 'lodash';
|
|
24
23
|
import { objectHash as hash } from '@izara_project/izara-shared-core';
|
|
25
24
|
import { consts } from '@izara_project/izara-core-library-service-schemas';
|
|
26
25
|
import { NoRetryError } from '@izara_project/izara-core-library-core';
|
|
@@ -81,6 +80,30 @@ function validateInput(returnValue, status, graphServiceTag, errorsFound) {
|
|
|
81
80
|
}
|
|
82
81
|
}
|
|
83
82
|
|
|
83
|
+
/**
|
|
84
|
+
* @param {*} value
|
|
85
|
+
*/
|
|
86
|
+
function isEmpty(value) {
|
|
87
|
+
if (value == null) return true;
|
|
88
|
+
|
|
89
|
+
if (
|
|
90
|
+
Array.isArray(value) ||
|
|
91
|
+
typeof value === 'string'
|
|
92
|
+
) {
|
|
93
|
+
return value.length === 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (value instanceof Map || value instanceof Set) {
|
|
97
|
+
return value.size === 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (typeof value === 'object') {
|
|
101
|
+
return Object.keys(value).length === 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
|
|
84
107
|
/**
|
|
85
108
|
* @param {*} returnValue
|
|
86
109
|
* @returns {object|null}
|
|
@@ -184,7 +207,7 @@ export default async function createObjectComplete(
|
|
|
184
207
|
passBackProperties,
|
|
185
208
|
});
|
|
186
209
|
|
|
187
|
-
if (
|
|
210
|
+
if (isEmpty(returnValue.requestParams)) {
|
|
188
211
|
_izContext.logger.debug('message callingFlowProperties is empty');
|
|
189
212
|
throw new NoRetryError('message not an object');
|
|
190
213
|
}
|
|
@@ -220,17 +243,34 @@ export default async function createObjectComplete(
|
|
|
220
243
|
_izContext.logger.debug('record awaitingSteps::', recordAwaitingSteps);
|
|
221
244
|
|
|
222
245
|
await Promise.all(
|
|
223
|
-
recordAwaitingSteps.Items.map(async (
|
|
246
|
+
recordAwaitingSteps.Items.map(async (recordAwaitingStep) => {
|
|
224
247
|
if (
|
|
225
248
|
await asyncFlowSharedLib.checkAllAwaitingStepsFinished(
|
|
226
249
|
_izContext,
|
|
227
|
-
pendingStepId,
|
|
250
|
+
recordAwaitingStep.pendingStepId,
|
|
228
251
|
awaitingStepId,
|
|
229
252
|
errorsFound,
|
|
230
253
|
)
|
|
231
254
|
) {
|
|
232
255
|
_izContext.logger.debug('finish all awaitingStep');
|
|
233
256
|
|
|
257
|
+
await Promise.all(
|
|
258
|
+
recordAwaitingStep.listOfRecords.map(async (listOfRecords) => {
|
|
259
|
+
Object.entries(listOfRecords).map(async ([tableName, record]) => {
|
|
260
|
+
await dynamodbSharedLib.putItem(
|
|
261
|
+
_izContext,
|
|
262
|
+
dynamodbSharedLib.tableName(_izContext,
|
|
263
|
+
tableName,
|
|
264
|
+
record.serviceTag
|
|
265
|
+
),
|
|
266
|
+
{
|
|
267
|
+
...record.objInstanceFull.identifiers,
|
|
268
|
+
...record.objInstanceFull.fields
|
|
269
|
+
}
|
|
270
|
+
);
|
|
271
|
+
})
|
|
272
|
+
}))
|
|
273
|
+
|
|
234
274
|
const messageObject = buildMessageObject(
|
|
235
275
|
returnValue,
|
|
236
276
|
existsNode,
|
|
@@ -15,7 +15,6 @@ You should have received a copy of the GNU Affero General Public License
|
|
|
15
15
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import lodash from 'lodash';
|
|
19
18
|
import { objectHash as hash } from '@izara_project/izara-shared-core';
|
|
20
19
|
import dynamodbSharedLib from '@izara_project/izara-core-library-dynamodb';
|
|
21
20
|
import snsSharedLib from '@izara_project/izara-core-library-sns';
|
|
@@ -40,9 +39,9 @@ const { dynamoDbIdentifiersByStorageResource, createIdentifiersByUseCase } = ide
|
|
|
40
39
|
const { TOPIC_NAME_GENERATE_CODE, TOPIC_NAME_GRAPH_HANDLER } = consts;
|
|
41
40
|
|
|
42
41
|
const PREFIX = {
|
|
43
|
-
ONE:
|
|
44
|
-
MANY:
|
|
45
|
-
CREATE_OBJECT_ASYNC:
|
|
42
|
+
ONE: 'one',
|
|
43
|
+
MANY: 'many',
|
|
44
|
+
CREATE_OBJECT_ASYNC: 'createObjectAsync',
|
|
46
45
|
CREATE_OBJECT_ASYNC_COMPLETE: 'createObjectAsyncComplete',
|
|
47
46
|
CREATE_OBJECT_EXTERNAL_TOPIC: 'createObjectExternalTopic'
|
|
48
47
|
};
|
|
@@ -56,7 +55,7 @@ const PREFIX = {
|
|
|
56
55
|
* @param {Object} beforeLogicalResults - Results from beforeLogical
|
|
57
56
|
* @returns {Promise<Object>} Result with objType, objInstanceFull, relationships, status, errorsFound
|
|
58
57
|
*/
|
|
59
|
-
|
|
58
|
+
export async function createMainLogical(
|
|
60
59
|
_izContext,
|
|
61
60
|
requestParams,
|
|
62
61
|
callingFlowConfig = {},
|
|
@@ -90,7 +89,7 @@ const PREFIX = {
|
|
|
90
89
|
|
|
91
90
|
// ── Detect invocation type ────────────────────────────────────────────────
|
|
92
91
|
const directInvoke = requestParams.hasOwnProperty('__context__') &&
|
|
93
|
-
|
|
92
|
+
requestParams.izEventSource?.eventSourceTag === 'DirectInvoke';
|
|
94
93
|
|
|
95
94
|
// ── Build createDataDetails ───────────────────────────────────────────────
|
|
96
95
|
const createDataDetails = await createDataDetailsLib(_izContext, objectSchemas);
|
|
@@ -122,11 +121,12 @@ const PREFIX = {
|
|
|
122
121
|
}
|
|
123
122
|
|
|
124
123
|
// ── Process storage resources ─────────────────────────────────────────────
|
|
125
|
-
const objInstanceFullForDynamoDb
|
|
126
|
-
const objInstanceFullForGraph
|
|
127
|
-
const objInstanceFullForExternalTopic =
|
|
128
|
-
const allAwaitingStepsId
|
|
129
|
-
const listOfObjectForCreates
|
|
124
|
+
const objInstanceFullForDynamoDb = structuredClone(objInstanceFull);
|
|
125
|
+
const objInstanceFullForGraph = structuredClone(objInstanceFull);
|
|
126
|
+
const objInstanceFullForExternalTopic = structuredClone(objInstanceFull);
|
|
127
|
+
const allAwaitingStepsId = [];
|
|
128
|
+
const listOfObjectForCreates = [];
|
|
129
|
+
const listOfRecords = [];
|
|
130
130
|
|
|
131
131
|
if (errorsFound.length === 0) {
|
|
132
132
|
//(<validateBeforeCreate>)
|
|
@@ -146,7 +146,9 @@ const PREFIX = {
|
|
|
146
146
|
Object.assign(objInstanceFullForDynamoDb.fields, { [`${parentObject.objectType}HandlerServiceTag`]: process.env.iz_serviceTag });
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
Object.assign(objInstanceFullForDynamoDb.fields,
|
|
149
|
+
Object.assign(objInstanceFullForDynamoDb.fields,
|
|
150
|
+
createObjInstanceFullFieldsByStorageTag(_izContext, storageTag, createDataDetail));
|
|
151
|
+
|
|
150
152
|
_izContext.logger.debug('objInstanceFull before create item in dynamoDB', objInstanceFullForDynamoDb);
|
|
151
153
|
|
|
152
154
|
const identifiersForCreateData = await dynamoDbIdentifiersByStorageResource(
|
|
@@ -154,43 +156,59 @@ const PREFIX = {
|
|
|
154
156
|
);
|
|
155
157
|
_izContext.logger.debug('identifiersForCreateData', identifiersForCreateData);
|
|
156
158
|
|
|
157
|
-
await dynamodbSharedLib.putItem(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
);
|
|
162
|
-
|
|
163
|
-
|
|
159
|
+
// await dynamodbSharedLib.putItem(
|
|
160
|
+
// _izContext,
|
|
161
|
+
// await dynamodbSharedLib.tableName(_izContext, createDataDetail.tableName, createDataDetail.serviceTag),
|
|
162
|
+
// { ...identifiersForCreateData, ...objInstanceFullForDynamoDb.fields }
|
|
163
|
+
// );
|
|
164
|
+
|
|
165
|
+
listOfRecords.push({
|
|
166
|
+
[createDataDetail.tableName]: {
|
|
167
|
+
serviceTag: createDataDetail.serviceTag,
|
|
168
|
+
objInstanceFull: {
|
|
169
|
+
identifiers: identifiersForCreateData,
|
|
170
|
+
fields: objInstanceFullForDynamoDb.fields
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
})
|
|
164
174
|
//(<afterCreateRecordDynamo>)
|
|
165
175
|
//(</afterCreateRecordDynamo>)
|
|
166
176
|
|
|
167
|
-
|
|
177
|
+
// ── Graph ─────────────────────────────────────────────────────────────
|
|
168
178
|
} else if (createDataDetail.storageType === consts.STORAGE_TYPES.graph) {
|
|
169
179
|
//(<beforeCreateNode>)
|
|
170
180
|
//(</beforeCreateNode>)
|
|
171
181
|
_izContext.logger.debug('::::::Graph::::::', { storageTag, objInstanceFull });
|
|
172
182
|
|
|
173
|
-
Object.assign(objInstanceFullForGraph.fields,
|
|
183
|
+
Object.assign(objInstanceFullForGraph.fields,
|
|
184
|
+
createObjInstanceFullFieldsByStorageTag(_izContext, storageTag, createDataDetail));
|
|
174
185
|
_izContext.logger.debug('objInstanceFull before send to Graph', objInstanceFullForGraph);
|
|
175
186
|
|
|
176
187
|
allAwaitingStepsId.push({
|
|
177
188
|
awaitingStepId: await asyncFlowSharedLib.createAwaitingStepId(
|
|
178
|
-
hash({ objType,
|
|
189
|
+
hash({ objType,
|
|
190
|
+
graphServerTag: storageTag,
|
|
191
|
+
identifiers: objInstanceFullForGraph.identifiers,
|
|
192
|
+
callingFlowProperties: callingFlowConfig.callingFlowProperties || {}
|
|
193
|
+
}),
|
|
179
194
|
PREFIX.CREATE_OBJECT_ASYNC
|
|
180
195
|
),
|
|
181
196
|
//(<additionalAttributeCreateNode>)
|
|
182
|
-
additionalAttributes: {}
|
|
197
|
+
additionalAttributes: { listOfRecords: listOfRecords }
|
|
183
198
|
//(</additionalAttributeCreateNode>)
|
|
184
199
|
});
|
|
185
200
|
|
|
186
201
|
listOfObjectForCreates.push({
|
|
187
202
|
[storageTag]: {
|
|
188
|
-
objInstanceFull:
|
|
203
|
+
objInstanceFull: {
|
|
204
|
+
identifiers: objInstanceFullForGraph.identifiers,
|
|
205
|
+
fields: objInstanceFullForGraph.fields
|
|
206
|
+
},
|
|
189
207
|
allStorageTagComplete: false
|
|
190
208
|
}
|
|
191
209
|
});
|
|
192
210
|
|
|
193
|
-
|
|
211
|
+
// ── External Topic ────────────────────────────────────────────────────
|
|
194
212
|
} else if (createDataDetail.storageType === consts.STORAGE_TYPES.externalTopic) {
|
|
195
213
|
_izContext.logger.debug('::::::externalTopic::::::', { storageTag, createDataDetail });
|
|
196
214
|
//(<beforeSendMessageToExternalTopic>)
|
|
@@ -210,7 +228,7 @@ const PREFIX = {
|
|
|
210
228
|
});
|
|
211
229
|
|
|
212
230
|
await sns.publishAsync(_izContext, {
|
|
213
|
-
Message:
|
|
231
|
+
Message: JSON.stringify(objInstanceFullForExternalTopic),
|
|
214
232
|
TopicArn: `arn:aws:sns:${createDataDetail.region}:${createDataDetail.accountId}:${createDataDetail.serviceTag}_${createDataDetail.stage}_Create_In`
|
|
215
233
|
});
|
|
216
234
|
}
|
|
@@ -272,7 +290,7 @@ const PREFIX = {
|
|
|
272
290
|
);
|
|
273
291
|
|
|
274
292
|
await sns.publishAsync(_izContext, {
|
|
275
|
-
Message:
|
|
293
|
+
Message: JSON.stringify(messageObject),
|
|
276
294
|
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GRAPH_HANDLER.inCreateNode, graphServiceName)
|
|
277
295
|
});
|
|
278
296
|
|
|
@@ -281,8 +299,8 @@ const PREFIX = {
|
|
|
281
299
|
return {
|
|
282
300
|
objType,
|
|
283
301
|
objInstanceFull: objInstanceFullForGraph,
|
|
284
|
-
relationships:
|
|
285
|
-
status:
|
|
302
|
+
relationships: requestParams.relationships || [],
|
|
303
|
+
status: 'complete',
|
|
286
304
|
errorsFound
|
|
287
305
|
};
|
|
288
306
|
}
|
|
@@ -307,7 +325,7 @@ const PREFIX = {
|
|
|
307
325
|
);
|
|
308
326
|
|
|
309
327
|
await sns.publishAsync(_izContext, {
|
|
310
|
-
Message:
|
|
328
|
+
Message: JSON.stringify(messageObject),
|
|
311
329
|
MessageAttributes: sns.createStringMessageAttributes(
|
|
312
330
|
_izContext,
|
|
313
331
|
callingFlowSharedLib.addCallingFlowToSnsResponseMessageAttributes(callingFlowConfig, {})
|
|
@@ -328,7 +346,7 @@ const PREFIX = {
|
|
|
328
346
|
if (callingFlowConfig[callingFlowSharedLib.consts.CALLINGFLOW_PROPERTYNAME]) {
|
|
329
347
|
_izContext.logger.debug('HAVE CallingFlow');
|
|
330
348
|
await sns.publishAsync(_izContext, {
|
|
331
|
-
Message:
|
|
349
|
+
Message: JSON.stringify(outMessage),
|
|
332
350
|
MessageAttributes: sns.createStringMessageAttributes(
|
|
333
351
|
_izContext,
|
|
334
352
|
callingFlowSharedLib.addCallingFlowToSnsResponseMessageAttributes(callingFlowConfig, {})
|
|
@@ -341,8 +359,8 @@ const PREFIX = {
|
|
|
341
359
|
return {
|
|
342
360
|
objType,
|
|
343
361
|
objInstanceFull: objInstanceFullForDynamoDb,
|
|
344
|
-
relationships:
|
|
345
|
-
status:
|
|
362
|
+
relationships: requestParams.relationships || [],
|
|
363
|
+
status: 'complete',
|
|
346
364
|
errorsFound
|
|
347
365
|
};
|
|
348
366
|
|
|
@@ -378,7 +396,7 @@ export default async function createMain(
|
|
|
378
396
|
// ── Resolve userId / targetId ─────────────────────────────────────────────
|
|
379
397
|
let userId, targetId;
|
|
380
398
|
if (objectSchema.generatedBy === 'userGenerated') {
|
|
381
|
-
userId
|
|
399
|
+
userId = _izContext.correlationIds.get(coreConsts.BASE_USER_ID);
|
|
382
400
|
targetId = _izContext.correlationIds.get(coreConsts.TARGET_ID);
|
|
383
401
|
if (!userId) errorsFound.push('Not have userId');
|
|
384
402
|
if (objectSchema.hasOwnProperty('belongTo') && !targetId) errorsFound.push('not have targetId');
|
|
@@ -444,12 +462,12 @@ export default async function createMain(
|
|
|
444
462
|
_izContext.logger.debug('errorsFound::', errorsFound);
|
|
445
463
|
|
|
446
464
|
if (errorsFound.length > 0)
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
465
|
+
return await createMainLogical(
|
|
466
|
+
_izContext,
|
|
467
|
+
requestParams,
|
|
468
|
+
callingFlowConfig,
|
|
469
|
+
errorsFound
|
|
470
|
+
);
|
|
453
471
|
|
|
454
472
|
// ── Validate fieldNames ───────────────────────────────────────────────────
|
|
455
473
|
const objInstanceFull = { identifiers: {}, fields: {} };
|
package/src/libs/Consts.js
CHANGED
|
@@ -94,7 +94,7 @@ const SOURCE_PATH = {
|
|
|
94
94
|
'src/generatedCode/CreateRecordComplete/',
|
|
95
95
|
|
|
96
96
|
// systemText
|
|
97
|
-
systemTextSchema: '
|
|
97
|
+
systemTextSchema: 'SystemTextSchemas/generatedCode/',
|
|
98
98
|
|
|
99
99
|
// rbac
|
|
100
100
|
rbac: '/src/generatedCode/Rbac/source/',
|
package/src/libs/Libs.js
CHANGED
|
@@ -120,28 +120,32 @@ function externalResourceName(resourceClass, resourceName, serviceTag) {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
function externalResourceYaml(resourceClass, resourceName, serviceTag) {
|
|
123
|
-
if (!serviceTag) {
|
|
124
|
-
|
|
125
|
-
} else {
|
|
126
|
-
|
|
127
|
-
}
|
|
123
|
+
// if (!serviceTag) {
|
|
124
|
+
// serviceTag = '${self:custom.iz_resourcePrefix}';
|
|
125
|
+
// } else {
|
|
126
|
+
// serviceTag = serviceTag + '${self:custom.iz_stage}';
|
|
127
|
+
// }
|
|
128
128
|
return {
|
|
129
129
|
[RESOURCE_CLASSES.dynamoDbTable]:
|
|
130
130
|
'arn:aws:dynamodb:${self:custom.iz_region}:${self:custom.iz_accountId}:table/' +
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
serviceTag ?
|
|
132
|
+
'${self:custom.iz_resourcePrefix}' : serviceTag + '${self:custom.iz_stage}' +
|
|
133
|
+
`${resourceName}`,
|
|
134
|
+
// `${serviceTag}` +
|
|
135
|
+
// `${resourceName}`,
|
|
133
136
|
[RESOURCE_CLASSES.lambda]:
|
|
134
137
|
'arn:aws:lambda:${self:custom.iz_region}:${self:custom.iz_accountId}:function:' +
|
|
135
|
-
|
|
136
|
-
|
|
138
|
+
serviceTag ?
|
|
139
|
+
'${self:custom.iz_resourcePrefix}' : serviceTag + '${self:custom.iz_stage}' +
|
|
140
|
+
`${resourceName}`,
|
|
137
141
|
[RESOURCE_CLASSES.sns]:
|
|
138
142
|
'arn:aws:sns:${self:custom.iz_region}:${self:custom.iz_accountId}:' +
|
|
139
|
-
`${serviceTag}` +
|
|
140
|
-
`${resourceName}`,
|
|
143
|
+
`${serviceTag}` + '_${self:custom.iz_stage}_' + `${resourceName}`,
|
|
141
144
|
[RESOURCE_CLASSES.sqs]:
|
|
142
145
|
'arn:aws:sqs:${self:custom.iz_region}:${self:custom.iz_accountId}:' +
|
|
143
|
-
|
|
144
|
-
|
|
146
|
+
serviceTag ?
|
|
147
|
+
'${self:custom.iz_resourcePrefix}' : serviceTag + '${self:custom.iz_stage}' +
|
|
148
|
+
`${resourceName}`,
|
|
145
149
|
}[resourceClass];
|
|
146
150
|
}
|
|
147
151
|
|
|
@@ -494,6 +498,7 @@ function createSnsResource(topicNames) {
|
|
|
494
498
|
resourceNames(RESOURCE_CLASSES.sns, topicName))
|
|
495
499
|
);
|
|
496
500
|
}
|
|
501
|
+
|
|
497
502
|
async function getLocalOrS3ObjectSchema(_izContext, objType, schemasPath) {
|
|
498
503
|
console.log("objType, schemasPath", objType, schemasPath)
|
|
499
504
|
const iz_serviceTag = getLocalConfig('iz_serviceTag');
|
|
@@ -528,7 +533,7 @@ async function getLocalOrS3ObjectSchema(_izContext, objType, schemasPath) {
|
|
|
528
533
|
async function getLocalOrS3FlowSchema(_izContext, flowType, schemasPath) {
|
|
529
534
|
const iz_serviceTag = getLocalConfig('iz_serviceTag');
|
|
530
535
|
const iz_serviceSchemaBucketName = getLocalConfig('iz_serviceSchemaBucketName');
|
|
531
|
-
|
|
536
|
+
console.log("schemasPath", schemasPath)
|
|
532
537
|
let flowSchema;
|
|
533
538
|
let errorMessage;
|
|
534
539
|
if (flowType.serviceTag === iz_serviceTag) {
|
|
@@ -551,7 +556,9 @@ async function getLocalOrS3FlowSchema(_izContext, flowType, schemasPath) {
|
|
|
551
556
|
flowType,
|
|
552
557
|
iz_serviceSchemaBucketName
|
|
553
558
|
);
|
|
554
|
-
|
|
559
|
+
if (!flowSchema) {
|
|
560
|
+
errorMessage = 's3 not exists';
|
|
561
|
+
}
|
|
555
562
|
}
|
|
556
563
|
return [flowSchema, errorMessage];
|
|
557
564
|
}
|