@ixo/topic-protocol 1.0.0-rc.7 → 1.0.0-rc.8

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.
@@ -1,6 +1,7 @@
1
1
  export * from "./types.js";
2
2
  export { createOperationIdV2, createRecordIdV2, createTopicIdV2 } from "./ids.js";
3
- export { SCHEMAS_V2, assertV2, validateV2, type SchemaNameV2, type ValidationIssueV2, type ValidationResultV2 } from "./validate.js";
3
+ export { SCHEMAS_V2, type SchemaNameV2 } from "./schemas.js";
4
+ export { assertV2, validateV2, type ValidationIssueV2, type ValidationResultV2 } from "./validate.js";
4
5
  export { baseKindOf, projectTopicV2, topicEtagV2 } from "./project.js";
5
6
  export { canonicalJsonV2, sha256V2 } from "./canonical.js";
6
7
  export { DEFAULT_MAX_CLOCK_SKEW_MS_V2, TOPIC_RECORD_KEY_V2, TOPIC_RECORD_MSGTYPE_V2, buildOperationContentV2, buildRecordContentV2, buildTopicRootContentV2, parseTopicEventV2, parseTopicRootV2, projectMatrixTopicV2, senderIsAuthor, senderIsCreator, type MatrixTopicProjectionInputV2, type TopicEventParseOptionsV2, type TopicRootAuthenticateV2, type MatrixTopicProjectionV2, type ParsedTopicEventV2, type ParsedTopicRootV2, type TopicAuthenticateV2, } from "./matrix.js";
@@ -1,6 +1,7 @@
1
1
  export * from "./types.js";
2
2
  export { createOperationIdV2, createRecordIdV2, createTopicIdV2 } from "./ids.js";
3
- export { SCHEMAS_V2, assertV2, validateV2 } from "./validate.js";
3
+ export { SCHEMAS_V2 } from "./schemas.js";
4
+ export { assertV2, validateV2 } from "./validate.js";
4
5
  export { baseKindOf, projectTopicV2, topicEtagV2 } from "./project.js";
5
6
  export { canonicalJsonV2, sha256V2 } from "./canonical.js";
6
7
  export { DEFAULT_MAX_CLOCK_SKEW_MS_V2, TOPIC_RECORD_KEY_V2, TOPIC_RECORD_MSGTYPE_V2, buildOperationContentV2, buildRecordContentV2, buildTopicRootContentV2, parseTopicEventV2, parseTopicRootV2, projectMatrixTopicV2, senderIsAuthor, senderIsCreator, } from "./matrix.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v2/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAsE,MAAM,eAAe,CAAC;AACrI,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,eAAe,GAQhB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAA2B,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/v2/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,EAAE,UAAU,EAAqB,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAmD,MAAM,eAAe,CAAC;AACtG,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,eAAe,GAQhB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAA2B,MAAM,aAAa,CAAC"}
