@epic-web/workshop-presence 6.47.9 → 6.47.11

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,43 @@
1
1
  import { z } from 'zod';
2
2
  export declare const partykitRoom = "epic-web-presence";
3
3
  export declare const partykitBaseUrl = "https://epic-web-presence.kentcdodds.partykit.dev/parties/main/epic-web-presence";
4
+ export declare const LocationSchema: z.ZodObject<{
5
+ workshopTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
+ origin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
+ productHost: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
+ exercise: z.ZodOptional<z.ZodNullable<z.ZodObject<{
9
+ type: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"problem">, z.ZodLiteral<"solution">]>>>;
10
+ exerciseNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
11
+ stepNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ type?: "problem" | "solution" | null | undefined;
14
+ exerciseNumber?: number | null | undefined;
15
+ stepNumber?: number | null | undefined;
16
+ }, {
17
+ type?: "problem" | "solution" | null | undefined;
18
+ exerciseNumber?: number | null | undefined;
19
+ stepNumber?: number | null | undefined;
20
+ }>>>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ workshopTitle?: string | null | undefined;
23
+ origin?: string | null | undefined;
24
+ productHost?: string | null | undefined;
25
+ exercise?: {
26
+ type?: "problem" | "solution" | null | undefined;
27
+ exerciseNumber?: number | null | undefined;
28
+ stepNumber?: number | null | undefined;
29
+ } | null | undefined;
30
+ }, {
31
+ workshopTitle?: string | null | undefined;
32
+ origin?: string | null | undefined;
33
+ productHost?: string | null | undefined;
34
+ exercise?: {
35
+ type?: "problem" | "solution" | null | undefined;
36
+ exerciseNumber?: number | null | undefined;
37
+ stepNumber?: number | null | undefined;
38
+ } | null | undefined;
39
+ }>;
40
+ export type Location = z.infer<typeof LocationSchema>;
4
41
  export declare const UserSchema: z.ZodObject<{
5
42
  id: z.ZodString;
6
43
  hasAccess: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
@@ -8,9 +45,12 @@ export declare const UserSchema: z.ZodObject<{
8
45
  imageUrlSmall: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
46
  imageUrlLarge: z.ZodOptional<z.ZodNullable<z.ZodString>>;
10
47
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
48
+ optOut: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
49
+ loggedInProductHosts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
11
50
  location: z.ZodOptional<z.ZodNullable<z.ZodObject<{
12
51
  workshopTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
52
  origin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
+ productHost: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
54
  exercise: z.ZodOptional<z.ZodNullable<z.ZodObject<{
15
55
  type: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"problem">, z.ZodLiteral<"solution">]>>>;
16
56
  exerciseNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -27,6 +67,7 @@ export declare const UserSchema: z.ZodObject<{
27
67
  }, "strip", z.ZodTypeAny, {
28
68
  workshopTitle?: string | null | undefined;
29
69
  origin?: string | null | undefined;
70
+ productHost?: string | null | undefined;
30
71
  exercise?: {
31
72
  type?: "problem" | "solution" | null | undefined;
32
73
  exerciseNumber?: number | null | undefined;
@@ -35,12 +76,49 @@ export declare const UserSchema: z.ZodObject<{
35
76
  }, {
36
77
  workshopTitle?: string | null | undefined;
37
78
  origin?: string | null | undefined;
79
+ productHost?: string | null | undefined;
38
80
  exercise?: {
39
81
  type?: "problem" | "solution" | null | undefined;
40
82
  exerciseNumber?: number | null | undefined;
41
83
  stepNumber?: number | null | undefined;
42
84
  } | null | undefined;
43
85
  }>>>;
86
+ locations: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
87
+ workshopTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
+ origin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
89
+ productHost: z.ZodOptional<z.ZodNullable<z.ZodString>>;
90
+ exercise: z.ZodOptional<z.ZodNullable<z.ZodObject<{
91
+ type: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"problem">, z.ZodLiteral<"solution">]>>>;
92
+ exerciseNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
93
+ stepNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
94
+ }, "strip", z.ZodTypeAny, {
95
+ type?: "problem" | "solution" | null | undefined;
96
+ exerciseNumber?: number | null | undefined;
97
+ stepNumber?: number | null | undefined;
98
+ }, {
99
+ type?: "problem" | "solution" | null | undefined;
100
+ exerciseNumber?: number | null | undefined;
101
+ stepNumber?: number | null | undefined;
102
+ }>>>;
103
+ }, "strip", z.ZodTypeAny, {
104
+ workshopTitle?: string | null | undefined;
105
+ origin?: string | null | undefined;
106
+ productHost?: string | null | undefined;
107
+ exercise?: {
108
+ type?: "problem" | "solution" | null | undefined;
109
+ exerciseNumber?: number | null | undefined;
110
+ stepNumber?: number | null | undefined;
111
+ } | null | undefined;
112
+ }, {
113
+ workshopTitle?: string | null | undefined;
114
+ origin?: string | null | undefined;
115
+ productHost?: string | null | undefined;
116
+ exercise?: {
117
+ type?: "problem" | "solution" | null | undefined;
118
+ exerciseNumber?: number | null | undefined;
119
+ stepNumber?: number | null | undefined;
120
+ } | null | undefined;
121
+ }>, "many">>>;
44
122
  }, "strip", z.ZodTypeAny, {
45
123
  id: string;
46
124
  hasAccess?: boolean | null | undefined;
@@ -48,15 +126,28 @@ export declare const UserSchema: z.ZodObject<{
48
126
  imageUrlSmall?: string | null | undefined;
49
127
  imageUrlLarge?: string | null | undefined;
50
128
  name?: string | null | undefined;
129
+ optOut?: boolean | null | undefined;
130
+ loggedInProductHosts?: string[] | null | undefined;
51
131
  location?: {
52
132
  workshopTitle?: string | null | undefined;
53
133
  origin?: string | null | undefined;
134
+ productHost?: string | null | undefined;
54
135
  exercise?: {
55
136
  type?: "problem" | "solution" | null | undefined;
56
137
  exerciseNumber?: number | null | undefined;
57
138
  stepNumber?: number | null | undefined;
58
139
  } | null | undefined;
59
140
  } | null | undefined;
141
+ locations?: {
142
+ workshopTitle?: string | null | undefined;
143
+ origin?: string | null | undefined;
144
+ productHost?: string | null | undefined;
145
+ exercise?: {
146
+ type?: "problem" | "solution" | null | undefined;
147
+ exerciseNumber?: number | null | undefined;
148
+ stepNumber?: number | null | undefined;
149
+ } | null | undefined;
150
+ }[] | null | undefined;
60
151
  }, {
61
152
  id: string;
62
153
  hasAccess?: boolean | null | undefined;
@@ -64,15 +155,28 @@ export declare const UserSchema: z.ZodObject<{
64
155
  imageUrlSmall?: string | null | undefined;
65
156
  imageUrlLarge?: string | null | undefined;
66
157
  name?: string | null | undefined;
158
+ optOut?: boolean | null | undefined;
159
+ loggedInProductHosts?: string[] | null | undefined;
67
160
  location?: {
68
161
  workshopTitle?: string | null | undefined;
69
162
  origin?: string | null | undefined;
163
+ productHost?: string | null | undefined;
70
164
  exercise?: {
71
165
  type?: "problem" | "solution" | null | undefined;
72
166
  exerciseNumber?: number | null | undefined;
73
167
  stepNumber?: number | null | undefined;
74
168
  } | null | undefined;
75
169
  } | null | undefined;
170
+ locations?: {
171
+ workshopTitle?: string | null | undefined;
172
+ origin?: string | null | undefined;
173
+ productHost?: string | null | undefined;
174
+ exercise?: {
175
+ type?: "problem" | "solution" | null | undefined;
176
+ exerciseNumber?: number | null | undefined;
177
+ stepNumber?: number | null | undefined;
178
+ } | null | undefined;
179
+ }[] | null | undefined;
76
180
  }>;
77
181
  export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
78
182
  type: z.ZodLiteral<"remove-user">;
@@ -102,9 +206,12 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
102
206
  imageUrlSmall: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
207
  imageUrlLarge: z.ZodOptional<z.ZodNullable<z.ZodString>>;
104
208
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
209
+ optOut: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
210
+ loggedInProductHosts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
105
211
  location: z.ZodOptional<z.ZodNullable<z.ZodObject<{
106
212
  workshopTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
107
213
  origin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
214
+ productHost: z.ZodOptional<z.ZodNullable<z.ZodString>>;
108
215
  exercise: z.ZodOptional<z.ZodNullable<z.ZodObject<{
109
216
  type: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"problem">, z.ZodLiteral<"solution">]>>>;
110
217
  exerciseNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -121,6 +228,7 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
121
228
  }, "strip", z.ZodTypeAny, {
122
229
  workshopTitle?: string | null | undefined;
123
230
  origin?: string | null | undefined;
231
+ productHost?: string | null | undefined;
124
232
  exercise?: {
125
233
  type?: "problem" | "solution" | null | undefined;
126
234
  exerciseNumber?: number | null | undefined;
@@ -129,12 +237,49 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
129
237
  }, {
130
238
  workshopTitle?: string | null | undefined;
131
239
  origin?: string | null | undefined;
240
+ productHost?: string | null | undefined;
132
241
  exercise?: {
133
242
  type?: "problem" | "solution" | null | undefined;
134
243
  exerciseNumber?: number | null | undefined;
135
244
  stepNumber?: number | null | undefined;
136
245
  } | null | undefined;
137
246
  }>>>;
247
+ locations: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
248
+ workshopTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
249
+ origin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
250
+ productHost: z.ZodOptional<z.ZodNullable<z.ZodString>>;
251
+ exercise: z.ZodOptional<z.ZodNullable<z.ZodObject<{
252
+ type: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"problem">, z.ZodLiteral<"solution">]>>>;
253
+ exerciseNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
254
+ stepNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
255
+ }, "strip", z.ZodTypeAny, {
256
+ type?: "problem" | "solution" | null | undefined;
257
+ exerciseNumber?: number | null | undefined;
258
+ stepNumber?: number | null | undefined;
259
+ }, {
260
+ type?: "problem" | "solution" | null | undefined;
261
+ exerciseNumber?: number | null | undefined;
262
+ stepNumber?: number | null | undefined;
263
+ }>>>;
264
+ }, "strip", z.ZodTypeAny, {
265
+ workshopTitle?: string | null | undefined;
266
+ origin?: string | null | undefined;
267
+ productHost?: string | null | undefined;
268
+ exercise?: {
269
+ type?: "problem" | "solution" | null | undefined;
270
+ exerciseNumber?: number | null | undefined;
271
+ stepNumber?: number | null | undefined;
272
+ } | null | undefined;
273
+ }, {
274
+ workshopTitle?: string | null | undefined;
275
+ origin?: string | null | undefined;
276
+ productHost?: string | null | undefined;
277
+ exercise?: {
278
+ type?: "problem" | "solution" | null | undefined;
279
+ exerciseNumber?: number | null | undefined;
280
+ stepNumber?: number | null | undefined;
281
+ } | null | undefined;
282
+ }>, "many">>>;
138
283
  }, "strip", z.ZodTypeAny, {
139
284
  id: string;
140
285
  hasAccess?: boolean | null | undefined;
@@ -142,15 +287,28 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
142
287
  imageUrlSmall?: string | null | undefined;
143
288
  imageUrlLarge?: string | null | undefined;
144
289
  name?: string | null | undefined;
290
+ optOut?: boolean | null | undefined;
291
+ loggedInProductHosts?: string[] | null | undefined;
145
292
  location?: {
146
293
  workshopTitle?: string | null | undefined;
147
294
  origin?: string | null | undefined;
295
+ productHost?: string | null | undefined;
148
296
  exercise?: {
149
297
  type?: "problem" | "solution" | null | undefined;
150
298
  exerciseNumber?: number | null | undefined;
151
299
  stepNumber?: number | null | undefined;
152
300
  } | null | undefined;
153
301
  } | null | undefined;
302
+ locations?: {
303
+ workshopTitle?: string | null | undefined;
304
+ origin?: string | null | undefined;
305
+ productHost?: string | null | undefined;
306
+ exercise?: {
307
+ type?: "problem" | "solution" | null | undefined;
308
+ exerciseNumber?: number | null | undefined;
309
+ stepNumber?: number | null | undefined;
310
+ } | null | undefined;
311
+ }[] | null | undefined;
154
312
  }, {
155
313
  id: string;
156
314
  hasAccess?: boolean | null | undefined;
@@ -158,15 +316,28 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
158
316
  imageUrlSmall?: string | null | undefined;
159
317
  imageUrlLarge?: string | null | undefined;
160
318
  name?: string | null | undefined;
319
+ optOut?: boolean | null | undefined;
320
+ loggedInProductHosts?: string[] | null | undefined;
161
321
  location?: {
162
322
  workshopTitle?: string | null | undefined;
163
323
  origin?: string | null | undefined;
324
+ productHost?: string | null | undefined;
164
325
  exercise?: {
165
326
  type?: "problem" | "solution" | null | undefined;
166
327
  exerciseNumber?: number | null | undefined;
167
328
  stepNumber?: number | null | undefined;
168
329
  } | null | undefined;
169
330
  } | null | undefined;
331
+ locations?: {
332
+ workshopTitle?: string | null | undefined;
333
+ origin?: string | null | undefined;
334
+ productHost?: string | null | undefined;
335
+ exercise?: {
336
+ type?: "problem" | "solution" | null | undefined;
337
+ exerciseNumber?: number | null | undefined;
338
+ stepNumber?: number | null | undefined;
339
+ } | null | undefined;
340
+ }[] | null | undefined;
170
341
  }>;
171
342
  }, "strip", z.ZodTypeAny, {
172
343
  type: "add-user";
@@ -177,15 +348,28 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
177
348
  imageUrlSmall?: string | null | undefined;
178
349
  imageUrlLarge?: string | null | undefined;
179
350
  name?: string | null | undefined;
351
+ optOut?: boolean | null | undefined;
352
+ loggedInProductHosts?: string[] | null | undefined;
180
353
  location?: {
181
354
  workshopTitle?: string | null | undefined;
182
355
  origin?: string | null | undefined;
356
+ productHost?: string | null | undefined;
183
357
  exercise?: {
184
358
  type?: "problem" | "solution" | null | undefined;
185
359
  exerciseNumber?: number | null | undefined;
186
360
  stepNumber?: number | null | undefined;
187
361
  } | null | undefined;
188
362
  } | null | undefined;
363
+ locations?: {
364
+ workshopTitle?: string | null | undefined;
365
+ origin?: string | null | undefined;
366
+ productHost?: string | null | undefined;
367
+ exercise?: {
368
+ type?: "problem" | "solution" | null | undefined;
369
+ exerciseNumber?: number | null | undefined;
370
+ stepNumber?: number | null | undefined;
371
+ } | null | undefined;
372
+ }[] | null | undefined;
189
373
  };
190
374
  }, {
191
375
  type: "add-user";
@@ -196,15 +380,28 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
196
380
  imageUrlSmall?: string | null | undefined;
197
381
  imageUrlLarge?: string | null | undefined;
198
382
  name?: string | null | undefined;
383
+ optOut?: boolean | null | undefined;
384
+ loggedInProductHosts?: string[] | null | undefined;
199
385
  location?: {
200
386
  workshopTitle?: string | null | undefined;
201
387
  origin?: string | null | undefined;
388
+ productHost?: string | null | undefined;
202
389
  exercise?: {
203
390
  type?: "problem" | "solution" | null | undefined;
204
391
  exerciseNumber?: number | null | undefined;
205
392
  stepNumber?: number | null | undefined;
206
393
  } | null | undefined;
207
394
  } | null | undefined;
395
+ locations?: {
396
+ workshopTitle?: string | null | undefined;
397
+ origin?: string | null | undefined;
398
+ productHost?: string | null | undefined;
399
+ exercise?: {
400
+ type?: "problem" | "solution" | null | undefined;
401
+ exerciseNumber?: number | null | undefined;
402
+ stepNumber?: number | null | undefined;
403
+ } | null | undefined;
404
+ }[] | null | undefined;
208
405
  };
