@unito/integration-api 8.0.4 → 8.0.5

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.
@@ -41,6 +41,13 @@
41
41
  "items": {
42
42
  "$ref": "https://unito.io/integration_api/relationSummary.schema.json"
43
43
  }
44
+ },
45
+ "kinds": {
46
+ "type": "array",
47
+ "items": {
48
+ "type": "string",
49
+ "format": "uri"
50
+ }
44
51
  }
45
52
  }
46
53
  }
@@ -116,7 +116,9 @@ export function isRelationSchema(potentialRelationSchema, options) {
116
116
  potentialRelationSchema['fields'].every((f) => isFieldSchema(f, options)) &&
117
117
  (isUndefined(potentialRelationSchema['relations']) ||
118
118
  (Array.isArray(potentialRelationSchema['relations']) &&
119
- potentialRelationSchema['relations'].every((r) => isRelationSummary(r, options)))));
119
+ potentialRelationSchema['relations'].every((r) => isRelationSummary(r, options)))) &&
120
+ (isUndefined(potentialRelationSchema['kinds']) ||
121
+ (Array.isArray(potentialRelationSchema['kinds']) && potentialRelationSchema['kinds'].every(isString))));
120
122
  }
121
123
  /**
122
124
  * Checks if the input is an Api.RelationSchema object or the string '__self'.
@@ -234,7 +234,9 @@ function isRelationSchema(potentialRelationSchema, options) {
234
234
  potentialRelationSchema['fields'].every((f) => isFieldSchema(f, options)) &&
235
235
  (isUndefined(potentialRelationSchema['relations']) ||
236
236
  (Array.isArray(potentialRelationSchema['relations']) &&
237
- potentialRelationSchema['relations'].every((r) => isRelationSummary(r, options)))));
237
+ potentialRelationSchema['relations'].every((r) => isRelationSummary(r, options)))) &&
238
+ (isUndefined(potentialRelationSchema['kinds']) ||
239
+ (Array.isArray(potentialRelationSchema['kinds']) && potentialRelationSchema['kinds'].every(isString))));
238
240
  }
239
241
  /**
240
242
  * Checks if the input is an Api.RelationSchema object or the string '__self'.
@@ -498,6 +498,12 @@ export interface RelationSchema {
498
498
  * Summaries of the relations expected to be found on these items.
499
499
  */
500
500
  relations?: RelationSummary[];
501
+ /**
502
+ * Optional URI-shaped identifiers describing the kind of items in this relation
503
+ * (e.g. ['urn:unito:person', 'https://schema.org/Person']). Most specific kind
504
+ * first; more general kinds after.
505
+ */
506
+ kinds?: string[];
501
507
  }
502
508
  /**
503
509
  * A type that guarantees the presence of a populated schema by preventing the use of __self.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unito/integration-api",
3
- "version": "8.0.4",
3
+ "version": "8.0.5",
4
4
  "description": "The Unito Integration API",
5
5
  "type": "module",
6
6
  "types": "./dist/src/index.d.ts",