@unito/integration-api 4.1.5 → 4.2.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.
- package/dist/src/compatibilities.d.ts +444 -0
- package/dist/src/compatibilities.js +345 -0
- package/dist/src/index.cjs +346 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/types.d.ts +9 -11
- package/package.json +1 -1
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
export declare const fieldTypeCompatibilityMatrix: {
|
|
2
|
+
readonly blob: {
|
|
3
|
+
readonly blob: {};
|
|
4
|
+
readonly boolean: null;
|
|
5
|
+
readonly date: null;
|
|
6
|
+
readonly dateRange: null;
|
|
7
|
+
readonly datetime: null;
|
|
8
|
+
readonly datetimeRange: null;
|
|
9
|
+
readonly duration: null;
|
|
10
|
+
readonly email: null;
|
|
11
|
+
readonly integer: null;
|
|
12
|
+
readonly number: null;
|
|
13
|
+
readonly object: null;
|
|
14
|
+
readonly reference: null;
|
|
15
|
+
readonly html: null;
|
|
16
|
+
readonly markdown: null;
|
|
17
|
+
readonly string: null;
|
|
18
|
+
readonly url: null;
|
|
19
|
+
};
|
|
20
|
+
readonly boolean: {
|
|
21
|
+
readonly blob: null;
|
|
22
|
+
readonly boolean: {};
|
|
23
|
+
readonly date: null;
|
|
24
|
+
readonly dateRange: null;
|
|
25
|
+
readonly datetime: null;
|
|
26
|
+
readonly datetimeRange: null;
|
|
27
|
+
readonly duration: null;
|
|
28
|
+
readonly email: null;
|
|
29
|
+
readonly integer: {};
|
|
30
|
+
readonly number: {};
|
|
31
|
+
readonly object: null;
|
|
32
|
+
readonly reference: null;
|
|
33
|
+
readonly html: {};
|
|
34
|
+
readonly markdown: {};
|
|
35
|
+
readonly string: {};
|
|
36
|
+
readonly url: null;
|
|
37
|
+
};
|
|
38
|
+
readonly date: {
|
|
39
|
+
readonly blob: null;
|
|
40
|
+
readonly boolean: null;
|
|
41
|
+
readonly date: {};
|
|
42
|
+
readonly dateRange: null;
|
|
43
|
+
readonly datetime: {};
|
|
44
|
+
readonly datetimeRange: null;
|
|
45
|
+
readonly duration: null;
|
|
46
|
+
readonly email: null;
|
|
47
|
+
readonly integer: {};
|
|
48
|
+
readonly number: {};
|
|
49
|
+
readonly object: null;
|
|
50
|
+
readonly reference: null;
|
|
51
|
+
readonly html: {
|
|
52
|
+
readonly locale: {
|
|
53
|
+
readonly type: "enum";
|
|
54
|
+
readonly default: "en-CA";
|
|
55
|
+
readonly values: ["en-CA"];
|
|
56
|
+
readonly description: "The locale to use for formatting the date.";
|
|
57
|
+
};
|
|
58
|
+
readonly timezone: {
|
|
59
|
+
readonly type: "enum";
|
|
60
|
+
readonly default: "UTC";
|
|
61
|
+
readonly values: ["UTC"];
|
|
62
|
+
readonly description: "The timezone to use for formatting the date.";
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
readonly markdown: {
|
|
66
|
+
readonly locale: {
|
|
67
|
+
readonly type: "enum";
|
|
68
|
+
readonly default: "en-CA";
|
|
69
|
+
readonly values: ["en-CA"];
|
|
70
|
+
readonly description: "The locale to use for formatting the date.";
|
|
71
|
+
};
|
|
72
|
+
readonly timezone: {
|
|
73
|
+
readonly type: "enum";
|
|
74
|
+
readonly default: "UTC";
|
|
75
|
+
readonly values: ["UTC"];
|
|
76
|
+
readonly description: "The timezone to use for formatting the date.";
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
readonly string: {
|
|
80
|
+
readonly locale: {
|
|
81
|
+
readonly type: "enum";
|
|
82
|
+
readonly default: "en-CA";
|
|
83
|
+
readonly values: ["en-CA"];
|
|
84
|
+
readonly description: "The locale to use for formatting the date.";
|
|
85
|
+
};
|
|
86
|
+
readonly timezone: {
|
|
87
|
+
readonly type: "enum";
|
|
88
|
+
readonly default: "UTC";
|
|
89
|
+
readonly values: ["UTC"];
|
|
90
|
+
readonly description: "The timezone to use for formatting the date.";
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
readonly url: null;
|
|
94
|
+
};
|
|
95
|
+
readonly dateRange: {
|
|
96
|
+
readonly blob: null;
|
|
97
|
+
readonly boolean: null;
|
|
98
|
+
readonly date: null;
|
|
99
|
+
readonly dateRange: null;
|
|
100
|
+
readonly datetime: null;
|
|
101
|
+
readonly datetimeRange: null;
|
|
102
|
+
readonly duration: null;
|
|
103
|
+
readonly email: null;
|
|
104
|
+
readonly integer: null;
|
|
105
|
+
readonly number: null;
|
|
106
|
+
readonly object: null;
|
|
107
|
+
readonly reference: null;
|
|
108
|
+
readonly html: null;
|
|
109
|
+
readonly markdown: null;
|
|
110
|
+
readonly string: null;
|
|
111
|
+
readonly url: null;
|
|
112
|
+
};
|
|
113
|
+
readonly datetime: {
|
|
114
|
+
readonly blob: null;
|
|
115
|
+
readonly boolean: null;
|
|
116
|
+
readonly date: {};
|
|
117
|
+
readonly dateRange: null;
|
|
118
|
+
readonly datetime: {};
|
|
119
|
+
readonly datetimeRange: null;
|
|
120
|
+
readonly duration: null;
|
|
121
|
+
readonly email: null;
|
|
122
|
+
readonly integer: {};
|
|
123
|
+
readonly number: {};
|
|
124
|
+
readonly object: null;
|
|
125
|
+
readonly reference: null;
|
|
126
|
+
readonly html: {
|
|
127
|
+
readonly locale: {
|
|
128
|
+
readonly type: "enum";
|
|
129
|
+
readonly default: "en-CA";
|
|
130
|
+
readonly values: ["en-CA"];
|
|
131
|
+
readonly description: "The locale to use for formatting the date.";
|
|
132
|
+
};
|
|
133
|
+
readonly timezone: {
|
|
134
|
+
readonly type: "enum";
|
|
135
|
+
readonly default: "UTC";
|
|
136
|
+
readonly values: ["UTC"];
|
|
137
|
+
readonly description: "The timezone to use for formatting the date.";
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
readonly markdown: {
|
|
141
|
+
readonly locale: {
|
|
142
|
+
readonly type: "enum";
|
|
143
|
+
readonly default: "en-CA";
|
|
144
|
+
readonly values: ["en-CA"];
|
|
145
|
+
readonly description: "The locale to use for formatting the date.";
|
|
146
|
+
};
|
|
147
|
+
readonly timezone: {
|
|
148
|
+
readonly type: "enum";
|
|
149
|
+
readonly default: "UTC";
|
|
150
|
+
readonly values: ["UTC"];
|
|
151
|
+
readonly description: "The timezone to use for formatting the date.";
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
readonly string: {
|
|
155
|
+
readonly locale: {
|
|
156
|
+
readonly type: "enum";
|
|
157
|
+
readonly default: "en-CA";
|
|
158
|
+
readonly values: ["en-CA"];
|
|
159
|
+
readonly description: "The locale to use for formatting the date.";
|
|
160
|
+
};
|
|
161
|
+
readonly timezone: {
|
|
162
|
+
readonly type: "enum";
|
|
163
|
+
readonly default: "UTC";
|
|
164
|
+
readonly values: ["UTC"];
|
|
165
|
+
readonly description: "The timezone to use for formatting the date.";
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
readonly url: null;
|
|
169
|
+
};
|
|
170
|
+
readonly datetimeRange: {
|
|
171
|
+
readonly blob: null;
|
|
172
|
+
readonly boolean: null;
|
|
173
|
+
readonly date: null;
|
|
174
|
+
readonly dateRange: null;
|
|
175
|
+
readonly datetime: null;
|
|
176
|
+
readonly datetimeRange: null;
|
|
177
|
+
readonly duration: null;
|
|
178
|
+
readonly email: null;
|
|
179
|
+
readonly integer: null;
|
|
180
|
+
readonly number: null;
|
|
181
|
+
readonly object: null;
|
|
182
|
+
readonly reference: null;
|
|
183
|
+
readonly html: null;
|
|
184
|
+
readonly markdown: null;
|
|
185
|
+
readonly string: null;
|
|
186
|
+
readonly url: null;
|
|
187
|
+
};
|
|
188
|
+
readonly duration: {
|
|
189
|
+
readonly blob: null;
|
|
190
|
+
readonly boolean: null;
|
|
191
|
+
readonly date: null;
|
|
192
|
+
readonly dateRange: null;
|
|
193
|
+
readonly datetime: null;
|
|
194
|
+
readonly datetimeRange: null;
|
|
195
|
+
readonly duration: {};
|
|
196
|
+
readonly email: null;
|
|
197
|
+
readonly integer: {};
|
|
198
|
+
readonly number: {};
|
|
199
|
+
readonly object: null;
|
|
200
|
+
readonly reference: null;
|
|
201
|
+
readonly html: {};
|
|
202
|
+
readonly markdown: {};
|
|
203
|
+
readonly string: {};
|
|
204
|
+
readonly url: null;
|
|
205
|
+
};
|
|
206
|
+
readonly email: {
|
|
207
|
+
readonly blob: null;
|
|
208
|
+
readonly boolean: null;
|
|
209
|
+
readonly date: null;
|
|
210
|
+
readonly dateRange: null;
|
|
211
|
+
readonly datetime: null;
|
|
212
|
+
readonly datetimeRange: null;
|
|
213
|
+
readonly duration: null;
|
|
214
|
+
readonly email: {};
|
|
215
|
+
readonly integer: null;
|
|
216
|
+
readonly number: null;
|
|
217
|
+
readonly object: null;
|
|
218
|
+
readonly reference: null;
|
|
219
|
+
readonly html: {};
|
|
220
|
+
readonly markdown: {};
|
|
221
|
+
readonly string: {};
|
|
222
|
+
readonly url: null;
|
|
223
|
+
};
|
|
224
|
+
readonly integer: {
|
|
225
|
+
readonly blob: null;
|
|
226
|
+
readonly boolean: {};
|
|
227
|
+
readonly date: {};
|
|
228
|
+
readonly dateRange: null;
|
|
229
|
+
readonly datetime: {};
|
|
230
|
+
readonly datetimeRange: null;
|
|
231
|
+
readonly duration: null;
|
|
232
|
+
readonly email: null;
|
|
233
|
+
readonly integer: {};
|
|
234
|
+
readonly number: {};
|
|
235
|
+
readonly object: null;
|
|
236
|
+
readonly reference: null;
|
|
237
|
+
readonly html: {};
|
|
238
|
+
readonly markdown: {};
|
|
239
|
+
readonly string: {};
|
|
240
|
+
readonly url: null;
|
|
241
|
+
};
|
|
242
|
+
readonly number: {
|
|
243
|
+
readonly blob: null;
|
|
244
|
+
readonly boolean: {};
|
|
245
|
+
readonly date: {};
|
|
246
|
+
readonly dateRange: null;
|
|
247
|
+
readonly datetime: {};
|
|
248
|
+
readonly datetimeRange: null;
|
|
249
|
+
readonly duration: null;
|
|
250
|
+
readonly email: null;
|
|
251
|
+
readonly integer: {};
|
|
252
|
+
readonly number: {};
|
|
253
|
+
readonly object: null;
|
|
254
|
+
readonly reference: null;
|
|
255
|
+
readonly html: {};
|
|
256
|
+
readonly markdown: {};
|
|
257
|
+
readonly string: {};
|
|
258
|
+
readonly url: null;
|
|
259
|
+
};
|
|
260
|
+
readonly object: {
|
|
261
|
+
readonly blob: null;
|
|
262
|
+
readonly boolean: null;
|
|
263
|
+
readonly date: null;
|
|
264
|
+
readonly dateRange: null;
|
|
265
|
+
readonly datetime: null;
|
|
266
|
+
readonly datetimeRange: null;
|
|
267
|
+
readonly duration: null;
|
|
268
|
+
readonly email: null;
|
|
269
|
+
readonly integer: null;
|
|
270
|
+
readonly number: null;
|
|
271
|
+
readonly object: null;
|
|
272
|
+
readonly reference: null;
|
|
273
|
+
readonly html: null;
|
|
274
|
+
readonly markdown: null;
|
|
275
|
+
readonly string: null;
|
|
276
|
+
readonly url: null;
|
|
277
|
+
};
|
|
278
|
+
readonly reference: {
|
|
279
|
+
readonly blob: null;
|
|
280
|
+
readonly boolean: null;
|
|
281
|
+
readonly date: null;
|
|
282
|
+
readonly dateRange: null;
|
|
283
|
+
readonly datetime: null;
|
|
284
|
+
readonly datetimeRange: null;
|
|
285
|
+
readonly duration: null;
|
|
286
|
+
readonly email: null;
|
|
287
|
+
readonly integer: null;
|
|
288
|
+
readonly number: null;
|
|
289
|
+
readonly object: null;
|
|
290
|
+
readonly reference: {};
|
|
291
|
+
readonly html: null;
|
|
292
|
+
readonly markdown: null;
|
|
293
|
+
readonly string: null;
|
|
294
|
+
readonly url: null;
|
|
295
|
+
};
|
|
296
|
+
readonly html: {
|
|
297
|
+
readonly blob: null;
|
|
298
|
+
readonly boolean: null;
|
|
299
|
+
readonly date: null;
|
|
300
|
+
readonly dateRange: null;
|
|
301
|
+
readonly datetime: null;
|
|
302
|
+
readonly datetimeRange: null;
|
|
303
|
+
readonly duration: null;
|
|
304
|
+
readonly email: null;
|
|
305
|
+
readonly integer: null;
|
|
306
|
+
readonly number: null;
|
|
307
|
+
readonly object: null;
|
|
308
|
+
readonly reference: null;
|
|
309
|
+
readonly html: {
|
|
310
|
+
readonly decorator: {
|
|
311
|
+
readonly type: "boolean";
|
|
312
|
+
readonly description: "Decorate the content with author information and optional date.";
|
|
313
|
+
readonly default: false;
|
|
314
|
+
readonly hidden: true;
|
|
315
|
+
};
|
|
316
|
+
readonly decoratorTemplate: {
|
|
317
|
+
readonly type: "string";
|
|
318
|
+
readonly description: "Template for the decorator. Use {author} and {date} placeholders.";
|
|
319
|
+
readonly default: "On <strong>{semantic:createdAt}</strong>, <em>{semantic:user.semantic:displayName}</em> commented:";
|
|
320
|
+
readonly hidden: true;
|
|
321
|
+
};
|
|
322
|
+
readonly decoratorPrefix: {
|
|
323
|
+
readonly type: "string";
|
|
324
|
+
readonly description: "Prefix for the decorator. Defaults to \"➤\".";
|
|
325
|
+
readonly default: "➤";
|
|
326
|
+
readonly hidden: true;
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
readonly markdown: {
|
|
330
|
+
readonly decorator: {
|
|
331
|
+
readonly type: "boolean";
|
|
332
|
+
readonly description: "Decorate the content with author information and optional date.";
|
|
333
|
+
readonly default: false;
|
|
334
|
+
readonly hidden: true;
|
|
335
|
+
};
|
|
336
|
+
readonly decoratorTemplate: {
|
|
337
|
+
readonly type: "string";
|
|
338
|
+
readonly description: "Template for the decorator. Use {author} and {date} placeholders.";
|
|
339
|
+
readonly default: "On <strong>{semantic:createdAt}</strong>, <em>{semantic:user.semantic:displayName}</em> commented:";
|
|
340
|
+
readonly hidden: true;
|
|
341
|
+
};
|
|
342
|
+
readonly decoratorPrefix: {
|
|
343
|
+
readonly type: "string";
|
|
344
|
+
readonly description: "Prefix for the decorator. Defaults to \"➤\".";
|
|
345
|
+
readonly default: "➤";
|
|
346
|
+
readonly hidden: true;
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
readonly string: {};
|
|
350
|
+
readonly url: null;
|
|
351
|
+
};
|
|
352
|
+
readonly markdown: {
|
|
353
|
+
readonly blob: null;
|
|
354
|
+
readonly boolean: null;
|
|
355
|
+
readonly date: null;
|
|
356
|
+
readonly dateRange: null;
|
|
357
|
+
readonly datetime: null;
|
|
358
|
+
readonly datetimeRange: null;
|
|
359
|
+
readonly duration: null;
|
|
360
|
+
readonly email: null;
|
|
361
|
+
readonly integer: null;
|
|
362
|
+
readonly number: null;
|
|
363
|
+
readonly object: null;
|
|
364
|
+
readonly reference: null;
|
|
365
|
+
readonly html: {
|
|
366
|
+
readonly decorator: {
|
|
367
|
+
readonly type: "boolean";
|
|
368
|
+
readonly description: "Decorate the content with author information and optional date.";
|
|
369
|
+
readonly default: false;
|
|
370
|
+
readonly hidden: true;
|
|
371
|
+
};
|
|
372
|
+
readonly decoratorTemplate: {
|
|
373
|
+
readonly type: "string";
|
|
374
|
+
readonly description: "Template for the decorator. Use {author} and {date} placeholders.";
|
|
375
|
+
readonly default: "On **{semantic:createdAt}**, __{semantic:user.semantic:displayName}__ commented:";
|
|
376
|
+
readonly hidden: true;
|
|
377
|
+
};
|
|
378
|
+
readonly decoratorPrefix: {
|
|
379
|
+
readonly type: "string";
|
|
380
|
+
readonly description: "Prefix for the decorator. Defaults to \"➤\".";
|
|
381
|
+
readonly default: "➤";
|
|
382
|
+
readonly hidden: true;
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
readonly markdown: {
|
|
386
|
+
readonly decorator: {
|
|
387
|
+
readonly type: "boolean";
|
|
388
|
+
readonly description: "Decorate the content with author information and optional date.";
|
|
389
|
+
readonly default: false;
|
|
390
|
+
readonly hidden: true;
|
|
391
|
+
};
|
|
392
|
+
readonly decoratorTemplate: {
|
|
393
|
+
readonly type: "string";
|
|
394
|
+
readonly description: "Template for the decorator. Use {author} and {date} placeholders.";
|
|
395
|
+
readonly default: "On **{semantic:createdAt}**, __{semantic:user.semantic:displayName}__ commented:";
|
|
396
|
+
readonly hidden: true;
|
|
397
|
+
};
|
|
398
|
+
readonly decoratorPrefix: {
|
|
399
|
+
readonly type: "string";
|
|
400
|
+
readonly description: "Prefix for the decorator. Defaults to \"➤\".";
|
|
401
|
+
readonly default: "➤";
|
|
402
|
+
readonly hidden: true;
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
readonly string: {};
|
|
406
|
+
readonly url: null;
|
|
407
|
+
};
|
|
408
|
+
readonly string: {
|
|
409
|
+
readonly blob: null;
|
|
410
|
+
readonly boolean: {};
|
|
411
|
+
readonly date: {};
|
|
412
|
+
readonly dateRange: null;
|
|
413
|
+
readonly datetime: {};
|
|
414
|
+
readonly datetimeRange: null;
|
|
415
|
+
readonly duration: null;
|
|
416
|
+
readonly email: null;
|
|
417
|
+
readonly integer: {};
|
|
418
|
+
readonly number: {};
|
|
419
|
+
readonly object: null;
|
|
420
|
+
readonly reference: null;
|
|
421
|
+
readonly html: {};
|
|
422
|
+
readonly markdown: {};
|
|
423
|
+
readonly string: {};
|
|
424
|
+
readonly url: null;
|
|
425
|
+
};
|
|
426
|
+
readonly url: {
|
|
427
|
+
readonly blob: null;
|
|
428
|
+
readonly boolean: null;
|
|
429
|
+
readonly date: null;
|
|
430
|
+
readonly dateRange: null;
|
|
431
|
+
readonly datetime: null;
|
|
432
|
+
readonly datetimeRange: null;
|
|
433
|
+
readonly duration: null;
|
|
434
|
+
readonly email: null;
|
|
435
|
+
readonly integer: null;
|
|
436
|
+
readonly number: null;
|
|
437
|
+
readonly object: null;
|
|
438
|
+
readonly reference: null;
|
|
439
|
+
readonly html: {};
|
|
440
|
+
readonly markdown: {};
|
|
441
|
+
readonly string: {};
|
|
442
|
+
readonly url: {};
|
|
443
|
+
};
|
|
444
|
+
};
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import * as Api from './types.js';
|
|
2
|
+
const dateToStringlikeConfiguration = {
|
|
3
|
+
locale: {
|
|
4
|
+
type: 'enum',
|
|
5
|
+
default: 'en-CA',
|
|
6
|
+
values: ['en-CA'],
|
|
7
|
+
description: 'The locale to use for formatting the date.',
|
|
8
|
+
},
|
|
9
|
+
timezone: {
|
|
10
|
+
type: 'enum',
|
|
11
|
+
default: 'UTC',
|
|
12
|
+
values: ['UTC'],
|
|
13
|
+
description: 'The timezone to use for formatting the date.',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
const htmlToRichTextConfiguration = {
|
|
17
|
+
decorator: {
|
|
18
|
+
type: 'boolean',
|
|
19
|
+
description: 'Decorate the content with author information and optional date.',
|
|
20
|
+
default: false,
|
|
21
|
+
hidden: true,
|
|
22
|
+
},
|
|
23
|
+
decoratorTemplate: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
description: 'Template for the decorator. Use {author} and {date} placeholders.',
|
|
26
|
+
default: 'On <strong>{semantic:createdAt}</strong>, <em>{semantic:user.semantic:displayName}</em> commented:',
|
|
27
|
+
hidden: true,
|
|
28
|
+
},
|
|
29
|
+
decoratorPrefix: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
description: `Prefix for the decorator. Defaults to "➤".`,
|
|
32
|
+
default: '➤',
|
|
33
|
+
hidden: true,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
const markdownToRichTextConfiguration = {
|
|
37
|
+
decorator: {
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
description: 'Decorate the content with author information and optional date.',
|
|
40
|
+
default: false,
|
|
41
|
+
hidden: true,
|
|
42
|
+
},
|
|
43
|
+
decoratorTemplate: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'Template for the decorator. Use {author} and {date} placeholders.',
|
|
46
|
+
default: 'On **{semantic:createdAt}**, __{semantic:user.semantic:displayName}__ commented:',
|
|
47
|
+
hidden: true,
|
|
48
|
+
},
|
|
49
|
+
decoratorPrefix: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
description: `Prefix for the decorator. Defaults to "➤".`,
|
|
52
|
+
default: '➤',
|
|
53
|
+
hidden: true,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
export const fieldTypeCompatibilityMatrix = {
|
|
57
|
+
[Api.FieldValueTypes.BLOB]: {
|
|
58
|
+
[Api.FieldValueTypes.BLOB]: {},
|
|
59
|
+
[Api.FieldValueTypes.BOOLEAN]: null,
|
|
60
|
+
[Api.FieldValueTypes.DATE]: null,
|
|
61
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
62
|
+
[Api.FieldValueTypes.DATETIME]: null,
|
|
63
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
64
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
65
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
66
|
+
[Api.FieldValueTypes.INTEGER]: null,
|
|
67
|
+
[Api.FieldValueTypes.NUMBER]: null,
|
|
68
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
69
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
70
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
71
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
72
|
+
[Api.FieldValueTypes.STRING]: null,
|
|
73
|
+
[Api.FieldValueTypes.URL]: null,
|
|
74
|
+
},
|
|
75
|
+
[Api.FieldValueTypes.BOOLEAN]: {
|
|
76
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
77
|
+
[Api.FieldValueTypes.BOOLEAN]: {},
|
|
78
|
+
[Api.FieldValueTypes.DATE]: null,
|
|
79
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
80
|
+
[Api.FieldValueTypes.DATETIME]: null,
|
|
81
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
82
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
83
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
84
|
+
[Api.FieldValueTypes.INTEGER]: {},
|
|
85
|
+
[Api.FieldValueTypes.NUMBER]: {},
|
|
86
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
87
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
88
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
89
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
90
|
+
[Api.FieldValueTypes.STRING]: {},
|
|
91
|
+
[Api.FieldValueTypes.URL]: null,
|
|
92
|
+
},
|
|
93
|
+
[Api.FieldValueTypes.DATE]: {
|
|
94
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
95
|
+
[Api.FieldValueTypes.BOOLEAN]: null,
|
|
96
|
+
[Api.FieldValueTypes.DATE]: {},
|
|
97
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
98
|
+
[Api.FieldValueTypes.DATETIME]: {},
|
|
99
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
100
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
101
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
102
|
+
[Api.FieldValueTypes.INTEGER]: {},
|
|
103
|
+
[Api.FieldValueTypes.NUMBER]: {},
|
|
104
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
105
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
106
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: dateToStringlikeConfiguration,
|
|
107
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: dateToStringlikeConfiguration,
|
|
108
|
+
[Api.FieldValueTypes.STRING]: dateToStringlikeConfiguration,
|
|
109
|
+
[Api.FieldValueTypes.URL]: null,
|
|
110
|
+
},
|
|
111
|
+
[Api.FieldValueTypes.DATE_RANGE]: {
|
|
112
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
113
|
+
[Api.FieldValueTypes.BOOLEAN]: null,
|
|
114
|
+
[Api.FieldValueTypes.DATE]: null,
|
|
115
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
116
|
+
[Api.FieldValueTypes.DATETIME]: null,
|
|
117
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
118
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
119
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
120
|
+
[Api.FieldValueTypes.INTEGER]: null,
|
|
121
|
+
[Api.FieldValueTypes.NUMBER]: null,
|
|
122
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
123
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
124
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
125
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
126
|
+
[Api.FieldValueTypes.STRING]: null,
|
|
127
|
+
[Api.FieldValueTypes.URL]: null,
|
|
128
|
+
},
|
|
129
|
+
[Api.FieldValueTypes.DATETIME]: {
|
|
130
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
131
|
+
[Api.FieldValueTypes.BOOLEAN]: null,
|
|
132
|
+
[Api.FieldValueTypes.DATE]: {},
|
|
133
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
134
|
+
[Api.FieldValueTypes.DATETIME]: {},
|
|
135
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
136
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
137
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
138
|
+
[Api.FieldValueTypes.INTEGER]: {},
|
|
139
|
+
[Api.FieldValueTypes.NUMBER]: {},
|
|
140
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
141
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
142
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: dateToStringlikeConfiguration,
|
|
143
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: dateToStringlikeConfiguration,
|
|
144
|
+
[Api.FieldValueTypes.STRING]: dateToStringlikeConfiguration,
|
|
145
|
+
[Api.FieldValueTypes.URL]: null,
|
|
146
|
+
},
|
|
147
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: {
|
|
148
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
149
|
+
[Api.FieldValueTypes.BOOLEAN]: null,
|
|
150
|
+
[Api.FieldValueTypes.DATE]: null,
|
|
151
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
152
|
+
[Api.FieldValueTypes.DATETIME]: null,
|
|
153
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
154
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
155
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
156
|
+
[Api.FieldValueTypes.INTEGER]: null,
|
|
157
|
+
[Api.FieldValueTypes.NUMBER]: null,
|
|
158
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
159
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
160
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
161
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
162
|
+
[Api.FieldValueTypes.STRING]: null,
|
|
163
|
+
[Api.FieldValueTypes.URL]: null,
|
|
164
|
+
},
|
|
165
|
+
[Api.FieldValueTypes.DURATION]: {
|
|
166
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
167
|
+
[Api.FieldValueTypes.BOOLEAN]: null,
|
|
168
|
+
[Api.FieldValueTypes.DATE]: null,
|
|
169
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
170
|
+
[Api.FieldValueTypes.DATETIME]: null,
|
|
171
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
172
|
+
[Api.FieldValueTypes.DURATION]: {},
|
|
173
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
174
|
+
[Api.FieldValueTypes.INTEGER]: {},
|
|
175
|
+
[Api.FieldValueTypes.NUMBER]: {},
|
|
176
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
177
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
178
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
179
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
180
|
+
[Api.FieldValueTypes.STRING]: {},
|
|
181
|
+
[Api.FieldValueTypes.URL]: null,
|
|
182
|
+
},
|
|
183
|
+
[Api.FieldValueTypes.EMAIL]: {
|
|
184
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
185
|
+
[Api.FieldValueTypes.BOOLEAN]: null,
|
|
186
|
+
[Api.FieldValueTypes.DATE]: null,
|
|
187
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
188
|
+
[Api.FieldValueTypes.DATETIME]: null,
|
|
189
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
190
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
191
|
+
[Api.FieldValueTypes.EMAIL]: {},
|
|
192
|
+
[Api.FieldValueTypes.INTEGER]: null,
|
|
193
|
+
[Api.FieldValueTypes.NUMBER]: null,
|
|
194
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
195
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
196
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
197
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
198
|
+
[Api.FieldValueTypes.STRING]: {},
|
|
199
|
+
[Api.FieldValueTypes.URL]: null,
|
|
200
|
+
},
|
|
201
|
+
[Api.FieldValueTypes.INTEGER]: {
|
|
202
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
203
|
+
[Api.FieldValueTypes.BOOLEAN]: {},
|
|
204
|
+
[Api.FieldValueTypes.DATE]: {},
|
|
205
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
206
|
+
[Api.FieldValueTypes.DATETIME]: {},
|
|
207
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
208
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
209
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
210
|
+
[Api.FieldValueTypes.INTEGER]: {},
|
|
211
|
+
[Api.FieldValueTypes.NUMBER]: {},
|
|
212
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
213
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
214
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
215
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
216
|
+
[Api.FieldValueTypes.STRING]: {},
|
|
217
|
+
[Api.FieldValueTypes.URL]: null,
|
|
218
|
+
},
|
|
219
|
+
[Api.FieldValueTypes.NUMBER]: {
|
|
220
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
221
|
+
[Api.FieldValueTypes.BOOLEAN]: {},
|
|
222
|
+
[Api.FieldValueTypes.DATE]: {},
|
|
223
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
224
|
+
[Api.FieldValueTypes.DATETIME]: {},
|
|
225
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
226
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
227
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
228
|
+
[Api.FieldValueTypes.INTEGER]: {},
|
|
229
|
+
[Api.FieldValueTypes.NUMBER]: {},
|
|
230
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
231
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
232
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
233
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
234
|
+
[Api.FieldValueTypes.STRING]: {},
|
|
235
|
+
[Api.FieldValueTypes.URL]: null,
|
|
236
|
+
},
|
|
237
|
+
[Api.FieldValueTypes.OBJECT]: {
|
|
238
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
239
|
+
[Api.FieldValueTypes.BOOLEAN]: null,
|
|
240
|
+
[Api.FieldValueTypes.DATE]: null,
|
|
241
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
242
|
+
[Api.FieldValueTypes.DATETIME]: null,
|
|
243
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
244
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
245
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
246
|
+
[Api.FieldValueTypes.INTEGER]: null,
|
|
247
|
+
[Api.FieldValueTypes.NUMBER]: null,
|
|
248
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
249
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
250
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
251
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
252
|
+
[Api.FieldValueTypes.STRING]: null,
|
|
253
|
+
[Api.FieldValueTypes.URL]: null,
|
|
254
|
+
},
|
|
255
|
+
[Api.FieldValueTypes.REFERENCE]: {
|
|
256
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
257
|
+
[Api.FieldValueTypes.BOOLEAN]: null,
|
|
258
|
+
[Api.FieldValueTypes.DATE]: null,
|
|
259
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
260
|
+
[Api.FieldValueTypes.DATETIME]: null,
|
|
261
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
262
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
263
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
264
|
+
[Api.FieldValueTypes.INTEGER]: null,
|
|
265
|
+
[Api.FieldValueTypes.NUMBER]: null,
|
|
266
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
267
|
+
[Api.FieldValueTypes.REFERENCE]: {},
|
|
268
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
269
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
270
|
+
[Api.FieldValueTypes.STRING]: null,
|
|
271
|
+
[Api.FieldValueTypes.URL]: null,
|
|
272
|
+
},
|
|
273
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: {
|
|
274
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
275
|
+
[Api.FieldValueTypes.BOOLEAN]: null,
|
|
276
|
+
[Api.FieldValueTypes.DATE]: null,
|
|
277
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
278
|
+
[Api.FieldValueTypes.DATETIME]: null,
|
|
279
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
280
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
281
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
282
|
+
[Api.FieldValueTypes.INTEGER]: null,
|
|
283
|
+
[Api.FieldValueTypes.NUMBER]: null,
|
|
284
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
285
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
286
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: htmlToRichTextConfiguration,
|
|
287
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: htmlToRichTextConfiguration,
|
|
288
|
+
[Api.FieldValueTypes.STRING]: {},
|
|
289
|
+
[Api.FieldValueTypes.URL]: null,
|
|
290
|
+
},
|
|
291
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {
|
|
292
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
293
|
+
[Api.FieldValueTypes.BOOLEAN]: null,
|
|
294
|
+
[Api.FieldValueTypes.DATE]: null,
|
|
295
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
296
|
+
[Api.FieldValueTypes.DATETIME]: null,
|
|
297
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
298
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
299
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
300
|
+
[Api.FieldValueTypes.INTEGER]: null,
|
|
301
|
+
[Api.FieldValueTypes.NUMBER]: null,
|
|
302
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
303
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
304
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: markdownToRichTextConfiguration,
|
|
305
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: markdownToRichTextConfiguration,
|
|
306
|
+
[Api.FieldValueTypes.STRING]: {},
|
|
307
|
+
[Api.FieldValueTypes.URL]: null,
|
|
308
|
+
},
|
|
309
|
+
[Api.FieldValueTypes.STRING]: {
|
|
310
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
311
|
+
[Api.FieldValueTypes.BOOLEAN]: {},
|
|
312
|
+
[Api.FieldValueTypes.DATE]: {},
|
|
313
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
314
|
+
[Api.FieldValueTypes.DATETIME]: {},
|
|
315
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
316
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
317
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
318
|
+
[Api.FieldValueTypes.INTEGER]: {},
|
|
319
|
+
[Api.FieldValueTypes.NUMBER]: {},
|
|
320
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
321
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
322
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
323
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
324
|
+
[Api.FieldValueTypes.STRING]: {},
|
|
325
|
+
[Api.FieldValueTypes.URL]: null,
|
|
326
|
+
},
|
|
327
|
+
[Api.FieldValueTypes.URL]: {
|
|
328
|
+
[Api.FieldValueTypes.BLOB]: null,
|
|
329
|
+
[Api.FieldValueTypes.BOOLEAN]: null,
|
|
330
|
+
[Api.FieldValueTypes.DATE]: null,
|
|
331
|
+
[Api.FieldValueTypes.DATE_RANGE]: null,
|
|
332
|
+
[Api.FieldValueTypes.DATETIME]: null,
|
|
333
|
+
[Api.FieldValueTypes.DATETIME_RANGE]: null,
|
|
334
|
+
[Api.FieldValueTypes.DURATION]: null,
|
|
335
|
+
[Api.FieldValueTypes.EMAIL]: null,
|
|
336
|
+
[Api.FieldValueTypes.INTEGER]: null,
|
|
337
|
+
[Api.FieldValueTypes.NUMBER]: null,
|
|
338
|
+
[Api.FieldValueTypes.OBJECT]: null,
|
|
339
|
+
[Api.FieldValueTypes.REFERENCE]: null,
|
|
340
|
+
[Api.FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
341
|
+
[Api.FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
342
|
+
[Api.FieldValueTypes.STRING]: {},
|
|
343
|
+
[Api.FieldValueTypes.URL]: {},
|
|
344
|
+
},
|
|
345
|
+
};
|
package/dist/src/index.cjs
CHANGED
|
@@ -218,11 +218,357 @@ function isFieldSchema(potentialFieldSchema) {
|
|
|
218
218
|
(isUndefined(potentialFieldSchema['semantic']) || isSemantic(potentialFieldSchema['semantic'])));
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
+
const dateToStringlikeConfiguration = {
|
|
222
|
+
locale: {
|
|
223
|
+
type: 'enum',
|
|
224
|
+
default: 'en-CA',
|
|
225
|
+
values: ['en-CA'],
|
|
226
|
+
description: 'The locale to use for formatting the date.',
|
|
227
|
+
},
|
|
228
|
+
timezone: {
|
|
229
|
+
type: 'enum',
|
|
230
|
+
default: 'UTC',
|
|
231
|
+
values: ['UTC'],
|
|
232
|
+
description: 'The timezone to use for formatting the date.',
|
|
233
|
+
},
|
|
234
|
+
};
|
|
235
|
+
const htmlToRichTextConfiguration = {
|
|
236
|
+
decorator: {
|
|
237
|
+
type: 'boolean',
|
|
238
|
+
description: 'Decorate the content with author information and optional date.',
|
|
239
|
+
default: false,
|
|
240
|
+
hidden: true,
|
|
241
|
+
},
|
|
242
|
+
decoratorTemplate: {
|
|
243
|
+
type: 'string',
|
|
244
|
+
description: 'Template for the decorator. Use {author} and {date} placeholders.',
|
|
245
|
+
default: 'On <strong>{semantic:createdAt}</strong>, <em>{semantic:user.semantic:displayName}</em> commented:',
|
|
246
|
+
hidden: true,
|
|
247
|
+
},
|
|
248
|
+
decoratorPrefix: {
|
|
249
|
+
type: 'string',
|
|
250
|
+
description: `Prefix for the decorator. Defaults to "➤".`,
|
|
251
|
+
default: '➤',
|
|
252
|
+
hidden: true,
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
const markdownToRichTextConfiguration = {
|
|
256
|
+
decorator: {
|
|
257
|
+
type: 'boolean',
|
|
258
|
+
description: 'Decorate the content with author information and optional date.',
|
|
259
|
+
default: false,
|
|
260
|
+
hidden: true,
|
|
261
|
+
},
|
|
262
|
+
decoratorTemplate: {
|
|
263
|
+
type: 'string',
|
|
264
|
+
description: 'Template for the decorator. Use {author} and {date} placeholders.',
|
|
265
|
+
default: 'On **{semantic:createdAt}**, __{semantic:user.semantic:displayName}__ commented:',
|
|
266
|
+
hidden: true,
|
|
267
|
+
},
|
|
268
|
+
decoratorPrefix: {
|
|
269
|
+
type: 'string',
|
|
270
|
+
description: `Prefix for the decorator. Defaults to "➤".`,
|
|
271
|
+
default: '➤',
|
|
272
|
+
hidden: true,
|
|
273
|
+
},
|
|
274
|
+
};
|
|
275
|
+
const fieldTypeCompatibilityMatrix = {
|
|
276
|
+
[FieldValueTypes.BLOB]: {
|
|
277
|
+
[FieldValueTypes.BLOB]: {},
|
|
278
|
+
[FieldValueTypes.BOOLEAN]: null,
|
|
279
|
+
[FieldValueTypes.DATE]: null,
|
|
280
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
281
|
+
[FieldValueTypes.DATETIME]: null,
|
|
282
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
283
|
+
[FieldValueTypes.DURATION]: null,
|
|
284
|
+
[FieldValueTypes.EMAIL]: null,
|
|
285
|
+
[FieldValueTypes.INTEGER]: null,
|
|
286
|
+
[FieldValueTypes.NUMBER]: null,
|
|
287
|
+
[FieldValueTypes.OBJECT]: null,
|
|
288
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
289
|
+
[FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
290
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
291
|
+
[FieldValueTypes.STRING]: null,
|
|
292
|
+
[FieldValueTypes.URL]: null,
|
|
293
|
+
},
|
|
294
|
+
[FieldValueTypes.BOOLEAN]: {
|
|
295
|
+
[FieldValueTypes.BLOB]: null,
|
|
296
|
+
[FieldValueTypes.BOOLEAN]: {},
|
|
297
|
+
[FieldValueTypes.DATE]: null,
|
|
298
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
299
|
+
[FieldValueTypes.DATETIME]: null,
|
|
300
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
301
|
+
[FieldValueTypes.DURATION]: null,
|
|
302
|
+
[FieldValueTypes.EMAIL]: null,
|
|
303
|
+
[FieldValueTypes.INTEGER]: {},
|
|
304
|
+
[FieldValueTypes.NUMBER]: {},
|
|
305
|
+
[FieldValueTypes.OBJECT]: null,
|
|
306
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
307
|
+
[FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
308
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
309
|
+
[FieldValueTypes.STRING]: {},
|
|
310
|
+
[FieldValueTypes.URL]: null,
|
|
311
|
+
},
|
|
312
|
+
[FieldValueTypes.DATE]: {
|
|
313
|
+
[FieldValueTypes.BLOB]: null,
|
|
314
|
+
[FieldValueTypes.BOOLEAN]: null,
|
|
315
|
+
[FieldValueTypes.DATE]: {},
|
|
316
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
317
|
+
[FieldValueTypes.DATETIME]: {},
|
|
318
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
319
|
+
[FieldValueTypes.DURATION]: null,
|
|
320
|
+
[FieldValueTypes.EMAIL]: null,
|
|
321
|
+
[FieldValueTypes.INTEGER]: {},
|
|
322
|
+
[FieldValueTypes.NUMBER]: {},
|
|
323
|
+
[FieldValueTypes.OBJECT]: null,
|
|
324
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
325
|
+
[FieldValueTypes.RICH_TEXT_HTML]: dateToStringlikeConfiguration,
|
|
326
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: dateToStringlikeConfiguration,
|
|
327
|
+
[FieldValueTypes.STRING]: dateToStringlikeConfiguration,
|
|
328
|
+
[FieldValueTypes.URL]: null,
|
|
329
|
+
},
|
|
330
|
+
[FieldValueTypes.DATE_RANGE]: {
|
|
331
|
+
[FieldValueTypes.BLOB]: null,
|
|
332
|
+
[FieldValueTypes.BOOLEAN]: null,
|
|
333
|
+
[FieldValueTypes.DATE]: null,
|
|
334
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
335
|
+
[FieldValueTypes.DATETIME]: null,
|
|
336
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
337
|
+
[FieldValueTypes.DURATION]: null,
|
|
338
|
+
[FieldValueTypes.EMAIL]: null,
|
|
339
|
+
[FieldValueTypes.INTEGER]: null,
|
|
340
|
+
[FieldValueTypes.NUMBER]: null,
|
|
341
|
+
[FieldValueTypes.OBJECT]: null,
|
|
342
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
343
|
+
[FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
344
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
345
|
+
[FieldValueTypes.STRING]: null,
|
|
346
|
+
[FieldValueTypes.URL]: null,
|
|
347
|
+
},
|
|
348
|
+
[FieldValueTypes.DATETIME]: {
|
|
349
|
+
[FieldValueTypes.BLOB]: null,
|
|
350
|
+
[FieldValueTypes.BOOLEAN]: null,
|
|
351
|
+
[FieldValueTypes.DATE]: {},
|
|
352
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
353
|
+
[FieldValueTypes.DATETIME]: {},
|
|
354
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
355
|
+
[FieldValueTypes.DURATION]: null,
|
|
356
|
+
[FieldValueTypes.EMAIL]: null,
|
|
357
|
+
[FieldValueTypes.INTEGER]: {},
|
|
358
|
+
[FieldValueTypes.NUMBER]: {},
|
|
359
|
+
[FieldValueTypes.OBJECT]: null,
|
|
360
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
361
|
+
[FieldValueTypes.RICH_TEXT_HTML]: dateToStringlikeConfiguration,
|
|
362
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: dateToStringlikeConfiguration,
|
|
363
|
+
[FieldValueTypes.STRING]: dateToStringlikeConfiguration,
|
|
364
|
+
[FieldValueTypes.URL]: null,
|
|
365
|
+
},
|
|
366
|
+
[FieldValueTypes.DATETIME_RANGE]: {
|
|
367
|
+
[FieldValueTypes.BLOB]: null,
|
|
368
|
+
[FieldValueTypes.BOOLEAN]: null,
|
|
369
|
+
[FieldValueTypes.DATE]: null,
|
|
370
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
371
|
+
[FieldValueTypes.DATETIME]: null,
|
|
372
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
373
|
+
[FieldValueTypes.DURATION]: null,
|
|
374
|
+
[FieldValueTypes.EMAIL]: null,
|
|
375
|
+
[FieldValueTypes.INTEGER]: null,
|
|
376
|
+
[FieldValueTypes.NUMBER]: null,
|
|
377
|
+
[FieldValueTypes.OBJECT]: null,
|
|
378
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
379
|
+
[FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
380
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
381
|
+
[FieldValueTypes.STRING]: null,
|
|
382
|
+
[FieldValueTypes.URL]: null,
|
|
383
|
+
},
|
|
384
|
+
[FieldValueTypes.DURATION]: {
|
|
385
|
+
[FieldValueTypes.BLOB]: null,
|
|
386
|
+
[FieldValueTypes.BOOLEAN]: null,
|
|
387
|
+
[FieldValueTypes.DATE]: null,
|
|
388
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
389
|
+
[FieldValueTypes.DATETIME]: null,
|
|
390
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
391
|
+
[FieldValueTypes.DURATION]: {},
|
|
392
|
+
[FieldValueTypes.EMAIL]: null,
|
|
393
|
+
[FieldValueTypes.INTEGER]: {},
|
|
394
|
+
[FieldValueTypes.NUMBER]: {},
|
|
395
|
+
[FieldValueTypes.OBJECT]: null,
|
|
396
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
397
|
+
[FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
398
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
399
|
+
[FieldValueTypes.STRING]: {},
|
|
400
|
+
[FieldValueTypes.URL]: null,
|
|
401
|
+
},
|
|
402
|
+
[FieldValueTypes.EMAIL]: {
|
|
403
|
+
[FieldValueTypes.BLOB]: null,
|
|
404
|
+
[FieldValueTypes.BOOLEAN]: null,
|
|
405
|
+
[FieldValueTypes.DATE]: null,
|
|
406
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
407
|
+
[FieldValueTypes.DATETIME]: null,
|
|
408
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
409
|
+
[FieldValueTypes.DURATION]: null,
|
|
410
|
+
[FieldValueTypes.EMAIL]: {},
|
|
411
|
+
[FieldValueTypes.INTEGER]: null,
|
|
412
|
+
[FieldValueTypes.NUMBER]: null,
|
|
413
|
+
[FieldValueTypes.OBJECT]: null,
|
|
414
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
415
|
+
[FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
416
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
417
|
+
[FieldValueTypes.STRING]: {},
|
|
418
|
+
[FieldValueTypes.URL]: null,
|
|
419
|
+
},
|
|
420
|
+
[FieldValueTypes.INTEGER]: {
|
|
421
|
+
[FieldValueTypes.BLOB]: null,
|
|
422
|
+
[FieldValueTypes.BOOLEAN]: {},
|
|
423
|
+
[FieldValueTypes.DATE]: {},
|
|
424
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
425
|
+
[FieldValueTypes.DATETIME]: {},
|
|
426
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
427
|
+
[FieldValueTypes.DURATION]: null,
|
|
428
|
+
[FieldValueTypes.EMAIL]: null,
|
|
429
|
+
[FieldValueTypes.INTEGER]: {},
|
|
430
|
+
[FieldValueTypes.NUMBER]: {},
|
|
431
|
+
[FieldValueTypes.OBJECT]: null,
|
|
432
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
433
|
+
[FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
434
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
435
|
+
[FieldValueTypes.STRING]: {},
|
|
436
|
+
[FieldValueTypes.URL]: null,
|
|
437
|
+
},
|
|
438
|
+
[FieldValueTypes.NUMBER]: {
|
|
439
|
+
[FieldValueTypes.BLOB]: null,
|
|
440
|
+
[FieldValueTypes.BOOLEAN]: {},
|
|
441
|
+
[FieldValueTypes.DATE]: {},
|
|
442
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
443
|
+
[FieldValueTypes.DATETIME]: {},
|
|
444
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
445
|
+
[FieldValueTypes.DURATION]: null,
|
|
446
|
+
[FieldValueTypes.EMAIL]: null,
|
|
447
|
+
[FieldValueTypes.INTEGER]: {},
|
|
448
|
+
[FieldValueTypes.NUMBER]: {},
|
|
449
|
+
[FieldValueTypes.OBJECT]: null,
|
|
450
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
451
|
+
[FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
452
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
453
|
+
[FieldValueTypes.STRING]: {},
|
|
454
|
+
[FieldValueTypes.URL]: null,
|
|
455
|
+
},
|
|
456
|
+
[FieldValueTypes.OBJECT]: {
|
|
457
|
+
[FieldValueTypes.BLOB]: null,
|
|
458
|
+
[FieldValueTypes.BOOLEAN]: null,
|
|
459
|
+
[FieldValueTypes.DATE]: null,
|
|
460
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
461
|
+
[FieldValueTypes.DATETIME]: null,
|
|
462
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
463
|
+
[FieldValueTypes.DURATION]: null,
|
|
464
|
+
[FieldValueTypes.EMAIL]: null,
|
|
465
|
+
[FieldValueTypes.INTEGER]: null,
|
|
466
|
+
[FieldValueTypes.NUMBER]: null,
|
|
467
|
+
[FieldValueTypes.OBJECT]: null,
|
|
468
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
469
|
+
[FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
470
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
471
|
+
[FieldValueTypes.STRING]: null,
|
|
472
|
+
[FieldValueTypes.URL]: null,
|
|
473
|
+
},
|
|
474
|
+
[FieldValueTypes.REFERENCE]: {
|
|
475
|
+
[FieldValueTypes.BLOB]: null,
|
|
476
|
+
[FieldValueTypes.BOOLEAN]: null,
|
|
477
|
+
[FieldValueTypes.DATE]: null,
|
|
478
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
479
|
+
[FieldValueTypes.DATETIME]: null,
|
|
480
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
481
|
+
[FieldValueTypes.DURATION]: null,
|
|
482
|
+
[FieldValueTypes.EMAIL]: null,
|
|
483
|
+
[FieldValueTypes.INTEGER]: null,
|
|
484
|
+
[FieldValueTypes.NUMBER]: null,
|
|
485
|
+
[FieldValueTypes.OBJECT]: null,
|
|
486
|
+
[FieldValueTypes.REFERENCE]: {},
|
|
487
|
+
[FieldValueTypes.RICH_TEXT_HTML]: null,
|
|
488
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: null,
|
|
489
|
+
[FieldValueTypes.STRING]: null,
|
|
490
|
+
[FieldValueTypes.URL]: null,
|
|
491
|
+
},
|
|
492
|
+
[FieldValueTypes.RICH_TEXT_HTML]: {
|
|
493
|
+
[FieldValueTypes.BLOB]: null,
|
|
494
|
+
[FieldValueTypes.BOOLEAN]: null,
|
|
495
|
+
[FieldValueTypes.DATE]: null,
|
|
496
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
497
|
+
[FieldValueTypes.DATETIME]: null,
|
|
498
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
499
|
+
[FieldValueTypes.DURATION]: null,
|
|
500
|
+
[FieldValueTypes.EMAIL]: null,
|
|
501
|
+
[FieldValueTypes.INTEGER]: null,
|
|
502
|
+
[FieldValueTypes.NUMBER]: null,
|
|
503
|
+
[FieldValueTypes.OBJECT]: null,
|
|
504
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
505
|
+
[FieldValueTypes.RICH_TEXT_HTML]: htmlToRichTextConfiguration,
|
|
506
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: htmlToRichTextConfiguration,
|
|
507
|
+
[FieldValueTypes.STRING]: {},
|
|
508
|
+
[FieldValueTypes.URL]: null,
|
|
509
|
+
},
|
|
510
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {
|
|
511
|
+
[FieldValueTypes.BLOB]: null,
|
|
512
|
+
[FieldValueTypes.BOOLEAN]: null,
|
|
513
|
+
[FieldValueTypes.DATE]: null,
|
|
514
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
515
|
+
[FieldValueTypes.DATETIME]: null,
|
|
516
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
517
|
+
[FieldValueTypes.DURATION]: null,
|
|
518
|
+
[FieldValueTypes.EMAIL]: null,
|
|
519
|
+
[FieldValueTypes.INTEGER]: null,
|
|
520
|
+
[FieldValueTypes.NUMBER]: null,
|
|
521
|
+
[FieldValueTypes.OBJECT]: null,
|
|
522
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
523
|
+
[FieldValueTypes.RICH_TEXT_HTML]: markdownToRichTextConfiguration,
|
|
524
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: markdownToRichTextConfiguration,
|
|
525
|
+
[FieldValueTypes.STRING]: {},
|
|
526
|
+
[FieldValueTypes.URL]: null,
|
|
527
|
+
},
|
|
528
|
+
[FieldValueTypes.STRING]: {
|
|
529
|
+
[FieldValueTypes.BLOB]: null,
|
|
530
|
+
[FieldValueTypes.BOOLEAN]: {},
|
|
531
|
+
[FieldValueTypes.DATE]: {},
|
|
532
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
533
|
+
[FieldValueTypes.DATETIME]: {},
|
|
534
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
535
|
+
[FieldValueTypes.DURATION]: null,
|
|
536
|
+
[FieldValueTypes.EMAIL]: null,
|
|
537
|
+
[FieldValueTypes.INTEGER]: {},
|
|
538
|
+
[FieldValueTypes.NUMBER]: {},
|
|
539
|
+
[FieldValueTypes.OBJECT]: null,
|
|
540
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
541
|
+
[FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
542
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
543
|
+
[FieldValueTypes.STRING]: {},
|
|
544
|
+
[FieldValueTypes.URL]: null,
|
|
545
|
+
},
|
|
546
|
+
[FieldValueTypes.URL]: {
|
|
547
|
+
[FieldValueTypes.BLOB]: null,
|
|
548
|
+
[FieldValueTypes.BOOLEAN]: null,
|
|
549
|
+
[FieldValueTypes.DATE]: null,
|
|
550
|
+
[FieldValueTypes.DATE_RANGE]: null,
|
|
551
|
+
[FieldValueTypes.DATETIME]: null,
|
|
552
|
+
[FieldValueTypes.DATETIME_RANGE]: null,
|
|
553
|
+
[FieldValueTypes.DURATION]: null,
|
|
554
|
+
[FieldValueTypes.EMAIL]: null,
|
|
555
|
+
[FieldValueTypes.INTEGER]: null,
|
|
556
|
+
[FieldValueTypes.NUMBER]: null,
|
|
557
|
+
[FieldValueTypes.OBJECT]: null,
|
|
558
|
+
[FieldValueTypes.REFERENCE]: null,
|
|
559
|
+
[FieldValueTypes.RICH_TEXT_HTML]: {},
|
|
560
|
+
[FieldValueTypes.RICH_TEXT_MARKDOWN]: {},
|
|
561
|
+
[FieldValueTypes.STRING]: {},
|
|
562
|
+
[FieldValueTypes.URL]: {},
|
|
563
|
+
},
|
|
564
|
+
};
|
|
565
|
+
|
|
221
566
|
exports.FieldValueTypes = FieldValueTypes;
|
|
222
567
|
exports.OperatorTypes = OperatorTypes;
|
|
223
568
|
exports.RelationSemantics = RelationSemantics;
|
|
224
569
|
exports.Semantics = Semantics;
|
|
225
570
|
exports.StatusCodes = StatusCodes;
|
|
571
|
+
exports.fieldTypeCompatibilityMatrix = fieldTypeCompatibilityMatrix;
|
|
226
572
|
exports.isFieldSchema = isFieldSchema;
|
|
227
573
|
exports.isFieldValueType = isFieldValueType;
|
|
228
574
|
exports.isItem = isItem;
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
package/dist/src/types.d.ts
CHANGED
|
@@ -257,16 +257,18 @@ export declare const OperatorTypes: {
|
|
|
257
257
|
readonly IS_NOT_NULL: "!";
|
|
258
258
|
};
|
|
259
259
|
export type OperatorType = (typeof OperatorTypes)[keyof typeof OperatorTypes];
|
|
260
|
+
/**
|
|
261
|
+
* A FieldValues holds the values for various fields.
|
|
262
|
+
*/
|
|
263
|
+
export type FieldValues<T extends FieldSchema[] | undefined = undefined> = Record<T extends FieldSchema[] ? T[number]['name'] : string, unknown>;
|
|
260
264
|
/**
|
|
261
265
|
* An Item represents a syncable entity. It has fields of its own as well as relations to other items.
|
|
262
266
|
*/
|
|
263
|
-
export interface Item {
|
|
267
|
+
export interface Item<T extends RelationSchema | undefined = undefined> {
|
|
264
268
|
/**
|
|
265
269
|
* The fields and values of the item.
|
|
266
270
|
*/
|
|
267
|
-
fields:
|
|
268
|
-
[k: string]: unknown;
|
|
269
|
-
};
|
|
271
|
+
fields: T extends RelationSchema ? FieldValues<T['fields']> : FieldValues;
|
|
270
272
|
/**
|
|
271
273
|
* The relations of the item
|
|
272
274
|
*/
|
|
@@ -281,7 +283,7 @@ export interface Item {
|
|
|
281
283
|
* An ItemSummary is a constituent of a collection.
|
|
282
284
|
* It links to an item, and can contain additional item information upon request.
|
|
283
285
|
*/
|
|
284
|
-
export interface ItemSummary {
|
|
286
|
+
export interface ItemSummary<T extends RelationSchema | undefined = undefined> {
|
|
285
287
|
/**
|
|
286
288
|
* Link to this specific item.
|
|
287
289
|
*/
|
|
@@ -289,9 +291,7 @@ export interface ItemSummary {
|
|
|
289
291
|
/**
|
|
290
292
|
* Optional list of requested fields and their values.
|
|
291
293
|
*/
|
|
292
|
-
fields?:
|
|
293
|
-
[k: string]: unknown;
|
|
294
|
-
};
|
|
294
|
+
fields?: Partial<FieldValues<T extends RelationSchema ? T['fields'] : undefined>>;
|
|
295
295
|
/**
|
|
296
296
|
* The shape of the request parameters.
|
|
297
297
|
*/
|
|
@@ -299,9 +299,7 @@ export interface ItemSummary {
|
|
|
299
299
|
/**
|
|
300
300
|
* Optional list of relation paths.
|
|
301
301
|
*/
|
|
302
|
-
relations?:
|
|
303
|
-
[k: string]: string;
|
|
304
|
-
};
|
|
302
|
+
relations?: Partial<Record<T extends RelationSchema ? T['relations'] extends NonNullable<RelationSchema['relations']> ? T['relations'][number]['name'] : never : string, string>>;
|
|
305
303
|
/**
|
|
306
304
|
* The canonical path of the item. This is the path / id that uniquely identifies the item in a provider.
|
|
307
305
|
* Even if the item is moved in the graph, the canonical path should remain the same.
|