209
406
  }>]>, z.ZodObject<{
210
407
  type: z.ZodLiteral<"presence">;
@@ -216,9 +413,12 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
216
413
  imageUrlSmall: z.ZodOptional<z.ZodNullable<z.ZodString>>;
217
414
  imageUrlLarge: z.ZodOptional<z.ZodNullable<z.ZodString>>;
218
415
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
416
+ optOut: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
417
+ loggedInProductHosts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
219
418
  location: z.ZodOptional<z.ZodNullable<z.ZodObject<{
220
419
  workshopTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
221
420
  origin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
421
+ productHost: z.ZodOptional<z.ZodNullable<z.ZodString>>;
222
422
  exercise: z.ZodOptional<z.ZodNullable<z.ZodObject<{
223
423
  type: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"problem">, z.ZodLiteral<"solution">]>>>;
224
424
  exerciseNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -235,6 +435,7 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
235
435
  }, "strip", z.ZodTypeAny, {
236
436
  workshopTitle?: string | null | undefined;
237
437
  origin?: string | null | undefined;
438
+ productHost?: string | null | undefined;
238
439
  exercise?: {
239
440
  type?: "problem" | "solution" | null | undefined;
240
441
  exerciseNumber?: number | null | undefined;
@@ -243,12 +444,49 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
243
444
  }, {
244
445
  workshopTitle?: string | null | undefined;
245
446
  origin?: string | null | undefined;
447
+ productHost?: string | null | undefined;
246
448
  exercise?: {
247
449
  type?: "problem" | "solution" | null | undefined;
248
450
  exerciseNumber?: number | null | undefined;
249
451
  stepNumber?: number | null | undefined;
250
452
  } | null | undefined;
251
453
  }>>>;
454
+ locations: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
455
+ workshopTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
456
+ origin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
457
+ productHost: z.ZodOptional<z.ZodNullable<z.ZodString>>;
458
+ exercise: z.ZodOptional<z.ZodNullable<z.ZodObject<{
459
+ type: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"problem">, z.ZodLiteral<"solution">]>>>;
460
+ exerciseNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
461
+ stepNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
462
+ }, "strip", z.ZodTypeAny, {
463
+ type?: "problem" | "solution" | null | undefined;
464
+ exerciseNumber?: number | null | undefined;
465
+ stepNumber?: number | null | undefined;
466
+ }, {
467
+ type?: "problem" | "solution" | null | undefined;
468
+ exerciseNumber?: number | null | undefined;
469
+ stepNumber?: number | null | undefined;
470
+ }>>>;
471
+ }, "strip", z.ZodTypeAny, {
472
+ workshopTitle?: string | null | undefined;
473
+ origin?: string | null | undefined;
474
+ productHost?: string | null | undefined;
475
+ exercise?: {
476
+ type?: "problem" | "solution" | null | undefined;
477
+ exerciseNumber?: number | null | undefined;
478
+ stepNumber?: number | null | undefined;
479
+ } | null | undefined;
480
+ }, {
481
+ workshopTitle?: string | null | undefined;
482
+ origin?: string | null | undefined;
483
+ productHost?: string | null | undefined;
484
+ exercise?: {
485
+ type?: "problem" | "solution" | null | undefined;
486
+ exerciseNumber?: number | null | undefined;
487
+ stepNumber?: number | null | undefined;
488
+ } | null | undefined;
489
+ }>, "many">>>;
252
490
  }, "strip", z.ZodTypeAny, {
253
491
  id: string;
254
492
  hasAccess?: boolean | null | undefined;
@@ -256,15 +494,28 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
256
494
  imageUrlSmall?: string | null | undefined;
257
495
  imageUrlLarge?: string | null | undefined;
258
496
  name?: string | null | undefined;
497
+ optOut?: boolean | null | undefined;
498
+ loggedInProductHosts?: string[] | null | undefined;
259
499
  location?: {
260
500
  workshopTitle?: string | null | undefined;
261
501
  origin?: string | null | undefined;
502
+ productHost?: string | null | undefined;
262
503
  exercise?: {
263
504
  type?: "problem" | "solution" | null | undefined;
264
505
  exerciseNumber?: number | null | undefined;
265
506
  stepNumber?: number | null | undefined;
266
507
  } | null | undefined;
267
508
  } | null | undefined;
509
+ locations?: {
510
+ workshopTitle?: string | null | undefined;
511
+ origin?: string | null | undefined;
512
+ productHost?: string | null | undefined;
513
+ exercise?: {
514
+ type?: "problem" | "solution" | null | undefined;
515
+ exerciseNumber?: number | null | undefined;
516
+ stepNumber?: number | null | undefined;
517
+ } | null | undefined;
518
+ }[] | null | undefined;
268
519
  }, {
269
520
  id: string;
270
521
  hasAccess?: boolean | null | undefined;
@@ -272,15 +523,28 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
272
523
  imageUrlSmall?: string | null | undefined;
273
524
  imageUrlLarge?: string | null | undefined;
274
525
  name?: string | null | undefined;
526
+ optOut?: boolean | null | undefined;
527
+ loggedInProductHosts?: string[] | null | undefined;
275
528
  location?: {
276
529
  workshopTitle?: string | null | undefined;
277
530
  origin?: string | null | undefined;
531
+ productHost?: string | null | undefined;
278
532
  exercise?: {
279
533
  type?: "problem" | "solution" | null | undefined;
280
534
  exerciseNumber?: number | null | undefined;
281
535
  stepNumber?: number | null | undefined;
282
536
  } | null | undefined;
283
537
  } | null | undefined;
538
+ locations?: {
539
+ workshopTitle?: string | null | undefined;
540
+ origin?: string | null | undefined;
541
+ productHost?: string | null | undefined;
542
+ exercise?: {
543
+ type?: "problem" | "solution" | null | undefined;
544
+ exerciseNumber?: number | null | undefined;
545
+ stepNumber?: number | null | undefined;
546
+ } | null | undefined;
547
+ }[] | null | undefined;
284
548
  }>, "many">;
