@izara_project/izara-market-library-service-schemas 1.0.67 → 1.0.69
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 +23 -11
- 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/action/handler/templateByHandler/apiTemplate.ejs +26 -44
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/dsqTemplate.ejs +26 -44
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/invTemplate.ejs +26 -44
- package/src/reStructure/TemplateData/relationshipPerAction/create/action/handler/templateByHandler/sqsTemplate.ejs +26 -44
- 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/action/handler/templateByHandler/apiTemplate.ejs +36 -55
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/dsqTemplate.ejs +36 -54
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/invTemplate.ejs +36 -54
- package/src/reStructure/TemplateData/relationshipPerAction/delete/action/handler/templateByHandler/sqsTemplate.ejs +36 -54
- 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/action/handler/templateByHandler/apiTemplate.ejs +28 -47
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/dsqTemplate.ejs +28 -47
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/invTemplate.ejs +28 -47
- package/src/reStructure/TemplateData/relationshipPerAction/get/action/handler/templateByHandler/sqsTemplate.ejs +28 -47
- 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/action/handler/templateByHandler/apiTemplate.ejs +39 -56
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/dsqTemplate.ejs +39 -56
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/invTemplate.ejs +39 -56
- package/src/reStructure/TemplateData/relationshipPerAction/update/action/handler/templateByHandler/sqsTemplate.ejs +39 -56
- 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
|
@@ -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"),
|
|
@@ -27,81 +27,64 @@ const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>
|
|
|
27
27
|
// validate event params in middleware before into function
|
|
28
28
|
let validatorSchema = {
|
|
29
29
|
type: "object",
|
|
30
|
-
required: [
|
|
31
|
-
'firstObject',
|
|
32
|
-
'secondObject',
|
|
33
|
-
'oldReltypeAndDirection',
|
|
34
|
-
'newRelType',
|
|
35
|
-
],
|
|
30
|
+
required: ["firstObject","secondObject", "relType", "relationshipProperties","relationshipDirection","relId"],
|
|
36
31
|
properties: {
|
|
37
32
|
firstObject: {
|
|
38
|
-
type:
|
|
39
|
-
required: [
|
|
33
|
+
type: "object",
|
|
34
|
+
required: ["objType","identifiers"],
|
|
40
35
|
properties: {
|
|
41
36
|
objType: {
|
|
42
|
-
type:
|
|
43
|
-
required: [
|
|
37
|
+
type: "object",
|
|
38
|
+
required: ["serviceTag","objectType"],
|
|
44
39
|
properties: {
|
|
45
|
-
serviceTag:
|
|
46
|
-
objectType:
|
|
40
|
+
serviceTag: validatorSchema.stringNotEmpty(),
|
|
41
|
+
objectType: validatorSchema.stringNotEmpty(),
|
|
47
42
|
}
|
|
48
43
|
},
|
|
49
44
|
identifiers: {
|
|
50
45
|
type: "object",
|
|
51
46
|
minProperties: 1
|
|
52
|
-
}
|
|
47
|
+
}
|
|
53
48
|
}
|
|
54
49
|
},
|
|
55
50
|
secondObject: {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
},
|
|
51
|
+
type: "object",
|
|
52
|
+
required: ["objType","identifiers"],
|
|
53
|
+
properties: {
|
|
54
|
+
objType: {
|
|
55
|
+
type: "object",
|
|
56
|
+
required: ["serviceTag","objectType"],
|
|
57
|
+
properties: {
|
|
58
|
+
serviceTag: validatorSchema.stringNotEmpty(),
|
|
59
|
+
objectType: validatorSchema.stringNotEmpty(),
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
identifiers: {
|
|
63
|
+
type: "object",
|
|
64
|
+
minProperties: 1
|
|
71
65
|
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
relType: {
|
|
69
|
+
type: "object",
|
|
70
|
+
required: ["relationshipTag", "serviceTag"],
|
|
76
71
|
properties: {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
required: ['serviceTag', 'relationshipTag'],
|
|
80
|
-
properties: {
|
|
81
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
82
|
-
relationshipTag: izara.validatorSchema.stringNotEmpty(),
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
relationshipProperties: {
|
|
86
|
-
type: 'object',
|
|
87
|
-
},
|
|
88
|
-
relationshipDirection: {
|
|
72
|
+
relationshipTag: validatorSchema.stringNotEmpty(),
|
|
73
|
+
serviceTag: {
|
|
89
74
|
type: 'string',
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
75
|
+
pattern: "^[a-zA-Z0-9_-]+$",
|
|
76
|
+
enum: [process.env.iz_serviceTag]
|
|
77
|
+
}
|
|
93
78
|
}
|
|
94
79
|
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
100
|
-
relationshipTag: izara.validatorSchema.stringNotEmpty(),
|
|
101
|
-
}
|
|
80
|
+
relId: validatorSchema.stringNotEmpty(),
|
|
81
|
+
relationshipProperties: {
|
|
82
|
+
type: "object",
|
|
83
|
+
minProperties: 1
|
|
102
84
|
},
|
|
103
|
-
|
|
104
|
-
type:
|
|
85
|
+
relationshipDirection: {
|
|
86
|
+
type: "string",
|
|
87
|
+
enum: ['from','to']
|
|
105
88
|
}
|
|
106
89
|
}
|
|
107
90
|
};
|
|
@@ -48,81 +48,64 @@ middleware.setValidatorSchema(recordHandlerSharedLib.baseValidatorSchema(
|
|
|
48
48
|
// validate event params in middlewware before into function.
|
|
49
49
|
let validatorSchema = {
|
|
50
50
|
type: "object",
|
|
51
|
-
required: [
|
|
52
|
-
'firstObject',
|
|
53
|
-
'secondObject',
|
|
54
|
-
'oldReltypeAndDirection',
|
|
55
|
-
'newRelType',
|
|
56
|
-
],
|
|
51
|
+
required: ["firstObject","secondObject", "relType", "relationshipProperties","relationshipDirection","relId"],
|
|
57
52
|
properties: {
|
|
58
53
|
firstObject: {
|
|
59
|
-
type:
|
|
60
|
-
required: [
|
|
54
|
+
type: "object",
|
|
55
|
+
required: ["objType","identifiers"],
|
|
61
56
|
properties: {
|
|
62
57
|
objType: {
|
|
63
|
-
type:
|
|
64
|
-
required: [
|
|
58
|
+
type: "object",
|
|
59
|
+
required: ["serviceTag","objectType"],
|
|
65
60
|
properties: {
|
|
66
|
-
serviceTag:
|
|
67
|
-
objectType:
|
|
61
|
+
serviceTag: validatorSchema.stringNotEmpty(),
|
|
62
|
+
objectType: validatorSchema.stringNotEmpty(),
|
|
68
63
|
}
|
|
69
64
|
},
|
|
70
65
|
identifiers: {
|
|
71
66
|
type: "object",
|
|
72
67
|
minProperties: 1
|
|
73
|
-
}
|
|
68
|
+
}
|
|
74
69
|
}
|
|
75
70
|
},
|
|
76
71
|
secondObject: {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
},
|
|
72
|
+
type: "object",
|
|
73
|
+
required: ["objType","identifiers"],
|
|
74
|
+
properties: {
|
|
75
|
+
objType: {
|
|
76
|
+
type: "object",
|
|
77
|
+
required: ["serviceTag","objectType"],
|
|
78
|
+
properties: {
|
|
79
|
+
serviceTag: validatorSchema.stringNotEmpty(),
|
|
80
|
+
objectType: validatorSchema.stringNotEmpty(),
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
identifiers: {
|
|
84
|
+
type: "object",
|
|
85
|
+
minProperties: 1
|
|
92
86
|
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
relType: {
|
|
90
|
+
type: "object",
|
|
91
|
+
required: ["relationshipTag", "serviceTag"],
|
|
97
92
|
properties: {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
required: ['serviceTag', 'relationshipTag'],
|
|
101
|
-
properties: {
|
|
102
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
103
|
-
relationshipTag: izara.validatorSchema.stringNotEmpty(),
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
relationshipProperties: {
|
|
107
|
-
type: 'object',
|
|
108
|
-
},
|
|
109
|
-
relationshipDirection: {
|
|
93
|
+
relationshipTag: validatorSchema.stringNotEmpty(),
|
|
94
|
+
serviceTag: {
|
|
110
95
|
type: 'string',
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
96
|
+
pattern: "^[a-zA-Z0-9_-]+$",
|
|
97
|
+
enum: [process.env.iz_serviceTag]
|
|
98
|
+
}
|
|
114
99
|
}
|
|
115
100
|
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
121
|
-
relationshipTag: izara.validatorSchema.stringNotEmpty(),
|
|
122
|
-
}
|
|
101
|
+
relId: validatorSchema.stringNotEmpty(),
|
|
102
|
+
relationshipProperties: {
|
|
103
|
+
type: "object",
|
|
104
|
+
minProperties: 1
|
|
123
105
|
},
|
|
124
|
-
|
|
125
|
-
type:
|
|
106
|
+
relationshipDirection: {
|
|
107
|
+
type: "string",
|
|
108
|
+
enum: ['from','to']
|
|
126
109
|
}
|
|
127
110
|
}
|
|
128
111
|
};
|
|
@@ -31,81 +31,64 @@ const <%- functionName %> = require('./<%- firstLetterUpperCase(functionName) %>
|
|
|
31
31
|
// validate event params in middlewware before into function.
|
|
32
32
|
let validatorSchema = {
|
|
33
33
|
type: "object",
|
|
34
|
-
required: [
|
|
35
|
-
'firstObject',
|
|
36
|
-
'secondObject',
|
|
37
|
-
'oldReltypeAndDirection',
|
|
38
|
-
'newRelType',
|
|
39
|
-
],
|
|
34
|
+
required: ["firstObject","secondObject", "relType", "relationshipProperties","relationshipDirection","relId"],
|
|
40
35
|
properties: {
|
|
41
36
|
firstObject: {
|
|
42
|
-
type:
|
|
43
|
-
required: [
|
|
37
|
+
type: "object",
|
|
38
|
+
required: ["objType","identifiers"],
|
|
44
39
|
properties: {
|
|
45
40
|
objType: {
|
|
46
|
-
type:
|
|
47
|
-
required: [
|
|
41
|
+
type: "object",
|
|
42
|
+
required: ["serviceTag","objectType"],
|
|
48
43
|
properties: {
|
|
49
|
-
serviceTag:
|
|
50
|
-
objectType:
|
|
44
|
+
serviceTag: validatorSchema.stringNotEmpty(),
|
|
45
|
+
objectType: validatorSchema.stringNotEmpty(),
|
|
51
46
|
}
|
|
52
47
|
},
|
|
53
48
|
identifiers: {
|
|
54
49
|
type: "object",
|
|
55
50
|
minProperties: 1
|
|
56
|
-
}
|
|
51
|
+
}
|
|
57
52
|
}
|
|
58
53
|
},
|
|
59
54
|
secondObject: {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
55
|
+
type: "object",
|
|
56
|
+
required: ["objType","identifiers"],
|
|
57
|
+
properties: {
|
|
58
|
+
objType: {
|
|
59
|
+
type: "object",
|
|
60
|
+
required: ["serviceTag","objectType"],
|
|
61
|
+
properties: {
|
|
62
|
+
serviceTag: validatorSchema.stringNotEmpty(),
|
|
63
|
+
objectType: validatorSchema.stringNotEmpty(),
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
identifiers: {
|
|
67
|
+
type: "object",
|
|
68
|
+
minProperties: 1
|
|
75
69
|
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
relType: {
|
|
73
|
+
type: "object",
|
|
74
|
+
required: ["relationshipTag", "serviceTag"],
|
|
80
75
|
properties: {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
required: ['serviceTag', 'relationshipTag'],
|
|
84
|
-
properties: {
|
|
85
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
86
|
-
relationshipTag: izara.validatorSchema.stringNotEmpty(),
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
relationshipProperties: {
|
|
90
|
-
type: 'object',
|
|
91
|
-
},
|
|
92
|
-
relationshipDirection: {
|
|
76
|
+
relationshipTag: validatorSchema.stringNotEmpty(),
|
|
77
|
+
serviceTag: {
|
|
93
78
|
type: 'string',
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
79
|
+
pattern: "^[a-zA-Z0-9_-]+$",
|
|
80
|
+
enum: [process.env.iz_serviceTag]
|
|
81
|
+
}
|
|
97
82
|
}
|
|
98
83
|
},
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
serviceTag: izara.validatorSchema.stringNotEmpty(),
|
|
104
|
-
relationshipTag: izara.validatorSchema.stringNotEmpty(),
|
|
105
|
-
}
|
|
84
|
+
relId: validatorSchema.stringNotEmpty(),
|
|
85
|
+
relationshipProperties: {
|
|
86
|
+
type: "object",
|
|
87
|
+
minProperties: 1
|
|
106
88
|
},
|
|
107
|
-
|
|
108
|
-
type:
|
|
89
|
+
relationshipDirection: {
|
|
90
|
+
type: "string",
|
|
91
|
+
enum: ['from','to']
|
|
109
92
|
}
|
|
110
93
|
}
|
|
111
94
|
};
|