@@ -0,0 +1,638 @@
1
+ export declare const SCHEMAS_V2: Readonly<{
2
+ capsule: {
3
+ $schema: string;
4
+ $id: string;
5
+ title: string;
6
+ description: string;
7
+ type: string;
8
+ required: string[];
9
+ properties: {
10
+ version: {
11
+ const: number;
12
+ };
13
+ topic: {
14
+ $ref: string;
15
+ };
16
+ messages: {
17
+ type: string;
18
+ maxItems: number;
19
+ items: {
20
+ type: string;
21
+ required: string[];
22
+ properties: {
23
+ eventId: {
24
+ $ref: string;
25
+ };
26
+ sender: {
27
+ $ref: string;
28
+ };
29
+ body: {
30
+ type: string;
31
+ };
32
+ at: {
33
+ $ref: string;
34
+ };
35
+ };
36
+ additionalProperties: boolean;
37
+ };
38
+ };
39
+ hint: {
40
+ type: string;
41
+ minLength: number;
42
+ };
43
+ };
44
+ additionalProperties: boolean;
45
+ };
46
+ operation: {
47
+ $schema: string;
48
+ $id: string;
49
+ title: string;
50
+ description: string;
51
+ type: string;
52
+ required: string[];
53
+ properties: {
54
+ version: {
55
+ const: number;
56
+ };
57
+ id: {
58
+ type: string;
59
+ pattern: string;
60
+ description: string;
61
+ };
62
+ topicId: {
63
+ $ref: string;
64
+ };
65
+ type: {
66
+ type: string;
67
+ enum: string[];
68
+ };
69
+ actor: {
70
+ $ref: string;
71
+ };
72
+ createdAt: {
73
+ $ref: string;
74
+ };
75
+ fields: {
76
+ type: string;
77
+ minProperties: number;
78
+ properties: {
79
+ title: {
80
+ $ref: string;
81
+ };
82
+ owner: {
83
+ oneOf: ({
84
+ $ref: string;
85
+ type?: never;
86
+ } | {
87
+ type: string;
88
+ $ref?: never;
89
+ })[];
90
+ };
91
+ due: {
92
+ oneOf: ({
93
+ $ref: string;
94
+ type?: never;
95
+ } | {
96
+ type: string;
97
+ $ref?: never;
98
+ })[];
99
+ };
100
+ intent: {
101
+ oneOf: ({
102
+ $ref: string;
103
+ type?: never;
104
+ } | {
105
+ type: string;
106
+ $ref?: never;
107
+ })[];
108
+ };
109
+ outcome: {
110
+ oneOf: ({
111
+ $ref: string;
112
+ type?: never;
113
+ } | {
114
+ type: string;
115
+ $ref?: never;
116
+ })[];
117
+ };
118
+ };
119
+ additionalProperties: boolean;
120
+ };
121
+ status: {
122
+ $ref: string;
123
+ };
124
+ reason: {
125
+ $ref: string;
126
+ };
127
+ on: {
128
+ type: string;
129
+ minLength: number;
130
+ };
131
+ ref: {
132
+ $ref: string;
133
+ };
134
+ file: {
135
+ $ref: string;
136
+ };
137
+ resource: {
138
+ type: string;
139
+ minLength: number;
140
+ };
141
+ fileId: {
142
+ type: string;
143
+ minLength: number;
144
+ };
145
+ relation: {
146
+ $ref: string;
147
+ };
148
+ targetTopicId: {
149
+ $ref: string;
150
+ };
151
+ flowUri: {
152
+ type: string;
153
+ minLength: number;
154
+ };
155
+ };
156
+ allOf: ({
157
+ if: {
158
+ properties: {
159
+ type: {
160
+ const: string;
161
+ enum?: never;
162
+ };
163
+ };
164
+ required: string[];
165
+ };
166
+ then: {
167
+ properties: {
168
+ fields: boolean;
169
+ status?: never;
170
+ reason?: never;
171
+ ref?: never;
172
+ file?: never;
173
+ resource?: never;
174
+ fileId?: never;
175
+ relation?: never;
176
+ targetTopicId?: never;
177
+ flowUri?: never;
178
+ };
179
+ required: string[];
180
+ };
181
+ } | {
182
+ if: {
183
+ properties: {
184
+ type: {
185
+ const: string;
186
+ enum?: never;
187
+ };
188
+ };
189
+ required: string[];
190
+ };
191
+ then: {
192
+ properties: {
193
+ status: boolean;
194
+ fields?: never;
195
+ reason?: never;
196
+ ref?: never;
197
+ file?: never;
198
+ resource?: never;
199
+ fileId?: never;
200
+ relation?: never;
201
+ targetTopicId?: never;
202
+ flowUri?: never;
203
+ };
204
+ required: string[];
205
+ };
206
+ } | {
207
+ if: {
208
+ properties: {
209
+ type: {
210
+ const: string;
211
+ enum?: never;
212
+ };
213
+ };
214
+ required: string[];
215
+ };
216
+ then: {
217
+ properties: {
218
+ reason: boolean;
219
+ fields?: never;
220
+ status?: never;
221
+ ref?: never;
222
+ file?: never;
223
+ resource?: never;
224
+ fileId?: never;
225
+ relation?: never;
226
+ targetTopicId?: never;
227
+ flowUri?: never;
228
+ };
229
+ required: string[];
230
+ };
231
+ } | {
232
+ if: {
233
+ properties: {
234
+ type: {
235
+ enum: string[];
236
+ const?: never;
237
+ };
238
+ };
239
+ required: string[];
240
+ };
241
+ then: {
242
+ properties: {
243
+ ref: boolean;
244
+ fields?: never;
245
+ status?: never;
246
+ reason?: never;
247
+ file?: never;
248
+ resource?: never;
249
+ fileId?: never;
250
+ relation?: never;
251
+ targetTopicId?: never;
252
+ flowUri?: never;
253
+ };
254
+ required: string[];
255
+ };
256
+ } | {
257
+ if: {
258
+ properties: {
259
+ type: {
260
+ const: string;
261
+ enum?: never;
262
+ };
263
+ };
264
+ required: string[];
265
+ };
266
+ then: {
267
+ properties: {
268
+ file: boolean;
269
+ fields?: never;
270
+ status?: never;
271
+ reason?: never;
272
+ ref?: never;
273
+ resource?: never;
274
+ fileId?: never;
275
+ relation?: never;
276
+ targetTopicId?: never;
277
+ flowUri?: never;
278
+ };
279
+ required: string[];
280
+ };
281
+ } | {
282
+ if: {
283
+ properties: {
284
+ type: {
285
+ const: string;
286
+ enum?: never;
287
+ };
288
+ };
289
+ required: string[];
290
+ };
291
+ then: {
292
+ properties: {
293
+ resource: boolean;
294
+ fileId: boolean;
295
+ fields?: never;
296
+ status?: never;
297
+ reason?: never;
298
+ ref?: never;
299
+ file?: never;
300
+ relation?: never;
301
+ targetTopicId?: never;
302
+ flowUri?: never;
303
+ };
304
+ required: string[];
305
+ };
306
+ } | {
307
+ if: {
308
+ properties: {
309
+ type: {
310
+ enum: string[];
311
+ const?: never;
312
+ };
313
+ };
314
+ required: string[];
315
+ };
316
+ then: {
317
+ properties: {
318
+ relation: boolean;
319
+ targetTopicId: boolean;
320
+ fields?: never;
321
+ status?: never;
322
+ reason?: never;
323
+ ref?: never;
324
+ file?: never;
325
+ resource?: never;
326
+ fileId?: never;
327
+ flowUri?: never;
328
+ };
329
+ required: string[];
330
+ };
331
+ } | {
332
+ if: {
333
+ properties: {
334
+ type: {
335
+ const: string;
336
+ enum?: never;
337
+ };
338
+ };
339
+ required: string[];
340
+ };
341
+ then: {
342
+ properties: {
343
+ flowUri: boolean;
344
+ fields?: never;
345
+ status?: never;
346
+ reason?: never;
347
+ ref?: never;
348
+ file?: never;
349
+ resource?: never;
350
+ fileId?: never;
351
+ relation?: never;
352
+ targetTopicId?: never;
353
+ };
354
+ required: string[];
355
+ };
356
+ })[];
357
+ additionalProperties: boolean;
358
+ };
359
+ projection: {
360
+ $schema: string;
361
+ $id: string;
362
+ title: string;
363
+ description: string;
364
+ type: string;
365
+ required: string[];
366
+ properties: {
367
+ version: {
368
+ const: number;
369
+ };
370
+ id: {
371
+ $ref: string;
372
+ };
373
+ anchor: {
374
+ $ref: string;
375
+ };
376
+ title: {
377
+ $ref: string;
378
+ };
379
+ kind: {
380
+ $ref: string;
381
+ };
382
+ baseKind: {
383
+ $ref: string;
384
+ };
385
+ status: {
386
+ $ref: string;
387
+ };
388
+ owner: {
389
+ $ref: string;
390
+ };
391
+ due: {
392
+ $ref: string;
393
+ };
394
+ intent: {
395
+ $ref: string;
396
+ };
397
+ outcome: {
398
+ $ref: string;
399
+ };
400
+ blocked: {
401
+ $ref: string;
402
+ };
403
+ createdBy: {
404
+ $ref: string;
405
+ };
406
+ createdAt: {
407
+ $ref: string;
408
+ };
409
+ updatedBy: {
410
+ $ref: string;
411
+ };
412
+ updatedAt: {
413
+ $ref: string;
414
+ };
415
+ links: {
416
+ type: string;
417
+ items: {
418
+ $ref: string;
419
+ };
420
+ };
421
+ files: {
422
+ type: string;
423
+ items: {
424
+ $ref: string;
425
+ };
426
+ };
427
+ relations: {
428
+ type: string;
429
+ items: {
430
+ type: string;
431
+ required: string[];
432
+ properties: {
433
+ relation: {
434
+ $ref: string;
435
+ };
436
+ topicId: {
437
+ $ref: string;
438
+ };
439
+ by: {
440
+ $ref: string;
441
+ };
442
+ at: {
443
+ $ref: string;
444
+ };
445
+ };
446
+ additionalProperties: boolean;
447
+ };
448
+ };
449
+ flow: {
450
+ type: string;
451
+ required: string[];
452
+ properties: {
453
+ flowUri: {
454
+ type: string;
455
+ minLength: number;
456
+ };
457
+ by: {
458
+ $ref: string;
459
+ };
460
+ at: {
461
+ $ref: string;
462
+ };
463
+ };
464
+ additionalProperties: boolean;
465
+ };
466
+ records: {
467
+ type: string;
468
+ required: string[];
469
+ properties: {
470
+ decisions: {
471
+ type: string;
472
+ items: {
473
+ $ref: string;
474
+ };
475
+ };
476
+ outcomes: {
477
+ type: string;
478
+ items: {
479
+ $ref: string;
480
+ };
481
+ };
482
+ artifacts: {
483
+ type: string;
484
+ items: {
485
+ $ref: string;
486
+ };
487
+ };
488
+ receipts: {
489
+ type: string;
490
+ items: {
491
+ $ref: string;
492
+ };
493
+ };
494
+ };
495
+ additionalProperties: boolean;
496
+ };
497
+ etag: {
498
+ type: string;
499
+ pattern: string;
500
+ description: string;
501
+ };
502
+ rejected: {
503
+ type: string;
504
+ items: {
505
+ type: string;
506
+ required: string[];
507
+ properties: {
508
+ id: {
509
+ type: string;
510
+ minLength: number;
511
+ };
512
+ reason: {
513
+ type: string;
514
+ enum: string[];
515
+ };
516
+ };
517
+ additionalProperties: boolean;
518
+ };
519
+ };
520
+ };
521
+ additionalProperties: boolean;
522
+ };
523
+ record: {
524
+ $schema: string;
525
+ $id: string;
526
+ title: string;
527
+ description: string;
528
+ type: string;
529
+ required: string[];
530
+ properties: {
531
+ version: {
532
+ const: number;
533
+ };
534
+ id: {
535
+ type: string;
536
+ pattern: string;
537
+ description: string;
538
+ };
539
+ topicId: {
540
+ $ref: string;
541
+ };
542
+ type: {
543
+ $ref: string;
544
+ };
545
+ text: {
546
+ $ref: string;
547
+ };
548
+ author: {
549
+ $ref: string;
550
+ };
551
+ createdAt: {
552
+ $ref: string;
553
+ };
554
+ refs: {
555
+ type: string;
556
+ items: {
557
+ $ref: string;
558
+ };
559
+ maxItems: number;
560
+ };
561
+ data: {
562
+ type: string;
563
+ };
564
+ supersedes: {
565
+ type: string;
566
+ pattern: string;
567
+ };
568
+ };
569
+ additionalProperties: boolean;
570
+ };
571
+ topic: {
572
+ $schema: string;
573
+ $id: string;
574
+ title: string;
575
+ description: string;
576
+ type: string;
577
+ required: string[];
578
+ properties: {
579
+ version: {
580
+ const: number;
581
+ };
582
+ id: {
583
+ $ref: string;
584
+ };
585
+ title: {
586
+ $ref: string;
587
+ };
588
+ kind: {
589
+ $ref: string;
590
+ };
591
+ baseKind: {
592
+ $ref: string;
593
+ };
594
+ createdBy: {
595
+ $ref: string;
596
+ };
597
+ createdAt: {
598
+ $ref: string;
599
+ };
600
+ owner: {
601
+ $ref: string;
602
+ };
603
+ due: {
604
+ $ref: string;
605
+ };
606
+ intent: {
607
+ $ref: string;
608
+ };
609
+ outcome: {
610
+ $ref: string;
611
+ };
612
+ };
613
+ if: {
614
+ properties: {
615
+ kind: {
616
+ enum: string[];
617
+ };
618
+ };
619
+ required: string[];
620
+ };
621
+ then: {
622
+ not: {
623
+ properties: {
624
+ baseKind: boolean;
625
+ };
626
+ required: string[];
627
+ };
628
+ };
629
+ else: {
630
+ properties: {
631
+ baseKind: boolean;
632
+ };
633
+ required: string[];
634
+ };
635
+ additionalProperties: boolean;
636
+ };
637
+ }>;
638
+ export type SchemaNameV2 = keyof typeof SCHEMAS_V2;
@@ -0,0 +1,13 @@
1
+ import capsule from "../../schemas/v2/capsule.schema.json" with { type: "json" };
2
+ import operation from "../../schemas/v2/operation.schema.json" with { type: "json" };
3
+ import projection from "../../schemas/v2/projection.schema.json" with { type: "json" };
4
+ import record from "../../schemas/v2/record.schema.json" with { type: "json" };
5
+ import topic from "../../schemas/v2/topic.schema.json" with { type: "json" };
6
+ export const SCHEMAS_V2 = Object.freeze({
7
+ capsule,
8
+ operation,
9
+ projection,
10
+ record,
11
+ topic,
12
+ });
13
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/v2/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,sCAAsC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACjF,OAAO,SAAS,MAAM,wCAAwC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACrF,OAAO,UAAU,MAAM,yCAAyC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACvF,OAAO,MAAM,MAAM,qCAAqC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC/E,OAAO,KAAK,MAAM,oCAAoC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAE7E,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;IACtC,OAAO;IACP,SAAS;IACT,UAAU;IACV,MAAM;IACN,KAAK;CACN,CAAC,CAAC"}