285
549
  }, "strip", z.ZodTypeAny, {
286
550
  users: {
@@ -290,15 +554,28 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
290
554
  imageUrlSmall?: string | null | undefined;
291
555
  imageUrlLarge?: string | null | undefined;
292
556
  name?: string | null | undefined;
557
+ optOut?: boolean | null | undefined;
558
+ loggedInProductHosts?: string[] | null | undefined;
293
559
  location?: {
294
560
  workshopTitle?: string | null | undefined;
295
561
  origin?: string | null | undefined;
562
+ productHost?: string | null | undefined;
296
563
  exercise?: {
297
564
  type?: "problem" | "solution" | null | undefined;
298
565
  exerciseNumber?: number | null | undefined;
299
566
  stepNumber?: number | null | undefined;
300
567
  } | null | undefined;
301
568
  } | null | undefined;
569
+ locations?: {
570
+ workshopTitle?: string | null | undefined;
571
+ origin?: string | null | undefined;
572
+ productHost?: string | null | undefined;
573
+ exercise?: {
574
+ type?: "problem" | "solution" | null | undefined;
575
+ exerciseNumber?: number | null | undefined;
576
+ stepNumber?: number | null | undefined;
577
+ } | null | undefined;
578
+ }[] | null | undefined;
302
579
  }[];
303
580
  }, {
304
581
  users: {
@@ -308,15 +585,28 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
308
585
  imageUrlSmall?: string | null | undefined;
309
586
  imageUrlLarge?: string | null | undefined;
310
587
  name?: string | null | undefined;
588
+ optOut?: boolean | null | undefined;
589
+ loggedInProductHosts?: string[] | null | undefined;
311
590
  location?: {
312
591
  workshopTitle?: string | null | undefined;
313
592
  origin?: string | null | undefined;
593
+ productHost?: string | null | undefined;
314
594
  exercise?: {
315
595
  type?: "problem" | "solution" | null | undefined;
316
596
  exerciseNumber?: number | null | undefined;
317
597
  stepNumber?: number | null | undefined;
318
598
  } | null | undefined;
319
599
  } | null | undefined;
600
+ locations?: {
601
+ workshopTitle?: string | null | undefined;
602
+ origin?: string | null | undefined;
603
+ productHost?: string | null | undefined;
604
+ exercise?: {
605
+ type?: "problem" | "solution" | null | undefined;
606
+ exerciseNumber?: number | null | undefined;
607
+ stepNumber?: number | null | undefined;
608
+ } | null | undefined;
609
+ }[] | null | undefined;
320
610
  }[];
321
611
  }>;
