@unito/integration-api 8.0.3 → 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/schemas/fieldSchema.json +0 -6
- package/dist/schemas/relationSchema.json +7 -0
- package/dist/src/compatibilities.d.ts +1 -1
- package/dist/src/compatibilities.js +1 -1
- package/dist/src/guards.js +3 -1
- package/dist/src/index.cjs +4 -2
- package/dist/src/types.d.ts +6 -12
- package/package.json +1 -1
|
@@ -404,7 +404,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
404
404
|
readonly number: null;
|
|
405
405
|
readonly object: null;
|
|
406
406
|
readonly reference: null;
|
|
407
|
-
readonly richText:
|
|
407
|
+
readonly richText: {};
|
|
408
408
|
readonly html: null;
|
|
409
409
|
readonly markdown: null;
|
|
410
410
|
readonly string: null;
|
|
@@ -346,7 +346,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
346
346
|
[Api.FieldValueTypes.NUMBER]: null,
|
|
347
347
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
348
348
|
[Api.FieldValueTypes.REFERENCE]: null,
|
|
349
|
-
[Api.FieldValueTypes.RICH_TEXT]:
|
|
349
|
+
[Api.FieldValueTypes.RICH_TEXT]: {},
|
|
350
350
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
351
351
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
352
352
|
[Api.FieldValueTypes.STRING]: null,
|
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'.
|
|
@@ -623,7 +625,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
623
625
|
[FieldValueTypes.NUMBER]: null,
|
|
624
626
|
[FieldValueTypes.OBJECT]: null,
|
|
625
627
|
[FieldValueTypes.REFERENCE]: null,
|
|
626
|
-
[FieldValueTypes.RICH_TEXT]:
|
|
628
|
+
[FieldValueTypes.RICH_TEXT]: {},
|
|
627
629
|
[FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
628
630
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
629
631
|
[FieldValueTypes.STRING]: null,
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
|
-
import type { RichTextNodeType } from './richText.js';
|
|
3
2
|
/**
|
|
4
3
|
* A Collection represents a paginated list of ItemSummary available through a Relation.
|
|
5
4
|
*/
|
|
@@ -253,21 +252,10 @@ export interface ObjectFieldSchema extends AbstractFieldSchema {
|
|
|
253
252
|
interface DescriptionRichTextFieldSchema extends AbstractFieldSchema {
|
|
254
253
|
semantic: typeof Semantics.DESCRIPTION;
|
|
255
254
|
type: typeof FieldValueTypes.RICH_TEXT;
|
|
256
|
-
/**
|
|
257
|
-
* The published rich text node types this field can round-trip.
|
|
258
|
-
* `text` is mandatory. When omitted, a curated baseline applies (defined
|
|
259
|
-
* elsewhere in this package).
|
|
260
|
-
*
|
|
261
|
-
* Syncer keys off the target field's declaration to decide whether to
|
|
262
|
-
* pass nodes through or sentinel-encode them. Source-side declarations
|
|
263
|
-
* are descriptive and not enforced at runtime.
|
|
264
|
-
*/
|
|
265
|
-
supportedRichTextNodes?: readonly ['text', ...RichTextNodeType[]];
|
|
266
255
|
}
|
|
267
256
|
interface UnconstrainedRichTextFieldSchema extends AbstractFieldSchema {
|
|
268
257
|
semantic?: never;
|
|
269
258
|
type: typeof FieldValueTypes.RICH_TEXT;
|
|
270
|
-
supportedRichTextNodes?: readonly ['text', ...RichTextNodeType[]];
|
|
271
259
|
}
|
|
272
260
|
export type RichTextFieldSchema = DescriptionRichTextFieldSchema | UnconstrainedRichTextFieldSchema;
|
|
273
261
|
/**
|
|
@@ -510,6 +498,12 @@ export interface RelationSchema {
|
|
|
510
498
|
* Summaries of the relations expected to be found on these items.
|
|
511
499
|
*/
|
|
512
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[];
|
|
513
507
|
}
|
|
514
508
|
/**
|
|
515
509
|
* A type that guarantees the presence of a populated schema by preventing the use of __self.
|