@izara_project/izara-core-library-service-schemas 1.0.68 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@izara_project/izara-core-library-service-schemas",
3
- "version": "1.0.68",
3
+ "version": "1.0.69",
4
4
  "description": "Schemas for the service and objects it controls",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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