322
612
  }, "strip", z.ZodTypeAny, {
@@ -329,15 +619,28 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
329
619
  imageUrlSmall?: string | null | undefined;
330
620
  imageUrlLarge?: string | null | undefined;
331
621
  name?: string | null | undefined;
622
+ optOut?: boolean | null | undefined;
623
+ loggedInProductHosts?: string[] | null | undefined;
332
624
  location?: {
333
625
  workshopTitle?: string | null | undefined;
334
626
  origin?: string | null | undefined;
627
+ productHost?: string | null | undefined;
335
628
  exercise?: {
336
629
  type?: "problem" | "solution" | null | undefined;
337
630
  exerciseNumber?: number | null | undefined;
338
631
  stepNumber?: number | null | undefined;
339
632
  } | null | undefined;
340
633
  } | null | undefined;
634
+ locations?: {
635
+ workshopTitle?: string | null | undefined;
636
+ origin?: string | null | undefined;
637
+ productHost?: string | null | undefined;
638
+ exercise?: {
639
+ type?: "problem" | "solution" | null | undefined;
640
+ exerciseNumber?: number | null | undefined;
641
+ stepNumber?: number | null | undefined;
642
+ } | null | undefined;
643
+ }[] | null | undefined;
341
644
  }[];
342
645
  };
