@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.
package/dist/src/guards.js
CHANGED
|
@@ -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'.
|
package/dist/src/index.cjs
CHANGED
|
@@ -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'.
|
package/dist/src/types.d.ts
CHANGED
|
@@ -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.
|