@izara_project/izara-market-library-service-schemas 1.0.67 → 1.0.68
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 +2 -0
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +21 -10
- package/src/reStructure/TemplateData/externalService/lambdaRole/data.js +8 -0
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +12 -1
- package/src/reStructure/TemplateData/findData/findDataYaml/data.js +2 -2
- package/src/reStructure/TemplateData/processLogical/yaml/data.js +2 -2
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/dsq/data.js +2 -2
- package/src/reStructure/TemplateData/processLogicalPagination/yaml/sqs/data.js +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/functionYaml/data.js +4 -4
- package/src/reStructure/TemplateData/relationshipPerAction/changeRelationship/action/mainFunction/template.ejs +4 -4
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js +1 -4
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/data.js +2 -1
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js +1 -4
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/functionYaml/data.js +2 -1
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +1 -4
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/functionYaml/data.js +2 -23
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/apiTemplate.ejs +15 -30
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/dsqTemplate.ejs +15 -30
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/invTemplate.ejs +15 -30
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/handler/templateByHandler/sqsTemplate.ejs +15 -30
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/action/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/relationshipPerAction/moveRelationship/complete/functionYaml/data.js +1 -4
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/data.js +2 -9
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +1 -4
- package/src/reStructure/TemplateData/resourceYaml/filterGenerateResource/data.js +1 -1
- package/src/reStructure/TemplateData/resourceYaml/generateTemplateData.js +1 -1
package/package.json
CHANGED
|
@@ -897,6 +897,8 @@ async function createDataDetailsLib(_izContext, objectSchemas, settings = { buck
|
|
|
897
897
|
fieldNames: [keyFieldName],
|
|
898
898
|
accountId: storageResources[eachStorageResourceTag].accountId,
|
|
899
899
|
region: storageResources[eachStorageResourceTag].region,
|
|
900
|
+
serviceTag: storageResources[eachStorageResourceTag].serviceTag,
|
|
901
|
+
stage: storageResources[eachStorageResourceTag].stage
|
|
900
902
|
}
|
|
901
903
|
});
|
|
902
904
|
}
|
|
@@ -67,7 +67,8 @@ const PREFIX = {
|
|
|
67
67
|
ONE: "one",
|
|
68
68
|
MANY: "many",
|
|
69
69
|
CREATE_OBJECT_ASYNC: "createObjectAsync",
|
|
70
|
-
CREATE_OBJECT_ASYNC_COMPLETE: "createObjectAsyncComplete"
|
|
70
|
+
CREATE_OBJECT_ASYNC_COMPLETE: "createObjectAsyncComplete",
|
|
71
|
+
CREATE_OBJECT_EXTERNAL_TOPIC: "createObjectExternalTopic"
|
|
71
72
|
}
|
|
72
73
|
//-----------------------------------------------------------------------------------------------------------
|
|
73
74
|
|
|
@@ -295,8 +296,9 @@ module.exports.createMain = async (
|
|
|
295
296
|
|
|
296
297
|
let listOfObjectForCreates = [];
|
|
297
298
|
|
|
298
|
-
let objInstanceFullForDynamoDb = lodash.cloneDeep(objInstanceFull)
|
|
299
|
-
let objInstanceFullForGraph = lodash.cloneDeep(objInstanceFull)
|
|
299
|
+
let objInstanceFullForDynamoDb = lodash.cloneDeep(objInstanceFull);
|
|
300
|
+
let objInstanceFullForGraph = lodash.cloneDeep(objInstanceFull);
|
|
301
|
+
let objInstanceFullForExternalTopic = lodash.cloneDeep(objInstanceFull);
|
|
300
302
|
|
|
301
303
|
if (errorsFound.length == 0) {
|
|
302
304
|
//(<validateBeforeCreate>)
|
|
@@ -312,8 +314,9 @@ module.exports.createMain = async (
|
|
|
312
314
|
if (parentObject) {
|
|
313
315
|
if (createDataDetail.tableName.includes(firstLetterUpperCase(`${parentObject.objectType}Records`))) {
|
|
314
316
|
Object.assign(
|
|
315
|
-
objInstanceFullForDynamoDb.fields,
|
|
316
|
-
|
|
317
|
+
objInstanceFullForDynamoDb.fields, {
|
|
318
|
+
[`${parentObject.objectType}HandlerServiceTag`]: process.env.iz_serviceTag
|
|
319
|
+
})
|
|
317
320
|
}
|
|
318
321
|
}
|
|
319
322
|
|
|
@@ -379,13 +382,21 @@ module.exports.createMain = async (
|
|
|
379
382
|
_izContext.logger.debug("::::::externalTopic::::::", { storageTag, createDataDetail });
|
|
380
383
|
//(<beforeSendMessageToExternalTopic>)
|
|
381
384
|
//(</beforeSendMessageToExternalTopic>)
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
385
|
+
Object.assign(objInstanceFullForExternalTopic.fields, createObjInstanceFullFieldsByStorageTag(_izContext, storageTag, createDataDetail))
|
|
386
|
+
_izContext.logger.debug("objInstanceFull before send to external topic", objInstanceFullForExternalTopic)
|
|
387
|
+
|
|
388
|
+
allAwaitingStepsId.push(await asyncFlowSharedLib.createAwaitingStepId(
|
|
389
|
+
(hash({
|
|
390
|
+
objType: objType,
|
|
391
|
+
graphServerTag: storageTag,
|
|
392
|
+
identifiers: objInstanceFullForGraph.identifiers,
|
|
393
|
+
callingFlowProperties: callingFlowConfig.callingFlowProperties || {}
|
|
394
|
+
})),
|
|
395
|
+
PREFIX.CREATE_OBJECT_EXTERNAL_TOPIC
|
|
396
|
+
));
|
|
386
397
|
|
|
387
398
|
let sendToCreateExternalTopic = {
|
|
388
|
-
Message: JSON.stringify(
|
|
399
|
+
Message: JSON.stringify(objInstanceFullForExternalTopic),
|
|
389
400
|
TopicArn: `arn:aws:sns:${createDataDetail.region}:${createDataDetail.accountId}:${createDataDetail.serviceTag}_${createDataDetail.stage}_Create_In`
|
|
390
401
|
};
|
|
391
402
|
_izContext.logger.debug("Request params before send to create endpoint:", sendToCreateExternalTopic);
|
|
@@ -204,6 +204,14 @@ async function externalLambdaIamRoleRelationships(_izContext, allRelSchemas) {
|
|
|
204
204
|
graphServiceNamesFromAllRelSchemas.map(graphServiceName =>
|
|
205
205
|
externalResourceName(RESOURCE_CLASSES.sns, "ChangeRelationshipType_In", graphServiceName)
|
|
206
206
|
)
|
|
207
|
+
),
|
|
208
|
+
createIamRole(
|
|
209
|
+
{
|
|
210
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish]
|
|
211
|
+
},
|
|
212
|
+
graphServiceNamesFromAllRelSchemas.map(graphServiceName =>
|
|
213
|
+
externalResourceName(RESOURCE_CLASSES.sns, "MoveRelationship_In", graphServiceName)
|
|
214
|
+
)
|
|
207
215
|
)
|
|
208
216
|
)
|
|
209
217
|
}
|
|
@@ -167,6 +167,17 @@ async function snsSubscriptionDeleteRelationshipComplete(_izContext, allRelSchem
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
+
async function snsSubscriptionDeleteRelationshipComplete(_izContext, allRelSchemas) {
|
|
171
|
+
let serviceTag = await getGraphServiceNameFromAllRelSchema(_izContext, allRelSchemas)
|
|
172
|
+
|
|
173
|
+
return {
|
|
174
|
+
serviceTag: serviceTag,
|
|
175
|
+
topicName: TOPIC_NAME_GRAPH_HANDLER.outMoveRelationship,
|
|
176
|
+
sqsEndpoint: TOPIC_NAME_GENERATE_CODE.moveRelationshipComplete
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
|
|
170
181
|
function snsSubscriptionReservedLimitCompleteForReservedDynamicUsage(_izContext) {
|
|
171
182
|
let serviceTag = [EXTERNAL_SERVICE_NAME.accountLimits]
|
|
172
183
|
return {
|
|
@@ -187,6 +198,6 @@ function snsSubscriptionConfirmReserved(_izContext) {
|
|
|
187
198
|
}
|
|
188
199
|
|
|
189
200
|
async function snsSubScriptionFromExternalTopic(_izContext, allObjectSchemas) {
|
|
190
|
-
|
|
201
|
+
|
|
191
202
|
}
|
|
192
203
|
module.exports = createExternalSnsSubscriptions;
|
|
@@ -65,7 +65,7 @@ async function data(_izContext, objectSchemas, srcPath, settings) {
|
|
|
65
65
|
for (let storageResource of Object.values(objectSchema.storageResources)) {
|
|
66
66
|
if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
|
|
67
67
|
// add IamRole for dynamodb depend on tableName in storageResources of objectSchema
|
|
68
|
-
tableForGetItem.push(resourceNames(RESOURCE_CLASSES.dynamoDbTable, storageResource.tableName));
|
|
68
|
+
tableForGetItem.push(resourceNames(RESOURCE_CLASSES.dynamoDbTable, upperCase(storageResource.tableName)));
|
|
69
69
|
|
|
70
70
|
} else if (storageResource.storageType === STORAGE_TYPES.graph) {
|
|
71
71
|
// find graph serviceName from graphServerTag or *GetNodeHdrInv ?
|
|
@@ -90,7 +90,7 @@ async function data(_izContext, objectSchemas, srcPath, settings) {
|
|
|
90
90
|
additionalResourcePermission.push(
|
|
91
91
|
createIamRole(
|
|
92
92
|
{ [RESOURCE_CLASSES.dynamoDbTable]: [DEFAULT_LAMBDA_ROLE_PER_ACTION[ACTIONS.get].dynamoDbPermission] },
|
|
93
|
-
|
|
93
|
+
tableForGetItem
|
|
94
94
|
)
|
|
95
95
|
);
|
|
96
96
|
}
|
|
@@ -62,7 +62,7 @@ async function data(_izContext, objectSchemas, srcPath) {
|
|
|
62
62
|
for (let storageResource of Object.values(objectSchema.storageResources)) {
|
|
63
63
|
if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
|
|
64
64
|
// add IamRole for dynamodb depend on tableName in storageResources of objectSchema
|
|
65
|
-
tableForQuery.push(resourceNames(RESOURCE_CLASSES.dynamoDbTable, storageResource.tableName));
|
|
65
|
+
tableForQuery.push(resourceNames(RESOURCE_CLASSES.dynamoDbTable, upperCase(storageResource.tableName)));
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
@@ -71,7 +71,7 @@ async function data(_izContext, objectSchemas, srcPath) {
|
|
|
71
71
|
additionalResourcePermission.push(
|
|
72
72
|
createIamRole(
|
|
73
73
|
{ [RESOURCE_CLASSES.dynamoDbTable]: DYNAMO_RESOURCE.query },
|
|
74
|
-
|
|
74
|
+
[tableForQuery]
|
|
75
75
|
)
|
|
76
76
|
);
|
|
77
77
|
}
|
|
@@ -60,7 +60,7 @@ async function data(_izContext, objectSchemas, srcPath) {
|
|
|
60
60
|
for (let storageResource of Object.values(objectSchema.storageResources)) {
|
|
61
61
|
if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
|
|
62
62
|
// add IamRole for dynamodb depend on tableName in storageResources of objectSchema
|
|
63
|
-
tableForQuery.push(resourceNames(RESOURCE_CLASSES.dynamoDbTable, storageResource.tableName));
|
|
63
|
+
tableForQuery.push(resourceNames(RESOURCE_CLASSES.dynamoDbTable, upperCase(storageResource.tableName)));
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -69,7 +69,7 @@ async function data(_izContext, objectSchemas, srcPath) {
|
|
|
69
69
|
additionalResourcePermission.push(
|
|
70
70
|
createIamRole(
|
|
71
71
|
{ [RESOURCE_CLASSES.dynamoDbTable]: "Query" },
|
|
72
|
-
|
|
72
|
+
tableForQuery
|
|
73
73
|
)
|
|
74
74
|
);
|
|
75
75
|
}
|
|
@@ -61,7 +61,7 @@ async function data(_izContext, objectSchemas, srcPath) {
|
|
|
61
61
|
for (let storageResource of Object.values(objectSchema.storageResources)) {
|
|
62
62
|
if (storageResource.storageType === STORAGE_TYPES.dynamoDB) {
|
|
63
63
|
// add IamRole for dynamodb depend on tableName in storageResources of objectSchema
|
|
64
|
-
tableForQuery.push(resourceNames(RESOURCE_CLASSES.dynamoDbTable, storageResource.tableName));
|
|
64
|
+
tableForQuery.push(resourceNames(RESOURCE_CLASSES.dynamoDbTable, upperCase(storageResource.tableName)));
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -70,7 +70,7 @@ async function data(_izContext, objectSchemas, srcPath) {
|
|
|
70
70
|
additionalResourcePermission.push(
|
|
71
71
|
createIamRole(
|
|
72
72
|
{ [RESOURCE_CLASSES.dynamoDbTable]: DYNAMO_RESOURCE.query },
|
|
73
|
-
|
|
73
|
+
tableForQuery
|
|
74
74
|
)
|
|
75
75
|
);
|
|
76
76
|
}
|
|
@@ -60,7 +60,7 @@ function data(_izContext, srcPath) {
|
|
|
60
60
|
const createSourceParam = createParamForCreateSource(handlerType, srcPath);
|
|
61
61
|
createSourceArray.push(createSourceParam);
|
|
62
62
|
}
|
|
63
|
-
// console.log("createSourceArrayInUpdaterelationShipSchemahdrSqs", createSourceArray)
|
|
63
|
+
// console.log("createSourceArrayInUpdaterelationShipSchemahdrSqs", JSON.stringify(createSourceArray, null, 2))
|
|
64
64
|
return createSourceArray
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -93,10 +93,10 @@ function createParamForCreateSource(handlerType, srcPath) {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
if (handlerType === HANDLER.hdrSqs) {
|
|
96
|
-
createIamRole(
|
|
96
|
+
additionalResourcePermission.push(createIamRole(
|
|
97
97
|
{
|
|
98
98
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe],
|
|
99
|
-
[RESOURCE_CLASSES.sqs]:
|
|
99
|
+
[RESOURCE_CLASSES.sqs]: Object.values(SQS_RESOURCE)
|
|
100
100
|
},
|
|
101
101
|
[
|
|
102
102
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.changeRelComplete) + "_Out"),
|
|
@@ -105,7 +105,7 @@ function createParamForCreateSource(handlerType, srcPath) {
|
|
|
105
105
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
|
106
106
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out"),
|
|
107
107
|
]
|
|
108
|
-
)
|
|
108
|
+
))
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
return {
|
|
@@ -234,8 +234,8 @@ module.exports.<%- functionName %> = async (
|
|
|
234
234
|
if (errorsFound.length) {
|
|
235
235
|
|
|
236
236
|
let changeRelCompleteMsg = {
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
firstObject,
|
|
238
|
+
secondObject,
|
|
239
239
|
oldRelTypeAndDirection,
|
|
240
240
|
newRelType,
|
|
241
241
|
originTimestamp,
|
|
@@ -320,8 +320,8 @@ module.exports.<%- functionName %> = async (
|
|
|
320
320
|
|
|
321
321
|
// prepare message body
|
|
322
322
|
let changeRelMessageBody = {
|
|
323
|
-
|
|
324
|
-
|
|
323
|
+
firstObject,
|
|
324
|
+
secondObject,
|
|
325
325
|
oldRelTypeAndDirection,
|
|
326
326
|
newRelType,
|
|
327
327
|
originTimestamp,
|
package/src/reStructure/TemplateData/relationshipPerAction/create/action/functionYaml/data.js
CHANGED
|
@@ -98,7 +98,7 @@ function createParamForCreateSource(allObjectRelationships, handlerType, srcPath
|
|
|
98
98
|
createIamRole(
|
|
99
99
|
{
|
|
100
100
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe],
|
|
101
|
-
[RESOURCE_CLASSES.sqs]:
|
|
101
|
+
[RESOURCE_CLASSES.sqs]: Object.values(SQS_RESOURCE)
|
|
102
102
|
},
|
|
103
103
|
[
|
|
104
104
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.createRelComplete) + "_Out"),
|
package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js
CHANGED
|
@@ -82,10 +82,7 @@ function createParamForCreateSource(srcPath) {
|
|
|
82
82
|
),
|
|
83
83
|
createIamRole(
|
|
84
84
|
{
|
|
85
|
-
[RESOURCE_CLASSES.sns]:
|
|
86
|
-
[
|
|
87
|
-
SNS_RESOURCE.publish, SNS_RESOURCE.subscribe
|
|
88
|
-
]
|
|
85
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe],
|
|
89
86
|
},
|
|
90
87
|
[
|
|
91
88
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/action/functionYaml/data.js
CHANGED
|
@@ -98,7 +98,8 @@ function createParamForCreateSource(allObjectRelationships, handlerType, srcPath
|
|
|
98
98
|
createIamRole(
|
|
99
99
|
{
|
|
100
100
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe],
|
|
101
|
-
[RESOURCE_CLASSES.sqs]:
|
|
101
|
+
[RESOURCE_CLASSES.sqs]: Object.values(SQS_RESOURCE)
|
|
102
|
+
},
|
|
102
103
|
[
|
|
103
104
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.deleteRelComplete) + "_Out"),
|
|
104
105
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(handlerType)),
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js
CHANGED
|
@@ -80,10 +80,7 @@ function createParamForCreateSource(srcPath) {
|
|
|
80
80
|
),
|
|
81
81
|
createIamRole(
|
|
82
82
|
{
|
|
83
|
-
[RESOURCE_CLASSES.sns]:
|
|
84
|
-
[
|
|
85
|
-
SNS_RESOURCE.publish, SNS_RESOURCE.subscribe
|
|
86
|
-
]
|
|
83
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe],
|
|
87
84
|
},
|
|
88
85
|
[
|
|
89
86
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
|
@@ -98,7 +98,8 @@ function createParamForCreateSource(allObjectRelationships, handlerType, srcPath
|
|
|
98
98
|
createIamRole(
|
|
99
99
|
{
|
|
100
100
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe],
|
|
101
|
-
[RESOURCE_CLASSES.sqs]:
|
|
101
|
+
[RESOURCE_CLASSES.sqs]: Object.values(SQS_RESOURCE)
|
|
102
|
+
},
|
|
102
103
|
[
|
|
103
104
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.getRelComplete) + "_Out"),
|
|
104
105
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(handlerType)),
|
package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js
CHANGED
|
@@ -80,10 +80,7 @@ function createParamForCreateSource(srcPath) {
|
|
|
80
80
|
),
|
|
81
81
|
createIamRole(
|
|
82
82
|
{
|
|
83
|
-
[RESOURCE_CLASSES.sns]:
|
|
84
|
-
[
|
|
85
|
-
SNS_RESOURCE.publish, SNS_RESOURCE.subscribe
|
|
86
|
-
]
|
|
83
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe],
|
|
87
84
|
},
|
|
88
85
|
[
|
|
89
86
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
|
@@ -98,7 +98,8 @@ function createParamForCreateSource(allObjectRelationships, handlerType, srcPath
|
|
|
98
98
|
createIamRole(
|
|
99
99
|
{
|
|
100
100
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe],
|
|
101
|
-
[RESOURCE_CLASSES.sqs]:
|
|
101
|
+
[RESOURCE_CLASSES.sqs]: Object.values(SQS_RESOURCE)
|
|
102
|
+
},
|
|
102
103
|
[
|
|
103
104
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.moveRelComplete) + "_Out"),
|
|
104
105
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(handlerType)),
|
|
@@ -110,28 +111,6 @@ function createParamForCreateSource(allObjectRelationships, handlerType, srcPath
|
|
|
110
111
|
)
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
for (const relationship of allObjectRelationships) {
|
|
114
|
-
let [storageType, relationshipTag, links] = checkDynamoTypeRelationship(relationship)
|
|
115
|
-
if (storageType === STORAGE_TYPES.dynamoDB) {
|
|
116
|
-
for (const link of links) {
|
|
117
|
-
let dynamoComponent = createDynamoDbComponentByLinks(link, relationshipTag)
|
|
118
|
-
additionalResourcePermission.push(
|
|
119
|
-
createIamRole(
|
|
120
|
-
{
|
|
121
|
-
[RESOURCE_CLASSES.dynamoDbTable]: [DYNAMO_RESOURCE.getItem]
|
|
122
|
-
},
|
|
123
|
-
[
|
|
124
|
-
resourceNames(RESOURCE_CLASSES.dynamoDbTable, upperCase(dynamoComponent.tableNameFrom)),
|
|
125
|
-
resourceNames(RESOURCE_CLASSES.dynamoDbTable, upperCase(dynamoComponent.tableNameTo))
|
|
126
|
-
]
|
|
127
|
-
)
|
|
128
|
-
)
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
114
|
return {
|
|
136
115
|
templatePath: templatePath,
|
|
137
116
|
templateData: {
|
|
@@ -28,12 +28,12 @@ const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>
|
|
|
28
28
|
let validatorSchema = {
|
|
29
29
|
type: "object",
|
|
30
30
|
required: [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
'firstObject',
|
|
32
|
+
'secondObject',
|
|
33
|
+
'relType',
|
|
34
|
+
'relationshipProperties',
|
|
35
|
+
'relationshipDirection',
|
|
36
|
+
'moveObject'
|
|
37
37
|
],
|
|
38
38
|
properties: {
|
|
39
39
|
firstObject: {
|
|
@@ -74,7 +74,7 @@ let validatorSchema = {
|
|
|
74
74
|
},
|
|
75
75
|
relType: {
|
|
76
76
|
type: "object",
|
|
77
|
-
required: ['serviceTag','relationshipTag'],
|
|
77
|
+
required: ['serviceTag', 'relationshipTag'],
|
|
78
78
|
properties: {
|
|
79
79
|
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
80
80
|
relationshipTag: izara.validatorSchema.stringNotEmpty()
|
|
@@ -82,37 +82,22 @@ let validatorSchema = {
|
|
|
82
82
|
},
|
|
83
83
|
relationshipDirection: {
|
|
84
84
|
type: "string",
|
|
85
|
-
enum: ['from','to']
|
|
85
|
+
enum: ['from', 'to']
|
|
86
86
|
},
|
|
87
|
-
|
|
87
|
+
relationshipProperties: {
|
|
88
88
|
type: "object",
|
|
89
89
|
minProperties: 1
|
|
90
90
|
},
|
|
91
91
|
moveObject: {
|
|
92
|
-
|
|
93
|
-
required: ['fromObjectRef','toObject'],
|
|
92
|
+
required: ["fromObjectRef", "moveToIdentifiers"],
|
|
94
93
|
properties: {
|
|
95
94
|
fromObjectRef: {
|
|
96
|
-
type:
|
|
97
|
-
enum: [
|
|
95
|
+
type: "string",
|
|
96
|
+
enum: ["firstObject", "secondObject"]
|
|
98
97
|
},
|
|
99
|
-
|
|
100
|
-
type:
|
|
101
|
-
|
|
102
|
-
properties: {
|
|
103
|
-
objType: {
|
|
104
|
-
type: 'object',
|
|
105
|
-
required: ['objectType', 'serviceTag'],
|
|
106
|
-
properties: {
|
|
107
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
108
|
-
objectType: izara.validatorSchema.stringNotEmpty()
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
identifiers: {
|
|
112
|
-
type: 'object',
|
|
113
|
-
minProperties: 1
|
|
114
|
-
}
|
|
115
|
-
}
|
|
98
|
+
moveToIdentifiers: {
|
|
99
|
+
type: "object",
|
|
100
|
+
minProperties: 1,
|
|
116
101
|
}
|
|
117
102
|
}
|
|
118
103
|
},
|
|
@@ -49,12 +49,12 @@ middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema(
|
|
|
49
49
|
let validatorSchema = {
|
|
50
50
|
type: "object",
|
|
51
51
|
required: [
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
'firstObject',
|
|
53
|
+
'secondObject',
|
|
54
|
+
'relType',
|
|
55
|
+
'relationshipProperties',
|
|
56
|
+
'relationshipDirection',
|
|
57
|
+
'moveObject'
|
|
58
58
|
],
|
|
59
59
|
properties: {
|
|
60
60
|
firstObject: {
|
|
@@ -95,7 +95,7 @@ let validatorSchema = {
|
|
|
95
95
|
},
|
|
96
96
|
relType: {
|
|
97
97
|
type: "object",
|
|
98
|
-
required: ['serviceTag','relationshipTag'],
|
|
98
|
+
required: ['serviceTag', 'relationshipTag'],
|
|
99
99
|
properties: {
|
|
100
100
|
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
101
101
|
relationshipTag: izara.validatorSchema.stringNotEmpty()
|
|
@@ -103,37 +103,22 @@ let validatorSchema = {
|
|
|
103
103
|
},
|
|
104
104
|
relationshipDirection: {
|
|
105
105
|
type: "string",
|
|
106
|
-
enum: ['from','to']
|
|
106
|
+
enum: ['from', 'to']
|
|
107
107
|
},
|
|
108
|
-
|
|
108
|
+
relationshipProperties: {
|
|
109
109
|
type: "object",
|
|
110
110
|
minProperties: 1
|
|
111
111
|
},
|
|
112
112
|
moveObject: {
|
|
113
|
-
|
|
114
|
-
required: ['fromObjectRef','toObject'],
|
|
113
|
+
required: ["fromObjectRef", "moveToIdentifiers"],
|
|
115
114
|
properties: {
|
|
116
115
|
fromObjectRef: {
|
|
117
|
-
type:
|
|
118
|
-
enum: [
|
|
116
|
+
type: "string",
|
|
117
|
+
enum: ["firstObject", "secondObject"]
|
|
119
118
|
},
|
|
120
|
-
|
|
121
|
-
type:
|
|
122
|
-
|
|
123
|
-
properties: {
|
|
124
|
-
objType: {
|
|
125
|
-
type: 'object',
|
|
126
|
-
required: ['objectType', 'serviceTag'],
|
|
127
|
-
properties: {
|
|
128
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
129
|
-
objectType: izara.validatorSchema.stringNotEmpty()
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
identifiers: {
|
|
133
|
-
type: 'object',
|
|
134
|
-
minProperties: 1
|
|
135
|
-
}
|
|
136
|
-
}
|
|
119
|
+
moveToIdentifiers: {
|
|
120
|
+
type: "object",
|
|
121
|
+
minProperties: 1,
|
|
137
122
|
}
|
|
138
123
|
}
|
|
139
124
|
},
|
|
@@ -32,12 +32,12 @@ const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>
|
|
|
32
32
|
let validatorSchema = {
|
|
33
33
|
type: "object",
|
|
34
34
|
required: [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
'firstObject',
|
|
36
|
+
'secondObject',
|
|
37
|
+
'relType',
|
|
38
|
+
'relationshipProperties',
|
|
39
|
+
'relationshipDirection',
|
|
40
|
+
'moveObject'
|
|
41
41
|
],
|
|
42
42
|
properties: {
|
|
43
43
|
firstObject: {
|
|
@@ -78,7 +78,7 @@ let validatorSchema = {
|
|
|
78
78
|
},
|
|
79
79
|
relType: {
|
|
80
80
|
type: "object",
|
|
81
|
-
required: ['serviceTag','relationshipTag'],
|
|
81
|
+
required: ['serviceTag', 'relationshipTag'],
|
|
82
82
|
properties: {
|
|
83
83
|
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
84
84
|
relationshipTag: izara.validatorSchema.stringNotEmpty()
|
|
@@ -86,37 +86,22 @@ let validatorSchema = {
|
|
|
86
86
|
},
|
|
87
87
|
relationshipDirection: {
|
|
88
88
|
type: "string",
|
|
89
|
-
enum: ['from','to']
|
|
89
|
+
enum: ['from', 'to']
|
|
90
90
|
},
|
|
91
|
-
|
|
91
|
+
relationshipProperties: {
|
|
92
92
|
type: "object",
|
|
93
93
|
minProperties: 1
|
|
94
94
|
},
|
|
95
95
|
moveObject: {
|
|
96
|
-
|
|
97
|
-
required: ['fromObjectRef','toObject'],
|
|
96
|
+
required: ["fromObjectRef", "moveToIdentifiers"],
|
|
98
97
|
properties: {
|
|
99
98
|
fromObjectRef: {
|
|
100
|
-
type:
|
|
101
|
-
enum: [
|
|
99
|
+
type: "string",
|
|
100
|
+
enum: ["firstObject", "secondObject"]
|
|
102
101
|
},
|
|
103
|
-
|
|
104
|
-
type:
|
|
105
|
-
|
|
106
|
-
properties: {
|
|
107
|
-
objType: {
|
|
108
|
-
type: 'object',
|
|
109
|
-
required: ['objectType', 'serviceTag'],
|
|
110
|
-
properties: {
|
|
111
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
112
|
-
objectType: izara.validatorSchema.stringNotEmpty()
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
identifiers: {
|
|
116
|
-
type: 'object',
|
|
117
|
-
minProperties: 1
|
|
118
|
-
}
|
|
119
|
-
}
|
|
102
|
+
moveToIdentifiers: {
|
|
103
|
+
type: "object",
|
|
104
|
+
minProperties: 1,
|
|
120
105
|
}
|
|
121
106
|
}
|
|
122
107
|
},
|
|
@@ -33,12 +33,12 @@ middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema());
|
|
|
33
33
|
let validatorSchema = {
|
|
34
34
|
type: "object",
|
|
35
35
|
required: [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
'firstObject',
|
|
37
|
+
'secondObject',
|
|
38
|
+
'relType',
|
|
39
|
+
'relationshipProperties',
|
|
40
|
+
'relationshipDirection',
|
|
41
|
+
'moveObject'
|
|
42
42
|
],
|
|
43
43
|
properties: {
|
|
44
44
|
firstObject: {
|
|
@@ -79,7 +79,7 @@ let validatorSchema = {
|
|
|
79
79
|
},
|
|
80
80
|
relType: {
|
|
81
81
|
type: "object",
|
|
82
|
-
required: ['serviceTag','relationshipTag'],
|
|
82
|
+
required: ['serviceTag', 'relationshipTag'],
|
|
83
83
|
properties: {
|
|
84
84
|
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
85
85
|
relationshipTag: izara.validatorSchema.stringNotEmpty()
|
|
@@ -87,37 +87,22 @@ let validatorSchema = {
|
|
|
87
87
|
},
|
|
88
88
|
relationshipDirection: {
|
|
89
89
|
type: "string",
|
|
90
|
-
enum: ['from','to']
|
|
90
|
+
enum: ['from', 'to']
|
|
91
91
|
},
|
|
92
|
-
|
|
92
|
+
relationshipProperties: {
|
|
93
93
|
type: "object",
|
|
94
94
|
minProperties: 1
|
|
95
95
|
},
|
|
96
96
|
moveObject: {
|
|
97
|
-
|
|
98
|
-
required: ['fromObjectRef','toObject'],
|
|
97
|
+
required: ["fromObjectRef", "moveToIdentifiers"],
|
|
99
98
|
properties: {
|
|
100
99
|
fromObjectRef: {
|
|
101
|
-
type:
|
|
102
|
-
enum: [
|
|
100
|
+
type: "string",
|
|
101
|
+
enum: ["firstObject", "secondObject"]
|
|
103
102
|
},
|
|
104
|
-
|
|
105
|
-
type:
|
|
106
|
-
|
|
107
|
-
properties: {
|
|
108
|
-
objType: {
|
|
109
|
-
type: 'object',
|
|
110
|
-
required: ['objectType', 'serviceTag'],
|
|
111
|
-
properties: {
|
|
112
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
113
|
-
objectType: izara.validatorSchema.stringNotEmpty()
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
identifiers: {
|
|
117
|
-
type: 'object',
|
|
118
|
-
minProperties: 1
|
|
119
|
-
}
|
|
120
|
-
}
|
|
103
|
+
moveToIdentifiers: {
|
|
104
|
+
type: "object",
|
|
105
|
+
minProperties: 1,
|
|
121
106
|
}
|
|
122
107
|
}
|
|
123
108
|
},
|
|
@@ -234,8 +234,8 @@ module.exports.<%- functionName %> = async (
|
|
|
234
234
|
if (errorsFound.length) {
|
|
235
235
|
|
|
236
236
|
let moveRelCompleteMsg = {
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
firstObject,
|
|
238
|
+
secondObject,
|
|
239
239
|
relType,
|
|
240
240
|
relationshipProperties,
|
|
241
241
|
relationshipDirection,
|
|
@@ -81,10 +81,7 @@ function createParamForCreateSource(srcPath) {
|
|
|
81
81
|
),
|
|
82
82
|
createIamRole(
|
|
83
83
|
{
|
|
84
|
-
[RESOURCE_CLASSES.sns]:
|
|
85
|
-
[
|
|
86
|
-
SNS_RESOURCE.publish, SNS_RESOURCE.subscribe
|
|
87
|
-
]
|
|
84
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe],
|
|
88
85
|
},
|
|
89
86
|
[
|
|
90
87
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
package/src/reStructure/TemplateData/relationshipPerAction/update/action/functionYaml/data.js
CHANGED
|
@@ -79,14 +79,7 @@ function createParamForCreateSource(allObjectRelationships, handlerType, srcPath
|
|
|
79
79
|
additionalResourcePermission.push(
|
|
80
80
|
createIamRole(
|
|
81
81
|
{
|
|
82
|
-
[RESOURCE_CLASSES.sqs]:
|
|
83
|
-
SQS_RESOURCE.deleteMessage,
|
|
84
|
-
SQS_RESOURCE.getQueueAttributes,
|
|
85
|
-
SQS_RESOURCE.receiveMessage,
|
|
86
|
-
SQS_RESOURCE.sendMessage,
|
|
87
|
-
SQS_RESOURCE.getQueueUrl,
|
|
88
|
-
SQS_RESOURCE.deleteMessageBatch
|
|
89
|
-
],
|
|
82
|
+
[RESOURCE_CLASSES.sqs]: Object.values(SQS_RESOURCE)
|
|
90
83
|
},
|
|
91
84
|
[
|
|
92
85
|
resourceNames(RESOURCE_CLASSES.sqs, upperCase(functionName) + upperCase(handlerType)),
|
|
@@ -101,7 +94,7 @@ function createParamForCreateSource(allObjectRelationships, handlerType, srcPath
|
|
|
101
94
|
createIamRole(
|
|
102
95
|
{
|
|
103
96
|
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe],
|
|
104
|
-
[RESOURCE_CLASSES.sqs]:
|
|
97
|
+
[RESOURCE_CLASSES.sqs]: Object.values(SQS_RESOURCE)
|
|
105
98
|
},
|
|
106
99
|
[
|
|
107
100
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(FUNCTION_NAME.updateRelComplete) + "_Out"),
|
package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js
CHANGED
|
@@ -80,10 +80,7 @@ function createParamForCreateSource(srcPath) {
|
|
|
80
80
|
),
|
|
81
81
|
createIamRole(
|
|
82
82
|
{
|
|
83
|
-
[RESOURCE_CLASSES.sns]:
|
|
84
|
-
[
|
|
85
|
-
SNS_RESOURCE.publish, SNS_RESOURCE.subscribe
|
|
86
|
-
]
|
|
83
|
+
[RESOURCE_CLASSES.sns]: [SNS_RESOURCE.publish, SNS_RESOURCE.subscribe],
|
|
87
84
|
},
|
|
88
85
|
[
|
|
89
86
|
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
|
@@ -62,7 +62,7 @@ async function filterCreateResourceYaml(_izContext, createSourceParams, objSchem
|
|
|
62
62
|
}))
|
|
63
63
|
|
|
64
64
|
|
|
65
|
-
console.log("tableNamesToFilter", tableNamesToFilter)
|
|
65
|
+
// console.log("tableNamesToFilter", tableNamesToFilter)
|
|
66
66
|
let filteredCreateSourceParams = createSourceParams.filter(
|
|
67
67
|
(result) => !tableNamesToFilter.has(result.templateData.tableName)
|
|
68
68
|
)
|
|
@@ -99,7 +99,7 @@ async function generateCodeWithTemplate(_izContext, objSchemaPath) {
|
|
|
99
99
|
// console.log("createSourceParams before filter", createSourceParams)
|
|
100
100
|
const filteredCreateSourceParams = await filterCreateResourceYaml(_izContext, createSourceParams, objSchemaPath);
|
|
101
101
|
|
|
102
|
-
console.log("filteredCreateSourceParams", filteredCreateSourceParams);
|
|
102
|
+
// console.log("filteredCreateSourceParams", filteredCreateSourceParams);
|
|
103
103
|
|
|
104
104
|
return filteredCreateSourceParams;
|
|
105
105
|
} catch (error) {
|