343
646
  }, {
@@ -350,15 +653,28 @@ export declare const MessageSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
350
653
  imageUrlSmall?: string | null | undefined;
351
654
  imageUrlLarge?: string | null | undefined;
352
655
  name?: string | null | undefined;
656
+ optOut?: boolean | null | undefined;
657
+ loggedInProductHosts?: string[] | null | undefined;
353
658
  location?: {
354
659
  workshopTitle?: string | null | undefined;
355
660
  origin?: string | null | undefined;
661
+ productHost?: string | null | undefined;
356
662
  exercise?: {
357
663
  type?: "problem" | "solution" | null | undefined;
358
664
  exerciseNumber?: number | null | undefined;
359
665
  stepNumber?: number | null | undefined;
360
666
  } | null | undefined;
361
667
  } | null | undefined;
668
+ locations?: {
669
+ workshopTitle?: string | null | undefined;
670
+ origin?: string | null | undefined;
671
+ productHost?: string | null | undefined;
672
+ exercise?: {
673
+ type?: "problem" | "solution" | null | undefined;
674
+ exerciseNumber?: number | null | undefined;
675
+ stepNumber?: number | null | undefined;
676
+ } | null | undefined;
677
+ }[] | null | undefined;
362
678
  }[];
363
679
  };
364
680
  }>]>;
