@chronicle.app/schema 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +24 -0
- package/README.md +103 -0
- package/chronicle.ttl +198 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/schema.d.ts +192 -0
- package/dist/schema.js +581 -0
- package/docs/schema.html +3217 -0
- package/package.json +57 -0
package/dist/schema.js
ADDED
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
export const SCHEMA_VERSION = '0.1.0';
|
|
2
|
+
// Generated from chronicle.ttl. Do not edit; run npm run schema:generate.
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
function requireNodeIdentity(node, ctx) {
|
|
5
|
+
const hasKey = Array.isArray(node['@key']) && node['@key'].length > 0;
|
|
6
|
+
const hasId = typeof node['@id'] === 'string' && node['@id'].length > 0;
|
|
7
|
+
if (!hasKey && !hasId) {
|
|
8
|
+
ctx.addIssue({
|
|
9
|
+
code: z.ZodIssueCode.custom,
|
|
10
|
+
message: 'Node must carry @key or @id — every identity-bearing node needs an identity.',
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const BaseProperties = {
|
|
15
|
+
source: z.lazy(() => z.string()).optional(),
|
|
16
|
+
sourceId: z.lazy(() => z.string()).optional(),
|
|
17
|
+
'@key': z
|
|
18
|
+
.array(z.union([z.string(), z.object({ key: z.string(), value: z.string() })]))
|
|
19
|
+
.optional(),
|
|
20
|
+
'@id': z.string().optional(),
|
|
21
|
+
};
|
|
22
|
+
export const BaseSchema = z
|
|
23
|
+
.object({
|
|
24
|
+
'@type': z.literal('Base'),
|
|
25
|
+
...BaseProperties,
|
|
26
|
+
})
|
|
27
|
+
.superRefine(requireNodeIdentity);
|
|
28
|
+
const ActionProperties = {
|
|
29
|
+
...BaseProperties,
|
|
30
|
+
agent: z.lazy(() => AgentAndChildrenSchema).optional(),
|
|
31
|
+
instrument: z.lazy(() => EntityAndChildrenSchema).optional(),
|
|
32
|
+
object: z.lazy(() => EntityAndChildrenSchema).optional(),
|
|
33
|
+
timestamp: z.lazy(() => z.coerce.date()).optional(),
|
|
34
|
+
};
|
|
35
|
+
export const ActionSchema = z
|
|
36
|
+
.object({
|
|
37
|
+
'@type': z.literal('Action'),
|
|
38
|
+
...ActionProperties,
|
|
39
|
+
})
|
|
40
|
+
.superRefine(requireNodeIdentity);
|
|
41
|
+
const EntityProperties = {
|
|
42
|
+
...BaseProperties,
|
|
43
|
+
about: z.lazy(() => z.array(EntityAndChildrenSchema)).optional(),
|
|
44
|
+
body: z.lazy(() => z.string()).optional(),
|
|
45
|
+
description: z.lazy(() => z.string()).optional(),
|
|
46
|
+
handle: z.lazy(() => z.string()).optional(),
|
|
47
|
+
inRealm: z.lazy(() => RealmAndChildrenSchema).optional(),
|
|
48
|
+
isPartOf: z.lazy(() => z.array(EntityAndChildrenSchema)).optional(),
|
|
49
|
+
name: z.lazy(() => z.string()).optional(),
|
|
50
|
+
sameAs: z.lazy(() => z.array(z.union([EntityAndChildrenSchema, z.string()]))).optional(),
|
|
51
|
+
url: z.lazy(() => z.string().url()).optional(),
|
|
52
|
+
};
|
|
53
|
+
export const EntitySchema = z
|
|
54
|
+
.object({
|
|
55
|
+
'@type': z.literal('Entity'),
|
|
56
|
+
...EntityProperties,
|
|
57
|
+
})
|
|
58
|
+
.superRefine(requireNodeIdentity);
|
|
59
|
+
const AgentProperties = {
|
|
60
|
+
...EntityProperties,
|
|
61
|
+
memberOf: z.lazy(() => z.array(EntityAndChildrenSchema)).optional(),
|
|
62
|
+
};
|
|
63
|
+
export const AgentSchema = z
|
|
64
|
+
.object({
|
|
65
|
+
'@type': z.literal('Agent'),
|
|
66
|
+
...AgentProperties,
|
|
67
|
+
})
|
|
68
|
+
.superRefine(requireNodeIdentity);
|
|
69
|
+
const MediaObjectProperties = {
|
|
70
|
+
...EntityProperties,
|
|
71
|
+
contentPath: z.lazy(() => z.string()).optional(),
|
|
72
|
+
mimeType: z.lazy(() => z.string()).optional(),
|
|
73
|
+
};
|
|
74
|
+
export const MediaObjectSchema = z
|
|
75
|
+
.object({
|
|
76
|
+
'@type': z.literal('MediaObject'),
|
|
77
|
+
...MediaObjectProperties,
|
|
78
|
+
})
|
|
79
|
+
.superRefine(requireNodeIdentity);
|
|
80
|
+
const AudioObjectProperties = {
|
|
81
|
+
...MediaObjectProperties,
|
|
82
|
+
};
|
|
83
|
+
export const AudioObjectSchema = z
|
|
84
|
+
.object({
|
|
85
|
+
'@type': z.literal('AudioObject'),
|
|
86
|
+
...AudioObjectProperties,
|
|
87
|
+
})
|
|
88
|
+
.superRefine(requireNodeIdentity);
|
|
89
|
+
const CancelActionProperties = {
|
|
90
|
+
...ActionProperties,
|
|
91
|
+
};
|
|
92
|
+
export const CancelActionSchema = z
|
|
93
|
+
.object({
|
|
94
|
+
'@type': z.literal('CancelAction'),
|
|
95
|
+
...CancelActionProperties,
|
|
96
|
+
})
|
|
97
|
+
.superRefine(requireNodeIdentity);
|
|
98
|
+
const CollectionProperties = {
|
|
99
|
+
...EntityProperties,
|
|
100
|
+
};
|
|
101
|
+
export const CollectionSchema = z
|
|
102
|
+
.object({
|
|
103
|
+
'@type': z.literal('Collection'),
|
|
104
|
+
...CollectionProperties,
|
|
105
|
+
})
|
|
106
|
+
.superRefine(requireNodeIdentity);
|
|
107
|
+
const CommandProperties = {
|
|
108
|
+
...EntityProperties,
|
|
109
|
+
};
|
|
110
|
+
export const CommandSchema = z
|
|
111
|
+
.object({
|
|
112
|
+
'@type': z.literal('Command'),
|
|
113
|
+
...CommandProperties,
|
|
114
|
+
})
|
|
115
|
+
.superRefine(requireNodeIdentity);
|
|
116
|
+
const CompleteActionProperties = {
|
|
117
|
+
...ActionProperties,
|
|
118
|
+
};
|
|
119
|
+
export const CompleteActionSchema = z
|
|
120
|
+
.object({
|
|
121
|
+
'@type': z.literal('CompleteAction'),
|
|
122
|
+
...CompleteActionProperties,
|
|
123
|
+
})
|
|
124
|
+
.superRefine(requireNodeIdentity);
|
|
125
|
+
const DeleteActionProperties = {
|
|
126
|
+
...ActionProperties,
|
|
127
|
+
};
|
|
128
|
+
export const DeleteActionSchema = z
|
|
129
|
+
.object({
|
|
130
|
+
'@type': z.literal('DeleteAction'),
|
|
131
|
+
...DeleteActionProperties,
|
|
132
|
+
})
|
|
133
|
+
.superRefine(requireNodeIdentity);
|
|
134
|
+
const DocumentObjectProperties = {
|
|
135
|
+
...MediaObjectProperties,
|
|
136
|
+
};
|
|
137
|
+
export const DocumentObjectSchema = z
|
|
138
|
+
.object({
|
|
139
|
+
'@type': z.literal('DocumentObject'),
|
|
140
|
+
...DocumentObjectProperties,
|
|
141
|
+
})
|
|
142
|
+
.superRefine(requireNodeIdentity);
|
|
143
|
+
const ExecuteActionProperties = {
|
|
144
|
+
...ActionProperties,
|
|
145
|
+
};
|
|
146
|
+
export const ExecuteActionSchema = z
|
|
147
|
+
.object({
|
|
148
|
+
'@type': z.literal('ExecuteAction'),
|
|
149
|
+
...ExecuteActionProperties,
|
|
150
|
+
})
|
|
151
|
+
.superRefine(requireNodeIdentity);
|
|
152
|
+
const ImageObjectProperties = {
|
|
153
|
+
...MediaObjectProperties,
|
|
154
|
+
};
|
|
155
|
+
export const ImageObjectSchema = z
|
|
156
|
+
.object({
|
|
157
|
+
'@type': z.literal('ImageObject'),
|
|
158
|
+
...ImageObjectProperties,
|
|
159
|
+
})
|
|
160
|
+
.superRefine(requireNodeIdentity);
|
|
161
|
+
const MessageProperties = {
|
|
162
|
+
...EntityProperties,
|
|
163
|
+
author: z.lazy(() => z.array(AgentAndChildrenSchema)).optional(),
|
|
164
|
+
contains: z.lazy(() => z.array(MediaObjectAndChildrenSchema)).optional(),
|
|
165
|
+
recipient: z.lazy(() => z.array(AgentAndChildrenSchema)).optional(),
|
|
166
|
+
};
|
|
167
|
+
export const MessageSchema = z
|
|
168
|
+
.object({
|
|
169
|
+
'@type': z.literal('Message'),
|
|
170
|
+
...MessageProperties,
|
|
171
|
+
})
|
|
172
|
+
.superRefine(requireNodeIdentity);
|
|
173
|
+
const MessageActionProperties = {
|
|
174
|
+
...ActionProperties,
|
|
175
|
+
};
|
|
176
|
+
export const MessageActionSchema = z
|
|
177
|
+
.object({
|
|
178
|
+
'@type': z.literal('MessageAction'),
|
|
179
|
+
...MessageActionProperties,
|
|
180
|
+
})
|
|
181
|
+
.superRefine(requireNodeIdentity);
|
|
182
|
+
const PersonProperties = {
|
|
183
|
+
...AgentProperties,
|
|
184
|
+
};
|
|
185
|
+
export const PersonSchema = z
|
|
186
|
+
.object({
|
|
187
|
+
'@type': z.literal('Person'),
|
|
188
|
+
...PersonProperties,
|
|
189
|
+
})
|
|
190
|
+
.superRefine(requireNodeIdentity);
|
|
191
|
+
const PlanActionProperties = {
|
|
192
|
+
...ActionProperties,
|
|
193
|
+
};
|
|
194
|
+
export const PlanActionSchema = z
|
|
195
|
+
.object({
|
|
196
|
+
'@type': z.literal('PlanAction'),
|
|
197
|
+
...PlanActionProperties,
|
|
198
|
+
})
|
|
199
|
+
.superRefine(requireNodeIdentity);
|
|
200
|
+
const ProjectProperties = {
|
|
201
|
+
...CollectionProperties,
|
|
202
|
+
};
|
|
203
|
+
export const ProjectSchema = z
|
|
204
|
+
.object({
|
|
205
|
+
'@type': z.literal('Project'),
|
|
206
|
+
...ProjectProperties,
|
|
207
|
+
})
|
|
208
|
+
.superRefine(requireNodeIdentity);
|
|
209
|
+
const RealmProperties = {
|
|
210
|
+
...EntityProperties,
|
|
211
|
+
};
|
|
212
|
+
export const RealmSchema = z
|
|
213
|
+
.object({
|
|
214
|
+
'@type': z.literal('Realm'),
|
|
215
|
+
...RealmProperties,
|
|
216
|
+
})
|
|
217
|
+
.superRefine(requireNodeIdentity);
|
|
218
|
+
const SoftwareAgentProperties = {
|
|
219
|
+
...AgentProperties,
|
|
220
|
+
};
|
|
221
|
+
export const SoftwareAgentSchema = z
|
|
222
|
+
.object({
|
|
223
|
+
'@type': z.literal('SoftwareAgent'),
|
|
224
|
+
...SoftwareAgentProperties,
|
|
225
|
+
})
|
|
226
|
+
.superRefine(requireNodeIdentity);
|
|
227
|
+
const SoftwareApplicationProperties = {
|
|
228
|
+
...EntityProperties,
|
|
229
|
+
};
|
|
230
|
+
export const SoftwareApplicationSchema = z
|
|
231
|
+
.object({
|
|
232
|
+
'@type': z.literal('SoftwareApplication'),
|
|
233
|
+
...SoftwareApplicationProperties,
|
|
234
|
+
})
|
|
235
|
+
.superRefine(requireNodeIdentity);
|
|
236
|
+
const TagProperties = {
|
|
237
|
+
...EntityProperties,
|
|
238
|
+
};
|
|
239
|
+
export const TagSchema = z
|
|
240
|
+
.object({
|
|
241
|
+
'@type': z.literal('Tag'),
|
|
242
|
+
...TagProperties,
|
|
243
|
+
})
|
|
244
|
+
.superRefine(requireNodeIdentity);
|
|
245
|
+
const TaskProperties = {
|
|
246
|
+
...EntityProperties,
|
|
247
|
+
};
|
|
248
|
+
export const TaskSchema = z
|
|
249
|
+
.object({
|
|
250
|
+
'@type': z.literal('Task'),
|
|
251
|
+
...TaskProperties,
|
|
252
|
+
})
|
|
253
|
+
.superRefine(requireNodeIdentity);
|
|
254
|
+
const ThreadProperties = {
|
|
255
|
+
...CollectionProperties,
|
|
256
|
+
};
|
|
257
|
+
export const ThreadSchema = z
|
|
258
|
+
.object({
|
|
259
|
+
'@type': z.literal('Thread'),
|
|
260
|
+
...ThreadProperties,
|
|
261
|
+
})
|
|
262
|
+
.superRefine(requireNodeIdentity);
|
|
263
|
+
const UpdateActionProperties = {
|
|
264
|
+
...ActionProperties,
|
|
265
|
+
};
|
|
266
|
+
export const UpdateActionSchema = z
|
|
267
|
+
.object({
|
|
268
|
+
'@type': z.literal('UpdateAction'),
|
|
269
|
+
...UpdateActionProperties,
|
|
270
|
+
})
|
|
271
|
+
.superRefine(requireNodeIdentity);
|
|
272
|
+
const VideoObjectProperties = {
|
|
273
|
+
...MediaObjectProperties,
|
|
274
|
+
};
|
|
275
|
+
export const VideoObjectSchema = z
|
|
276
|
+
.object({
|
|
277
|
+
'@type': z.literal('VideoObject'),
|
|
278
|
+
...VideoObjectProperties,
|
|
279
|
+
})
|
|
280
|
+
.superRefine(requireNodeIdentity);
|
|
281
|
+
export const VideoObjectAndChildrenSchema = VideoObjectSchema;
|
|
282
|
+
export const UpdateActionAndChildrenSchema = UpdateActionSchema;
|
|
283
|
+
export const ThreadAndChildrenSchema = ThreadSchema;
|
|
284
|
+
export const TaskAndChildrenSchema = TaskSchema;
|
|
285
|
+
export const TagAndChildrenSchema = TagSchema;
|
|
286
|
+
export const SoftwareApplicationAndChildrenSchema = SoftwareApplicationSchema;
|
|
287
|
+
export const SoftwareAgentAndChildrenSchema = SoftwareAgentSchema;
|
|
288
|
+
export const RealmAndChildrenSchema = RealmSchema;
|
|
289
|
+
export const ProjectAndChildrenSchema = ProjectSchema;
|
|
290
|
+
export const PlanActionAndChildrenSchema = PlanActionSchema;
|
|
291
|
+
export const PersonAndChildrenSchema = PersonSchema;
|
|
292
|
+
export const MessageActionAndChildrenSchema = MessageActionSchema;
|
|
293
|
+
export const MessageAndChildrenSchema = MessageSchema;
|
|
294
|
+
export const ImageObjectAndChildrenSchema = ImageObjectSchema;
|
|
295
|
+
export const ExecuteActionAndChildrenSchema = ExecuteActionSchema;
|
|
296
|
+
export const DocumentObjectAndChildrenSchema = DocumentObjectSchema;
|
|
297
|
+
export const DeleteActionAndChildrenSchema = DeleteActionSchema;
|
|
298
|
+
export const CompleteActionAndChildrenSchema = CompleteActionSchema;
|
|
299
|
+
export const CommandAndChildrenSchema = CommandSchema;
|
|
300
|
+
export const CollectionAndChildrenSchema = z
|
|
301
|
+
.discriminatedUnion('@type', [
|
|
302
|
+
z.object({
|
|
303
|
+
'@type': z.literal('Collection'),
|
|
304
|
+
...CollectionProperties,
|
|
305
|
+
}),
|
|
306
|
+
z.object({
|
|
307
|
+
'@type': z.literal('Thread'),
|
|
308
|
+
...ThreadProperties,
|
|
309
|
+
}),
|
|
310
|
+
z.object({
|
|
311
|
+
'@type': z.literal('Project'),
|
|
312
|
+
...ProjectProperties,
|
|
313
|
+
}),
|
|
314
|
+
])
|
|
315
|
+
.superRefine(requireNodeIdentity);
|
|
316
|
+
export const CancelActionAndChildrenSchema = CancelActionSchema;
|
|
317
|
+
export const AudioObjectAndChildrenSchema = AudioObjectSchema;
|
|
318
|
+
export const MediaObjectAndChildrenSchema = z
|
|
319
|
+
.discriminatedUnion('@type', [
|
|
320
|
+
z.object({
|
|
321
|
+
'@type': z.literal('MediaObject'),
|
|
322
|
+
...MediaObjectProperties,
|
|
323
|
+
}),
|
|
324
|
+
z.object({
|
|
325
|
+
'@type': z.literal('VideoObject'),
|
|
326
|
+
...VideoObjectProperties,
|
|
327
|
+
}),
|
|
328
|
+
z.object({
|
|
329
|
+
'@type': z.literal('ImageObject'),
|
|
330
|
+
...ImageObjectProperties,
|
|
331
|
+
}),
|
|
332
|
+
z.object({
|
|
333
|
+
'@type': z.literal('DocumentObject'),
|
|
334
|
+
...DocumentObjectProperties,
|
|
335
|
+
}),
|
|
336
|
+
z.object({
|
|
337
|
+
'@type': z.literal('AudioObject'),
|
|
338
|
+
...AudioObjectProperties,
|
|
339
|
+
}),
|
|
340
|
+
])
|
|
341
|
+
.superRefine(requireNodeIdentity);
|
|
342
|
+
export const AgentAndChildrenSchema = z
|
|
343
|
+
.discriminatedUnion('@type', [
|
|
344
|
+
z.object({
|
|
345
|
+
'@type': z.literal('Agent'),
|
|
346
|
+
...AgentProperties,
|
|
347
|
+
}),
|
|
348
|
+
z.object({
|
|
349
|
+
'@type': z.literal('SoftwareAgent'),
|
|
350
|
+
...SoftwareAgentProperties,
|
|
351
|
+
}),
|
|
352
|
+
z.object({
|
|
353
|
+
'@type': z.literal('Person'),
|
|
354
|
+
...PersonProperties,
|
|
355
|
+
}),
|
|
356
|
+
])
|
|
357
|
+
.superRefine(requireNodeIdentity);
|
|
358
|
+
export const EntityAndChildrenSchema = z
|
|
359
|
+
.discriminatedUnion('@type', [
|
|
360
|
+
z.object({
|
|
361
|
+
'@type': z.literal('Entity'),
|
|
362
|
+
...EntityProperties,
|
|
363
|
+
}),
|
|
364
|
+
z.object({
|
|
365
|
+
'@type': z.literal('Task'),
|
|
366
|
+
...TaskProperties,
|
|
367
|
+
}),
|
|
368
|
+
z.object({
|
|
369
|
+
'@type': z.literal('Tag'),
|
|
370
|
+
...TagProperties,
|
|
371
|
+
}),
|
|
372
|
+
z.object({
|
|
373
|
+
'@type': z.literal('SoftwareApplication'),
|
|
374
|
+
...SoftwareApplicationProperties,
|
|
375
|
+
}),
|
|
376
|
+
z.object({
|
|
377
|
+
'@type': z.literal('Realm'),
|
|
378
|
+
...RealmProperties,
|
|
379
|
+
}),
|
|
380
|
+
z.object({
|
|
381
|
+
'@type': z.literal('Message'),
|
|
382
|
+
...MessageProperties,
|
|
383
|
+
}),
|
|
384
|
+
z.object({
|
|
385
|
+
'@type': z.literal('Command'),
|
|
386
|
+
...CommandProperties,
|
|
387
|
+
}),
|
|
388
|
+
z.object({
|
|
389
|
+
'@type': z.literal('Collection'),
|
|
390
|
+
...CollectionProperties,
|
|
391
|
+
}),
|
|
392
|
+
z.object({
|
|
393
|
+
'@type': z.literal('Thread'),
|
|
394
|
+
...ThreadProperties,
|
|
395
|
+
}),
|
|
396
|
+
z.object({
|
|
397
|
+
'@type': z.literal('Project'),
|
|
398
|
+
...ProjectProperties,
|
|
399
|
+
}),
|
|
400
|
+
z.object({
|
|
401
|
+
'@type': z.literal('MediaObject'),
|
|
402
|
+
...MediaObjectProperties,
|
|
403
|
+
}),
|
|
404
|
+
z.object({
|
|
405
|
+
'@type': z.literal('VideoObject'),
|
|
406
|
+
...VideoObjectProperties,
|
|
407
|
+
}),
|
|
408
|
+
z.object({
|
|
409
|
+
'@type': z.literal('ImageObject'),
|
|
410
|
+
...ImageObjectProperties,
|
|
411
|
+
}),
|
|
412
|
+
z.object({
|
|
413
|
+
'@type': z.literal('DocumentObject'),
|
|
414
|
+
...DocumentObjectProperties,
|
|
415
|
+
}),
|
|
416
|
+
z.object({
|
|
417
|
+
'@type': z.literal('AudioObject'),
|
|
418
|
+
...AudioObjectProperties,
|
|
419
|
+
}),
|
|
420
|
+
z.object({
|
|
421
|
+
'@type': z.literal('Agent'),
|
|
422
|
+
...AgentProperties,
|
|
423
|
+
}),
|
|
424
|
+
z.object({
|
|
425
|
+
'@type': z.literal('SoftwareAgent'),
|
|
426
|
+
...SoftwareAgentProperties,
|
|
427
|
+
}),
|
|
428
|
+
z.object({
|
|
429
|
+
'@type': z.literal('Person'),
|
|
430
|
+
...PersonProperties,
|
|
431
|
+
}),
|
|
432
|
+
])
|
|
433
|
+
.superRefine(requireNodeIdentity);
|
|
434
|
+
export const ActionAndChildrenSchema = z
|
|
435
|
+
.discriminatedUnion('@type', [
|
|
436
|
+
z.object({
|
|
437
|
+
'@type': z.literal('Action'),
|
|
438
|
+
...ActionProperties,
|
|
439
|
+
}),
|
|
440
|
+
z.object({
|
|
441
|
+
'@type': z.literal('UpdateAction'),
|
|
442
|
+
...UpdateActionProperties,
|
|
443
|
+
}),
|
|
444
|
+
z.object({
|
|
445
|
+
'@type': z.literal('PlanAction'),
|
|
446
|
+
...PlanActionProperties,
|
|
447
|
+
}),
|
|
448
|
+
z.object({
|
|
449
|
+
'@type': z.literal('MessageAction'),
|
|
450
|
+
...MessageActionProperties,
|
|
451
|
+
}),
|
|
452
|
+
z.object({
|
|
453
|
+
'@type': z.literal('ExecuteAction'),
|
|
454
|
+
...ExecuteActionProperties,
|
|
455
|
+
}),
|
|
456
|
+
z.object({
|
|
457
|
+
'@type': z.literal('DeleteAction'),
|
|
458
|
+
...DeleteActionProperties,
|
|
459
|
+
}),
|
|
460
|
+
z.object({
|
|
461
|
+
'@type': z.literal('CompleteAction'),
|
|
462
|
+
...CompleteActionProperties,
|
|
463
|
+
}),
|
|
464
|
+
z.object({
|
|
465
|
+
'@type': z.literal('CancelAction'),
|
|
466
|
+
...CancelActionProperties,
|
|
467
|
+
}),
|
|
468
|
+
])
|
|
469
|
+
.superRefine(requireNodeIdentity);
|
|
470
|
+
export const BaseAndChildrenSchema = z
|
|
471
|
+
.discriminatedUnion('@type', [
|
|
472
|
+
z.object({
|
|
473
|
+
'@type': z.literal('Base'),
|
|
474
|
+
...BaseProperties,
|
|
475
|
+
}),
|
|
476
|
+
z.object({
|
|
477
|
+
'@type': z.literal('Entity'),
|
|
478
|
+
...EntityProperties,
|
|
479
|
+
}),
|
|
480
|
+
z.object({
|
|
481
|
+
'@type': z.literal('Task'),
|
|
482
|
+
...TaskProperties,
|
|
483
|
+
}),
|
|
484
|
+
z.object({
|
|
485
|
+
'@type': z.literal('Tag'),
|
|
486
|
+
...TagProperties,
|
|
487
|
+
}),
|
|
488
|
+
z.object({
|
|
489
|
+
'@type': z.literal('SoftwareApplication'),
|
|
490
|
+
...SoftwareApplicationProperties,
|
|
491
|
+
}),
|
|
492
|
+
z.object({
|
|
493
|
+
'@type': z.literal('Realm'),
|
|
494
|
+
...RealmProperties,
|
|
495
|
+
}),
|
|
496
|
+
z.object({
|
|
497
|
+
'@type': z.literal('Message'),
|
|
498
|
+
...MessageProperties,
|
|
499
|
+
}),
|
|
500
|
+
z.object({
|
|
501
|
+
'@type': z.literal('Command'),
|
|
502
|
+
...CommandProperties,
|
|
503
|
+
}),
|
|
504
|
+
z.object({
|
|
505
|
+
'@type': z.literal('Collection'),
|
|
506
|
+
...CollectionProperties,
|
|
507
|
+
}),
|
|
508
|
+
z.object({
|
|
509
|
+
'@type': z.literal('Thread'),
|
|
510
|
+
...ThreadProperties,
|
|
511
|
+
}),
|
|
512
|
+
z.object({
|
|
513
|
+
'@type': z.literal('Project'),
|
|
514
|
+
...ProjectProperties,
|
|
515
|
+
}),
|
|
516
|
+
z.object({
|
|
517
|
+
'@type': z.literal('MediaObject'),
|
|
518
|
+
...MediaObjectProperties,
|
|
519
|
+
}),
|
|
520
|
+
z.object({
|
|
521
|
+
'@type': z.literal('VideoObject'),
|
|
522
|
+
...VideoObjectProperties,
|
|
523
|
+
}),
|
|
524
|
+
z.object({
|
|
525
|
+
'@type': z.literal('ImageObject'),
|
|
526
|
+
...ImageObjectProperties,
|
|
527
|
+
}),
|
|
528
|
+
z.object({
|
|
529
|
+
'@type': z.literal('DocumentObject'),
|
|
530
|
+
...DocumentObjectProperties,
|
|
531
|
+
}),
|
|
532
|
+
z.object({
|
|
533
|
+
'@type': z.literal('AudioObject'),
|
|
534
|
+
...AudioObjectProperties,
|
|
535
|
+
}),
|
|
536
|
+
z.object({
|
|
537
|
+
'@type': z.literal('Agent'),
|
|
538
|
+
...AgentProperties,
|
|
539
|
+
}),
|
|
540
|
+
z.object({
|
|
541
|
+
'@type': z.literal('SoftwareAgent'),
|
|
542
|
+
...SoftwareAgentProperties,
|
|
543
|
+
}),
|
|
544
|
+
z.object({
|
|
545
|
+
'@type': z.literal('Person'),
|
|
546
|
+
...PersonProperties,
|
|
547
|
+
}),
|
|
548
|
+
z.object({
|
|
549
|
+
'@type': z.literal('Action'),
|
|
550
|
+
...ActionProperties,
|
|
551
|
+
}),
|
|
552
|
+
z.object({
|
|
553
|
+
'@type': z.literal('UpdateAction'),
|
|
554
|
+
...UpdateActionProperties,
|
|
555
|
+
}),
|
|
556
|
+
z.object({
|
|
557
|
+
'@type': z.literal('PlanAction'),
|
|
558
|
+
...PlanActionProperties,
|
|
559
|
+
}),
|
|
560
|
+
z.object({
|
|
561
|
+
'@type': z.literal('MessageAction'),
|
|
562
|
+
...MessageActionProperties,
|
|
563
|
+
}),
|
|
564
|
+
z.object({
|
|
565
|
+
'@type': z.literal('ExecuteAction'),
|
|
566
|
+
...ExecuteActionProperties,
|
|
567
|
+
}),
|
|
568
|
+
z.object({
|
|
569
|
+
'@type': z.literal('DeleteAction'),
|
|
570
|
+
...DeleteActionProperties,
|
|
571
|
+
}),
|
|
572
|
+
z.object({
|
|
573
|
+
'@type': z.literal('CompleteAction'),
|
|
574
|
+
...CompleteActionProperties,
|
|
575
|
+
}),
|
|
576
|
+
z.object({
|
|
577
|
+
'@type': z.literal('CancelAction'),
|
|
578
|
+
...CancelActionProperties,
|
|
579
|
+
}),
|
|
580
|
+
])
|
|
581
|
+
.superRefine(requireNodeIdentity);
|