@izara_project/izara-market-library-service-schemas 1.0.41 → 1.0.44
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/MainLibs/src/Consts.js +1 -1
- package/src/reStructure/GenerateCode.js +2 -2
- package/src/reStructure/GenerateSchema.js +8 -8
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/create/template.ejs +23 -13
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/delete/template.ejs +25 -8
- package/src/reStructure/TemplateData/EndpointPerService/mainFunction/update/template.ejs +30 -21
- package/src/reStructure/TemplateData/externalService/snsTopicSubscriptions/data.js +0 -32
- package/src/reStructure/TemplateData/findData/mainFunction/template.ejs +4 -4
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/CreateRecordComplete/functionYaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/confirmReserved/functionYaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObject/mainFunction/template.ejs +2 -3
- package/src/reStructure/TemplateData/flowSchema/components/upload/createObjectComplete/functionYaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/functionYaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/createPresignUrl/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/upload/preSignUrl/reservedLimit/mainFunction/template.ejs +5 -5
- package/src/reStructure/TemplateData/flowSchema/components/upload/processFile/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/components/websocket/connect/functionYaml/data.js +5 -2
- package/src/reStructure/TemplateData/flowSchema/dynamoDb/data.js +0 -20
- package/src/reStructure/TemplateData/flowSchema/eventBridge/functionYaml/data.js +7 -16
- package/src/reStructure/TemplateData/flowSchema/eventBridge/handler/inv/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/eventBridge/handler/inv/template.ejs +0 -1
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/functionYaml/data.js +112 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/{functionYaml → Complete/functionYaml}/template.ejs +1 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/handler/data.js +93 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/mainFunction/data.js +61 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Complete/mainFunction/template.ejs +96 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/{functionYaml → Process/functionYaml}/data.js +20 -4
- package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/flowStep → externalTopic/Process}/functionYaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/{handler → Process/handler}/data.js +3 -3
- package/src/reStructure/TemplateData/flowSchema/externalTopic/Process/handler/template.ejs +87 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/{mainFunction → Process/mainFunction}/data.js +2 -2
- package/src/reStructure/TemplateData/flowSchema/externalTopic/{mainFunction → Process/mainFunction}/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/data.js +14 -4
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-in-sqs/sqsTemplate.ejs +52 -0
- package/src/reStructure/TemplateData/flowSchema/externalTopic/sns-out/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/data.js +4 -4
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/functionYaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/data.js +1 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/handler/template.ejs +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/data.js +5 -5
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComplete/mainFunction/template.ejs +5 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/functionYaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/handler/template.ejs +2 -0
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/data.js +3 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/EndpointComponent/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/FlowSchemaComponent/mainFunction/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/data.js +9 -21
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-in/sqsTemplate.ejs +0 -10
- package/src/reStructure/TemplateData/flowSchema/flowSchemaOwnTopic/sns-out/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/flowStep → flowStep}/functionYaml/data.js +36 -23
- package/src/reStructure/TemplateData/flowSchema/flowStep/functionYaml/template.ejs +20 -0
- package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/flowStep → flowStep}/handler/data.js +22 -18
- package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/flowStep → flowStep}/mainFunction/data.js +22 -18
- package/src/reStructure/TemplateData/flowSchema/flowStep/sns-in/data.js +90 -0
- package/src/reStructure/TemplateData/flowSchema/flowStep/sns-in/template.ejs +45 -0
- package/src/reStructure/TemplateData/flowSchema/generateTemplateData.js +41 -25
- package/src/reStructure/TemplateData/flowSchema/register/complete/functionYaml/data.js +1 -0
- package/src/reStructure/TemplateData/flowSchema/register/complete/functionYaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/flowSchema/register/complete/handler/data.js +0 -1
- package/src/reStructure/TemplateData/flowSchema/register/complete/mainFunction/template.ejs +17 -18
- package/src/reStructure/TemplateData/flowSchema/register/dynamoDB/register.js +0 -17
- package/src/reStructure/TemplateData/flowSchema/register/sns-in/data.js +0 -1
- package/src/reStructure/TemplateData/flowSchema/register/subscriptionOutAll/data.js +1 -3
- package/src/reStructure/TemplateData/flowSchema/register/subscriptionOutAll/template.ejs +2 -2
- package/src/reStructure/TemplateData/flowSchema/register/wbs/functionYaml/data.js +0 -29
- package/src/reStructure/TemplateData/flowSchema/register/wbs/handler/data.js +0 -1
- package/src/reStructure/TemplateData/flowSchema/register/wbs/handler/template.ejs +0 -5
- package/src/reStructure/TemplateData/flowSchema/register/wbs/mainFunction/template.ejs +16 -15
- package/src/reStructure/TemplateData/flowSchema/templateBystatusType/triggerCacheTemplate.ejs +7 -1
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/functionYaml/data.js +1 -1
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/functionYaml/template.ejs +2 -1
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/sqs/data.js +97 -0
- package/src/reStructure/TemplateData/flowSchema/webSocketComplete/sqs/template.ejs +52 -0
- package/src/reStructure/TemplateData/perActionComplete/create/handler/template.ejs +3 -3
- package/src/reStructure/TemplateData/perActionComplete/create/mainFunction/template.ejs +6 -0
- package/src/reStructure/TemplateData/perActionComplete/create/yaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/perActionComplete/delete/handler/template.ejs +3 -3
- package/src/reStructure/TemplateData/perActionComplete/delete/yaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/perActionComplete/get/handler/template.ejs +3 -3
- package/src/reStructure/TemplateData/perActionComplete/get/yaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/perActionComplete/update/handler/template.ejs +3 -3
- package/src/reStructure/TemplateData/perActionComplete/update/yaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/perActionEndpoint/mainFunction/update/template.ejs +12 -12
- package/src/reStructure/TemplateData/propertyValueSchema/generateTemplateData.js +19 -19
- package/src/reStructure/TemplateData/propertyValueSchema/objectPropertyValueSchema/data.js +82 -79
- package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/data.js +33 -37
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs +7 -5
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js +4 -2
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs +4 -4
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs +7 -5
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js +6 -3
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs +4 -4
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs +3 -3
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js +6 -3
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs +1 -1
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs +5 -3
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js +6 -3
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/template.ejs +1 -0
- package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs +4 -4
- package/src/reStructure/libs/ValidateAddOnDataStructure.js +5 -5
- /package/src/reStructure/TemplateData/flowSchema/externalTopic/{handler → Complete/handler}/template.ejs +0 -0
- /package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/flowStep → flowStep}/handler/template.ejs +0 -0
- /package/src/reStructure/TemplateData/flowSchema/{flowSchemaOwnTopic/flowStep → flowStep}/mainFunction/template.ejs +0 -0
package/src/reStructure/TemplateData/propertyValueSchema/relationshipPropertyValueSchema/data.js
CHANGED
|
@@ -33,37 +33,38 @@ const objectschemaLocalByPath = require('@izara_project/izara-core-library-servi
|
|
|
33
33
|
const { firstLetterUpperCase: upperCase, getLocalServiceTag } = require("../../../../MainLibs/src/Utils");
|
|
34
34
|
const { createBasicRelationshipsProperties } = require('../../../../GenerateCodeLibs/src/GenerateCodeLibs');
|
|
35
35
|
const { ADD_ON_DATA_STRUCTURE_TYPE } = require('../../../../TemplateManager/src/libs/Consts');
|
|
36
|
-
async function data(_izContext, settings, srcPath) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
let objectSchema = await objectschemaLocalByPath.getLocalObjectSchemasWithHierarchy(
|
|
40
|
-
_izContext,
|
|
41
|
-
settings.objType.objectType,
|
|
42
|
-
path.join(srcPath, "./schemas")
|
|
43
|
-
).then(res => res.records[0]);
|
|
44
|
-
|
|
45
|
-
if (!objectSchema) {
|
|
46
|
-
throw Error(`Invalid objType:${objTypeString(objType)}, cannot generate attribute tree schema cause objectSchema is not exists`)
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
// validate addOnData type PropertyValues
|
|
50
|
-
let addOn = objectSchema.addOnDataStructure.find(addOn => {
|
|
51
|
-
return addOn.type === ADD_ON_DATA_STRUCTURE_TYPE.propertyValue && objectSchema.objectType === settings.objType.objectType
|
|
52
|
-
})
|
|
53
|
-
console.log("addOn in generate Relationship", addOn)
|
|
54
|
-
if (!addOn) {
|
|
55
|
-
throw Error(`Invalid objType:${objTypeString(objType)}, not have setting for generate propertyValues`)
|
|
56
|
-
}
|
|
57
36
|
|
|
37
|
+
async function data(_izContext, settings, srcPath) {
|
|
38
|
+
// console.log("create Data function ::", { settings })
|
|
58
39
|
let createSourceRecords = []
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
40
|
+
for (const settingPropertyValue of settings) {
|
|
41
|
+
let objectSchema = await objectschemaLocalByPath.getLocalObjectSchemasWithHierarchy(
|
|
42
|
+
_izContext,
|
|
43
|
+
settingPropertyValue.objType.objectType,
|
|
44
|
+
path.join(srcPath, "./schemas")
|
|
45
|
+
).then(res => res.records[0]);
|
|
46
|
+
|
|
47
|
+
if (!objectSchema) {
|
|
48
|
+
throw Error(`Invalid objType:${objTypeString(objType)}, cannot generate attribute tree schema cause objectSchema is not exists`)
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// validate addOnData type PropertyValues
|
|
52
|
+
let addOn = objectSchema.addOnDataStructure.find(addOn => {
|
|
53
|
+
return addOn.type === ADD_ON_DATA_STRUCTURE_TYPE.propertyValue && objectSchema.objectType === settingPropertyValue.objType.objectType
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
if (!addOn) {
|
|
57
|
+
throw Error(`Invalid objType:${objTypeString(objType)}, not have setting for generate propertyValues`)
|
|
58
|
+
}
|
|
66
59
|
|
|
60
|
+
let generateRelationships = createSourceParams(
|
|
61
|
+
_izContext,
|
|
62
|
+
objectSchema,
|
|
63
|
+
settingPropertyValue,
|
|
64
|
+
srcPath
|
|
65
|
+
);
|
|
66
|
+
createSourceRecords.push(...generateRelationships);
|
|
67
|
+
}
|
|
67
68
|
if (createSourceRecords.length) {
|
|
68
69
|
return {
|
|
69
70
|
templatePath: templatePath,
|
|
@@ -82,12 +83,7 @@ async function data(_izContext, settings, srcPath) {
|
|
|
82
83
|
};
|
|
83
84
|
|
|
84
85
|
|
|
85
|
-
function createSourceParams(
|
|
86
|
-
_izContext,
|
|
87
|
-
objectSchema,
|
|
88
|
-
settings,
|
|
89
|
-
srcPath
|
|
90
|
-
) {
|
|
86
|
+
function createSourceParams(_izContext, objectSchema, settings, srcPath) {
|
|
91
87
|
const attributeRelationships = [];
|
|
92
88
|
// const objectType = objectSchema.objectType; // main objectType
|
|
93
89
|
let propertyValue = settings.propertyValueTag
|
|
@@ -100,7 +96,7 @@ function createSourceParams(
|
|
|
100
96
|
relationshipProperties: createBasicRelationshipsProperties(
|
|
101
97
|
{
|
|
102
98
|
serviceTag: serviceTag,
|
|
103
|
-
objectType:
|
|
99
|
+
objectType: objectSchema.objectType,
|
|
104
100
|
linkType: "one",
|
|
105
101
|
requiredOnCreate: false
|
|
106
102
|
},
|
|
@@ -120,7 +116,7 @@ function createSourceParams(
|
|
|
120
116
|
relationshipProperties: createBasicRelationshipsProperties(
|
|
121
117
|
{
|
|
122
118
|
serviceTag: serviceTag,
|
|
123
|
-
objectType:
|
|
119
|
+
objectType: objectSchema.objectType,
|
|
124
120
|
linkType: "one",
|
|
125
121
|
requiredOnCreate: false
|
|
126
122
|
},
|
|
@@ -128,7 +124,7 @@ function createSourceParams(
|
|
|
128
124
|
serviceTag: serviceTag,
|
|
129
125
|
objectType: propertyValue + PROPERTYVALUE_TAG.property,
|
|
130
126
|
linkType: "many",
|
|
131
|
-
requiredOnCreate:
|
|
127
|
+
requiredOnCreate: false
|
|
132
128
|
},
|
|
133
129
|
storageResources,
|
|
134
130
|
"from"
|
package/src/reStructure/TemplateData/relationshipPerAction/create/action/mainFunction/template.ejs
CHANGED
|
@@ -88,8 +88,8 @@ module.exports.createRelationship = async (
|
|
|
88
88
|
relType,
|
|
89
89
|
relationshipDirection,
|
|
90
90
|
relationshipProperties
|
|
91
|
-
//(<
|
|
92
|
-
//(</
|
|
91
|
+
//(<requestParamCreateRel>)
|
|
92
|
+
//(</requestParamCreateRel>)
|
|
93
93
|
} = requestParams;
|
|
94
94
|
|
|
95
95
|
let errorsFound = [];
|
|
@@ -258,7 +258,7 @@ module.exports.createRelationship = async (
|
|
|
258
258
|
//(<inCreateRelCompleteMsgCrateRel>)
|
|
259
259
|
//(</inCreateRelCompleteMsgCrateRel>)
|
|
260
260
|
status: 'error',
|
|
261
|
-
|
|
261
|
+
errorsFound: errorsFound
|
|
262
262
|
};
|
|
263
263
|
|
|
264
264
|
// if have callingFlow will send to message complete
|
|
@@ -323,7 +323,7 @@ module.exports.createRelationship = async (
|
|
|
323
323
|
}
|
|
324
324
|
)
|
|
325
325
|
|
|
326
|
-
//
|
|
326
|
+
// put Item second Object DynamoDb
|
|
327
327
|
await dynamodbSharedLib.putItem(_izContext,
|
|
328
328
|
await dynamodbSharedLib.tableName(_izContext, tableNameTo),
|
|
329
329
|
{
|
|
@@ -365,8 +365,10 @@ module.exports.createRelationship = async (
|
|
|
365
365
|
createRelMessageBody,
|
|
366
366
|
callingFlowSharedLib.addParentCallingFlowConfig(
|
|
367
367
|
callingFlowConfig, // receive parent callingFlowConfig.
|
|
368
|
-
callingFlowSharedLib.createCallingFlowConfig( //
|
|
368
|
+
callingFlowSharedLib.createCallingFlowConfig( // calling flow own service
|
|
369
|
+
//(<callingFlowProperties>)
|
|
369
370
|
await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.createRelComplete),
|
|
371
|
+
//(</callingFlowProperties>)
|
|
370
372
|
{
|
|
371
373
|
graphServiceTag: storageResource.graphServiceTag
|
|
372
374
|
}
|
package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/data.js
CHANGED
|
@@ -87,8 +87,10 @@ function createParamForCreateSource(srcPath) {
|
|
|
87
87
|
SNS_RESOURCE.publish, SNS_RESOURCE.subscribe
|
|
88
88
|
]
|
|
89
89
|
},
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
[
|
|
91
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
|
92
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out")
|
|
93
|
+
]
|
|
92
94
|
)
|
|
93
95
|
)
|
|
94
96
|
|
package/src/reStructure/TemplateData/relationshipPerAction/create/complete/functionYaml/template.ejs
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
batchSize: 10
|
|
9
9
|
filterPatterns: #**** need to update serverless framwork upper v.2.69.1
|
|
10
10
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-firstLetterUpperCase(functionName) %>"]}}} # functionName of callingFlow
|
|
11
|
+
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
11
12
|
role: <%- roleName %>Role
|
|
12
13
|
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
13
14
|
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
package/src/reStructure/TemplateData/relationshipPerAction/create/complete/mainFunction/template.ejs
CHANGED
|
@@ -98,7 +98,7 @@ module.exports.createRelationshipComplete = async (
|
|
|
98
98
|
relType: returnValue.relType,
|
|
99
99
|
relationshipProperties: returnValue.relationshipProperties,
|
|
100
100
|
status: status,
|
|
101
|
-
|
|
101
|
+
errorsFound: errorsFound
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
createCompleteMsg = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, createCompleteMsg);
|
|
@@ -107,13 +107,13 @@ module.exports.createRelationshipComplete = async (
|
|
|
107
107
|
let messageAttributes = callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(passBackProperties, {});
|
|
108
108
|
_izContext.logger.debug("After addCallingFlowToSnsResponseMessageAttributes", createCompleteMsg);
|
|
109
109
|
|
|
110
|
-
let
|
|
110
|
+
let sendMessageToOutCreateRelationshipComplete = {
|
|
111
111
|
Message: JSON.stringify(createCompleteMsg),
|
|
112
112
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
113
113
|
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outCreateRelComplete)
|
|
114
114
|
};
|
|
115
|
-
_izContext.logger.debug("Send message to OutCreateRelationshipComplete :::>",
|
|
116
|
-
await sns.publishAsync(_izContext,
|
|
115
|
+
_izContext.logger.debug("Send message to OutCreateRelationshipComplete :::>", sendMessageToOutCreateRelationshipComplete);
|
|
116
|
+
await sns.publishAsync(_izContext, sendMessageToOutCreateRelationshipComplete);
|
|
117
117
|
|
|
118
118
|
|
|
119
119
|
// remove awaitingMultipleStep after finished
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/action/mainFunction/template.ejs
CHANGED
|
@@ -85,8 +85,8 @@ module.exports.deleteRelationship = async (
|
|
|
85
85
|
relType,
|
|
86
86
|
relationshipProperties,
|
|
87
87
|
relationshipDirection
|
|
88
|
-
//(<
|
|
89
|
-
//(</
|
|
88
|
+
//(<requestParamDeleteRel>)
|
|
89
|
+
//(</requestParamDeleteRel>)
|
|
90
90
|
} = requestParams;
|
|
91
91
|
|
|
92
92
|
let errorsFound = [];
|
|
@@ -224,7 +224,7 @@ module.exports.deleteRelationship = async (
|
|
|
224
224
|
//(<inDeleteRelCompleteMsg>)
|
|
225
225
|
//(</inDeleteRelCompleteMsg>)
|
|
226
226
|
status: 'error',
|
|
227
|
-
|
|
227
|
+
errorsFound: errorsFound
|
|
228
228
|
};
|
|
229
229
|
|
|
230
230
|
// if have callingFlow will send to message complete
|
|
@@ -286,7 +286,7 @@ module.exports.deleteRelationship = async (
|
|
|
286
286
|
}
|
|
287
287
|
)
|
|
288
288
|
|
|
289
|
-
//
|
|
289
|
+
// put item second Object DynamoDb
|
|
290
290
|
await dynamodbSharedLib.deleteItem(_izContext,
|
|
291
291
|
await dynamodbSharedLib.tableName(_izContext, tableNameTo),
|
|
292
292
|
{
|
|
@@ -328,8 +328,10 @@ module.exports.deleteRelationship = async (
|
|
|
328
328
|
deleteRelMessageBody,
|
|
329
329
|
callingFlowSharedLib.addParentCallingFlowConfig(
|
|
330
330
|
callingFlowConfig, // receive parent callingFlowConfig.
|
|
331
|
-
callingFlowSharedLib.createCallingFlowConfig( //
|
|
331
|
+
callingFlowSharedLib.createCallingFlowConfig( // calling flow own service
|
|
332
|
+
//(<callingFlowProperties>)
|
|
332
333
|
await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.deleteRelComplete), {}
|
|
334
|
+
//(</callingFlowProperties>)
|
|
333
335
|
)
|
|
334
336
|
)
|
|
335
337
|
);
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/data.js
CHANGED
|
@@ -85,9 +85,12 @@ function createParamForCreateSource(srcPath) {
|
|
|
85
85
|
SNS_RESOURCE.publish, SNS_RESOURCE.subscribe
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
[
|
|
89
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
|
90
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out")
|
|
91
|
+
]
|
|
92
|
+
)
|
|
93
|
+
)
|
|
91
94
|
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
92
95
|
|
|
93
96
|
return {
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/functionYaml/template.ejs
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
batchSize: 10
|
|
9
9
|
filterPatterns: #**** need to update serverless framwork upper v.2.69.1
|
|
10
10
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-firstLetterUpperCase(functionName) %>"]}}} # functionName of callingFlow
|
|
11
|
+
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
11
12
|
role: <%- roleName %>Role
|
|
12
13
|
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
13
14
|
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
package/src/reStructure/TemplateData/relationshipPerAction/delete/complete/mainFunction/template.ejs
CHANGED
|
@@ -99,7 +99,7 @@ module.exports.deleteRelationshipComplete = async (
|
|
|
99
99
|
relType: returnValue.relType,
|
|
100
100
|
relationshipProperties: returnValue.relationshipProperties,
|
|
101
101
|
status: status,
|
|
102
|
-
|
|
102
|
+
errorsFound: errorsFound
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
deleteRelComp = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, deleteRelComp);
|
|
@@ -108,13 +108,13 @@ module.exports.deleteRelationshipComplete = async (
|
|
|
108
108
|
let messageAttributes = callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(passBackProperties, {});
|
|
109
109
|
_izContext.logger.debug("After addCallingFlowToSnsResponseMessageAttributes", deleteRelComp);
|
|
110
110
|
|
|
111
|
-
let
|
|
111
|
+
let sendMessageToOutDeleteRelationshipComplete = {
|
|
112
112
|
Message: JSON.stringify(deleteRelComp),
|
|
113
113
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
114
114
|
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outDeleteRelComplete)
|
|
115
115
|
};
|
|
116
|
-
_izContext.logger.debug("Send message to
|
|
117
|
-
await sns.publishAsync(_izContext,
|
|
116
|
+
_izContext.logger.debug("Send message to OutDeleteRelationshipComplete :::>", sendMessageToOutDeleteRelationshipComplete);
|
|
117
|
+
await sns.publishAsync(_izContext, sendMessageToOutDeleteRelationshipComplete);
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
// remove awaitingMultipleStep after finished
|
package/src/reStructure/TemplateData/relationshipPerAction/get/action/mainFunction/template.ejs
CHANGED
|
@@ -86,8 +86,8 @@ module.exports.getRelationship = async (
|
|
|
86
86
|
relType,
|
|
87
87
|
relId,
|
|
88
88
|
relationshipDirection,
|
|
89
|
-
//(<
|
|
90
|
-
//(</
|
|
89
|
+
//(<requestParamGetRel>)
|
|
90
|
+
//(</requestParamGetRel>)
|
|
91
91
|
} = requestParams;
|
|
92
92
|
|
|
93
93
|
let errorsFound = [];
|
|
@@ -208,7 +208,7 @@ module.exports.getRelationship = async (
|
|
|
208
208
|
//(<inGetRelCompleteMsgCrateRel>)
|
|
209
209
|
//(</inGetRelCompleteMsgCrateRel>)
|
|
210
210
|
status: 'error',
|
|
211
|
-
|
|
211
|
+
errorsFound: errorsFound
|
|
212
212
|
};
|
|
213
213
|
|
|
214
214
|
// if have callingFlow will send to message complete
|
package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/data.js
CHANGED
|
@@ -85,9 +85,12 @@ function createParamForCreateSource(srcPath) {
|
|
|
85
85
|
SNS_RESOURCE.publish, SNS_RESOURCE.subscribe
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
[
|
|
89
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
|
90
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out")
|
|
91
|
+
]
|
|
92
|
+
)
|
|
93
|
+
)
|
|
91
94
|
|
|
92
95
|
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
93
96
|
|
package/src/reStructure/TemplateData/relationshipPerAction/get/complete/functionYaml/template.ejs
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
batchSize: 10
|
|
9
9
|
filterPatterns: #**** need to update serverless framwork upper v.2.69.1
|
|
10
10
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-firstLetterUpperCase(functionName) %>"]}}} # functionName of callingFlow
|
|
11
|
+
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
11
12
|
role: <%- roleName %>Role
|
|
12
13
|
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
13
14
|
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
package/src/reStructure/TemplateData/relationshipPerAction/get/complete/mainFunction/template.ejs
CHANGED
|
@@ -99,7 +99,7 @@ module.exports.getRelationshipComplete = async (
|
|
|
99
99
|
relType: returnValue.relType,
|
|
100
100
|
relationshipProperties: returnValue.relationshipProperties,
|
|
101
101
|
status: status,
|
|
102
|
-
|
|
102
|
+
errorsFound: errorsFound
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
createCompleteMsg = callingFlowSharedLib.addParentPassBackPropertiesToSnsResponseMessageObject(passBackProperties, createCompleteMsg);
|
package/src/reStructure/TemplateData/relationshipPerAction/update/action/mainFunction/template.ejs
CHANGED
|
@@ -92,8 +92,8 @@ module.exports.updateRelationship = async (
|
|
|
92
92
|
relId,
|
|
93
93
|
relationshipProperties,
|
|
94
94
|
relationshipDirection
|
|
95
|
-
//(<
|
|
96
|
-
//(</
|
|
95
|
+
//(<requestParamUpdateRel>)
|
|
96
|
+
//(</requestParamUpdateRel>)
|
|
97
97
|
} = requestParams;
|
|
98
98
|
|
|
99
99
|
let errorsFound = [];
|
|
@@ -221,7 +221,7 @@ module.exports.updateRelationship = async (
|
|
|
221
221
|
relType: relType,
|
|
222
222
|
relationshipDirection,
|
|
223
223
|
status: 'error',
|
|
224
|
-
|
|
224
|
+
errorsFound: errorsFound
|
|
225
225
|
//(<inUpdateCompleteMsgUpdateRel>)
|
|
226
226
|
//(</inUpdateCompleteMsgUpdateRel>)
|
|
227
227
|
};
|
|
@@ -328,7 +328,9 @@ module.exports.updateRelationship = async (
|
|
|
328
328
|
callingFlowSharedLib.addParentCallingFlowConfig(
|
|
329
329
|
callingFlowConfig, // receive parent callingFlowConfig.
|
|
330
330
|
callingFlowSharedLib.createCallingFlowConfig( // callinfflow own service
|
|
331
|
+
//(<callingFlowProperties>)
|
|
331
332
|
await lambdaSharedLib.lambdaFunctionName(_izContext, TOPIC_NAME_GENERATE_CODE.updateRelComplete),
|
|
333
|
+
//(</callingFlowProperties>)
|
|
332
334
|
{
|
|
333
335
|
graphServiceTag: storageResource.graphServiceTag
|
|
334
336
|
}
|
package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/data.js
CHANGED
|
@@ -85,9 +85,12 @@ function createParamForCreateSource(srcPath) {
|
|
|
85
85
|
SNS_RESOURCE.publish, SNS_RESOURCE.subscribe
|
|
86
86
|
]
|
|
87
87
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
[
|
|
89
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_In"),
|
|
90
|
+
resourceNames(RESOURCE_CLASSES.sns, upperCase(functionName) + "_Out")
|
|
91
|
+
]
|
|
92
|
+
)
|
|
93
|
+
)
|
|
91
94
|
|
|
92
95
|
additionalResourcePermission.push(awaitingMultipleStepsRole())
|
|
93
96
|
|
package/src/reStructure/TemplateData/relationshipPerAction/update/complete/functionYaml/template.ejs
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
batchSize: 10
|
|
9
9
|
filterPatterns: #**** need to update serverless framwork upper v.2.69.1
|
|
10
10
|
- body: {"MessageAttributes":{"callingFlow":{"Value":["${self:custom.iz_resourcePrefix}<%-firstLetterUpperCase(functionName) %>"]}}} # functionName of callingFlow
|
|
11
|
+
- body: {"MessageAttributes":{"callingFlow":{"Value":[{"exists":false}]}}}
|
|
11
12
|
role: <%- roleName %>Role
|
|
12
13
|
#<#<%- functionName %><%- handlerType %>IamRole#>
|
|
13
14
|
#<#/<%- functionName %><%- handlerType %>IamRole#>
|
package/src/reStructure/TemplateData/relationshipPerAction/update/complete/mainFunction/template.ejs
CHANGED
|
@@ -99,7 +99,7 @@ module.exports.updateRelationshipComplete = async (
|
|
|
99
99
|
relId: returnValue.relId,
|
|
100
100
|
relType: returnValue.relType,
|
|
101
101
|
status: status,
|
|
102
|
-
|
|
102
|
+
errorsFound: errorsFound
|
|
103
103
|
//(<inUpdateCompleteMsg>)
|
|
104
104
|
//(</inUpdateCompleteMsg>)
|
|
105
105
|
};
|
|
@@ -110,13 +110,13 @@ module.exports.updateRelationshipComplete = async (
|
|
|
110
110
|
let messageAttributes = callingFlowSharedLib.addParentPassBackCallingFlowToSnsResponseMessageAttributes(passBackProperties, {});
|
|
111
111
|
_izContext.logger.debug("After addCallingFlowToSnsResponseMessageAttributes", updateCompleteMsg);
|
|
112
112
|
|
|
113
|
-
let
|
|
113
|
+
let sendMessageToOutUpdateRelationshipComplete = {
|
|
114
114
|
Message: JSON.stringify(updateCompleteMsg),
|
|
115
115
|
MessageAttributes: sns.createStringMessageAttributes(_izContext, messageAttributes),
|
|
116
116
|
TopicArn: await snsSharedLib.snsTopicArnByFlowSchema(_izContext, TOPIC_NAME_GENERATE_CODE.outUpdateRelComplete)
|
|
117
117
|
};
|
|
118
|
-
_izContext.logger.debug("Send message to OutUpdateRelationshipComplete :::>",
|
|
119
|
-
await sns.publishAsync(_izContext,
|
|
118
|
+
_izContext.logger.debug("Send message to OutUpdateRelationshipComplete :::>", sendMessageToOutUpdateRelationshipComplete);
|
|
119
|
+
await sns.publishAsync(_izContext, sendMessageToOutUpdateRelationshipComplete);
|
|
120
120
|
|
|
121
121
|
|
|
122
122
|
// remove awaitingMultipleStep after finished
|
|
@@ -24,7 +24,7 @@ async function validateAddOnDataStructure(
|
|
|
24
24
|
settings
|
|
25
25
|
) {
|
|
26
26
|
|
|
27
|
-
let
|
|
27
|
+
let errorsFound = [];
|
|
28
28
|
let returnObjectValue = {}
|
|
29
29
|
|
|
30
30
|
const objTypeString = objType => `{ serviceTag: ${objType.serviceTag}, objectType: ${objType.objectType} }`;
|
|
@@ -32,11 +32,11 @@ async function validateAddOnDataStructure(
|
|
|
32
32
|
const objectSchema = await getObjectSchema.getObjSchemaS3WithHierarchy(_izContext, settings.objType);
|
|
33
33
|
|
|
34
34
|
if (!objectSchema) {
|
|
35
|
-
|
|
35
|
+
errorsFound.push(`Invalid objType:${objTypeString(settings.objType)}, cannot generate attribute tree schema cause objectSchema is not exists`)
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
if (!objectSchema.hasOwnProperty("addOnDataStructure") || !Array.isArray(objectSchema.addOnDataStructure) || !objectSchema.addOnDataStructure.length) {
|
|
39
|
-
|
|
39
|
+
errorsFound.push(`objType: ${objTypeString(settings.objType)}.cause addOnDataStructure is not exists or empty`)
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
|
|
@@ -48,7 +48,7 @@ async function validateAddOnDataStructure(
|
|
|
48
48
|
addOnAttributeTree: addOnAttributeTree,
|
|
49
49
|
});
|
|
50
50
|
if (!addOnAttributeTree) {
|
|
51
|
-
|
|
51
|
+
errorsFound.push(`objType: ${objTypeString(settings.objType)}. cannot generate attribute tree schema cause not found addOnDataStructure with attributeTreeTag: ${settings.attributeTag}`)
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
|
|
@@ -56,6 +56,6 @@ async function validateAddOnDataStructure(
|
|
|
56
56
|
objectSchema: objectSchema
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
return [returnObjectValue,
|
|
59
|
+
return [returnObjectValue, errorsFound];
|
|
60
60
|
}
|
|
61
61
|
module.exports = validateAddOnDataStructure
|
|
File without changes
|
|
File without changes
|
|
File without changes
|