@izara_project/izara-core-generate-service-code 1.0.90 → 1.0.91
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/emit/crud/emitDynamicCrudFlowSchemas.js +2 -2
- package/src/emit/crud/templates/CreateAfterHookCallback_Main.ejs +6 -6
- package/src/emit/crud/templates/CreateBeforeHookCallback_Main.ejs +3 -3
- package/src/emit/crud/templates/CreateComplete_Main.ejs +22 -22
- package/src/emit/crud/templates/CreateEndpoint_Main.ejs +18 -18
- package/src/emit/crud/templates/CreateLogicalLib.ejs +47 -47
- package/src/emit/crud/templates/CreateNodeCallback_Main.ejs +24 -24
- package/src/emit/crud/templates/DeleteAfterHookCallback_Main.ejs +5 -5
- package/src/emit/crud/templates/DeleteBeforeHookCallback_Main.ejs +3 -3
- package/src/emit/crud/templates/DeleteComplete_Main.ejs +23 -23
- package/src/emit/crud/templates/DeleteEndpoint_Main.ejs +15 -15
- package/src/emit/crud/templates/DeleteLogicalLib.ejs +19 -19
- package/src/emit/crud/templates/FlowEndpointRbacCallback_Main.ejs +3 -3
- package/src/emit/crud/templates/UpdateAfterHookCallback_Main.ejs +5 -5
- package/src/emit/crud/templates/UpdateBeforeHookCallback_Main.ejs +3 -3
- package/src/emit/crud/templates/UpdateComplete_Main.ejs +22 -22
- package/src/emit/crud/templates/UpdateEndpoint_Main.ejs +15 -15
- package/src/emit/crud/templates/UpdateLogicalLib.ejs +33 -33
- package/src/emit/custom/templates/FlowEndpointRbacCallback_Main.ejs +7 -7
- package/src/emit/custom/templates/s3/ConfirmReserved_HdrSqs.ejs +3 -3
- package/src/emit/custom/templates/s3/ConfirmReserved_Main.ejs +3 -3
- package/src/emit/custom/templates/s3/CreatePreSignUrl_HdrSqs.ejs +3 -3
- package/src/emit/custom/templates/s3/CreatePreSignUrl_Main.ejs +4 -4
- package/src/emit/rbac/emitDynamicRbacFlowSchemas.js +26 -6
- package/src/emit/rbac/emitRbacApplicationArtifacts.js +40 -13
- package/src/emit/rbac/templates/UserRbacFlow_Main.ejs +13 -7
- package/src/emit/relationship/emitDynamicRelationshipFlowSchemas.js +1 -1
- package/src/emit/relationship/templates/ChangeRelationshipComplete_HdrSqs.ejs +2 -2
- package/src/emit/relationship/templates/ChangeRelationshipComplete_Main.ejs +6 -6
- package/src/emit/relationship/templates/ChangeRelationship_Main.ejs +17 -17
- package/src/emit/relationship/templates/CreateRelationshipComplete_HdrSqs.ejs +2 -2
- package/src/emit/relationship/templates/CreateRelationshipComplete_Main.ejs +6 -6
- package/src/emit/relationship/templates/CreateRelationship_Main.ejs +14 -14
- package/src/emit/relationship/templates/DeleteRelationshipComplete_HdrSqs.ejs +2 -2
- package/src/emit/relationship/templates/DeleteRelationshipComplete_Main.ejs +6 -6
- package/src/emit/relationship/templates/DeleteRelationship_Main.ejs +10 -10
- package/src/emit/relationship/templates/GetRelationshipComplete_HdrSqs.ejs +2 -2
- package/src/emit/relationship/templates/GetRelationshipComplete_Main.ejs +5 -5
- package/src/emit/relationship/templates/GetRelationship_Main.ejs +9 -9
- package/src/emit/relationship/templates/MoveRelationshipComplete_HdrSqs.ejs +2 -2
- package/src/emit/relationship/templates/MoveRelationshipComplete_Main.ejs +6 -6
- package/src/emit/relationship/templates/MoveRelationship_Main.ejs +15 -15
- package/src/emit/relationship/templates/UpdateRelationshipComplete_HdrSqs.ejs +2 -2
- package/src/emit/relationship/templates/UpdateRelationshipComplete_Main.ejs +6 -6
- package/src/emit/relationship/templates/UpdateRelationship_Main.ejs +11 -11
- package/src/emit/resource/emitResourceArtifacts.js +3 -7
- package/src/emit/shared/templates/FindData_Main.ejs +19 -19
- package/src/emit/shared/templates/PaginateProcessLogical_Main.ejs +3 -3
- package/src/emit/shared/templates/ProcessLogical_Main.ejs +15 -15
- package/test/createTargetRoleHandler.test.js +62 -4
- package/test/crudApplicationArtifacts.test.js +3 -3
- package/test/dynamicCrudFlowSchemas.test.js +2 -2
- package/test/dynamicRbacFlowSchemas.test.js +32 -4
- package/test/relationshipApplicationArtifacts.test.js +1 -1
|
@@ -87,7 +87,7 @@ export default async function deleteRelationship(
|
|
|
87
87
|
} = requestParams;
|
|
88
88
|
|
|
89
89
|
const parentFlowId = identifierUuid();
|
|
90
|
-
let
|
|
90
|
+
let foundErrors = [];
|
|
91
91
|
|
|
92
92
|
//(<beforeValidateDeleteRel>)
|
|
93
93
|
//(</beforeValidateDeleteRel>)
|
|
@@ -104,7 +104,7 @@ export default async function deleteRelationship(
|
|
|
104
104
|
);
|
|
105
105
|
|
|
106
106
|
if (!objectSchema) {
|
|
107
|
-
|
|
107
|
+
foundErrors.push(
|
|
108
108
|
`validateIdentifiers, not found schema of ${objTypeString}`
|
|
109
109
|
);
|
|
110
110
|
}
|
|
@@ -115,7 +115,7 @@ export default async function deleteRelationship(
|
|
|
115
115
|
];
|
|
116
116
|
for (const identifierName of identifierNames) {
|
|
117
117
|
if (!identifiersObject.hasOwnProperty(identifierName)) {
|
|
118
|
-
|
|
118
|
+
foundErrors.push(
|
|
119
119
|
`validateIdentifiers, ${objTypeString} property:${identifierName} not exists`
|
|
120
120
|
);
|
|
121
121
|
} else {
|
|
@@ -123,7 +123,7 @@ export default async function deleteRelationship(
|
|
|
123
123
|
typeof identifiersObject[identifierName] !== 'string' &&
|
|
124
124
|
typeof identifiersObject[identifierName] !== 'number'
|
|
125
125
|
) {
|
|
126
|
-
|
|
126
|
+
foundErrors.push(
|
|
127
127
|
`validateIdentifiers, ${objTypeString} property:${identifierName} should be string or number`
|
|
128
128
|
);
|
|
129
129
|
}
|
|
@@ -178,7 +178,7 @@ export default async function deleteRelationship(
|
|
|
178
178
|
usedStorageResource.graphServerTag
|
|
179
179
|
);
|
|
180
180
|
if (!graphServiceTag) {
|
|
181
|
-
|
|
181
|
+
foundErrors.push(
|
|
182
182
|
`storageResourceTag:${storageResourceTag} invalid, not found graph serviceTag from graphServerTag:${usedStorageResource.graphServerTag}`
|
|
183
183
|
);
|
|
184
184
|
}
|
|
@@ -202,14 +202,14 @@ export default async function deleteRelationship(
|
|
|
202
202
|
);
|
|
203
203
|
|
|
204
204
|
if (!targetStorageResources.length) {
|
|
205
|
-
|
|
205
|
+
foundErrors.push(`Not found link from relationship schema`);
|
|
206
206
|
}
|
|
207
207
|
} else {
|
|
208
|
-
|
|
208
|
+
foundErrors.push(`relationshipSchema not exists`);
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
// if found errors will stop processing
|
|
212
|
-
if (
|
|
212
|
+
if (foundErrors.length) {
|
|
213
213
|
let deleteRelCompleteMsg = {
|
|
214
214
|
firstObject: firstObject,
|
|
215
215
|
secondObject: secondObject,
|
|
@@ -219,7 +219,7 @@ export default async function deleteRelationship(
|
|
|
219
219
|
//(<inDeleteRelCompleteMsg>)
|
|
220
220
|
//(</inDeleteRelCompleteMsg>)
|
|
221
221
|
status: 'error',
|
|
222
|
-
|
|
222
|
+
foundErrors: foundErrors,
|
|
223
223
|
parentFlowId
|
|
224
224
|
};
|
|
225
225
|
|
|
@@ -444,7 +444,7 @@ export default async function deleteRelationship(
|
|
|
444
444
|
relType,
|
|
445
445
|
relationshipProperties,
|
|
446
446
|
relationshipDirection,
|
|
447
|
-
|
|
447
|
+
foundErrors
|
|
448
448
|
};
|
|
449
449
|
} catch (err) {
|
|
450
450
|
_izContext.logger.error('error deleteRelationship: ', err);
|
|
@@ -20,7 +20,7 @@ let perRecordsValidatorSchema = {
|
|
|
20
20
|
status: {
|
|
21
21
|
type: 'string'
|
|
22
22
|
},
|
|
23
|
-
|
|
23
|
+
foundErrors: {
|
|
24
24
|
type: 'array'
|
|
25
25
|
},
|
|
26
26
|
graphServiceTag: {
|
|
@@ -31,7 +31,7 @@ let perRecordsValidatorSchema = {
|
|
|
31
31
|
'returnValue',
|
|
32
32
|
'parentFlowId',
|
|
33
33
|
'status',
|
|
34
|
-
'
|
|
34
|
+
'foundErrors',
|
|
35
35
|
'graphServiceTag'
|
|
36
36
|
]
|
|
37
37
|
//(<validatorSchema>)
|
|
@@ -44,7 +44,7 @@ export default async function getRelationshipComplete(
|
|
|
44
44
|
returnValue,
|
|
45
45
|
parentFlowId,
|
|
46
46
|
status,
|
|
47
|
-
|
|
47
|
+
foundErrors,
|
|
48
48
|
graphServiceTag
|
|
49
49
|
} = requestParams;
|
|
50
50
|
|
|
@@ -52,7 +52,7 @@ export default async function getRelationshipComplete(
|
|
|
52
52
|
returnValue: returnValue,
|
|
53
53
|
parentFlowId: parentFlowId,
|
|
54
54
|
status: status,
|
|
55
|
-
|
|
55
|
+
foundErrors: foundErrors,
|
|
56
56
|
graphServiceTag: graphServiceTag,
|
|
57
57
|
passBackProperties: passBackProperties
|
|
58
58
|
});
|
|
@@ -63,7 +63,7 @@ export default async function getRelationshipComplete(
|
|
|
63
63
|
relType: returnValue.requestParams.relType,
|
|
64
64
|
relationshipProperties: returnValue.requestParams.relationshipProperties,
|
|
65
65
|
status: status,
|
|
66
|
-
|
|
66
|
+
foundErrors: foundErrors
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
createCompleteMsg =
|
|
@@ -110,13 +110,13 @@ export default async function getRelationshipComplete(
|
|
|
110
110
|
_izContext,
|
|
111
111
|
awaitingStepId,
|
|
112
112
|
pendingStepId,
|
|
113
|
-
|
|
113
|
+
foundErrors
|
|
114
114
|
);
|
|
115
115
|
|
|
116
116
|
return {
|
|
117
117
|
returnValue,
|
|
118
118
|
status,
|
|
119
|
-
|
|
119
|
+
foundErrors
|
|
120
120
|
};
|
|
121
121
|
} catch (err) {
|
|
122
122
|
_izContext.logger.error('error GetRelationshipComplete:', err);
|
|
@@ -84,7 +84,7 @@ export default async function getRelationship(
|
|
|
84
84
|
//(</requestParamGetRel>)
|
|
85
85
|
} = requestParams;
|
|
86
86
|
|
|
87
|
-
let
|
|
87
|
+
let foundErrors = [];
|
|
88
88
|
|
|
89
89
|
//(<beforeValidateGetRel>)
|
|
90
90
|
//(</beforeValidateGetRel>)
|
|
@@ -103,7 +103,7 @@ export default async function getRelationship(
|
|
|
103
103
|
);
|
|
104
104
|
|
|
105
105
|
if (!objectSchema) {
|
|
106
|
-
|
|
106
|
+
foundErrors.push(
|
|
107
107
|
`validateIdentifiers, not found schema of ${objTypeString}`
|
|
108
108
|
);
|
|
109
109
|
}
|
|
@@ -114,7 +114,7 @@ export default async function getRelationship(
|
|
|
114
114
|
];
|
|
115
115
|
for (const identifierName of identifierNames) {
|
|
116
116
|
if (!identifiersObject.hasOwnProperty(identifierName)) {
|
|
117
|
-
|
|
117
|
+
foundErrors.push(
|
|
118
118
|
`validateIdentifiers, ${objTypeString} ` +
|
|
119
119
|
`property:${identifierName} not exists`
|
|
120
120
|
);
|
|
@@ -123,7 +123,7 @@ export default async function getRelationship(
|
|
|
123
123
|
typeof identifiersObject[identifierName] !== 'string' &&
|
|
124
124
|
typeof identifiersObject[identifierName] !== 'number'
|
|
125
125
|
) {
|
|
126
|
-
|
|
126
|
+
foundErrors.push(
|
|
127
127
|
`validateIdentifiers, ${objTypeString} ` +
|
|
128
128
|
`property:${identifierName} should be string or number`
|
|
129
129
|
);
|
|
@@ -227,7 +227,7 @@ export default async function getRelationship(
|
|
|
227
227
|
usedStorageResource.graphServerTag
|
|
228
228
|
);
|
|
229
229
|
if (!graphServiceTag) {
|
|
230
|
-
|
|
230
|
+
foundErrors.push(
|
|
231
231
|
`storageResourceTag: ${storageResourceTag} ` +
|
|
232
232
|
`invalid, not found graph serviceTag from ` +
|
|
233
233
|
`graphServerTag: ${usedStorageResource.graphServerTag}`
|
|
@@ -255,15 +255,15 @@ export default async function getRelationship(
|
|
|
255
255
|
);
|
|
256
256
|
|
|
257
257
|
if (!targetStorageResources.length) {
|
|
258
|
-
|
|
258
|
+
foundErrors.push(`Not found link from relationship schema`);
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
} else {
|
|
262
|
-
|
|
262
|
+
foundErrors.push(`relationshipSchema not exists`);
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
// if found errors will stop processing
|
|
266
|
-
if (
|
|
266
|
+
if (foundErrors.length) {
|
|
267
267
|
let getRelCompleteMsg = {
|
|
268
268
|
firstObject: firstObject,
|
|
269
269
|
secondObject: secondObject,
|
|
@@ -272,7 +272,7 @@ export default async function getRelationship(
|
|
|
272
272
|
//(<inGetRelCompleteMsgCrateRel>)
|
|
273
273
|
//(</inGetRelCompleteMsgCrateRel>)
|
|
274
274
|
status: 'error',
|
|
275
|
-
|
|
275
|
+
foundErrors: foundErrors
|
|
276
276
|
};
|
|
277
277
|
|
|
278
278
|
// if have callingFlow will send to message complete
|
|
@@ -20,7 +20,7 @@ let perRecordsValidatorSchema = {
|
|
|
20
20
|
status: {
|
|
21
21
|
type: 'string'
|
|
22
22
|
},
|
|
23
|
-
|
|
23
|
+
foundErrors: {
|
|
24
24
|
type: 'array'
|
|
25
25
|
},
|
|
26
26
|
graphServiceTag: {
|
|
@@ -31,7 +31,7 @@ let perRecordsValidatorSchema = {
|
|
|
31
31
|
'returnValue',
|
|
32
32
|
'parentFlowId',
|
|
33
33
|
'status',
|
|
34
|
-
'
|
|
34
|
+
'foundErrors',
|
|
35
35
|
'graphServiceTag'
|
|
36
36
|
]
|
|
37
37
|
//(<validatorSchema>)
|
|
@@ -44,7 +44,7 @@ export default async function <%- functionName %>(
|
|
|
44
44
|
returnValue,
|
|
45
45
|
parentFlowId,
|
|
46
46
|
status,
|
|
47
|
-
|
|
47
|
+
foundErrors,
|
|
48
48
|
graphServiceTag
|
|
49
49
|
} = requestParams;
|
|
50
50
|
|
|
@@ -52,7 +52,7 @@ export default async function <%- functionName %>(
|
|
|
52
52
|
returnValue: returnValue,
|
|
53
53
|
parentFlowId: parentFlowId,
|
|
54
54
|
status: status,
|
|
55
|
-
|
|
55
|
+
foundErrors: foundErrors,
|
|
56
56
|
graphServiceTag: graphServiceTag,
|
|
57
57
|
passBackProperties: passBackProperties
|
|
58
58
|
});
|
|
@@ -76,7 +76,7 @@ export default async function <%- functionName %>(
|
|
|
76
76
|
_izContext.logger.warn(
|
|
77
77
|
`No pending step found for awaitingStepId: ${awaitingStepId}`
|
|
78
78
|
);
|
|
79
|
-
return { returnValue, status,
|
|
79
|
+
return { returnValue, status, foundErrors };
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
const result =
|
|
@@ -84,7 +84,7 @@ export default async function <%- functionName %>(
|
|
|
84
84
|
_izContext,
|
|
85
85
|
pending.pendingStepId,
|
|
86
86
|
awaitingStepId,
|
|
87
|
-
|
|
87
|
+
foundErrors
|
|
88
88
|
);
|
|
89
89
|
_izContext.logger.debug(
|
|
90
90
|
'[<%- functionName %>] all awaiting steps result',
|
|
@@ -109,7 +109,7 @@ export default async function <%- functionName %>(
|
|
|
109
109
|
moveObject: returnValue.requestParams.moveObject,
|
|
110
110
|
status: status,
|
|
111
111
|
parentFlowId: parentFlowId || returnValue?.parentFlowId,
|
|
112
|
-
|
|
112
|
+
foundErrors: foundErrors
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
const callingFlowConfig =
|
|
@@ -167,7 +167,7 @@ export default async function <%- functionName %>(
|
|
|
167
167
|
return {
|
|
168
168
|
returnValue,
|
|
169
169
|
status,
|
|
170
|
-
|
|
170
|
+
foundErrors
|
|
171
171
|
};
|
|
172
172
|
} catch (err) {
|
|
173
173
|
_izContext.logger.error('error createRelationshipComplete:', err);
|
|
@@ -93,7 +93,7 @@ export default async function moveRelationship(
|
|
|
93
93
|
} = requestParams;
|
|
94
94
|
|
|
95
95
|
const parentFlowId = identifierUuid();
|
|
96
|
-
let
|
|
96
|
+
let foundErrors = [];
|
|
97
97
|
|
|
98
98
|
//(<beforeValidateMoveRel>)
|
|
99
99
|
//(</beforeValidateMoveRel>).
|
|
@@ -110,7 +110,7 @@ export default async function moveRelationship(
|
|
|
110
110
|
);
|
|
111
111
|
|
|
112
112
|
if (!objectSchema) {
|
|
113
|
-
|
|
113
|
+
foundErrors.push(
|
|
114
114
|
`validateIdentifiers, not found schema of ${objTypeString}`
|
|
115
115
|
);
|
|
116
116
|
}
|
|
@@ -121,7 +121,7 @@ export default async function moveRelationship(
|
|
|
121
121
|
];
|
|
122
122
|
for (const identifierName of identifierNames) {
|
|
123
123
|
if (!identifiersObject.hasOwnProperty(identifierName)) {
|
|
124
|
-
|
|
124
|
+
foundErrors.push(
|
|
125
125
|
`validateIdentifiers, ${objTypeString} property:${identifierName} not exists`
|
|
126
126
|
);
|
|
127
127
|
} else {
|
|
@@ -129,7 +129,7 @@ export default async function moveRelationship(
|
|
|
129
129
|
typeof identifiersObject[identifierName] !== 'string' &&
|
|
130
130
|
typeof identifiersObject[identifierName] !== 'number'
|
|
131
131
|
) {
|
|
132
|
-
|
|
132
|
+
foundErrors.push(
|
|
133
133
|
`validateIdentifiers, ${objTypeString} property:${identifierName} should be string or number`
|
|
134
134
|
);
|
|
135
135
|
}
|
|
@@ -163,13 +163,13 @@ export default async function moveRelationship(
|
|
|
163
163
|
!relationshipSchema.hasOwnProperty('moveBy') ||
|
|
164
164
|
relationshipSchema.moveBy === 'none'
|
|
165
165
|
) {
|
|
166
|
-
|
|
166
|
+
foundErrors.push(`relationship: ${relType.relationshipTag} can't move`);
|
|
167
167
|
// ? Legacy Code:
|
|
168
168
|
/*
|
|
169
169
|
} else if (relationshipSchema.moveBy === "user") {
|
|
170
170
|
if (callingFlowConfig) {
|
|
171
171
|
if (callingFlowConfig.callingFlow !== "ImportDataTestExternalUpdateRelationshipHdrSqs") {
|
|
172
|
-
|
|
172
|
+
foundErrors.push(`moveBy is user but it's not user process with importData`);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
}
|
|
@@ -177,7 +177,7 @@ export default async function moveRelationship(
|
|
|
177
177
|
// ? [Fix]: The legacy logic incorrectly blocked "user" from regular execution and allowed non-user values.
|
|
178
178
|
// ? It has been corrected to require moveBy === "user" for normal execution.
|
|
179
179
|
} else if (relationshipSchema.moveBy !== 'user') {
|
|
180
|
-
|
|
180
|
+
foundErrors.push(
|
|
181
181
|
`relationship: ${relType.relationshipTag} moveBy is not user`
|
|
182
182
|
);
|
|
183
183
|
}
|
|
@@ -199,7 +199,7 @@ export default async function moveRelationship(
|
|
|
199
199
|
);
|
|
200
200
|
|
|
201
201
|
if (!links.length) {
|
|
202
|
-
|
|
202
|
+
foundErrors.push(
|
|
203
203
|
`not found link between ${JSON.stringify({ firstObject: firstObject.objType })} ${JSON.stringify({ secondObject: secondObject.objType })}`
|
|
204
204
|
);
|
|
205
205
|
}
|
|
@@ -238,7 +238,7 @@ export default async function moveRelationship(
|
|
|
238
238
|
}
|
|
239
239
|
|
|
240
240
|
if (checkCorrectLink == false) {
|
|
241
|
-
|
|
241
|
+
foundErrors.push(`Wrong Relationship Direction`);
|
|
242
242
|
}
|
|
243
243
|
|
|
244
244
|
let targetStorageResources = [];
|
|
@@ -286,7 +286,7 @@ export default async function moveRelationship(
|
|
|
286
286
|
usedStorageResource.graphServerTag
|
|
287
287
|
);
|
|
288
288
|
if (!graphServiceTag) {
|
|
289
|
-
|
|
289
|
+
foundErrors.push(
|
|
290
290
|
`storageResourceTag: ${storageResourceTag} invalid, not found graph serviceTag from graphServerTag: ${usedStorageResource.graphServerTag}`
|
|
291
291
|
);
|
|
292
292
|
}
|
|
@@ -312,23 +312,23 @@ export default async function moveRelationship(
|
|
|
312
312
|
);
|
|
313
313
|
|
|
314
314
|
if (!targetStorageResources.length) {
|
|
315
|
-
|
|
315
|
+
foundErrors.push(`Not found link from relationship schema`);
|
|
316
316
|
}
|
|
317
317
|
|
|
318
318
|
// validate properties exists with schema
|
|
319
319
|
for (const propKey in relationshipProperties) {
|
|
320
320
|
if (!relationshipSchema.fieldNames.hasOwnProperty(propKey)) {
|
|
321
|
-
|
|
321
|
+
foundErrors.push(
|
|
322
322
|
`property: ${propKey} not exists in relationshipSchema`
|
|
323
323
|
);
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
} else {
|
|
327
|
-
|
|
327
|
+
foundErrors.push(`relationshipSchema not exists`);
|
|
328
328
|
}
|
|
329
329
|
|
|
330
330
|
// if found errors will stop processing
|
|
331
|
-
if (
|
|
331
|
+
if (foundErrors.length) {
|
|
332
332
|
let moveRelCompleteMsg = {
|
|
333
333
|
firstObject,
|
|
334
334
|
secondObject,
|
|
@@ -339,7 +339,7 @@ export default async function moveRelationship(
|
|
|
339
339
|
//(<inMoveCompleteMsg>)
|
|
340
340
|
//(</inMoveCompleteMsg>)
|
|
341
341
|
status: 'error',
|
|
342
|
-
|
|
342
|
+
foundErrors: foundErrors,
|
|
343
343
|
parentFlowId: parentFlowId
|
|
344
344
|
};
|
|
345
345
|
|
|
@@ -20,7 +20,7 @@ let perRecordsValidatorSchema = {
|
|
|
20
20
|
status: {
|
|
21
21
|
type: 'string'
|
|
22
22
|
},
|
|
23
|
-
|
|
23
|
+
foundErrors: {
|
|
24
24
|
type: 'array'
|
|
25
25
|
},
|
|
26
26
|
graphServiceTag: {
|
|
@@ -31,7 +31,7 @@ let perRecordsValidatorSchema = {
|
|
|
31
31
|
'returnValue',
|
|
32
32
|
'parentFlowId',
|
|
33
33
|
'status',
|
|
34
|
-
'
|
|
34
|
+
'foundErrors',
|
|
35
35
|
'graphServiceTag'
|
|
36
36
|
]
|
|
37
37
|
//(<validatorSchema>)
|
|
@@ -45,7 +45,7 @@ export default async function updateRelationshipComplete(
|
|
|
45
45
|
returnValue,
|
|
46
46
|
parentFlowId,
|
|
47
47
|
status,
|
|
48
|
-
|
|
48
|
+
foundErrors,
|
|
49
49
|
graphServiceTag
|
|
50
50
|
} = requestParams;
|
|
51
51
|
|
|
@@ -53,7 +53,7 @@ export default async function updateRelationshipComplete(
|
|
|
53
53
|
returnValue: returnValue,
|
|
54
54
|
parentFlowId: parentFlowId,
|
|
55
55
|
status: status,
|
|
56
|
-
|
|
56
|
+
foundErrors: foundErrors,
|
|
57
57
|
graphServiceTag: graphServiceTag,
|
|
58
58
|
passBackProperties: passBackProperties
|
|
59
59
|
// callingFlowConfig: callingFlowConfig
|
|
@@ -78,7 +78,7 @@ export default async function updateRelationshipComplete(
|
|
|
78
78
|
_izContext.logger.warn(
|
|
79
79
|
`No pending step found for awaitingStepId: ${awaitingStepId}`
|
|
80
80
|
);
|
|
81
|
-
return { returnValue, status,
|
|
81
|
+
return { returnValue, status, foundErrors };
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
const result =
|
|
@@ -86,7 +86,7 @@ export default async function updateRelationshipComplete(
|
|
|
86
86
|
_izContext,
|
|
87
87
|
pending.pendingStepId,
|
|
88
88
|
awaitingStepId,
|
|
89
|
-
|
|
89
|
+
foundErrors
|
|
90
90
|
);
|
|
91
91
|
_izContext.logger.debug(
|
|
92
92
|
'[UpdateRelationshipComplete] all awaiting steps result',
|
|
@@ -104,7 +104,7 @@ export default async function updateRelationshipComplete(
|
|
|
104
104
|
relId: returnValue.requestParams.relId,
|
|
105
105
|
relType: returnValue.requestParams.relType,
|
|
106
106
|
status: status,
|
|
107
|
-
|
|
107
|
+
foundErrors: foundErrors
|
|
108
108
|
//(<inUpdateCompleteMsg>)
|
|
109
109
|
//(</inUpdateCompleteMsg>)
|
|
110
110
|
};
|
|
@@ -158,7 +158,7 @@ export default async function updateRelationshipComplete(
|
|
|
158
158
|
return {
|
|
159
159
|
returnValue,
|
|
160
160
|
status,
|
|
161
|
-
|
|
161
|
+
foundErrors
|
|
162
162
|
};
|
|
163
163
|
} catch (err) {
|
|
164
164
|
_izContext.logger.error('error updateRelationshipComplete:', err);
|
|
@@ -88,7 +88,7 @@ export default async function updateRelationship(
|
|
|
88
88
|
//(</requestParamUpdateRel>)
|
|
89
89
|
} = requestParams;
|
|
90
90
|
|
|
91
|
-
let
|
|
91
|
+
let foundErrors = [];
|
|
92
92
|
const parentFlowId = identifierUuid();
|
|
93
93
|
|
|
94
94
|
//(<beforeValidateUpdateRel>)
|
|
@@ -106,7 +106,7 @@ export default async function updateRelationship(
|
|
|
106
106
|
);
|
|
107
107
|
|
|
108
108
|
if (!objectSchema) {
|
|
109
|
-
|
|
109
|
+
foundErrors.push(
|
|
110
110
|
`validateIdentifiers, not found schema of ${objTypeString}`
|
|
111
111
|
);
|
|
112
112
|
}
|
|
@@ -116,7 +116,7 @@ export default async function updateRelationship(
|
|
|
116
116
|
schemaIdentifier.fieldName || schemaIdentifier.name;
|
|
117
117
|
|
|
118
118
|
if (!identifiersObject.hasOwnProperty(identifierName)) {
|
|
119
|
-
|
|
119
|
+
foundErrors.push(
|
|
120
120
|
`validateIdentifiers, ${objTypeString} property:${identifierName} not exists`
|
|
121
121
|
);
|
|
122
122
|
} else {
|
|
@@ -124,7 +124,7 @@ export default async function updateRelationship(
|
|
|
124
124
|
typeof identifiersObject[identifierName] !== 'string' &&
|
|
125
125
|
typeof identifiersObject[identifierName] !== 'number'
|
|
126
126
|
) {
|
|
127
|
-
|
|
127
|
+
foundErrors.push(
|
|
128
128
|
`validateIdentifiers, ${objTypeString} property:${identifierName} should be string or number`
|
|
129
129
|
);
|
|
130
130
|
}
|
|
@@ -225,7 +225,7 @@ export default async function updateRelationship(
|
|
|
225
225
|
usedStorageResource.graphServerTag
|
|
226
226
|
);
|
|
227
227
|
if (!graphServiceTag) {
|
|
228
|
-
|
|
228
|
+
foundErrors.push(
|
|
229
229
|
`storageResourceTag:${storageResourceTag} invalid, not found graph serviceTag from graphServerTag:${usedStorageResource.graphServerTag}`
|
|
230
230
|
);
|
|
231
231
|
}
|
|
@@ -252,7 +252,7 @@ export default async function updateRelationship(
|
|
|
252
252
|
);
|
|
253
253
|
|
|
254
254
|
if (!targetStorageResources.length) {
|
|
255
|
-
|
|
255
|
+
foundErrors.push(`Not found link from relationship schema`);
|
|
256
256
|
}
|
|
257
257
|
|
|
258
258
|
// validate canUpdate properties relationship
|
|
@@ -269,21 +269,21 @@ export default async function updateRelationship(
|
|
|
269
269
|
callingFlowConfig.callingFlow !==
|
|
270
270
|
'ImportDataTestExternalUpdateRelationshipHdrSqs'
|
|
271
271
|
) {
|
|
272
|
-
|
|
272
|
+
foundErrors.push(
|
|
273
273
|
`property:${propKey} can update user but it's not user process with importData`
|
|
274
274
|
);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
} else {
|
|
279
|
-
|
|
279
|
+
foundErrors.push(
|
|
280
280
|
`property:${propKey} not exists in relationshipSchema`
|
|
281
281
|
);
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
|
|
285
285
|
// if found errors will stop processing
|
|
286
|
-
if (
|
|
286
|
+
if (foundErrors.length) {
|
|
287
287
|
let updateCompleteMsg = {
|
|
288
288
|
firstObject: firstObject,
|
|
289
289
|
secondObject: secondObject,
|
|
@@ -291,7 +291,7 @@ export default async function updateRelationship(
|
|
|
291
291
|
relType: relType,
|
|
292
292
|
relationshipDirection,
|
|
293
293
|
status: 'error',
|
|
294
|
-
|
|
294
|
+
foundErrors: foundErrors,
|
|
295
295
|
parentFlowId: parentFlowId
|
|
296
296
|
//(<inUpdateCompleteMsgUpdateRel>)
|
|
297
297
|
//(</inUpdateCompleteMsgUpdateRel>)
|
|
@@ -524,7 +524,7 @@ export default async function updateRelationship(
|
|
|
524
524
|
relId: relId,
|
|
525
525
|
relType: relType,
|
|
526
526
|
relationshipDirection,
|
|
527
|
-
|
|
527
|
+
foundErrors
|
|
528
528
|
};
|
|
529
529
|
}
|
|
530
530
|
} catch (err) {
|
|
@@ -1327,15 +1327,11 @@ function hasRbacAddOn(object, objects = []) {
|
|
|
1327
1327
|
}
|
|
1328
1328
|
|
|
1329
1329
|
/**
|
|
1330
|
-
* Returns the per-object RBAC flow queues
|
|
1331
|
-
*
|
|
1332
|
-
* UserRbacFlow SQS functions emitted in emitRbacApplicationArtifacts.
|
|
1330
|
+
* Returns the per-object RBAC flow queues created for objects with an 'rbac'
|
|
1331
|
+
* add-on. ValidatorRbac uses HdrInv and HdrApi (no SQS queue).
|
|
1333
1332
|
*/
|
|
1334
1333
|
function rbacFlowQueueNames(state) {
|
|
1335
|
-
|
|
1336
|
-
...new Set((state.objects ?? []).filter(hasSelfRbacAddOn).map(rbacFlowTag))
|
|
1337
|
-
];
|
|
1338
|
-
return flowTags.map((flowTag) => `${flowTag}HdrSqs`);
|
|
1334
|
+
return [];
|
|
1339
1335
|
}
|
|
1340
1336
|
function includesEvent(flow, event) {
|
|
1341
1337
|
return Array.isArray(flow?.event) && flow.event.includes(event);
|