@izara_project/izara-core-library-service-schemas 1.0.68 → 1.0.70
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/ValidatorSchema.js +18 -2
package/package.json
CHANGED
package/src/ValidatorSchema.js
CHANGED
|
@@ -25,7 +25,7 @@ const Logger = require('@izara_project/izara-core-library-logger');
|
|
|
25
25
|
const uploadUseCase = require('./libs/UploadUseCase')
|
|
26
26
|
|
|
27
27
|
const { getGraphServiceTag, getServiceName } = require('./ServiceConfig')
|
|
28
|
-
|
|
28
|
+
const { createLinkTypeId } = require('./Utils');
|
|
29
29
|
const hash = require('@izara_project/izara-shared-core').objectHash;
|
|
30
30
|
const {
|
|
31
31
|
validateObjectSchema,
|
|
@@ -929,7 +929,6 @@ async function validateLocalSchema(_izContext, schemasPath, serviceConfigPath) {
|
|
|
929
929
|
const allObjectRelationships = getAllLocalRelationshipSchema(_izContext, schemasPath);
|
|
930
930
|
const allReferenceObjectRelationships = getAllLocalRefObjectRelationshipSchema(_izContext, schemasPath);
|
|
931
931
|
const allFlowSchemas = await getAllLocalFlowSchemas(_izContext, schemasPath).then(res => res.records);
|
|
932
|
-
console.log("allObjectRelationships", allObjectRelationships)
|
|
933
932
|
|
|
934
933
|
// validate all schema
|
|
935
934
|
for (const objSchema of allObjectSchema) {
|
|
@@ -1129,6 +1128,23 @@ async function validateLocalSchema(_izContext, schemasPath, serviceConfigPath) {
|
|
|
1129
1128
|
}
|
|
1130
1129
|
})
|
|
1131
1130
|
)
|
|
1131
|
+
// validate dulicate link
|
|
1132
|
+
let relSchemaLinkType = new Set();
|
|
1133
|
+
for (let link of relData.links) {
|
|
1134
|
+
console.log("link", link)
|
|
1135
|
+
let linkTypeRelSchema = createLinkTypeId(_izContext,
|
|
1136
|
+
link.from.objType,
|
|
1137
|
+
link.to.objType,
|
|
1138
|
+
{ relationshipTag: relTagName, serviceTag: process.env.iz_serviceTag },
|
|
1139
|
+
"from"
|
|
1140
|
+
)
|
|
1141
|
+
|
|
1142
|
+
if (!relSchemaLinkType.has(linkTypeRelSchema)) {
|
|
1143
|
+
relSchemaLinkType.add(linkTypeRelSchema)
|
|
1144
|
+
} else {
|
|
1145
|
+
throw new NoRetryError(`error Schema relationship duplicate link with objType ${JSON.stringify(link.from.objType)} and ${JSON.stringify(link.to.objType)}`)
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1132
1148
|
}
|
|
1133
1149
|
}
|
|
1134
1150
|
|