@uncorded/protocol 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.
@@ -0,0 +1,991 @@
1
+ import { z } from "zod";
2
+ /** Accepts both ISO strings and Date objects (MessagePack preserves Dates). */
3
+ export declare const coerceDate: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodDate, string, Date>]>;
4
+ export declare const coerceDateNullable: z.ZodNullable<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodDate, string, Date>]>>;
5
+ export declare const authorSchema: z.ZodObject<{
6
+ id: z.ZodString;
7
+ username: z.ZodNullable<z.ZodString>;
8
+ displayName: z.ZodNullable<z.ZodString>;
9
+ avatarUrl: z.ZodNullable<z.ZodString>;
10
+ isBot: z.ZodDefault<z.ZodBoolean>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ id: string;
13
+ username: string | null;
14
+ displayName: string | null;
15
+ avatarUrl: string | null;
16
+ isBot: boolean;
17
+ }, {
18
+ id: string;
19
+ username: string | null;
20
+ displayName: string | null;
21
+ avatarUrl: string | null;
22
+ isBot?: boolean | undefined;
23
+ }>;
24
+ export declare const channelSchema: z.ZodObject<{
25
+ id: z.ZodString;
26
+ serverId: z.ZodString;
27
+ name: z.ZodString;
28
+ type: z.ZodString;
29
+ position: z.ZodNumber;
30
+ topic: z.ZodNullable<z.ZodString>;
31
+ fileSharingEnabled: z.ZodBoolean;
32
+ }, "strip", z.ZodTypeAny, {
33
+ type: string;
34
+ id: string;
35
+ serverId: string;
36
+ name: string;
37
+ position: number;
38
+ topic: string | null;
39
+ fileSharingEnabled: boolean;
40
+ }, {
41
+ type: string;
42
+ id: string;
43
+ serverId: string;
44
+ name: string;
45
+ position: number;
46
+ topic: string | null;
47
+ fileSharingEnabled: boolean;
48
+ }>;
49
+ export declare const identifyRequestSchema: z.ZodEffects<z.ZodObject<{
50
+ ticket: z.ZodOptional<z.ZodString>;
51
+ token: z.ZodOptional<z.ZodString>;
52
+ }, "strip", z.ZodTypeAny, {
53
+ ticket?: string | undefined;
54
+ token?: string | undefined;
55
+ }, {
56
+ ticket?: string | undefined;
57
+ token?: string | undefined;
58
+ }>, {
59
+ ticket?: string | undefined;
60
+ token?: string | undefined;
61
+ }, {
62
+ ticket?: string | undefined;
63
+ token?: string | undefined;
64
+ }>;
65
+ export declare const typingStartRequestSchema: z.ZodObject<{
66
+ channelId: z.ZodString;
67
+ }, "strip", z.ZodTypeAny, {
68
+ channelId: string;
69
+ }, {
70
+ channelId: string;
71
+ }>;
72
+ export declare const webRtcSignalRequestSchema: z.ZodObject<{
73
+ targetUserId: z.ZodString;
74
+ channelId: z.ZodString;
75
+ data: z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>]>;
76
+ }, "strip", z.ZodTypeAny, {
77
+ channelId: string;
78
+ targetUserId: string;
79
+ data: string | Record<string, unknown>;
80
+ }, {
81
+ channelId: string;
82
+ targetUserId: string;
83
+ data: string | Record<string, unknown>;
84
+ }>;
85
+ export declare const fileShareRequestSchema: z.ZodObject<{
86
+ channelId: z.ZodString;
87
+ fileName: z.ZodString;
88
+ fileSize: z.ZodNumber;
89
+ contentType: z.ZodString;
90
+ magnetUri: z.ZodString;
91
+ infoHash: z.ZodString;
92
+ }, "strip", z.ZodTypeAny, {
93
+ channelId: string;
94
+ fileName: string;
95
+ fileSize: number;
96
+ contentType: string;
97
+ magnetUri: string;
98
+ infoHash: string;
99
+ }, {
100
+ channelId: string;
101
+ fileName: string;
102
+ fileSize: number;
103
+ contentType: string;
104
+ magnetUri: string;
105
+ infoHash: string;
106
+ }>;
107
+ export declare const fileAvailabilityRequestSchema: z.ZodObject<{
108
+ fileReceiptId: z.ZodString;
109
+ channelId: z.ZodString;
110
+ available: z.ZodBoolean;
111
+ }, "strip", z.ZodTypeAny, {
112
+ channelId: string;
113
+ fileReceiptId: string;
114
+ available: boolean;
115
+ }, {
116
+ channelId: string;
117
+ fileReceiptId: string;
118
+ available: boolean;
119
+ }>;
120
+ export declare const readyEventSchema: z.ZodObject<{
121
+ user: z.ZodObject<{
122
+ id: z.ZodString;
123
+ username: z.ZodNullable<z.ZodString>;
124
+ displayName: z.ZodNullable<z.ZodString>;
125
+ avatarUrl: z.ZodNullable<z.ZodString>;
126
+ status: z.ZodString;
127
+ subscriptionTier: z.ZodString;
128
+ isBot: z.ZodDefault<z.ZodBoolean>;
129
+ }, "strip", z.ZodTypeAny, {
130
+ status: string;
131
+ id: string;
132
+ username: string | null;
133
+ displayName: string | null;
134
+ avatarUrl: string | null;
135
+ isBot: boolean;
136
+ subscriptionTier: string;
137
+ }, {
138
+ status: string;
139
+ id: string;
140
+ username: string | null;
141
+ displayName: string | null;
142
+ avatarUrl: string | null;
143
+ subscriptionTier: string;
144
+ isBot?: boolean | undefined;
145
+ }>;
146
+ servers: z.ZodArray<z.ZodObject<{
147
+ id: z.ZodString;
148
+ name: z.ZodString;
149
+ iconUrl: z.ZodNullable<z.ZodString>;
150
+ ownerId: z.ZodString;
151
+ }, "strip", z.ZodTypeAny, {
152
+ id: string;
153
+ name: string;
154
+ iconUrl: string | null;
155
+ ownerId: string;
156
+ }, {
157
+ id: string;
158
+ name: string;
159
+ iconUrl: string | null;
160
+ ownerId: string;
161
+ }>, "many">;
162
+ dmChannels: z.ZodDefault<z.ZodArray<z.ZodObject<{
163
+ id: z.ZodString;
164
+ otherUser: z.ZodObject<{
165
+ id: z.ZodString;
166
+ username: z.ZodNullable<z.ZodString>;
167
+ displayName: z.ZodNullable<z.ZodString>;
168
+ avatarUrl: z.ZodNullable<z.ZodString>;
169
+ status: z.ZodString;
170
+ }, "strip", z.ZodTypeAny, {
171
+ status: string;
172
+ id: string;
173
+ username: string | null;
174
+ displayName: string | null;
175
+ avatarUrl: string | null;
176
+ }, {
177
+ status: string;
178
+ id: string;
179
+ username: string | null;
180
+ displayName: string | null;
181
+ avatarUrl: string | null;
182
+ }>;
183
+ }, "strip", z.ZodTypeAny, {
184
+ id: string;
185
+ otherUser: {
186
+ status: string;
187
+ id: string;
188
+ username: string | null;
189
+ displayName: string | null;
190
+ avatarUrl: string | null;
191
+ };
192
+ }, {
193
+ id: string;
194
+ otherUser: {
195
+ status: string;
196
+ id: string;
197
+ username: string | null;
198
+ displayName: string | null;
199
+ avatarUrl: string | null;
200
+ };
201
+ }>, "many">>;
202
+ hasMoreDmChannels: z.ZodBoolean;
203
+ friends: z.ZodDefault<z.ZodArray<z.ZodObject<{
204
+ userId: z.ZodString;
205
+ username: z.ZodNullable<z.ZodString>;
206
+ displayName: z.ZodNullable<z.ZodString>;
207
+ avatarUrl: z.ZodNullable<z.ZodString>;
208
+ status: z.ZodString;
209
+ friendshipStatus: z.ZodString;
210
+ incoming: z.ZodBoolean;
211
+ }, "strip", z.ZodTypeAny, {
212
+ status: string;
213
+ username: string | null;
214
+ displayName: string | null;
215
+ avatarUrl: string | null;
216
+ userId: string;
217
+ friendshipStatus: string;
218
+ incoming: boolean;
219
+ }, {
220
+ status: string;
221
+ username: string | null;
222
+ displayName: string | null;
223
+ avatarUrl: string | null;
224
+ userId: string;
225
+ friendshipStatus: string;
226
+ incoming: boolean;
227
+ }>, "many">>;
228
+ hasMoreFriends: z.ZodBoolean;
229
+ }, "strip", z.ZodTypeAny, {
230
+ user: {
231
+ status: string;
232
+ id: string;
233
+ username: string | null;
234
+ displayName: string | null;
235
+ avatarUrl: string | null;
236
+ isBot: boolean;
237
+ subscriptionTier: string;
238
+ };
239
+ servers: {
240
+ id: string;
241
+ name: string;
242
+ iconUrl: string | null;
243
+ ownerId: string;
244
+ }[];
245
+ dmChannels: {
246
+ id: string;
247
+ otherUser: {
248
+ status: string;
249
+ id: string;
250
+ username: string | null;
251
+ displayName: string | null;
252
+ avatarUrl: string | null;
253
+ };
254
+ }[];
255
+ hasMoreDmChannels: boolean;
256
+ friends: {
257
+ status: string;
258
+ username: string | null;
259
+ displayName: string | null;
260
+ avatarUrl: string | null;
261
+ userId: string;
262
+ friendshipStatus: string;
263
+ incoming: boolean;
264
+ }[];
265
+ hasMoreFriends: boolean;
266
+ }, {
267
+ user: {
268
+ status: string;
269
+ id: string;
270
+ username: string | null;
271
+ displayName: string | null;
272
+ avatarUrl: string | null;
273
+ subscriptionTier: string;
274
+ isBot?: boolean | undefined;
275
+ };
276
+ servers: {
277
+ id: string;
278
+ name: string;
279
+ iconUrl: string | null;
280
+ ownerId: string;
281
+ }[];
282
+ hasMoreDmChannels: boolean;
283
+ hasMoreFriends: boolean;
284
+ dmChannels?: {
285
+ id: string;
286
+ otherUser: {
287
+ status: string;
288
+ id: string;
289
+ username: string | null;
290
+ displayName: string | null;
291
+ avatarUrl: string | null;
292
+ };
293
+ }[] | undefined;
294
+ friends?: {
295
+ status: string;
296
+ username: string | null;
297
+ displayName: string | null;
298
+ avatarUrl: string | null;
299
+ userId: string;
300
+ friendshipStatus: string;
301
+ incoming: boolean;
302
+ }[] | undefined;
303
+ }>;
304
+ export declare const messageCreateEventSchema: z.ZodObject<{
305
+ id: z.ZodString;
306
+ channelId: z.ZodString;
307
+ content: z.ZodNullable<z.ZodString>;
308
+ editedAt: z.ZodNullable<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodDate, string, Date>]>>;
309
+ createdAt: z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodDate, string, Date>]>;
310
+ author: z.ZodObject<{
311
+ id: z.ZodString;
312
+ username: z.ZodNullable<z.ZodString>;
313
+ displayName: z.ZodNullable<z.ZodString>;
314
+ avatarUrl: z.ZodNullable<z.ZodString>;
315
+ isBot: z.ZodDefault<z.ZodBoolean>;
316
+ }, "strip", z.ZodTypeAny, {
317
+ id: string;
318
+ username: string | null;
319
+ displayName: string | null;
320
+ avatarUrl: string | null;
321
+ isBot: boolean;
322
+ }, {
323
+ id: string;
324
+ username: string | null;
325
+ displayName: string | null;
326
+ avatarUrl: string | null;
327
+ isBot?: boolean | undefined;
328
+ }>;
329
+ fileReceipt: z.ZodOptional<z.ZodObject<{
330
+ id: z.ZodString;
331
+ fileName: z.ZodString;
332
+ fileSize: z.ZodNumber;
333
+ contentType: z.ZodString;
334
+ magnetUri: z.ZodString;
335
+ infoHash: z.ZodString;
336
+ }, "strip", z.ZodTypeAny, {
337
+ id: string;
338
+ fileName: string;
339
+ fileSize: number;
340
+ contentType: string;
341
+ magnetUri: string;
342
+ infoHash: string;
343
+ }, {
344
+ id: string;
345
+ fileName: string;
346
+ fileSize: number;
347
+ contentType: string;
348
+ magnetUri: string;
349
+ infoHash: string;
350
+ }>>;
351
+ }, "strip", z.ZodTypeAny, {
352
+ id: string;
353
+ channelId: string;
354
+ content: string | null;
355
+ editedAt: string | null;
356
+ createdAt: string;
357
+ author: {
358
+ id: string;
359
+ username: string | null;
360
+ displayName: string | null;
361
+ avatarUrl: string | null;
362
+ isBot: boolean;
363
+ };
364
+ fileReceipt?: {
365
+ id: string;
366
+ fileName: string;
367
+ fileSize: number;
368
+ contentType: string;
369
+ magnetUri: string;
370
+ infoHash: string;
371
+ } | undefined;
372
+ }, {
373
+ id: string;
374
+ channelId: string;
375
+ content: string | null;
376
+ editedAt: string | Date | null;
377
+ createdAt: string | Date;
378
+ author: {
379
+ id: string;
380
+ username: string | null;
381
+ displayName: string | null;
382
+ avatarUrl: string | null;
383
+ isBot?: boolean | undefined;
384
+ };
385
+ fileReceipt?: {
386
+ id: string;
387
+ fileName: string;
388
+ fileSize: number;
389
+ contentType: string;
390
+ magnetUri: string;
391
+ infoHash: string;
392
+ } | undefined;
393
+ }>;
394
+ export declare const messageUpdateEventSchema: z.ZodObject<{
395
+ id: z.ZodString;
396
+ channelId: z.ZodString;
397
+ content: z.ZodString;
398
+ editedAt: z.ZodNullable<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodDate, string, Date>]>>;
399
+ }, "strip", z.ZodTypeAny, {
400
+ id: string;
401
+ channelId: string;
402
+ content: string;
403
+ editedAt: string | null;
404
+ }, {
405
+ id: string;
406
+ channelId: string;
407
+ content: string;
408
+ editedAt: string | Date | null;
409
+ }>;
410
+ export declare const messageDeleteEventSchema: z.ZodObject<{
411
+ id: z.ZodString;
412
+ channelId: z.ZodString;
413
+ }, "strip", z.ZodTypeAny, {
414
+ id: string;
415
+ channelId: string;
416
+ }, {
417
+ id: string;
418
+ channelId: string;
419
+ }>;
420
+ export declare const typingStartEventSchema: z.ZodObject<{
421
+ channelId: z.ZodString;
422
+ userId: z.ZodString;
423
+ username: z.ZodString;
424
+ }, "strip", z.ZodTypeAny, {
425
+ username: string;
426
+ channelId: string;
427
+ userId: string;
428
+ }, {
429
+ username: string;
430
+ channelId: string;
431
+ userId: string;
432
+ }>;
433
+ export declare const serverCreateEventSchema: z.ZodObject<{
434
+ server: z.ZodObject<{
435
+ id: z.ZodString;
436
+ name: z.ZodString;
437
+ iconUrl: z.ZodNullable<z.ZodString>;
438
+ ownerId: z.ZodString;
439
+ }, "strip", z.ZodTypeAny, {
440
+ id: string;
441
+ name: string;
442
+ iconUrl: string | null;
443
+ ownerId: string;
444
+ }, {
445
+ id: string;
446
+ name: string;
447
+ iconUrl: string | null;
448
+ ownerId: string;
449
+ }>;
450
+ channels: z.ZodArray<z.ZodObject<{
451
+ id: z.ZodString;
452
+ serverId: z.ZodString;
453
+ name: z.ZodString;
454
+ type: z.ZodString;
455
+ position: z.ZodNumber;
456
+ topic: z.ZodNullable<z.ZodString>;
457
+ fileSharingEnabled: z.ZodBoolean;
458
+ }, "strip", z.ZodTypeAny, {
459
+ type: string;
460
+ id: string;
461
+ serverId: string;
462
+ name: string;
463
+ position: number;
464
+ topic: string | null;
465
+ fileSharingEnabled: boolean;
466
+ }, {
467
+ type: string;
468
+ id: string;
469
+ serverId: string;
470
+ name: string;
471
+ position: number;
472
+ topic: string | null;
473
+ fileSharingEnabled: boolean;
474
+ }>, "many">;
475
+ }, "strip", z.ZodTypeAny, {
476
+ server: {
477
+ id: string;
478
+ name: string;
479
+ iconUrl: string | null;
480
+ ownerId: string;
481
+ };
482
+ channels: {
483
+ type: string;
484
+ id: string;
485
+ serverId: string;
486
+ name: string;
487
+ position: number;
488
+ topic: string | null;
489
+ fileSharingEnabled: boolean;
490
+ }[];
491
+ }, {
492
+ server: {
493
+ id: string;
494
+ name: string;
495
+ iconUrl: string | null;
496
+ ownerId: string;
497
+ };
498
+ channels: {
499
+ type: string;
500
+ id: string;
501
+ serverId: string;
502
+ name: string;
503
+ position: number;
504
+ topic: string | null;
505
+ fileSharingEnabled: boolean;
506
+ }[];
507
+ }>;
508
+ export declare const serverDeleteEventSchema: z.ZodObject<{
509
+ id: z.ZodString;
510
+ }, "strip", z.ZodTypeAny, {
511
+ id: string;
512
+ }, {
513
+ id: string;
514
+ }>;
515
+ export declare const serverUpdateEventSchema: z.ZodObject<{
516
+ id: z.ZodString;
517
+ name: z.ZodOptional<z.ZodString>;
518
+ iconUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
519
+ ownerId: z.ZodOptional<z.ZodString>;
520
+ }, "strip", z.ZodTypeAny, {
521
+ id: string;
522
+ name?: string | undefined;
523
+ iconUrl?: string | null | undefined;
524
+ ownerId?: string | undefined;
525
+ }, {
526
+ id: string;
527
+ name?: string | undefined;
528
+ iconUrl?: string | null | undefined;
529
+ ownerId?: string | undefined;
530
+ }>;
531
+ export declare const channelCreateEventSchema: z.ZodObject<{
532
+ id: z.ZodString;
533
+ serverId: z.ZodString;
534
+ name: z.ZodString;
535
+ type: z.ZodString;
536
+ position: z.ZodNumber;
537
+ topic: z.ZodNullable<z.ZodString>;
538
+ fileSharingEnabled: z.ZodBoolean;
539
+ }, "strip", z.ZodTypeAny, {
540
+ type: string;
541
+ id: string;
542
+ serverId: string;
543
+ name: string;
544
+ position: number;
545
+ topic: string | null;
546
+ fileSharingEnabled: boolean;
547
+ }, {
548
+ type: string;
549
+ id: string;
550
+ serverId: string;
551
+ name: string;
552
+ position: number;
553
+ topic: string | null;
554
+ fileSharingEnabled: boolean;
555
+ }>;
556
+ export declare const channelUpdateEventSchema: z.ZodObject<{
557
+ id: z.ZodString;
558
+ serverId: z.ZodString;
559
+ name: z.ZodOptional<z.ZodString>;
560
+ topic: z.ZodOptional<z.ZodNullable<z.ZodString>>;
561
+ position: z.ZodOptional<z.ZodNumber>;
562
+ fileSharingEnabled: z.ZodOptional<z.ZodBoolean>;
563
+ }, "strip", z.ZodTypeAny, {
564
+ id: string;
565
+ serverId: string;
566
+ name?: string | undefined;
567
+ position?: number | undefined;
568
+ topic?: string | null | undefined;
569
+ fileSharingEnabled?: boolean | undefined;
570
+ }, {
571
+ id: string;
572
+ serverId: string;
573
+ name?: string | undefined;
574
+ position?: number | undefined;
575
+ topic?: string | null | undefined;
576
+ fileSharingEnabled?: boolean | undefined;
577
+ }>;
578
+ export declare const channelDeleteEventSchema: z.ZodObject<{
579
+ id: z.ZodString;
580
+ serverId: z.ZodString;
581
+ }, "strip", z.ZodTypeAny, {
582
+ id: string;
583
+ serverId: string;
584
+ }, {
585
+ id: string;
586
+ serverId: string;
587
+ }>;
588
+ export declare const memberAddEventSchema: z.ZodObject<{
589
+ serverId: z.ZodString;
590
+ user: z.ZodObject<{
591
+ id: z.ZodString;
592
+ username: z.ZodNullable<z.ZodString>;
593
+ displayName: z.ZodNullable<z.ZodString>;
594
+ avatarUrl: z.ZodNullable<z.ZodString>;
595
+ isBot: z.ZodDefault<z.ZodBoolean>;
596
+ }, "strip", z.ZodTypeAny, {
597
+ id: string;
598
+ username: string | null;
599
+ displayName: string | null;
600
+ avatarUrl: string | null;
601
+ isBot: boolean;
602
+ }, {
603
+ id: string;
604
+ username: string | null;
605
+ displayName: string | null;
606
+ avatarUrl: string | null;
607
+ isBot?: boolean | undefined;
608
+ }>;
609
+ }, "strip", z.ZodTypeAny, {
610
+ serverId: string;
611
+ user: {
612
+ id: string;
613
+ username: string | null;
614
+ displayName: string | null;
615
+ avatarUrl: string | null;
616
+ isBot: boolean;
617
+ };
618
+ }, {
619
+ serverId: string;
620
+ user: {
621
+ id: string;
622
+ username: string | null;
623
+ displayName: string | null;
624
+ avatarUrl: string | null;
625
+ isBot?: boolean | undefined;
626
+ };
627
+ }>;
628
+ export declare const memberRemoveEventSchema: z.ZodObject<{
629
+ serverId: z.ZodString;
630
+ userId: z.ZodString;
631
+ }, "strip", z.ZodTypeAny, {
632
+ serverId: string;
633
+ userId: string;
634
+ }, {
635
+ serverId: string;
636
+ userId: string;
637
+ }>;
638
+ export declare const friendRequestEventSchema: z.ZodObject<{
639
+ userId: z.ZodString;
640
+ username: z.ZodNullable<z.ZodString>;
641
+ displayName: z.ZodNullable<z.ZodString>;
642
+ avatarUrl: z.ZodNullable<z.ZodString>;
643
+ status: z.ZodString;
644
+ }, "strip", z.ZodTypeAny, {
645
+ status: string;
646
+ username: string | null;
647
+ displayName: string | null;
648
+ avatarUrl: string | null;
649
+ userId: string;
650
+ }, {
651
+ status: string;
652
+ username: string | null;
653
+ displayName: string | null;
654
+ avatarUrl: string | null;
655
+ userId: string;
656
+ }>;
657
+ export declare const friendAcceptEventSchema: z.ZodObject<{
658
+ userId: z.ZodString;
659
+ username: z.ZodNullable<z.ZodString>;
660
+ displayName: z.ZodNullable<z.ZodString>;
661
+ avatarUrl: z.ZodNullable<z.ZodString>;
662
+ status: z.ZodString;
663
+ }, "strip", z.ZodTypeAny, {
664
+ status: string;
665
+ username: string | null;
666
+ displayName: string | null;
667
+ avatarUrl: string | null;
668
+ userId: string;
669
+ }, {
670
+ status: string;
671
+ username: string | null;
672
+ displayName: string | null;
673
+ avatarUrl: string | null;
674
+ userId: string;
675
+ }>;
676
+ export declare const friendRemoveEventSchema: z.ZodObject<{
677
+ userId: z.ZodString;
678
+ }, "strip", z.ZodTypeAny, {
679
+ userId: string;
680
+ }, {
681
+ userId: string;
682
+ }>;
683
+ export declare const dmChannelCreateEventSchema: z.ZodObject<{
684
+ id: z.ZodString;
685
+ otherUser: z.ZodObject<{
686
+ id: z.ZodString;
687
+ username: z.ZodNullable<z.ZodString>;
688
+ displayName: z.ZodNullable<z.ZodString>;
689
+ avatarUrl: z.ZodNullable<z.ZodString>;
690
+ status: z.ZodString;
691
+ }, "strip", z.ZodTypeAny, {
692
+ status: string;
693
+ id: string;
694
+ username: string | null;
695
+ displayName: string | null;
696
+ avatarUrl: string | null;
697
+ }, {
698
+ status: string;
699
+ id: string;
700
+ username: string | null;
701
+ displayName: string | null;
702
+ avatarUrl: string | null;
703
+ }>;
704
+ }, "strip", z.ZodTypeAny, {
705
+ id: string;
706
+ otherUser: {
707
+ status: string;
708
+ id: string;
709
+ username: string | null;
710
+ displayName: string | null;
711
+ avatarUrl: string | null;
712
+ };
713
+ }, {
714
+ id: string;
715
+ otherUser: {
716
+ status: string;
717
+ id: string;
718
+ username: string | null;
719
+ displayName: string | null;
720
+ avatarUrl: string | null;
721
+ };
722
+ }>;
723
+ export declare const fileShareEventSchema: z.ZodObject<{
724
+ senderId: z.ZodString;
725
+ fileReceiptId: z.ZodString;
726
+ channelId: z.ZodString;
727
+ fileName: z.ZodString;
728
+ fileSize: z.ZodNumber;
729
+ contentType: z.ZodString;
730
+ magnetUri: z.ZodString;
731
+ infoHash: z.ZodString;
732
+ }, "strip", z.ZodTypeAny, {
733
+ channelId: string;
734
+ fileName: string;
735
+ fileSize: number;
736
+ contentType: string;
737
+ magnetUri: string;
738
+ infoHash: string;
739
+ fileReceiptId: string;
740
+ senderId: string;
741
+ }, {
742
+ channelId: string;
743
+ fileName: string;
744
+ fileSize: number;
745
+ contentType: string;
746
+ magnetUri: string;
747
+ infoHash: string;
748
+ fileReceiptId: string;
749
+ senderId: string;
750
+ }>;
751
+ export declare const fileAvailabilityEventSchema: z.ZodObject<{
752
+ fileReceiptId: z.ZodString;
753
+ channelId: z.ZodString;
754
+ userId: z.ZodString;
755
+ available: z.ZodBoolean;
756
+ }, "strip", z.ZodTypeAny, {
757
+ channelId: string;
758
+ fileReceiptId: string;
759
+ available: boolean;
760
+ userId: string;
761
+ }, {
762
+ channelId: string;
763
+ fileReceiptId: string;
764
+ available: boolean;
765
+ userId: string;
766
+ }>;
767
+ export declare const signalingEventSchema: z.ZodObject<{
768
+ fromUserId: z.ZodString;
769
+ channelId: z.ZodString;
770
+ data: z.ZodUnknown;
771
+ }, "strip", z.ZodTypeAny, {
772
+ channelId: string;
773
+ fromUserId: string;
774
+ data?: unknown;
775
+ }, {
776
+ channelId: string;
777
+ fromUserId: string;
778
+ data?: unknown;
779
+ }>;
780
+ export declare const errorEventSchema: z.ZodObject<{
781
+ code: z.ZodString;
782
+ message: z.ZodString;
783
+ }, "strip", z.ZodTypeAny, {
784
+ code: string;
785
+ message: string;
786
+ }, {
787
+ code: string;
788
+ message: string;
789
+ }>;
790
+ /** Client → Server: user sets their own status (no "offline" — server controls that). */
791
+ export declare const presenceUpdateSchema: z.ZodObject<{
792
+ status: z.ZodEnum<["online", "idle"]>;
793
+ }, "strip", z.ZodTypeAny, {
794
+ status: "online" | "idle";
795
+ }, {
796
+ status: "online" | "idle";
797
+ }>;
798
+ /** Server → Client: broadcast when any user's presence changes. */
799
+ export declare const presenceUpdateEventSchema: z.ZodObject<{
800
+ userId: z.ZodString;
801
+ status: z.ZodEnum<["online", "idle", "offline"]>;
802
+ }, "strip", z.ZodTypeAny, {
803
+ status: "online" | "idle" | "offline";
804
+ userId: string;
805
+ }, {
806
+ status: "online" | "idle" | "offline";
807
+ userId: string;
808
+ }>;
809
+ /** Branded session ID — reused across all file-session event schemas. */
810
+ export declare const sessionIdSchema: z.ZodBranded<z.ZodString, "SessionId">;
811
+ export type SessionId = z.infer<typeof sessionIdSchema>;
812
+ /** Client → Server: create a share session */
813
+ export declare const fileSessionCreateRequestSchema: z.ZodObject<{
814
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
815
+ fileName: z.ZodString;
816
+ fileSize: z.ZodNumber;
817
+ contentType: z.ZodString;
818
+ magnetUri: z.ZodString;
819
+ infoHash: z.ZodString;
820
+ invitees: z.ZodArray<z.ZodString, "many">;
821
+ }, "strip", z.ZodTypeAny, {
822
+ fileName: string;
823
+ fileSize: number;
824
+ contentType: string;
825
+ magnetUri: string;
826
+ infoHash: string;
827
+ sessionId: string & z.BRAND<"SessionId">;
828
+ invitees: string[];
829
+ }, {
830
+ fileName: string;
831
+ fileSize: number;
832
+ contentType: string;
833
+ magnetUri: string;
834
+ infoHash: string;
835
+ sessionId: string;
836
+ invitees: string[];
837
+ }>;
838
+ /** Client → Server: join a session */
839
+ export declare const fileSessionJoinRequestSchema: z.ZodObject<{
840
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
841
+ }, "strip", z.ZodTypeAny, {
842
+ sessionId: string & z.BRAND<"SessionId">;
843
+ }, {
844
+ sessionId: string;
845
+ }>;
846
+ /** Client → Server: report download progress */
847
+ export declare const fileSessionProgressRequestSchema: z.ZodObject<{
848
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
849
+ progress: z.ZodNumber;
850
+ speed: z.ZodNumber;
851
+ }, "strip", z.ZodTypeAny, {
852
+ sessionId: string & z.BRAND<"SessionId">;
853
+ progress: number;
854
+ speed: number;
855
+ }, {
856
+ sessionId: string;
857
+ progress: number;
858
+ speed: number;
859
+ }>;
860
+ /** Client → Server: report download complete */
861
+ export declare const fileSessionCompleteRequestSchema: z.ZodObject<{
862
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
863
+ }, "strip", z.ZodTypeAny, {
864
+ sessionId: string & z.BRAND<"SessionId">;
865
+ }, {
866
+ sessionId: string;
867
+ }>;
868
+ /** Client → Server: close session */
869
+ export declare const fileSessionCloseRequestSchema: z.ZodObject<{
870
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
871
+ }, "strip", z.ZodTypeAny, {
872
+ sessionId: string & z.BRAND<"SessionId">;
873
+ }, {
874
+ sessionId: string;
875
+ }>;
876
+ /** Client → Server: leave session */
877
+ export declare const fileSessionLeaveRequestSchema: z.ZodObject<{
878
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
879
+ }, "strip", z.ZodTypeAny, {
880
+ sessionId: string & z.BRAND<"SessionId">;
881
+ }, {
882
+ sessionId: string;
883
+ }>;
884
+ /** Server → Client: session invite */
885
+ export declare const fileSessionInviteEventSchema: z.ZodObject<{
886
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
887
+ senderId: z.ZodString;
888
+ senderUsername: z.ZodString;
889
+ senderDisplayName: z.ZodNullable<z.ZodString>;
890
+ senderAvatarUrl: z.ZodNullable<z.ZodString>;
891
+ fileName: z.ZodString;
892
+ fileSize: z.ZodNumber;
893
+ contentType: z.ZodString;
894
+ }, "strip", z.ZodTypeAny, {
895
+ fileName: string;
896
+ fileSize: number;
897
+ contentType: string;
898
+ senderId: string;
899
+ sessionId: string & z.BRAND<"SessionId">;
900
+ senderUsername: string;
901
+ senderDisplayName: string | null;
902
+ senderAvatarUrl: string | null;
903
+ }, {
904
+ fileName: string;
905
+ fileSize: number;
906
+ contentType: string;
907
+ senderId: string;
908
+ sessionId: string;
909
+ senderUsername: string;
910
+ senderDisplayName: string | null;
911
+ senderAvatarUrl: string | null;
912
+ }>;
913
+ /** Server → Client: magnetUri for the joining recipient */
914
+ export declare const fileSessionJoinAcceptEventSchema: z.ZodObject<{
915
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
916
+ magnetUri: z.ZodString;
917
+ }, "strip", z.ZodTypeAny, {
918
+ magnetUri: string;
919
+ sessionId: string & z.BRAND<"SessionId">;
920
+ }, {
921
+ magnetUri: string;
922
+ sessionId: string;
923
+ }>;
924
+ /** Server → Client: a user joined the session */
925
+ export declare const fileSessionJoinedEventSchema: z.ZodObject<{
926
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
927
+ userId: z.ZodString;
928
+ username: z.ZodString;
929
+ displayName: z.ZodNullable<z.ZodString>;
930
+ avatarUrl: z.ZodNullable<z.ZodString>;
931
+ }, "strip", z.ZodTypeAny, {
932
+ username: string;
933
+ displayName: string | null;
934
+ avatarUrl: string | null;
935
+ userId: string;
936
+ sessionId: string & z.BRAND<"SessionId">;
937
+ }, {
938
+ username: string;
939
+ displayName: string | null;
940
+ avatarUrl: string | null;
941
+ userId: string;
942
+ sessionId: string;
943
+ }>;
944
+ /** Server → Client: progress update for a participant */
945
+ export declare const fileSessionProgressEventSchema: z.ZodObject<{
946
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
947
+ userId: z.ZodString;
948
+ progress: z.ZodNumber;
949
+ speed: z.ZodNumber;
950
+ }, "strip", z.ZodTypeAny, {
951
+ userId: string;
952
+ sessionId: string & z.BRAND<"SessionId">;
953
+ progress: number;
954
+ speed: number;
955
+ }, {
956
+ userId: string;
957
+ sessionId: string;
958
+ progress: number;
959
+ speed: number;
960
+ }>;
961
+ /** Server → Client: participant completed download */
962
+ export declare const fileSessionCompleteEventSchema: z.ZodObject<{
963
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
964
+ userId: z.ZodString;
965
+ }, "strip", z.ZodTypeAny, {
966
+ userId: string;
967
+ sessionId: string & z.BRAND<"SessionId">;
968
+ }, {
969
+ userId: string;
970
+ sessionId: string;
971
+ }>;
972
+ /** Server → Client: session closed */
973
+ export declare const fileSessionCloseEventSchema: z.ZodObject<{
974
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
975
+ }, "strip", z.ZodTypeAny, {
976
+ sessionId: string & z.BRAND<"SessionId">;
977
+ }, {
978
+ sessionId: string;
979
+ }>;
980
+ /** Server → Client: participant left the session */
981
+ export declare const fileSessionLeaveEventSchema: z.ZodObject<{
982
+ sessionId: z.ZodBranded<z.ZodString, "SessionId">;
983
+ userId: z.ZodString;
984
+ }, "strip", z.ZodTypeAny, {
985
+ userId: string;
986
+ sessionId: string & z.BRAND<"SessionId">;
987
+ }, {
988
+ userId: string;
989
+ sessionId: string;
990
+ }>;
991
+ //# sourceMappingURL=schemas.d.ts.map