@unito/integration-api 3.0.0 → 4.1.0

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.
@@ -49,7 +49,7 @@
49
49
  }
50
50
  },
51
51
  "reference": {
52
- "$ref": "https://unito.io/integration_api/relation.schema.json"
52
+ "$ref": "https://unito.io/integration_api/referenceRelation.schema.json"
53
53
  },
54
54
  "info": {
55
55
  "type": "string"
@@ -0,0 +1,35 @@
1
+ {
2
+ "$id": "https://unito.io/integration_api/referenceRelation.schema.json",
3
+ "title": "Relation",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": ["path", "schema", "label"],
7
+ "properties": {
8
+ "path": {
9
+ "type": "string",
10
+ "format": "uri-reference",
11
+ "pattern": "^\/.*$"
12
+ },
13
+ "label": {
14
+ "type": "string",
15
+ "minLength": 1,
16
+ "maxLength": 100
17
+ },
18
+ "searchable": {
19
+ "type": "boolean"
20
+ },
21
+ "semantic": {
22
+ "$ref": "https://unito.io/integration_api/definitions.schema.json#/$defs/relationSemantic"
23
+ },
24
+ "schema": {
25
+ "oneOf": [
26
+ {
27
+ "$ref": "https://unito.io/integration_api/relationSchema.schema.json"
28
+ },
29
+ {
30
+ "const": "__self"
31
+ }
32
+ ]
33
+ }
34
+ }
35
+ }
@@ -110,7 +110,32 @@ export interface ReferenceFieldSchema extends AbstractFieldSchema {
110
110
  /**
111
111
  * Describe the referenced collection.
112
112
  */
113
- reference: Relation;
113
+ reference: ReferenceRelation;
114
+ }
115
+ /**
116
+ * A ReferenceRelation describes a relation that can be used in a ReferenceFieldSchema.
117
+ */
118
+ export interface ReferenceRelation {
119
+ /**
120
+ * The path at which the relation data is available.
121
+ */
122
+ path: string;
123
+ /**
124
+ * The publicly visible label of the relation.
125
+ */
126
+ label: string;
127
+ /**
128
+ * Whether the relation is searchable.
129
+ */
130
+ searchable?: boolean;
131
+ /**
132
+ * The semantic of the relation.
133
+ */
134
+ semantic?: RelationSemantic;
135
+ /**
136
+ * The shape of the relation.
137
+ */
138
+ schema: RelationSchema | '__self';
114
139
  }
115
140
  export interface DatetimeRangeFieldSchema extends AbstractFieldSchema {
116
141
  /**
@@ -314,7 +339,7 @@ export interface Relation {
314
339
  /**
315
340
  * The semantic of the relation.
316
341
  */
317
- semantic?: Semantic;
342
+ semantic?: RelationSemantic;
318
343
  /**
319
344
  * The shape of the relation.
320
345
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unito/integration-api",
3
- "version": "3.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "The Unito Integration API",
5
5
  "type": "module",
6
6
  "types": "./dist/src/index.d.ts",