@unito/integration-api 8.0.0 → 8.0.2
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/definitions.json +36 -0
- package/dist/schemas/fieldSchema.json +6 -0
- package/dist/src/compatibilities.d.ts +35 -0
- package/dist/src/compatibilities.js +35 -0
- package/dist/src/index.cjs +91 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/richText.d.ts +59 -0
- package/dist/src/richText.js +52 -0
- package/dist/src/types.d.ts +29 -2
- package/dist/src/types.js +1 -0
- package/package.json +1 -1
|
@@ -19,10 +19,46 @@
|
|
|
19
19
|
"number",
|
|
20
20
|
"object",
|
|
21
21
|
"reference",
|
|
22
|
+
"richText",
|
|
22
23
|
"string",
|
|
23
24
|
"url"
|
|
24
25
|
]
|
|
25
26
|
},
|
|
27
|
+
"richTextNodeType": {
|
|
28
|
+
"$id": "RichTextNodeType",
|
|
29
|
+
"type": "string",
|
|
30
|
+
"enum": [
|
|
31
|
+
"blockquote",
|
|
32
|
+
"break",
|
|
33
|
+
"code",
|
|
34
|
+
"delete",
|
|
35
|
+
"emphasis",
|
|
36
|
+
"heading1",
|
|
37
|
+
"heading2",
|
|
38
|
+
"heading3",
|
|
39
|
+
"heading4",
|
|
40
|
+
"heading5",
|
|
41
|
+
"heading6",
|
|
42
|
+
"highlight",
|
|
43
|
+
"image",
|
|
44
|
+
"inlineCode",
|
|
45
|
+
"link",
|
|
46
|
+
"listItem",
|
|
47
|
+
"listOrdered",
|
|
48
|
+
"listUnordered",
|
|
49
|
+
"paragraph",
|
|
50
|
+
"reference",
|
|
51
|
+
"strong",
|
|
52
|
+
"subscript",
|
|
53
|
+
"superscript",
|
|
54
|
+
"table",
|
|
55
|
+
"tableCell",
|
|
56
|
+
"tableRow",
|
|
57
|
+
"text",
|
|
58
|
+
"thematicBreak",
|
|
59
|
+
"underline"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
26
62
|
"semantic": {
|
|
27
63
|
"$id": "Semantic",
|
|
28
64
|
"type": ["string", "null"],
|
|
@@ -12,6 +12,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
12
12
|
readonly number: null;
|
|
13
13
|
readonly object: null;
|
|
14
14
|
readonly reference: null;
|
|
15
|
+
readonly richText: null;
|
|
15
16
|
readonly html: null;
|
|
16
17
|
readonly markdown: null;
|
|
17
18
|
readonly string: null;
|
|
@@ -30,6 +31,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
30
31
|
readonly number: {};
|
|
31
32
|
readonly object: null;
|
|
32
33
|
readonly reference: null;
|
|
34
|
+
readonly richText: null;
|
|
33
35
|
readonly html: {};
|
|
34
36
|
readonly markdown: {};
|
|
35
37
|
readonly string: {};
|
|
@@ -48,6 +50,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
48
50
|
readonly number: {};
|
|
49
51
|
readonly object: null;
|
|
50
52
|
readonly reference: null;
|
|
53
|
+
readonly richText: null;
|
|
51
54
|
readonly html: {
|
|
52
55
|
readonly locale: {
|
|
53
56
|
readonly type: "enum";
|
|
@@ -117,6 +120,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
117
120
|
readonly number: null;
|
|
118
121
|
readonly object: null;
|
|
119
122
|
readonly reference: null;
|
|
123
|
+
readonly richText: null;
|
|
120
124
|
readonly html: null;
|
|
121
125
|
readonly markdown: null;
|
|
122
126
|
readonly string: null;
|
|
@@ -135,6 +139,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
135
139
|
readonly number: {};
|
|
136
140
|
readonly object: null;
|
|
137
141
|
readonly reference: null;
|
|
142
|
+
readonly richText: null;
|
|
138
143
|
readonly html: {
|
|
139
144
|
readonly locale: {
|
|
140
145
|
readonly type: "enum";
|
|
@@ -204,6 +209,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
204
209
|
readonly number: null;
|
|
205
210
|
readonly object: null;
|
|
206
211
|
readonly reference: null;
|
|
212
|
+
readonly richText: null;
|
|
207
213
|
readonly html: null;
|
|
208
214
|
readonly markdown: null;
|
|
209
215
|
readonly string: null;
|
|
@@ -222,6 +228,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
222
228
|
readonly number: {};
|
|
223
229
|
readonly object: null;
|
|
224
230
|
readonly reference: null;
|
|
231
|
+
readonly richText: null;
|
|
225
232
|
readonly html: {};
|
|
226
233
|
readonly markdown: {};
|
|
227
234
|
readonly string: {};
|
|
@@ -249,6 +256,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
249
256
|
readonly required: true;
|
|
250
257
|
};
|
|
251
258
|
};
|
|
259
|
+
readonly richText: null;
|
|
252
260
|
readonly html: {};
|
|
253
261
|
readonly markdown: {};
|
|
254
262
|
readonly string: {};
|
|
@@ -267,6 +275,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
267
275
|
readonly number: {};
|
|
268
276
|
readonly object: null;
|
|
269
277
|
readonly reference: null;
|
|
278
|
+
readonly richText: null;
|
|
270
279
|
readonly html: {};
|
|
271
280
|
readonly markdown: {};
|
|
272
281
|
readonly string: {};
|
|
@@ -285,6 +294,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
285
294
|
readonly number: {};
|
|
286
295
|
readonly object: null;
|
|
287
296
|
readonly reference: null;
|
|
297
|
+
readonly richText: null;
|
|
288
298
|
readonly html: {};
|
|
289
299
|
readonly markdown: {};
|
|
290
300
|
readonly string: {};
|
|
@@ -303,6 +313,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
303
313
|
readonly number: null;
|
|
304
314
|
readonly object: null;
|
|
305
315
|
readonly reference: null;
|
|
316
|
+
readonly richText: null;
|
|
306
317
|
readonly html: null;
|
|
307
318
|
readonly markdown: null;
|
|
308
319
|
readonly string: null;
|
|
@@ -347,6 +358,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
347
358
|
readonly required: true;
|
|
348
359
|
};
|
|
349
360
|
};
|
|
361
|
+
readonly richText: null;
|
|
350
362
|
readonly html: {
|
|
351
363
|
readonly field: {
|
|
352
364
|
readonly type: "sourceField";
|
|
@@ -379,6 +391,25 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
379
391
|
};
|
|
380
392
|
readonly url: null;
|
|
381
393
|
};
|
|
394
|
+
readonly richText: {
|
|
395
|
+
readonly blob: null;
|
|
396
|
+
readonly boolean: null;
|
|
397
|
+
readonly date: null;
|
|
398
|
+
readonly dateRange: null;
|
|
399
|
+
readonly datetime: null;
|
|
400
|
+
readonly datetimeRange: null;
|
|
401
|
+
readonly duration: null;
|
|
402
|
+
readonly email: null;
|
|
403
|
+
readonly integer: null;
|
|
404
|
+
readonly number: null;
|
|
405
|
+
readonly object: null;
|
|
406
|
+
readonly reference: null;
|
|
407
|
+
readonly richText: null;
|
|
408
|
+
readonly html: null;
|
|
409
|
+
readonly markdown: null;
|
|
410
|
+
readonly string: null;
|
|
411
|
+
readonly url: null;
|
|
412
|
+
};
|
|
382
413
|
readonly html: {
|
|
383
414
|
readonly blob: null;
|
|
384
415
|
readonly boolean: null;
|
|
@@ -392,6 +423,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
392
423
|
readonly number: null;
|
|
393
424
|
readonly object: null;
|
|
394
425
|
readonly reference: null;
|
|
426
|
+
readonly richText: null;
|
|
395
427
|
readonly html: {
|
|
396
428
|
readonly decoratorTemplate: {
|
|
397
429
|
readonly type: "stringWithSourceItemFields";
|
|
@@ -460,6 +492,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
460
492
|
readonly number: null;
|
|
461
493
|
readonly object: null;
|
|
462
494
|
readonly reference: null;
|
|
495
|
+
readonly richText: null;
|
|
463
496
|
readonly html: {
|
|
464
497
|
readonly decoratorTemplate: {
|
|
465
498
|
readonly type: "stringWithSourceItemFields";
|
|
@@ -537,6 +570,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
537
570
|
readonly required: true;
|
|
538
571
|
};
|
|
539
572
|
};
|
|
573
|
+
readonly richText: null;
|
|
540
574
|
readonly html: {};
|
|
541
575
|
readonly markdown: {};
|
|
542
576
|
readonly string: {};
|
|
@@ -555,6 +589,7 @@ export declare const fieldTypeCompatibilityMatrix: {
|
|
|
555
589
|
readonly number: null;
|
|
556
590
|
readonly object: null;
|
|
557
591
|
readonly reference: null;
|
|
592
|
+
readonly richText: null;
|
|
558
593
|
readonly html: {};
|
|
559
594
|
readonly markdown: {};
|
|
560
595
|
readonly string: {};
|
|
@@ -103,6 +103,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
103
103
|
[Api.FieldValueTypes.NUMBER]: null,
|
|
104
104
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
105
105
|
[Api.FieldValueTypes.REFERENCE]: null,
|
|
106
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
106
107
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
107
108
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
108
109
|
[Api.FieldValueTypes.STRING]: null,
|
|
@@ -121,6 +122,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
121
122
|
[Api.FieldValueTypes.NUMBER]: {},
|
|
122
123
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
123
124
|
[Api.FieldValueTypes.REFERENCE]: null,
|
|
125
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
124
126
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
125
127
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
126
128
|
[Api.FieldValueTypes.STRING]: {},
|
|
@@ -139,6 +141,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
139
141
|
[Api.FieldValueTypes.NUMBER]: {},
|
|
140
142
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
141
143
|
[Api.FieldValueTypes.REFERENCE]: null,
|
|
144
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
142
145
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: dateToStringlikeConfiguration,
|
|
143
146
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: dateToStringlikeConfiguration,
|
|
144
147
|
[Api.FieldValueTypes.STRING]: dateToStringlikeConfiguration,
|
|
@@ -157,6 +160,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
157
160
|
[Api.FieldValueTypes.NUMBER]: null,
|
|
158
161
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
159
162
|
[Api.FieldValueTypes.REFERENCE]: null,
|
|
163
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
160
164
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
161
165
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
162
166
|
[Api.FieldValueTypes.STRING]: null,
|
|
@@ -175,6 +179,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
175
179
|
[Api.FieldValueTypes.NUMBER]: {},
|
|
176
180
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
177
181
|
[Api.FieldValueTypes.REFERENCE]: null,
|
|
182
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
178
183
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: dateToStringlikeConfiguration,
|
|
179
184
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: dateToStringlikeConfiguration,
|
|
180
185
|
[Api.FieldValueTypes.STRING]: dateToStringlikeConfiguration,
|
|
@@ -193,6 +198,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
193
198
|
[Api.FieldValueTypes.NUMBER]: null,
|
|
194
199
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
195
200
|
[Api.FieldValueTypes.REFERENCE]: null,
|
|
201
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
196
202
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
197
203
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
198
204
|
[Api.FieldValueTypes.STRING]: null,
|
|
@@ -211,6 +217,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
211
217
|
[Api.FieldValueTypes.NUMBER]: {},
|
|
212
218
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
213
219
|
[Api.FieldValueTypes.REFERENCE]: null,
|
|
220
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
214
221
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
215
222
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
216
223
|
[Api.FieldValueTypes.STRING]: {},
|
|
@@ -229,6 +236,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
229
236
|
[Api.FieldValueTypes.NUMBER]: null,
|
|
230
237
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
231
238
|
[Api.FieldValueTypes.REFERENCE]: stringLikeToReferenceConfiguration,
|
|
239
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
232
240
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
233
241
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
234
242
|
[Api.FieldValueTypes.STRING]: {},
|
|
@@ -247,6 +255,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
247
255
|
[Api.FieldValueTypes.NUMBER]: {},
|
|
248
256
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
249
257
|
[Api.FieldValueTypes.REFERENCE]: null,
|
|
258
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
250
259
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
251
260
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
252
261
|
[Api.FieldValueTypes.STRING]: {},
|
|
@@ -265,6 +274,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
265
274
|
[Api.FieldValueTypes.NUMBER]: {},
|
|
266
275
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
267
276
|
[Api.FieldValueTypes.REFERENCE]: null,
|
|
277
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
268
278
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
269
279
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
270
280
|
[Api.FieldValueTypes.STRING]: {},
|
|
@@ -283,6 +293,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
283
293
|
[Api.FieldValueTypes.NUMBER]: null,
|
|
284
294
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
285
295
|
[Api.FieldValueTypes.REFERENCE]: null,
|
|
296
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
286
297
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
287
298
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
288
299
|
[Api.FieldValueTypes.STRING]: null,
|
|
@@ -316,11 +327,31 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
316
327
|
required: true,
|
|
317
328
|
},
|
|
318
329
|
},
|
|
330
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
319
331
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: referenceToStringLikeConfiguration,
|
|
320
332
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: referenceToStringLikeConfiguration,
|
|
321
333
|
[Api.FieldValueTypes.STRING]: referenceToStringLikeConfiguration,
|
|
322
334
|
[Api.FieldValueTypes.URL]: null,
|
|
323
335
|
},
|
|
336
|
+
[Api.FieldValueTypes.RICH_TEXT]: {
|
|
337
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
338
|
+
[Api.FieldValueTypes.BOOLEAN]: null,
|
|
339
|
+
[Api.FieldValueTypes.DATE]: null,
|
|
340
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
341
|
+
[Api.FieldValueTypes.DATETIME]: null,
|
|
342
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
343
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
344
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
345
|
+
[Api.FieldValueTypes.INTEGER]: null,
|
|
346
|
+
[Api.FieldValueTypes.NUMBER]: null,
|
|
347
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
348
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
349
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
350
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
351
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
352
|
+
[Api.FieldValueTypes.STRING]: null,
|
|
353
|
+
[Api.FieldValueTypes.URL]: null,
|
|
354
|
+
},
|
|
324
355
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: {
|
|
325
356
|
[Api.FieldValueTypes.BLOB]: null,
|
|
326
357
|
[Api.FieldValueTypes.BOOLEAN]: null,
|
|
@@ -334,6 +365,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
334
365
|
[Api.FieldValueTypes.NUMBER]: null,
|
|
335
366
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
336
367
|
[Api.FieldValueTypes.REFERENCE]: null,
|
|
368
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
337
369
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: htmlToRichTextConfiguration,
|
|
338
370
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: htmlToRichTextConfiguration,
|
|
339
371
|
[Api.FieldValueTypes.STRING]: {},
|
|
@@ -352,6 +384,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
352
384
|
[Api.FieldValueTypes.NUMBER]: null,
|
|
353
385
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
354
386
|
[Api.FieldValueTypes.REFERENCE]: null,
|
|
387
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
355
388
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: markdownToRichTextConfiguration,
|
|
356
389
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: markdownToRichTextConfiguration,
|
|
357
390
|
[Api.FieldValueTypes.STRING]: {},
|
|
@@ -370,6 +403,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
370
403
|
[Api.FieldValueTypes.NUMBER]: {},
|
|
371
404
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
372
405
|
[Api.FieldValueTypes.REFERENCE]: stringLikeToReferenceConfiguration,
|
|
406
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
373
407
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
374
408
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
375
409
|
[Api.FieldValueTypes.STRING]: {},
|
|
@@ -388,6 +422,7 @@ export const fieldTypeCompatibilityMatrix = {
|
|
|
388
422
|
[Api.FieldValueTypes.NUMBER]: null,
|
|
389
423
|
[Api.FieldValueTypes.OBJECT]: null,
|
|
390
424
|
[Api.FieldValueTypes.REFERENCE]: null,
|
|
425
|
+
[Api.FieldValueTypes.RICH_TEXT]: null,
|
|
391
426
|
[Api.FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
392
427
|
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
393
428
|
[Api.FieldValueTypes.STRING]: {},
|
package/dist/src/index.cjs
CHANGED
|
@@ -20,6 +20,7 @@ const FieldValueTypes = {
|
|
|
20
20
|
NUMBER: 'number',
|
|
21
21
|
OBJECT: 'object',
|
|
22
22
|
REFERENCE: 'reference',
|
|
23
|
+
RICH_TEXT: 'richText',
|
|
23
24
|
STRING: 'string',
|
|
24
25
|
URL: 'url',
|
|
25
26
|
};
|
|
@@ -379,6 +380,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
379
380
|
[FieldValueTypes.NUMBER]: null,
|
|
380
381
|
[FieldValueTypes.OBJECT]: null,
|
|
381
382
|
[FieldValueTypes.REFERENCE]: null,
|
|
383
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
382
384
|
[FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
383
385
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
384
386
|
[FieldValueTypes.STRING]: null,
|
|
@@ -397,6 +399,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
397
399
|
[FieldValueTypes.NUMBER]: {},
|
|
398
400
|
[FieldValueTypes.OBJECT]: null,
|
|
399
401
|
[FieldValueTypes.REFERENCE]: null,
|
|
402
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
400
403
|
[FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
401
404
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
402
405
|
[FieldValueTypes.STRING]: {},
|
|
@@ -415,6 +418,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
415
418
|
[FieldValueTypes.NUMBER]: {},
|
|
416
419
|
[FieldValueTypes.OBJECT]: null,
|
|
417
420
|
[FieldValueTypes.REFERENCE]: null,
|
|
421
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
418
422
|
[FieldValueTypes.RICH_TEXT_HTML]: dateToStringlikeConfiguration,
|
|
419
423
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: dateToStringlikeConfiguration,
|
|
420
424
|
[FieldValueTypes.STRING]: dateToStringlikeConfiguration,
|
|
@@ -433,6 +437,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
433
437
|
[FieldValueTypes.NUMBER]: null,
|
|
434
438
|
[FieldValueTypes.OBJECT]: null,
|
|
435
439
|
[FieldValueTypes.REFERENCE]: null,
|
|
440
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
436
441
|
[FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
437
442
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
438
443
|
[FieldValueTypes.STRING]: null,
|
|
@@ -451,6 +456,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
451
456
|
[FieldValueTypes.NUMBER]: {},
|
|
452
457
|
[FieldValueTypes.OBJECT]: null,
|
|
453
458
|
[FieldValueTypes.REFERENCE]: null,
|
|
459
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
454
460
|
[FieldValueTypes.RICH_TEXT_HTML]: dateToStringlikeConfiguration,
|
|
455
461
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: dateToStringlikeConfiguration,
|
|
456
462
|
[FieldValueTypes.STRING]: dateToStringlikeConfiguration,
|
|
@@ -469,6 +475,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
469
475
|
[FieldValueTypes.NUMBER]: null,
|
|
470
476
|
[FieldValueTypes.OBJECT]: null,
|
|
471
477
|
[FieldValueTypes.REFERENCE]: null,
|
|
478
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
472
479
|
[FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
473
480
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
474
481
|
[FieldValueTypes.STRING]: null,
|
|
@@ -487,6 +494,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
487
494
|
[FieldValueTypes.NUMBER]: {},
|
|
488
495
|
[FieldValueTypes.OBJECT]: null,
|
|
489
496
|
[FieldValueTypes.REFERENCE]: null,
|
|
497
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
490
498
|
[FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
491
499
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
492
500
|
[FieldValueTypes.STRING]: {},
|
|
@@ -505,6 +513,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
505
513
|
[FieldValueTypes.NUMBER]: null,
|
|
506
514
|
[FieldValueTypes.OBJECT]: null,
|
|
507
515
|
[FieldValueTypes.REFERENCE]: stringLikeToReferenceConfiguration,
|
|
516
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
508
517
|
[FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
509
518
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
510
519
|
[FieldValueTypes.STRING]: {},
|
|
@@ -523,6 +532,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
523
532
|
[FieldValueTypes.NUMBER]: {},
|
|
524
533
|
[FieldValueTypes.OBJECT]: null,
|
|
525
534
|
[FieldValueTypes.REFERENCE]: null,
|
|
535
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
526
536
|
[FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
527
537
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
528
538
|
[FieldValueTypes.STRING]: {},
|
|
@@ -541,6 +551,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
541
551
|
[FieldValueTypes.NUMBER]: {},
|
|
542
552
|
[FieldValueTypes.OBJECT]: null,
|
|
543
553
|
[FieldValueTypes.REFERENCE]: null,
|
|
554
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
544
555
|
[FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
545
556
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
546
557
|
[FieldValueTypes.STRING]: {},
|
|
@@ -559,6 +570,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
559
570
|
[FieldValueTypes.NUMBER]: null,
|
|
560
571
|
[FieldValueTypes.OBJECT]: null,
|
|
561
572
|
[FieldValueTypes.REFERENCE]: null,
|
|
573
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
562
574
|
[FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
563
575
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
564
576
|
[FieldValueTypes.STRING]: null,
|
|
@@ -592,11 +604,31 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
592
604
|
required: true,
|
|
593
605
|
},
|
|
594
606
|
},
|
|
607
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
595
608
|
[FieldValueTypes.RICH_TEXT_HTML]: referenceToStringLikeConfiguration,
|
|
596
609
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: referenceToStringLikeConfiguration,
|
|
597
610
|
[FieldValueTypes.STRING]: referenceToStringLikeConfiguration,
|
|
598
611
|
[FieldValueTypes.URL]: null,
|
|
599
612
|
},
|
|
613
|
+
[FieldValueTypes.RICH_TEXT]: {
|
|
614
|
+
[FieldValueTypes.BLOB]: null,
|
|
615
|
+
[FieldValueTypes.BOOLEAN]: null,
|
|
616
|
+
[FieldValueTypes.DATE]: null,
|
|
617
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
618
|
+
[FieldValueTypes.DATETIME]: null,
|
|
619
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
620
|
+
[FieldValueTypes.DURATION]: null,
|
|
621
|
+
[FieldValueTypes.EMAIL]: null,
|
|
622
|
+
[FieldValueTypes.INTEGER]: null,
|
|
623
|
+
[FieldValueTypes.NUMBER]: null,
|
|
624
|
+
[FieldValueTypes.OBJECT]: null,
|
|
625
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
626
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
627
|
+
[FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
628
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
629
|
+
[FieldValueTypes.STRING]: null,
|
|
630
|
+
[FieldValueTypes.URL]: null,
|
|
631
|
+
},
|
|
600
632
|
[FieldValueTypes.RICH_TEXT_HTML]: {
|
|
601
633
|
[FieldValueTypes.BLOB]: null,
|
|
602
634
|
[FieldValueTypes.BOOLEAN]: null,
|
|
@@ -610,6 +642,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
610
642
|
[FieldValueTypes.NUMBER]: null,
|
|
611
643
|
[FieldValueTypes.OBJECT]: null,
|
|
612
644
|
[FieldValueTypes.REFERENCE]: null,
|
|
645
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
613
646
|
[FieldValueTypes.RICH_TEXT_HTML]: htmlToRichTextConfiguration,
|
|
614
647
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: htmlToRichTextConfiguration,
|
|
615
648
|
[FieldValueTypes.STRING]: {},
|
|
@@ -628,6 +661,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
628
661
|
[FieldValueTypes.NUMBER]: null,
|
|
629
662
|
[FieldValueTypes.OBJECT]: null,
|
|
630
663
|
[FieldValueTypes.REFERENCE]: null,
|
|
664
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
631
665
|
[FieldValueTypes.RICH_TEXT_HTML]: markdownToRichTextConfiguration,
|
|
632
666
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: markdownToRichTextConfiguration,
|
|
633
667
|
[FieldValueTypes.STRING]: {},
|
|
@@ -646,6 +680,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
646
680
|
[FieldValueTypes.NUMBER]: {},
|
|
647
681
|
[FieldValueTypes.OBJECT]: null,
|
|
648
682
|
[FieldValueTypes.REFERENCE]: stringLikeToReferenceConfiguration,
|
|
683
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
649
684
|
[FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
650
685
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
651
686
|
[FieldValueTypes.STRING]: {},
|
|
@@ -664,6 +699,7 @@ const fieldTypeCompatibilityMatrix = {
|
|
|
664
699
|
[FieldValueTypes.NUMBER]: null,
|
|
665
700
|
[FieldValueTypes.OBJECT]: null,
|
|
666
701
|
[FieldValueTypes.REFERENCE]: null,
|
|
702
|
+
[FieldValueTypes.RICH_TEXT]: null,
|
|
667
703
|
[FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
668
704
|
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
669
705
|
[FieldValueTypes.STRING]: {},
|
|
@@ -837,11 +873,65 @@ function matchesFilter(item, filter) {
|
|
|
837
873
|
return item[filter.property] === filter.value;
|
|
838
874
|
}
|
|
839
875
|
|
|
876
|
+
/**
|
|
877
|
+
* Published rich text node vocabulary, following the unist structural convention.
|
|
878
|
+
* Every node has `{ type, children?, value?, data? }`.
|
|
879
|
+
*
|
|
880
|
+
* Per-variant types are used where providers have real capability variance
|
|
881
|
+
* (e.g., heading depth support differs across providers; ordered and unordered
|
|
882
|
+
* lists are independent capabilities). Semantically-equivalent HTML synonyms
|
|
883
|
+
* collapse to the canonical type at parse time — `<b>`/`<strong>` yield
|
|
884
|
+
* `strong`, `<i>`/`<em>` yield `emphasis`, `<s>`/`<strike>`/`<del>` yield
|
|
885
|
+
* `delete`.
|
|
886
|
+
*
|
|
887
|
+
* Nodes whose `type` is not in this list are treated as custom-typed nodes by
|
|
888
|
+
* the Syncer and sentinel-encoded when the target doesn't declare support.
|
|
889
|
+
*
|
|
890
|
+
* Ref: https://github.com/unitoio/sync-services/issues/3239
|
|
891
|
+
*/
|
|
892
|
+
const RichTextNodeTypes = {
|
|
893
|
+
// Block
|
|
894
|
+
PARAGRAPH: 'paragraph',
|
|
895
|
+
HEADING_1: 'heading1',
|
|
896
|
+
HEADING_2: 'heading2',
|
|
897
|
+
HEADING_3: 'heading3',
|
|
898
|
+
HEADING_4: 'heading4',
|
|
899
|
+
HEADING_5: 'heading5',
|
|
900
|
+
HEADING_6: 'heading6',
|
|
901
|
+
BLOCKQUOTE: 'blockquote',
|
|
902
|
+
CODE: 'code',
|
|
903
|
+
LIST_ORDERED: 'listOrdered',
|
|
904
|
+
LIST_UNORDERED: 'listUnordered',
|
|
905
|
+
LIST_ITEM: 'listItem',
|
|
906
|
+
TABLE: 'table',
|
|
907
|
+
TABLE_ROW: 'tableRow',
|
|
908
|
+
TABLE_CELL: 'tableCell',
|
|
909
|
+
THEMATIC_BREAK: 'thematicBreak',
|
|
910
|
+
IMAGE: 'image',
|
|
911
|
+
BREAK: 'break',
|
|
912
|
+
// Inline
|
|
913
|
+
TEXT: 'text',
|
|
914
|
+
STRONG: 'strong',
|
|
915
|
+
EMPHASIS: 'emphasis',
|
|
916
|
+
UNDERLINE: 'underline',
|
|
917
|
+
INLINE_CODE: 'inlineCode',
|
|
918
|
+
DELETE: 'delete',
|
|
919
|
+
LINK: 'link',
|
|
920
|
+
SUPERSCRIPT: 'superscript',
|
|
921
|
+
SUBSCRIPT: 'subscript',
|
|
922
|
+
HIGHLIGHT: 'highlight',
|
|
923
|
+
REFERENCE: 'reference',
|
|
924
|
+
};
|
|
925
|
+
function isRichTextNodeType(value) {
|
|
926
|
+
return typeof value === 'string' && Object.values(RichTextNodeTypes).includes(value);
|
|
927
|
+
}
|
|
928
|
+
|
|
840
929
|
exports.FieldSchemaDefaultValues = FieldSchemaDefaultValues;
|
|
841
930
|
exports.FieldValueTypes = FieldValueTypes;
|
|
842
931
|
exports.OperatorTypes = OperatorTypes;
|
|
843
932
|
exports.RelationSchemaDefaultValues = RelationSchemaDefaultValues;
|
|
844
933
|
exports.RelationSemantics = RelationSemantics;
|
|
934
|
+
exports.RichTextNodeTypes = RichTextNodeTypes;
|
|
845
935
|
exports.Semantics = Semantics;
|
|
846
936
|
exports.StatusCodes = StatusCodes;
|
|
847
937
|
exports.fieldTypeCompatibilityMatrix = fieldTypeCompatibilityMatrix;
|
|
@@ -857,6 +947,7 @@ exports.isRelationPointer = isRelationPointer;
|
|
|
857
947
|
exports.isRelationSchema = isRelationSchema;
|
|
858
948
|
exports.isRelationSchemaOrSelf = isRelationSchemaOrSelf;
|
|
859
949
|
exports.isRelationSummary = isRelationSummary;
|
|
950
|
+
exports.isRichTextNodeType = isRichTextNodeType;
|
|
860
951
|
exports.isSemantic = isSemantic;
|
|
861
952
|
exports.isString = isString;
|
|
862
953
|
exports.isUndefined = isUndefined;
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Published rich text node vocabulary, following the unist structural convention.
|
|
3
|
+
* Every node has `{ type, children?, value?, data? }`.
|
|
4
|
+
*
|
|
5
|
+
* Per-variant types are used where providers have real capability variance
|
|
6
|
+
* (e.g., heading depth support differs across providers; ordered and unordered
|
|
7
|
+
* lists are independent capabilities). Semantically-equivalent HTML synonyms
|
|
8
|
+
* collapse to the canonical type at parse time — `<b>`/`<strong>` yield
|
|
9
|
+
* `strong`, `<i>`/`<em>` yield `emphasis`, `<s>`/`<strike>`/`<del>` yield
|
|
10
|
+
* `delete`.
|
|
11
|
+
*
|
|
12
|
+
* Nodes whose `type` is not in this list are treated as custom-typed nodes by
|
|
13
|
+
* the Syncer and sentinel-encoded when the target doesn't declare support.
|
|
14
|
+
*
|
|
15
|
+
* Ref: https://github.com/unitoio/sync-services/issues/3239
|
|
16
|
+
*/
|
|
17
|
+
export declare const RichTextNodeTypes: {
|
|
18
|
+
readonly PARAGRAPH: "paragraph";
|
|
19
|
+
readonly HEADING_1: "heading1";
|
|
20
|
+
readonly HEADING_2: "heading2";
|
|
21
|
+
readonly HEADING_3: "heading3";
|
|
22
|
+
readonly HEADING_4: "heading4";
|
|
23
|
+
readonly HEADING_5: "heading5";
|
|
24
|
+
readonly HEADING_6: "heading6";
|
|
25
|
+
readonly BLOCKQUOTE: "blockquote";
|
|
26
|
+
readonly CODE: "code";
|
|
27
|
+
readonly LIST_ORDERED: "listOrdered";
|
|
28
|
+
readonly LIST_UNORDERED: "listUnordered";
|
|
29
|
+
readonly LIST_ITEM: "listItem";
|
|
30
|
+
readonly TABLE: "table";
|
|
31
|
+
readonly TABLE_ROW: "tableRow";
|
|
32
|
+
readonly TABLE_CELL: "tableCell";
|
|
33
|
+
readonly THEMATIC_BREAK: "thematicBreak";
|
|
34
|
+
readonly IMAGE: "image";
|
|
35
|
+
readonly BREAK: "break";
|
|
36
|
+
readonly TEXT: "text";
|
|
37
|
+
readonly STRONG: "strong";
|
|
38
|
+
readonly EMPHASIS: "emphasis";
|
|
39
|
+
readonly UNDERLINE: "underline";
|
|
40
|
+
readonly INLINE_CODE: "inlineCode";
|
|
41
|
+
readonly DELETE: "delete";
|
|
42
|
+
readonly LINK: "link";
|
|
43
|
+
readonly SUPERSCRIPT: "superscript";
|
|
44
|
+
readonly SUBSCRIPT: "subscript";
|
|
45
|
+
readonly HIGHLIGHT: "highlight";
|
|
46
|
+
readonly REFERENCE: "reference";
|
|
47
|
+
};
|
|
48
|
+
export type RichTextNodeType = (typeof RichTextNodeTypes)[keyof typeof RichTextNodeTypes];
|
|
49
|
+
export interface RichTextNode {
|
|
50
|
+
type: string;
|
|
51
|
+
children?: RichTextNode[];
|
|
52
|
+
value?: string;
|
|
53
|
+
data?: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
export interface RichTextRoot {
|
|
56
|
+
type: 'root';
|
|
57
|
+
children: RichTextNode[];
|
|
58
|
+
}
|
|
59
|
+
export declare function isRichTextNodeType(value: unknown): value is RichTextNodeType;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Published rich text node vocabulary, following the unist structural convention.
|
|
3
|
+
* Every node has `{ type, children?, value?, data? }`.
|
|
4
|
+
*
|
|
5
|
+
* Per-variant types are used where providers have real capability variance
|
|
6
|
+
* (e.g., heading depth support differs across providers; ordered and unordered
|
|
7
|
+
* lists are independent capabilities). Semantically-equivalent HTML synonyms
|
|
8
|
+
* collapse to the canonical type at parse time — `<b>`/`<strong>` yield
|
|
9
|
+
* `strong`, `<i>`/`<em>` yield `emphasis`, `<s>`/`<strike>`/`<del>` yield
|
|
10
|
+
* `delete`.
|
|
11
|
+
*
|
|
12
|
+
* Nodes whose `type` is not in this list are treated as custom-typed nodes by
|
|
13
|
+
* the Syncer and sentinel-encoded when the target doesn't declare support.
|
|
14
|
+
*
|
|
15
|
+
* Ref: https://github.com/unitoio/sync-services/issues/3239
|
|
16
|
+
*/
|
|
17
|
+
export const RichTextNodeTypes = {
|
|
18
|
+
// Block
|
|
19
|
+
PARAGRAPH: 'paragraph',
|
|
20
|
+
HEADING_1: 'heading1',
|
|
21
|
+
HEADING_2: 'heading2',
|
|
22
|
+
HEADING_3: 'heading3',
|
|
23
|
+
HEADING_4: 'heading4',
|
|
24
|
+
HEADING_5: 'heading5',
|
|
25
|
+
HEADING_6: 'heading6',
|
|
26
|
+
BLOCKQUOTE: 'blockquote',
|
|
27
|
+
CODE: 'code',
|
|
28
|
+
LIST_ORDERED: 'listOrdered',
|
|
29
|
+
LIST_UNORDERED: 'listUnordered',
|
|
30
|
+
LIST_ITEM: 'listItem',
|
|
31
|
+
TABLE: 'table',
|
|
32
|
+
TABLE_ROW: 'tableRow',
|
|
33
|
+
TABLE_CELL: 'tableCell',
|
|
34
|
+
THEMATIC_BREAK: 'thematicBreak',
|
|
35
|
+
IMAGE: 'image',
|
|
36
|
+
BREAK: 'break',
|
|
37
|
+
// Inline
|
|
38
|
+
TEXT: 'text',
|
|
39
|
+
STRONG: 'strong',
|
|
40
|
+
EMPHASIS: 'emphasis',
|
|
41
|
+
UNDERLINE: 'underline',
|
|
42
|
+
INLINE_CODE: 'inlineCode',
|
|
43
|
+
DELETE: 'delete',
|
|
44
|
+
LINK: 'link',
|
|
45
|
+
SUPERSCRIPT: 'superscript',
|
|
46
|
+
SUBSCRIPT: 'subscript',
|
|
47
|
+
HIGHLIGHT: 'highlight',
|
|
48
|
+
REFERENCE: 'reference',
|
|
49
|
+
};
|
|
50
|
+
export function isRichTextNodeType(value) {
|
|
51
|
+
return typeof value === 'string' && Object.values(RichTextNodeTypes).includes(value);
|
|
52
|
+
}
|
package/dist/src/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
|
+
import type { RichTextNodeType } from './richText.js';
|
|
2
3
|
/**
|
|
3
4
|
* A Collection represents a paginated list of ItemSummary available through a Relation.
|
|
4
5
|
*/
|
|
@@ -98,7 +99,7 @@ interface AbstractFieldSchema {
|
|
|
98
99
|
*/
|
|
99
100
|
nullable?: boolean;
|
|
100
101
|
}
|
|
101
|
-
type BasicFieldValueType = Exclude<FieldValueType, typeof FieldValueTypes.BLOB | typeof FieldValueTypes.REFERENCE | typeof FieldValueTypes.OBJECT | typeof FieldValueTypes.DATETIME_RANGE | typeof FieldValueTypes.DATE_RANGE>;
|
|
102
|
+
type BasicFieldValueType = Exclude<FieldValueType, typeof FieldValueTypes.BLOB | typeof FieldValueTypes.REFERENCE | typeof FieldValueTypes.OBJECT | typeof FieldValueTypes.DATETIME_RANGE | typeof FieldValueTypes.DATE_RANGE | typeof FieldValueTypes.RICH_TEXT>;
|
|
102
103
|
/**
|
|
103
104
|
* Semantic-constrained BasicFieldSchema variants.
|
|
104
105
|
* Each semantic restricts which field types are valid, matching the runtime
|
|
@@ -244,10 +245,35 @@ export interface ObjectFieldSchema extends AbstractFieldSchema {
|
|
|
244
245
|
*/
|
|
245
246
|
fields: FieldSchema[];
|
|
246
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Semantic-constrained RichTextFieldSchema variants.
|
|
250
|
+
* DESCRIPTION is the only semantic that naturally applies to rich text; other
|
|
251
|
+
* semantics (USER, CREATED_AT, etc.) are tied to different field value types.
|
|
252
|
+
*/
|
|
253
|
+
interface DescriptionRichTextFieldSchema extends AbstractFieldSchema {
|
|
254
|
+
semantic: typeof Semantics.DESCRIPTION;
|
|
255
|
+
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
|
+
}
|
|
267
|
+
interface UnconstrainedRichTextFieldSchema extends AbstractFieldSchema {
|
|
268
|
+
semantic?: never;
|
|
269
|
+
type: typeof FieldValueTypes.RICH_TEXT;
|
|
270
|
+
supportedRichTextNodes?: readonly ['text', ...RichTextNodeType[]];
|
|
271
|
+
}
|
|
272
|
+
export type RichTextFieldSchema = DescriptionRichTextFieldSchema | UnconstrainedRichTextFieldSchema;
|
|
247
273
|
/**
|
|
248
274
|
* A FieldSchema describes the shape of a field.
|
|
249
275
|
*/
|
|
250
|
-
export type FieldSchema = BasicFieldSchema | BlobFieldSchema | ReferenceFieldSchema | ObjectFieldSchema | DateRangeFieldSchema | DatetimeRangeFieldSchema;
|
|
276
|
+
export type FieldSchema = BasicFieldSchema | BlobFieldSchema | ReferenceFieldSchema | ObjectFieldSchema | DateRangeFieldSchema | DatetimeRangeFieldSchema | RichTextFieldSchema;
|
|
251
277
|
/**
|
|
252
278
|
* A FieldValueType determines the type of an item's value.
|
|
253
279
|
* The type represents a unique scalar value such as a string or an integer.
|
|
@@ -268,6 +294,7 @@ export declare const FieldValueTypes: {
|
|
|
268
294
|
readonly NUMBER: "number";
|
|
269
295
|
readonly OBJECT: "object";
|
|
270
296
|
readonly REFERENCE: "reference";
|
|
297
|
+
readonly RICH_TEXT: "richText";
|
|
271
298
|
readonly STRING: "string";
|
|
272
299
|
readonly URL: "url";
|
|
273
300
|
};
|
package/dist/src/types.js
CHANGED