@@ -372,9 +688,12 @@ export declare const PresenceSchema: z.ZodObject<{
372
688
  imageUrlSmall: z.ZodOptional<z.ZodNullable<z.ZodString>>;
373
689
  imageUrlLarge: z.ZodOptional<z.ZodNullable<z.ZodString>>;
374
690
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
691
+ optOut: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
692
+ loggedInProductHosts: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
375
693
  location: z.ZodOptional<z.ZodNullable<z.ZodObject<{
376
694
  workshopTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
377
695
  origin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
696
+ productHost: z.ZodOptional<z.ZodNullable<z.ZodString>>;
378
697
  exercise: z.ZodOptional<z.ZodNullable<z.ZodObject<{
379
698
  type: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"problem">, z.ZodLiteral<"solution">]>>>;
380
699
  exerciseNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -391,6 +710,7 @@ export declare const PresenceSchema: z.ZodObject<{
391
710
  }, "strip", z.ZodTypeAny, {
392
711
  workshopTitle?: string | null | undefined;
393
712
  origin?: string | null | undefined;
713
+ productHost?: string | null | undefined;
394
714
  exercise?: {
395
715
  type?: "problem" | "solution" | null | undefined;
396
716
  exerciseNumber?: number | null | undefined;
@@ -399,12 +719,49 @@ export declare const PresenceSchema: z.ZodObject<{
399
719
  }, {
400
720
  workshopTitle?: string | null | undefined;
401
721
  origin?: string | null | undefined;
722
+ productHost?: string | null | undefined;
402
723
  exercise?: {
403
724
  type?: "problem" | "solution" | null | undefined;
404
725
  exerciseNumber?: number | null | undefined;
405
726
  stepNumber?: number | null | undefined;
406
727
  } | null | undefined;
407
728
  }>>>;
729
+ locations: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
730
+ workshopTitle: z.ZodOptional<z.ZodNullable<z.ZodString>>;
731
+ origin: z.ZodOptional<z.ZodNullable<z.ZodString>>;
732
+ productHost: z.ZodOptional<z.ZodNullable<z.ZodString>>;
733
+ exercise: z.ZodOptional<z.ZodNullable<z.ZodObject<{
734
+ type: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<"problem">, z.ZodLiteral<"solution">]>>>;
735
+ exerciseNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
736
+ stepNumber: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
737
+ }, "strip", z.ZodTypeAny, {
738
+ type?: "problem" | "solution" | null | undefined;
739
+ exerciseNumber?: number | null | undefined;
740
+ stepNumber?: number | null | undefined;
741
+ }, {
742
+ type?: "problem" | "solution" | null | undefined;
743
+ exerciseNumber?: number | null | undefined;
744
+ stepNumber?: number | null | undefined;
745
+ }>>>;
746
+ }, "strip", z.ZodTypeAny, {
747
+ workshopTitle?: string | null | undefined;
748
+ origin?: string | null | undefined;
749
+ productHost?: string | null | undefined;
750
+ exercise?: {
751
+ type?: "problem" | "solution" | null | undefined;
752
+ exerciseNumber?: number | null | undefined;
753
+ stepNumber?: number | null | undefined;
754
+ } | null | undefined;
755
+ }, {
756
+ workshopTitle?: string | null | undefined;
757
+ origin?: string | null | undefined;
758
+ productHost?: string | null | undefined;
759
+ exercise?: {
760
+ type?: "problem" | "solution" | null | undefined;
761
+ exerciseNumber?: number | null | undefined;
762
+ stepNumber?: number | null | undefined;
763
+ } | null | undefined;
764
+ }>, "many">>>;
408
765
  }, "strip", z.ZodTypeAny, {
409
766
  id: string;
410
767
  hasAccess?: boolean | null | undefined;
@@ -412,15 +769,28 @@ export declare const PresenceSchema: z.ZodObject<{
412
769
  imageUrlSmall?: string | null | undefined;
413
770
  imageUrlLarge?: string | null | undefined;
414
771
  name?: string | null | undefined;
772
+ optOut?: boolean | null | undefined;
773
+ loggedInProductHosts?: string[] | null | undefined;
415
774
  location?: {
416
775
  workshopTitle?: string | null | undefined;
417
776
  origin?: string | null | undefined;
777
+ productHost?: string | null | undefined;
418
778
  exercise?: {
419
779
  type?: "problem" | "solution" | null | undefined;
420
780
  exerciseNumber?: number | null | undefined;
421
781
  stepNumber?: number | null | undefined;
422
782
  } | null | undefined;
423
783
  } | null | undefined;
784
+ locations?: {
785
+ workshopTitle?: string | null | undefined;
786
+ origin?: string | null | undefined;
787
+ productHost?: string | null | undefined;
788
+ exercise?: {
789
+ type?: "problem" | "solution" | null | undefined;
790
+ exerciseNumber?: number | null | undefined;
791
+ stepNumber?: number | null | undefined;
792
+ } | null | undefined;
793
+ }[] | null | undefined;
424
794
  }, {
425
795
  id: string;
426
796
  hasAccess?: boolean | null | undefined;
@@ -428,15 +798,28 @@ export declare const PresenceSchema: z.ZodObject<{
428
798
  imageUrlSmall?: string | null | undefined;
429
799
  imageUrlLarge?: string | null | undefined;
430
800
  name?: string | null | undefined;
801
+ optOut?: boolean | null | undefined;
802
+ loggedInProductHosts?: string[] | null | undefined;
431
803
  location?: {
432
804
  workshopTitle?: string | null | undefined;
433
805
  origin?: string | null | undefined;
806
+ productHost?: string | null | undefined;
434
807
  exercise?: {
435
808
  type?: "problem" | "solution" | null | undefined;
436
809
  exerciseNumber?: number | null | undefined;
437
810
  stepNumber?: number | null | undefined;
438
811
  } | null | undefined;
439
812
  } | null | undefined;
813
+ locations?: {
814
+ workshopTitle?: string | null | undefined;
815
+ origin?: string | null | undefined;
816
+ productHost?: string | null | undefined;
817
+ exercise?: {
818
+ type?: "problem" | "solution" | null | undefined;
819
+ exerciseNumber?: number | null | undefined;
820
+ stepNumber?: number | null | undefined;
821
+ } | null | undefined;
822
+ }[] | null | undefined;
440
823
  }>, "many">;
441
824
  }, "strip", z.ZodTypeAny, {
442
825
  users: {
@@ -446,15 +829,28 @@ export declare const PresenceSchema: z.ZodObject<{
446
829
  imageUrlSmall?: string | null | undefined;
447
830
  imageUrlLarge?: string | null | undefined;
448
831
  name?: string | null | undefined;
832
+ optOut?: boolean | null | undefined;
833
+ loggedInProductHosts?: string[] | null | undefined;
449
834
  location?: {
450
835
  workshopTitle?: string | null | undefined;
451
836
  origin?: string | null | undefined;
837
+ productHost?: string | null | undefined;
452
838
  exercise?: {
453
839
  type?: "problem" | "solution" | null | undefined;
454
840
  exerciseNumber?: number | null | undefined;
455
841
  stepNumber?: number | null | undefined;
456
842
  } | null | undefined;
457
843
  } | null | undefined;
844
+ locations?: {
845
+ workshopTitle?: string | null | undefined;
846
+ origin?: string | null | undefined;
847
+ productHost?: string | null | undefined;
848
+ exercise?: {
849
+ type?: "problem" | "solution" | null | undefined;
850
+ exerciseNumber?: number | null | undefined;
851
+ stepNumber?: number | null | undefined;
852
+ } | null | undefined;
853
+ }[] | null | undefined;
458
854
  }[];
459
855
  }, {
460
856
  users: {
@@ -464,14 +860,29 @@ export declare const PresenceSchema: z.ZodObject<{
464
860
  imageUrlSmall?: string | null | undefined;
465
861
  imageUrlLarge?: string | null | undefined;
466
862
  name?: string | null | undefined;
863
+ optOut?: boolean | null | undefined;
864
+ loggedInProductHosts?: string[] | null | undefined;
467
865
  location?: {
468
866
  workshopTitle?: string | null | undefined;
469
867
  origin?: string | null | undefined;
868
+ productHost?: string | null | undefined;
470
869
  exercise?: {
471
870
  type?: "problem" | "solution" | null | undefined;
472
871
  exerciseNumber?: number | null | undefined;
473
872
  stepNumber?: number | null | undefined;
474
873
  } | null | undefined;
475
874
  } | null | undefined;
875
+ locations?: {
876
+ workshopTitle?: string | null | undefined;
877
+ origin?: string | null | undefined;
878
+ productHost?: string | null | undefined;
879
+ exercise?: {
880
+ type?: "problem" | "solution" | null | undefined;
881
+ exerciseNumber?: number | null | undefined;
882
+ stepNumber?: number | null | undefined;
883
+ } | null | undefined;
884
+ }[] | null | undefined;
476
885
  }[];
477
886
  }>;
887
+ export declare const productHostEmojis: Record<string, string>;
888
+ export declare function getProductHostEmoji(host: string | null | undefined): string | null;
package/dist/presence.js CHANGED
@@ -2,6 +2,22 @@ import { z } from 'zod';
2
2
  export const partykitRoom = 'epic-web-presence';
3
3
  // export const partykitBaseUrl = `http://127.0.0.1:1999/parties/main/${partykitRoom}`
4
4
  export const partykitBaseUrl = `https://epic-web-presence.kentcdodds.partykit.dev/parties/main/${partykitRoom}`;
5
+ export const LocationSchema = z.object({
6
+ workshopTitle: z.string().nullable().optional(),
7
+ origin: z.string().nullable().optional(),
8
+ productHost: z.string().nullable().optional(),
9
+ exercise: z
10
+ .object({
11
+ type: z
12
+ .union([z.literal('problem'), z.literal('solution')])
13
+ .nullable()
14
+ .optional(),
15
+ exerciseNumber: z.number().nullable().optional(),
16
+ stepNumber: z.number().nullable().optional(),
17
+ })
18
+ .nullable()
19
+ .optional(),
20
+ });
5
21
  export const UserSchema = z.object({
6
22
  id: z.string(),
7
23
  hasAccess: z.boolean().nullable().optional(),
@@ -10,24 +26,12 @@ export const UserSchema = z.object({
10
26
  imageUrlSmall: z.string().nullable().optional(),
11
27
  imageUrlLarge: z.string().nullable().optional(),
12
28
  name: z.string().nullable().optional(),
13
- location: z
14
- .object({
15
- workshopTitle: z.string().nullable().optional(),
16
- origin: z.string().nullable().optional(),
17
- exercise: z
18
- .object({
19
- type: z
20
- .union([z.literal('problem'), z.literal('solution')])
21
- .nullable()
22
- .optional(),
23
- exerciseNumber: z.number().nullable().optional(),
24
- stepNumber: z.number().nullable().optional(),
25
- })
26
- .nullable()
27
- .optional(),
28
- })
29
- .nullable()
30
- .optional(),
29
+ optOut: z.boolean().nullable().optional(),
30
+ loggedInProductHosts: z.array(z.string()).nullable().optional(),
31
+ // Single location (for backward compat and single-connection case)
32
+ location: LocationSchema.nullable().optional(),
33
+ // Multiple locations when user is connected from multiple workshops
34
+ locations: z.array(LocationSchema).nullable().optional(),
31
35
  });
32
36
  export const MessageSchema = z
33
37
  .object({
@@ -40,3 +44,14 @@ export const MessageSchema = z
40
44
  payload: z.object({ users: z.array(UserSchema) }),
41
45
  }));
42
46
  export const PresenceSchema = z.object({ users: z.array(UserSchema) });
47
+ // Product host to emoji mapping for FacePile badges
48
+ export const productHostEmojis = {
49
+ 'www.epicreact.dev': '🚀',
50
+ 'www.epicai.pro': '⚡',
51
+ 'www.epicweb.dev': '🌌',
52
+ };
53
+ export function getProductHostEmoji(host) {
54
+ if (!host)
55
+ return null;
56
+ return productHostEmojis[host] ?? null;
57
+ }
@@ -9,15 +9,28 @@ export declare const presenceCache: {
9
9
  imageUrlSmall?: string | null | undefined;
10
10
  imageUrlLarge?: string | null | undefined;
11
11
  name?: string | null | undefined;
12
+ optOut?: boolean | null | undefined;
13
+ loggedInProductHosts?: string[] | null | undefined;
12
14
  location?: {
13
15
  workshopTitle?: string | null | undefined;
14
16
  origin?: string | null | undefined;
17
+ productHost?: string | null | undefined;
15
18
  exercise?: {
16
19
  type?: "problem" | "solution" | null | undefined;
17
20
  exerciseNumber?: number | null | undefined;
18
21
  stepNumber?: number | null | undefined;
19
22
  } | null | undefined;
20
23
  } | null | undefined;
24
+ locations?: {
25
+ workshopTitle?: string | null | undefined;
26
+ origin?: string | null | undefined;
27
+ productHost?: string | null | undefined;
28
+ exercise?: {
29
+ type?: "problem" | "solution" | null | undefined;
30
+ exerciseNumber?: number | null | undefined;
31
+ stepNumber?: number | null | undefined;
32
+ } | null | undefined;
33
+ }[] | null | undefined;
21
34
  }[]>) => import("@epic-web/cachified").CacheEntry<{
22
35
  id: string;
23
36
  hasAccess?: boolean | null | undefined;
@@ -25,15 +38,28 @@ export declare const presenceCache: {
25
38
  imageUrlSmall?: string | null | undefined;
26
39
  imageUrlLarge?: string | null | undefined;
27
40
  name?: string | null | undefined;
41
+ optOut?: boolean | null | undefined;
42
+ loggedInProductHosts?: string[] | null | undefined;
28
43
  location?: {
29
44
  workshopTitle?: string | null | undefined;
30
45
  origin?: string | null | undefined;
46
+ productHost?: string | null | undefined;
31
47
  exercise?: {
32
48
  type?: "problem" | "solution" | null | undefined;
33
49
  exerciseNumber?: number | null | undefined;
34
50
  stepNumber?: number | null | undefined;
35
51
  } | null | undefined;
36
52
  } | null | undefined;
53
+ locations?: {
54
+ workshopTitle?: string | null | undefined;
55
+ origin?: string | null | undefined;
56
+ productHost?: string | null | undefined;
57
+ exercise?: {
58
+ type?: "problem" | "solution" | null | undefined;
59
+ exerciseNumber?: number | null | undefined;
60
+ stepNumber?: number | null | undefined;
61
+ } | null | undefined;
62
+ }[] | null | undefined;
37
63
  }[]>;
38
64
  get: (key: string) => import("@epic-web/cachified").CacheEntry<{
39
65
  id: string;
@@ -42,15 +68,28 @@ export declare const presenceCache: {
42
68
  imageUrlSmall?: string | null | undefined;
43
69
  imageUrlLarge?: string | null | undefined;
44
70
  name?: string | null | undefined;
71
+ optOut?: boolean | null | undefined;
72
+ loggedInProductHosts?: string[] | null | undefined;
45
73
  location?: {
46
74
  workshopTitle?: string | null | undefined;
47
75
  origin?: string | null | undefined;
76
+ productHost?: string | null | undefined;
48
77
  exercise?: {
49
78
  type?: "problem" | "solution" | null | undefined;
50
79
  exerciseNumber?: number | null | undefined;
51
80
  stepNumber?: number | null | undefined;
52
81
  } | null | undefined;
53
82
  } | null | undefined;
83
+ locations?: {
84
+ workshopTitle?: string | null | undefined;
85
+ origin?: string | null | undefined;
86
+ productHost?: string | null | undefined;
87
+ exercise?: {
88
+ type?: "problem" | "solution" | null | undefined;
89
+ exerciseNumber?: number | null | undefined;
90
+ stepNumber?: number | null | undefined;
91
+ } | null | undefined;
92
+ }[] | null | undefined;
54
93
  }[]> | undefined;
55
94
  delete: (key: string) => boolean;
56
95
  };
@@ -1,6 +1,6 @@
1
1
  import { cachified, makeSingletonCache, } from '@epic-web/workshop-utils/cache.server';
2
2
  import { getWorkshopConfig } from '@epic-web/workshop-utils/config.server';
3
- import { getAuthInfo, getPreferences } from '@epic-web/workshop-utils/db.server';
3
+ import { getAuthInfo, getLoggedInProductHosts, getPreferences, } from '@epic-web/workshop-utils/db.server';
4
4
  import { getUserInfo, userHasAccessToWorkshop, } from '@epic-web/workshop-utils/epic-api.server';
5
5
  import { getUserId } from '@epic-web/workshop-utils/user.server';
6
6
  import { PresenceSchema, partykitBaseUrl } from "./presence.js";
@@ -45,50 +45,63 @@ export async function getPresentUsers({ timings, request, } = {}) {
45
45
  ? (await getUserId({ request })).id
46
46
  : (authInfo?.id ?? null);
47
47
  const preferences = await getPreferences();
48
- if (preferences?.presence.optOut || !userId) {
49
- return uniqueUsers(users.filter((u) => u.id !== userId));
48
+ const isOptOut = preferences?.presence.optOut ?? false;
49
+ // If no userId, just return other users
50
+ if (!userId) {
51
+ return uniqueUsers(users);
50
52
  }
51
- else {
52
- const user = { id: userId };
53
- const config = getWorkshopConfig();
54
- const url = request ? new URL(request.url) : undefined;
55
- user.location = {
56
- workshopTitle: config.title,
57
- origin: url ? url.origin : undefined,
53
+ // Get logged in product hosts for the local user
54
+ const loggedInProductHosts = await getLoggedInProductHosts();
55
+ // If opted out, include user with minimal info (just id and optOut flag)
56
+ if (isOptOut) {
57
+ const optOutUser = {
58
+ id: userId,
59
+ optOut: true,
60
+ loggedInProductHosts,
58
61
  };
59
- if (url) {
60
- if (url.pathname.startsWith('/exercise/')) {
61
- const [exerciseNumber, stepNumber, type] = url.pathname
62
- .split('/')
63
- .slice(2);
64
- user.location.exercise = {
65
- exerciseNumber: isNaN(Number(exerciseNumber))
66
- ? null
67
- : Number(exerciseNumber),
68
- stepNumber: isNaN(Number(stepNumber)) ? null : Number(stepNumber),
69
- type: type === 'problem'
70
- ? 'problem'
71
- : type === 'solution'
72
- ? 'solution'
73
- : null,
74
- };
75
- }
76
- }
77
- if (authInfo) {
78
- const [userInfo, hasAccess] = await Promise.all([
79
- getUserInfo({ request, timings }),
80
- userHasAccessToWorkshop({ request, timings }),
81
- ]);
82
- Object.assign(user, {
83
- name: userInfo?.name,
84
- avatarUrl: userInfo?.imageUrlLarge,
85
- imageUrlSmall: userInfo?.imageUrlSmall,
86
- imageUrlLarge: userInfo?.imageUrlLarge,
87
- hasAccess,
88
- });
62
+ return uniqueUsers([...users.filter((u) => u.id !== userId), optOutUser]);
63
+ }
64
+ // Build full user info
65
+ const user = { id: userId, loggedInProductHosts };
66
+ const config = getWorkshopConfig();
67
+ const url = request ? new URL(request.url) : undefined;
68
+ user.location = {
69
+ workshopTitle: config.title,
70
+ origin: url ? url.origin : undefined,
71
+ productHost: config.product.host,
72
+ };
73
+ if (url) {
74
+ if (url.pathname.startsWith('/exercise/')) {
75
+ const [exerciseNumber, stepNumber, type] = url.pathname
76
+ .split('/')
77
+ .slice(2);
78
+ user.location.exercise = {
79
+ exerciseNumber: isNaN(Number(exerciseNumber))
80
+ ? null
81
+ : Number(exerciseNumber),
82
+ stepNumber: isNaN(Number(stepNumber)) ? null : Number(stepNumber),
83
+ type: type === 'problem'
84
+ ? 'problem'
85
+ : type === 'solution'
86
+ ? 'solution'
87
+ : null,
88
+ };
89
89
  }
90
- return uniqueUsers([...users, user]);
91
90
  }
91
+ if (authInfo) {
92
+ const [userInfo, hasAccess] = await Promise.all([
93
+ getUserInfo({ request, timings }),
94
+ userHasAccessToWorkshop({ request, timings }),
95
+ ]);
96
+ Object.assign(user, {
97
+ name: userInfo?.name,
98
+ avatarUrl: userInfo?.imageUrlLarge,
99
+ imageUrlSmall: userInfo?.imageUrlSmall,
100
+ imageUrlLarge: userInfo?.imageUrlLarge,
101
+ hasAccess,
102
+ });
103
+ }
104
+ return uniqueUsers([...users.filter((u) => u.id !== userId), user]);
92
105
  }
93
106
  // A user maybe on the same page in multiple tabs
94
107
  // so let's make sure we only show them once
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epic-web/workshop-presence",
3
- "version": "6.47.9",
3
+ "version": "6.47.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -14,7 +14,7 @@
14
14
  "deploy": "partykit deploy"
15
15
  },
16
16
  "dependencies": {
17
- "@epic-web/workshop-utils": "6.47.9",
17
+ "@epic-web/workshop-utils": "6.47.11",
18
18
  "zod": "^3.25.76"
19
19
  },
20
20
  "devDependencies": {