@openora/core 0.4.1-canary.83 → 0.4.1-canary.85

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.
Files changed (40) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/audit/__tests__/audit.service.int.test.js +12 -0
  3. package/dist/audit/__tests__/audit.service.int.test.js.map +1 -1
  4. package/dist/audit/plugin.d.ts.map +1 -1
  5. package/dist/audit/plugin.js +11 -0
  6. package/dist/audit/plugin.js.map +1 -1
  7. package/dist/compliance/__tests__/rg.service.int.test.js +32 -4
  8. package/dist/compliance/__tests__/rg.service.int.test.js.map +1 -1
  9. package/dist/compliance/service/rg.service.d.ts.map +1 -1
  10. package/dist/compliance/service/rg.service.js +38 -9
  11. package/dist/compliance/service/rg.service.js.map +1 -1
  12. package/dist/contracts/adapters/identity-reader.d.ts +2 -0
  13. package/dist/contracts/adapters/identity-reader.d.ts.map +1 -1
  14. package/dist/contracts/adapters/identity-reader.js.map +1 -1
  15. package/dist/contracts/schemas/events.d.ts +8 -0
  16. package/dist/contracts/schemas/events.d.ts.map +1 -1
  17. package/dist/contracts/schemas/events.js +6 -0
  18. package/dist/contracts/schemas/events.js.map +1 -1
  19. package/dist/engagement/chat/__tests__/global-chat-room.int.test.d.ts +2 -0
  20. package/dist/engagement/chat/__tests__/global-chat-room.int.test.d.ts.map +1 -0
  21. package/dist/engagement/chat/__tests__/global-chat-room.int.test.js +91 -0
  22. package/dist/engagement/chat/__tests__/global-chat-room.int.test.js.map +1 -0
  23. package/dist/engagement/chat/drizzle/migrations/0007_seed_global_chat_room.sql +8 -0
  24. package/dist/engagement/chat/drizzle/migrations/meta/0007_snapshot.json +1456 -0
  25. package/dist/engagement/chat/drizzle/migrations/meta/_journal.json +7 -0
  26. package/dist/engagement/chat/router/index.d.ts.map +1 -1
  27. package/dist/engagement/chat/router/index.js +6 -3
  28. package/dist/engagement/chat/router/index.js.map +1 -1
  29. package/dist/engagement/chat/service/chat.service.d.ts +1 -0
  30. package/dist/engagement/chat/service/chat.service.d.ts.map +1 -1
  31. package/dist/engagement/chat/service/chat.service.js +12 -0
  32. package/dist/engagement/chat/service/chat.service.js.map +1 -1
  33. package/dist/pam/identity/adapters/identity-reader.service.d.ts +1 -0
  34. package/dist/pam/identity/adapters/identity-reader.service.d.ts.map +1 -1
  35. package/dist/pam/identity/adapters/identity-reader.service.js +20 -1
  36. package/dist/pam/identity/adapters/identity-reader.service.js.map +1 -1
  37. package/dist/testing/mock.d.ts.map +1 -1
  38. package/dist/testing/mock.js +1 -0
  39. package/dist/testing/mock.js.map +1 -1
  40. package/package.json +1 -1
@@ -0,0 +1,1456 @@
1
+ {
2
+ "id": "6af09461-5ea9-4381-b5d9-a4e6caf872f5",
3
+ "prevId": "61e27bb3-c7c7-45b0-9a12-4fc163fe3a8f",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.chat_message": {
8
+ "name": "chat_message",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "gen_random_uuid()"
17
+ },
18
+ "room_id": {
19
+ "name": "room_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": false
23
+ },
24
+ "user_id": {
25
+ "name": "user_id",
26
+ "type": "uuid",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "username": {
31
+ "name": "username",
32
+ "type": "text",
33
+ "primaryKey": false,
34
+ "notNull": true
35
+ },
36
+ "content": {
37
+ "name": "content",
38
+ "type": "text",
39
+ "primaryKey": false,
40
+ "notNull": true
41
+ },
42
+ "type": {
43
+ "name": "type",
44
+ "type": "chat_message_type",
45
+ "typeSchema": "public",
46
+ "primaryKey": false,
47
+ "notNull": true,
48
+ "default": "'user'"
49
+ },
50
+ "metadata": {
51
+ "name": "metadata",
52
+ "type": "jsonb",
53
+ "primaryKey": false,
54
+ "notNull": false
55
+ },
56
+ "is_deleted": {
57
+ "name": "is_deleted",
58
+ "type": "boolean",
59
+ "primaryKey": false,
60
+ "notNull": true,
61
+ "default": false
62
+ },
63
+ "deleted_at": {
64
+ "name": "deleted_at",
65
+ "type": "timestamp with time zone",
66
+ "primaryKey": false,
67
+ "notNull": false
68
+ },
69
+ "created_at": {
70
+ "name": "created_at",
71
+ "type": "timestamp with time zone",
72
+ "primaryKey": false,
73
+ "notNull": true,
74
+ "default": "now()"
75
+ }
76
+ },
77
+ "indexes": {
78
+ "chat_msg_room_id_created_at_idx": {
79
+ "name": "chat_msg_room_id_created_at_idx",
80
+ "columns": [
81
+ {
82
+ "expression": "room_id",
83
+ "isExpression": false,
84
+ "asc": true,
85
+ "nulls": "last"
86
+ },
87
+ {
88
+ "expression": "created_at",
89
+ "isExpression": false,
90
+ "asc": true,
91
+ "nulls": "last"
92
+ }
93
+ ],
94
+ "isUnique": false,
95
+ "concurrently": false,
96
+ "method": "btree",
97
+ "with": {}
98
+ },
99
+ "chat_msg_created_at_idx": {
100
+ "name": "chat_msg_created_at_idx",
101
+ "columns": [
102
+ {
103
+ "expression": "created_at",
104
+ "isExpression": false,
105
+ "asc": true,
106
+ "nulls": "last"
107
+ }
108
+ ],
109
+ "isUnique": false,
110
+ "concurrently": false,
111
+ "method": "btree",
112
+ "with": {}
113
+ },
114
+ "chat_msg_deleted_at_idx": {
115
+ "name": "chat_msg_deleted_at_idx",
116
+ "columns": [
117
+ {
118
+ "expression": "deleted_at",
119
+ "isExpression": false,
120
+ "asc": true,
121
+ "nulls": "last"
122
+ }
123
+ ],
124
+ "isUnique": false,
125
+ "concurrently": false,
126
+ "method": "btree",
127
+ "with": {}
128
+ }
129
+ },
130
+ "foreignKeys": {
131
+ "chat_message_room_id_chat_room_id_fk": {
132
+ "name": "chat_message_room_id_chat_room_id_fk",
133
+ "tableFrom": "chat_message",
134
+ "tableTo": "chat_room",
135
+ "columnsFrom": ["room_id"],
136
+ "columnsTo": ["id"],
137
+ "onDelete": "no action",
138
+ "onUpdate": "no action"
139
+ }
140
+ },
141
+ "compositePrimaryKeys": {},
142
+ "uniqueConstraints": {},
143
+ "policies": {},
144
+ "checkConstraints": {},
145
+ "isRLSEnabled": false
146
+ },
147
+ "public.chat_mute": {
148
+ "name": "chat_mute",
149
+ "schema": "",
150
+ "columns": {
151
+ "id": {
152
+ "name": "id",
153
+ "type": "uuid",
154
+ "primaryKey": true,
155
+ "notNull": true,
156
+ "default": "gen_random_uuid()"
157
+ },
158
+ "user_id": {
159
+ "name": "user_id",
160
+ "type": "uuid",
161
+ "primaryKey": false,
162
+ "notNull": true
163
+ },
164
+ "room_id": {
165
+ "name": "room_id",
166
+ "type": "uuid",
167
+ "primaryKey": false,
168
+ "notNull": false
169
+ },
170
+ "scope": {
171
+ "name": "scope",
172
+ "type": "chat_moderation_scope",
173
+ "typeSchema": "public",
174
+ "primaryKey": false,
175
+ "notNull": true,
176
+ "default": "'__global'"
177
+ },
178
+ "muted_by": {
179
+ "name": "muted_by",
180
+ "type": "uuid",
181
+ "primaryKey": false,
182
+ "notNull": true
183
+ },
184
+ "reason": {
185
+ "name": "reason",
186
+ "type": "text",
187
+ "primaryKey": false,
188
+ "notNull": true
189
+ },
190
+ "created_at": {
191
+ "name": "created_at",
192
+ "type": "timestamp with time zone",
193
+ "primaryKey": false,
194
+ "notNull": true,
195
+ "default": "now()"
196
+ },
197
+ "expires_at": {
198
+ "name": "expires_at",
199
+ "type": "timestamp with time zone",
200
+ "primaryKey": false,
201
+ "notNull": false
202
+ },
203
+ "lifted_at": {
204
+ "name": "lifted_at",
205
+ "type": "timestamp with time zone",
206
+ "primaryKey": false,
207
+ "notNull": false
208
+ },
209
+ "lifted_by": {
210
+ "name": "lifted_by",
211
+ "type": "uuid",
212
+ "primaryKey": false,
213
+ "notNull": false
214
+ }
215
+ },
216
+ "indexes": {
217
+ "chat_mute_user_room_idx": {
218
+ "name": "chat_mute_user_room_idx",
219
+ "columns": [
220
+ {
221
+ "expression": "user_id",
222
+ "isExpression": false,
223
+ "asc": true,
224
+ "nulls": "last"
225
+ },
226
+ {
227
+ "expression": "room_id",
228
+ "isExpression": false,
229
+ "asc": true,
230
+ "nulls": "last"
231
+ }
232
+ ],
233
+ "isUnique": false,
234
+ "concurrently": false,
235
+ "method": "btree",
236
+ "with": {}
237
+ },
238
+ "chat_mute_expires_at_idx": {
239
+ "name": "chat_mute_expires_at_idx",
240
+ "columns": [
241
+ {
242
+ "expression": "expires_at",
243
+ "isExpression": false,
244
+ "asc": true,
245
+ "nulls": "last"
246
+ }
247
+ ],
248
+ "isUnique": false,
249
+ "concurrently": false,
250
+ "method": "btree",
251
+ "with": {}
252
+ }
253
+ },
254
+ "foreignKeys": {},
255
+ "compositePrimaryKeys": {},
256
+ "uniqueConstraints": {},
257
+ "policies": {},
258
+ "checkConstraints": {},
259
+ "isRLSEnabled": false
260
+ },
261
+ "public.chat_platform_ban": {
262
+ "name": "chat_platform_ban",
263
+ "schema": "",
264
+ "columns": {
265
+ "id": {
266
+ "name": "id",
267
+ "type": "uuid",
268
+ "primaryKey": true,
269
+ "notNull": true,
270
+ "default": "gen_random_uuid()"
271
+ },
272
+ "user_id": {
273
+ "name": "user_id",
274
+ "type": "uuid",
275
+ "primaryKey": false,
276
+ "notNull": true
277
+ },
278
+ "banned_by": {
279
+ "name": "banned_by",
280
+ "type": "uuid",
281
+ "primaryKey": false,
282
+ "notNull": true
283
+ },
284
+ "scope": {
285
+ "name": "scope",
286
+ "type": "chat_moderation_scope",
287
+ "typeSchema": "public",
288
+ "primaryKey": false,
289
+ "notNull": true,
290
+ "default": "'__all_public'"
291
+ },
292
+ "room_id": {
293
+ "name": "room_id",
294
+ "type": "uuid",
295
+ "primaryKey": false,
296
+ "notNull": false
297
+ },
298
+ "reason": {
299
+ "name": "reason",
300
+ "type": "text",
301
+ "primaryKey": false,
302
+ "notNull": true
303
+ },
304
+ "created_at": {
305
+ "name": "created_at",
306
+ "type": "timestamp with time zone",
307
+ "primaryKey": false,
308
+ "notNull": true,
309
+ "default": "now()"
310
+ },
311
+ "expires_at": {
312
+ "name": "expires_at",
313
+ "type": "timestamp with time zone",
314
+ "primaryKey": false,
315
+ "notNull": false
316
+ },
317
+ "lifted_at": {
318
+ "name": "lifted_at",
319
+ "type": "timestamp with time zone",
320
+ "primaryKey": false,
321
+ "notNull": false
322
+ },
323
+ "lifted_by": {
324
+ "name": "lifted_by",
325
+ "type": "uuid",
326
+ "primaryKey": false,
327
+ "notNull": false
328
+ }
329
+ },
330
+ "indexes": {
331
+ "chat_platform_ban_active_scope_key": {
332
+ "name": "chat_platform_ban_active_scope_key",
333
+ "columns": [
334
+ {
335
+ "expression": "user_id",
336
+ "isExpression": false,
337
+ "asc": true,
338
+ "nulls": "last"
339
+ },
340
+ {
341
+ "expression": "scope",
342
+ "isExpression": false,
343
+ "asc": true,
344
+ "nulls": "last"
345
+ }
346
+ ],
347
+ "isUnique": true,
348
+ "where": "\"chat_platform_ban\".\"lifted_at\" IS NULL AND \"chat_platform_ban\".\"room_id\" IS NULL",
349
+ "concurrently": false,
350
+ "method": "btree",
351
+ "with": {}
352
+ },
353
+ "chat_platform_ban_active_room_key": {
354
+ "name": "chat_platform_ban_active_room_key",
355
+ "columns": [
356
+ {
357
+ "expression": "user_id",
358
+ "isExpression": false,
359
+ "asc": true,
360
+ "nulls": "last"
361
+ },
362
+ {
363
+ "expression": "scope",
364
+ "isExpression": false,
365
+ "asc": true,
366
+ "nulls": "last"
367
+ },
368
+ {
369
+ "expression": "room_id",
370
+ "isExpression": false,
371
+ "asc": true,
372
+ "nulls": "last"
373
+ }
374
+ ],
375
+ "isUnique": true,
376
+ "where": "\"chat_platform_ban\".\"lifted_at\" IS NULL AND \"chat_platform_ban\".\"room_id\" IS NOT NULL",
377
+ "concurrently": false,
378
+ "method": "btree",
379
+ "with": {}
380
+ },
381
+ "chat_platform_ban_user_idx": {
382
+ "name": "chat_platform_ban_user_idx",
383
+ "columns": [
384
+ {
385
+ "expression": "user_id",
386
+ "isExpression": false,
387
+ "asc": true,
388
+ "nulls": "last"
389
+ }
390
+ ],
391
+ "isUnique": false,
392
+ "concurrently": false,
393
+ "method": "btree",
394
+ "with": {}
395
+ }
396
+ },
397
+ "foreignKeys": {
398
+ "chat_platform_ban_room_id_chat_room_id_fk": {
399
+ "name": "chat_platform_ban_room_id_chat_room_id_fk",
400
+ "tableFrom": "chat_platform_ban",
401
+ "tableTo": "chat_room",
402
+ "columnsFrom": ["room_id"],
403
+ "columnsTo": ["id"],
404
+ "onDelete": "no action",
405
+ "onUpdate": "no action"
406
+ }
407
+ },
408
+ "compositePrimaryKeys": {},
409
+ "uniqueConstraints": {},
410
+ "policies": {},
411
+ "checkConstraints": {},
412
+ "isRLSEnabled": false
413
+ },
414
+ "public.chat_room": {
415
+ "name": "chat_room",
416
+ "schema": "",
417
+ "columns": {
418
+ "id": {
419
+ "name": "id",
420
+ "type": "uuid",
421
+ "primaryKey": true,
422
+ "notNull": true,
423
+ "default": "gen_random_uuid()"
424
+ },
425
+ "name": {
426
+ "name": "name",
427
+ "type": "text",
428
+ "primaryKey": false,
429
+ "notNull": true
430
+ },
431
+ "slug": {
432
+ "name": "slug",
433
+ "type": "text",
434
+ "primaryKey": false,
435
+ "notNull": true
436
+ },
437
+ "category": {
438
+ "name": "category",
439
+ "type": "chat_room_category",
440
+ "typeSchema": "public",
441
+ "primaryKey": false,
442
+ "notNull": false
443
+ },
444
+ "is_public": {
445
+ "name": "is_public",
446
+ "type": "boolean",
447
+ "primaryKey": false,
448
+ "notNull": true,
449
+ "default": true
450
+ },
451
+ "join_code": {
452
+ "name": "join_code",
453
+ "type": "text",
454
+ "primaryKey": false,
455
+ "notNull": false
456
+ },
457
+ "creator_id": {
458
+ "name": "creator_id",
459
+ "type": "uuid",
460
+ "primaryKey": false,
461
+ "notNull": false
462
+ },
463
+ "created_at": {
464
+ "name": "created_at",
465
+ "type": "timestamp with time zone",
466
+ "primaryKey": false,
467
+ "notNull": true,
468
+ "default": "now()"
469
+ },
470
+ "deleted_at": {
471
+ "name": "deleted_at",
472
+ "type": "timestamp with time zone",
473
+ "primaryKey": false,
474
+ "notNull": false
475
+ }
476
+ },
477
+ "indexes": {
478
+ "chat_room_slug_key": {
479
+ "name": "chat_room_slug_key",
480
+ "columns": [
481
+ {
482
+ "expression": "slug",
483
+ "isExpression": false,
484
+ "asc": true,
485
+ "nulls": "last"
486
+ }
487
+ ],
488
+ "isUnique": true,
489
+ "concurrently": false,
490
+ "method": "btree",
491
+ "with": {}
492
+ },
493
+ "chat_room_join_code_key": {
494
+ "name": "chat_room_join_code_key",
495
+ "columns": [
496
+ {
497
+ "expression": "join_code",
498
+ "isExpression": false,
499
+ "asc": true,
500
+ "nulls": "last"
501
+ }
502
+ ],
503
+ "isUnique": true,
504
+ "concurrently": false,
505
+ "method": "btree",
506
+ "with": {}
507
+ },
508
+ "chat_room_deleted_at_idx": {
509
+ "name": "chat_room_deleted_at_idx",
510
+ "columns": [
511
+ {
512
+ "expression": "deleted_at",
513
+ "isExpression": false,
514
+ "asc": true,
515
+ "nulls": "last"
516
+ }
517
+ ],
518
+ "isUnique": false,
519
+ "concurrently": false,
520
+ "method": "btree",
521
+ "with": {}
522
+ },
523
+ "chat_room_creator_public_deleted_at_idx": {
524
+ "name": "chat_room_creator_public_deleted_at_idx",
525
+ "columns": [
526
+ {
527
+ "expression": "creator_id",
528
+ "isExpression": false,
529
+ "asc": true,
530
+ "nulls": "last"
531
+ },
532
+ {
533
+ "expression": "is_public",
534
+ "isExpression": false,
535
+ "asc": true,
536
+ "nulls": "last"
537
+ },
538
+ {
539
+ "expression": "deleted_at",
540
+ "isExpression": false,
541
+ "asc": true,
542
+ "nulls": "last"
543
+ }
544
+ ],
545
+ "isUnique": false,
546
+ "concurrently": false,
547
+ "method": "btree",
548
+ "with": {}
549
+ }
550
+ },
551
+ "foreignKeys": {},
552
+ "compositePrimaryKeys": {},
553
+ "uniqueConstraints": {},
554
+ "policies": {},
555
+ "checkConstraints": {},
556
+ "isRLSEnabled": false
557
+ },
558
+ "public.chat_room_ban": {
559
+ "name": "chat_room_ban",
560
+ "schema": "",
561
+ "columns": {
562
+ "id": {
563
+ "name": "id",
564
+ "type": "uuid",
565
+ "primaryKey": true,
566
+ "notNull": true,
567
+ "default": "gen_random_uuid()"
568
+ },
569
+ "room_id": {
570
+ "name": "room_id",
571
+ "type": "uuid",
572
+ "primaryKey": false,
573
+ "notNull": true
574
+ },
575
+ "user_id": {
576
+ "name": "user_id",
577
+ "type": "uuid",
578
+ "primaryKey": false,
579
+ "notNull": true
580
+ },
581
+ "banned_by": {
582
+ "name": "banned_by",
583
+ "type": "uuid",
584
+ "primaryKey": false,
585
+ "notNull": true
586
+ },
587
+ "created_at": {
588
+ "name": "created_at",
589
+ "type": "timestamp with time zone",
590
+ "primaryKey": false,
591
+ "notNull": true,
592
+ "default": "now()"
593
+ },
594
+ "expires_at": {
595
+ "name": "expires_at",
596
+ "type": "timestamp with time zone",
597
+ "primaryKey": false,
598
+ "notNull": false
599
+ },
600
+ "lifted_at": {
601
+ "name": "lifted_at",
602
+ "type": "timestamp with time zone",
603
+ "primaryKey": false,
604
+ "notNull": false
605
+ },
606
+ "lifted_by": {
607
+ "name": "lifted_by",
608
+ "type": "uuid",
609
+ "primaryKey": false,
610
+ "notNull": false
611
+ }
612
+ },
613
+ "indexes": {
614
+ "chat_room_ban_active_room_user_key": {
615
+ "name": "chat_room_ban_active_room_user_key",
616
+ "columns": [
617
+ {
618
+ "expression": "room_id",
619
+ "isExpression": false,
620
+ "asc": true,
621
+ "nulls": "last"
622
+ },
623
+ {
624
+ "expression": "user_id",
625
+ "isExpression": false,
626
+ "asc": true,
627
+ "nulls": "last"
628
+ }
629
+ ],
630
+ "isUnique": true,
631
+ "where": "\"chat_room_ban\".\"lifted_at\" IS NULL",
632
+ "concurrently": false,
633
+ "method": "btree",
634
+ "with": {}
635
+ },
636
+ "chat_room_ban_room_idx": {
637
+ "name": "chat_room_ban_room_idx",
638
+ "columns": [
639
+ {
640
+ "expression": "room_id",
641
+ "isExpression": false,
642
+ "asc": true,
643
+ "nulls": "last"
644
+ }
645
+ ],
646
+ "isUnique": false,
647
+ "concurrently": false,
648
+ "method": "btree",
649
+ "with": {}
650
+ },
651
+ "chat_room_ban_user_idx": {
652
+ "name": "chat_room_ban_user_idx",
653
+ "columns": [
654
+ {
655
+ "expression": "user_id",
656
+ "isExpression": false,
657
+ "asc": true,
658
+ "nulls": "last"
659
+ }
660
+ ],
661
+ "isUnique": false,
662
+ "concurrently": false,
663
+ "method": "btree",
664
+ "with": {}
665
+ },
666
+ "chat_room_ban_expires_at_idx": {
667
+ "name": "chat_room_ban_expires_at_idx",
668
+ "columns": [
669
+ {
670
+ "expression": "expires_at",
671
+ "isExpression": false,
672
+ "asc": true,
673
+ "nulls": "last"
674
+ }
675
+ ],
676
+ "isUnique": false,
677
+ "concurrently": false,
678
+ "method": "btree",
679
+ "with": {}
680
+ }
681
+ },
682
+ "foreignKeys": {
683
+ "chat_room_ban_room_id_chat_room_id_fk": {
684
+ "name": "chat_room_ban_room_id_chat_room_id_fk",
685
+ "tableFrom": "chat_room_ban",
686
+ "tableTo": "chat_room",
687
+ "columnsFrom": ["room_id"],
688
+ "columnsTo": ["id"],
689
+ "onDelete": "cascade",
690
+ "onUpdate": "no action"
691
+ }
692
+ },
693
+ "compositePrimaryKeys": {},
694
+ "uniqueConstraints": {},
695
+ "policies": {},
696
+ "checkConstraints": {},
697
+ "isRLSEnabled": false
698
+ },
699
+ "public.chat_room_configuration": {
700
+ "name": "chat_room_configuration",
701
+ "schema": "",
702
+ "columns": {
703
+ "id": {
704
+ "name": "id",
705
+ "type": "uuid",
706
+ "primaryKey": true,
707
+ "notNull": true,
708
+ "default": "gen_random_uuid()"
709
+ },
710
+ "room_id": {
711
+ "name": "room_id",
712
+ "type": "uuid",
713
+ "primaryKey": false,
714
+ "notNull": true
715
+ },
716
+ "slow_mode": {
717
+ "name": "slow_mode",
718
+ "type": "boolean",
719
+ "primaryKey": false,
720
+ "notNull": true,
721
+ "default": false
722
+ },
723
+ "slow_mode_seconds": {
724
+ "name": "slow_mode_seconds",
725
+ "type": "integer",
726
+ "primaryKey": false,
727
+ "notNull": true,
728
+ "default": 0
729
+ },
730
+ "read_only_mode": {
731
+ "name": "read_only_mode",
732
+ "type": "boolean",
733
+ "primaryKey": false,
734
+ "notNull": true,
735
+ "default": false
736
+ },
737
+ "only_invited_can_join": {
738
+ "name": "only_invited_can_join",
739
+ "type": "boolean",
740
+ "primaryKey": false,
741
+ "notNull": true,
742
+ "default": false
743
+ },
744
+ "lock_room": {
745
+ "name": "lock_room",
746
+ "type": "boolean",
747
+ "primaryKey": false,
748
+ "notNull": true,
749
+ "default": false
750
+ },
751
+ "moderator_invite": {
752
+ "name": "moderator_invite",
753
+ "type": "boolean",
754
+ "primaryKey": false,
755
+ "notNull": true,
756
+ "default": false
757
+ },
758
+ "created_at": {
759
+ "name": "created_at",
760
+ "type": "timestamp with time zone",
761
+ "primaryKey": false,
762
+ "notNull": true,
763
+ "default": "now()"
764
+ },
765
+ "updated_at": {
766
+ "name": "updated_at",
767
+ "type": "timestamp with time zone",
768
+ "primaryKey": false,
769
+ "notNull": true,
770
+ "default": "now()"
771
+ }
772
+ },
773
+ "indexes": {
774
+ "chat_room_configuration_room_key": {
775
+ "name": "chat_room_configuration_room_key",
776
+ "columns": [
777
+ {
778
+ "expression": "room_id",
779
+ "isExpression": false,
780
+ "asc": true,
781
+ "nulls": "last"
782
+ }
783
+ ],
784
+ "isUnique": true,
785
+ "concurrently": false,
786
+ "method": "btree",
787
+ "with": {}
788
+ }
789
+ },
790
+ "foreignKeys": {
791
+ "chat_room_configuration_room_id_chat_room_id_fk": {
792
+ "name": "chat_room_configuration_room_id_chat_room_id_fk",
793
+ "tableFrom": "chat_room_configuration",
794
+ "tableTo": "chat_room",
795
+ "columnsFrom": ["room_id"],
796
+ "columnsTo": ["id"],
797
+ "onDelete": "cascade",
798
+ "onUpdate": "no action"
799
+ }
800
+ },
801
+ "compositePrimaryKeys": {},
802
+ "uniqueConstraints": {},
803
+ "policies": {},
804
+ "checkConstraints": {},
805
+ "isRLSEnabled": false
806
+ },
807
+ "public.chat_room_member": {
808
+ "name": "chat_room_member",
809
+ "schema": "",
810
+ "columns": {
811
+ "id": {
812
+ "name": "id",
813
+ "type": "uuid",
814
+ "primaryKey": true,
815
+ "notNull": true,
816
+ "default": "gen_random_uuid()"
817
+ },
818
+ "room_id": {
819
+ "name": "room_id",
820
+ "type": "uuid",
821
+ "primaryKey": false,
822
+ "notNull": true
823
+ },
824
+ "user_id": {
825
+ "name": "user_id",
826
+ "type": "uuid",
827
+ "primaryKey": false,
828
+ "notNull": true
829
+ },
830
+ "role": {
831
+ "name": "role",
832
+ "type": "chat_room_role",
833
+ "typeSchema": "public",
834
+ "primaryKey": false,
835
+ "notNull": true,
836
+ "default": "'member'"
837
+ },
838
+ "joined_at": {
839
+ "name": "joined_at",
840
+ "type": "timestamp with time zone",
841
+ "primaryKey": false,
842
+ "notNull": true,
843
+ "default": "now()"
844
+ }
845
+ },
846
+ "indexes": {
847
+ "chat_room_member_room_user_key": {
848
+ "name": "chat_room_member_room_user_key",
849
+ "columns": [
850
+ {
851
+ "expression": "room_id",
852
+ "isExpression": false,
853
+ "asc": true,
854
+ "nulls": "last"
855
+ },
856
+ {
857
+ "expression": "user_id",
858
+ "isExpression": false,
859
+ "asc": true,
860
+ "nulls": "last"
861
+ }
862
+ ],
863
+ "isUnique": true,
864
+ "concurrently": false,
865
+ "method": "btree",
866
+ "with": {}
867
+ },
868
+ "chat_room_member_room_idx": {
869
+ "name": "chat_room_member_room_idx",
870
+ "columns": [
871
+ {
872
+ "expression": "room_id",
873
+ "isExpression": false,
874
+ "asc": true,
875
+ "nulls": "last"
876
+ }
877
+ ],
878
+ "isUnique": false,
879
+ "concurrently": false,
880
+ "method": "btree",
881
+ "with": {}
882
+ },
883
+ "chat_room_member_user_idx": {
884
+ "name": "chat_room_member_user_idx",
885
+ "columns": [
886
+ {
887
+ "expression": "user_id",
888
+ "isExpression": false,
889
+ "asc": true,
890
+ "nulls": "last"
891
+ }
892
+ ],
893
+ "isUnique": false,
894
+ "concurrently": false,
895
+ "method": "btree",
896
+ "with": {}
897
+ }
898
+ },
899
+ "foreignKeys": {
900
+ "chat_room_member_room_id_chat_room_id_fk": {
901
+ "name": "chat_room_member_room_id_chat_room_id_fk",
902
+ "tableFrom": "chat_room_member",
903
+ "tableTo": "chat_room",
904
+ "columnsFrom": ["room_id"],
905
+ "columnsTo": ["id"],
906
+ "onDelete": "cascade",
907
+ "onUpdate": "no action"
908
+ }
909
+ },
910
+ "compositePrimaryKeys": {},
911
+ "uniqueConstraints": {},
912
+ "policies": {},
913
+ "checkConstraints": {},
914
+ "isRLSEnabled": false
915
+ },
916
+ "public.chat_room_mute": {
917
+ "name": "chat_room_mute",
918
+ "schema": "",
919
+ "columns": {
920
+ "id": {
921
+ "name": "id",
922
+ "type": "uuid",
923
+ "primaryKey": true,
924
+ "notNull": true,
925
+ "default": "gen_random_uuid()"
926
+ },
927
+ "room_id": {
928
+ "name": "room_id",
929
+ "type": "uuid",
930
+ "primaryKey": false,
931
+ "notNull": true
932
+ },
933
+ "user_id": {
934
+ "name": "user_id",
935
+ "type": "uuid",
936
+ "primaryKey": false,
937
+ "notNull": true
938
+ },
939
+ "muted_by": {
940
+ "name": "muted_by",
941
+ "type": "uuid",
942
+ "primaryKey": false,
943
+ "notNull": true
944
+ },
945
+ "reason": {
946
+ "name": "reason",
947
+ "type": "text",
948
+ "primaryKey": false,
949
+ "notNull": true
950
+ },
951
+ "created_at": {
952
+ "name": "created_at",
953
+ "type": "timestamp with time zone",
954
+ "primaryKey": false,
955
+ "notNull": true,
956
+ "default": "now()"
957
+ },
958
+ "expires_at": {
959
+ "name": "expires_at",
960
+ "type": "timestamp with time zone",
961
+ "primaryKey": false,
962
+ "notNull": false
963
+ },
964
+ "lifted_at": {
965
+ "name": "lifted_at",
966
+ "type": "timestamp with time zone",
967
+ "primaryKey": false,
968
+ "notNull": false
969
+ },
970
+ "lifted_by": {
971
+ "name": "lifted_by",
972
+ "type": "uuid",
973
+ "primaryKey": false,
974
+ "notNull": false
975
+ }
976
+ },
977
+ "indexes": {
978
+ "chat_room_mute_active_room_user_key": {
979
+ "name": "chat_room_mute_active_room_user_key",
980
+ "columns": [
981
+ {
982
+ "expression": "room_id",
983
+ "isExpression": false,
984
+ "asc": true,
985
+ "nulls": "last"
986
+ },
987
+ {
988
+ "expression": "user_id",
989
+ "isExpression": false,
990
+ "asc": true,
991
+ "nulls": "last"
992
+ }
993
+ ],
994
+ "isUnique": true,
995
+ "where": "\"chat_room_mute\".\"lifted_at\" IS NULL",
996
+ "concurrently": false,
997
+ "method": "btree",
998
+ "with": {}
999
+ },
1000
+ "chat_room_mute_room_user_idx": {
1001
+ "name": "chat_room_mute_room_user_idx",
1002
+ "columns": [
1003
+ {
1004
+ "expression": "room_id",
1005
+ "isExpression": false,
1006
+ "asc": true,
1007
+ "nulls": "last"
1008
+ },
1009
+ {
1010
+ "expression": "user_id",
1011
+ "isExpression": false,
1012
+ "asc": true,
1013
+ "nulls": "last"
1014
+ }
1015
+ ],
1016
+ "isUnique": false,
1017
+ "concurrently": false,
1018
+ "method": "btree",
1019
+ "with": {}
1020
+ },
1021
+ "chat_room_mute_expires_at_idx": {
1022
+ "name": "chat_room_mute_expires_at_idx",
1023
+ "columns": [
1024
+ {
1025
+ "expression": "expires_at",
1026
+ "isExpression": false,
1027
+ "asc": true,
1028
+ "nulls": "last"
1029
+ }
1030
+ ],
1031
+ "isUnique": false,
1032
+ "concurrently": false,
1033
+ "method": "btree",
1034
+ "with": {}
1035
+ }
1036
+ },
1037
+ "foreignKeys": {
1038
+ "chat_room_mute_room_id_chat_room_id_fk": {
1039
+ "name": "chat_room_mute_room_id_chat_room_id_fk",
1040
+ "tableFrom": "chat_room_mute",
1041
+ "tableTo": "chat_room",
1042
+ "columnsFrom": ["room_id"],
1043
+ "columnsTo": ["id"],
1044
+ "onDelete": "cascade",
1045
+ "onUpdate": "no action"
1046
+ }
1047
+ },
1048
+ "compositePrimaryKeys": {},
1049
+ "uniqueConstraints": {},
1050
+ "policies": {},
1051
+ "checkConstraints": {},
1052
+ "isRLSEnabled": false
1053
+ },
1054
+ "public.chat_room_remove": {
1055
+ "name": "chat_room_remove",
1056
+ "schema": "",
1057
+ "columns": {
1058
+ "id": {
1059
+ "name": "id",
1060
+ "type": "uuid",
1061
+ "primaryKey": true,
1062
+ "notNull": true,
1063
+ "default": "gen_random_uuid()"
1064
+ },
1065
+ "room_id": {
1066
+ "name": "room_id",
1067
+ "type": "uuid",
1068
+ "primaryKey": false,
1069
+ "notNull": true
1070
+ },
1071
+ "user_id": {
1072
+ "name": "user_id",
1073
+ "type": "uuid",
1074
+ "primaryKey": false,
1075
+ "notNull": true
1076
+ },
1077
+ "removed_by": {
1078
+ "name": "removed_by",
1079
+ "type": "uuid",
1080
+ "primaryKey": false,
1081
+ "notNull": true
1082
+ },
1083
+ "reason": {
1084
+ "name": "reason",
1085
+ "type": "text",
1086
+ "primaryKey": false,
1087
+ "notNull": true
1088
+ },
1089
+ "created_at": {
1090
+ "name": "created_at",
1091
+ "type": "timestamp with time zone",
1092
+ "primaryKey": false,
1093
+ "notNull": true,
1094
+ "default": "now()"
1095
+ }
1096
+ },
1097
+ "indexes": {
1098
+ "chat_room_remove_room_created_at_idx": {
1099
+ "name": "chat_room_remove_room_created_at_idx",
1100
+ "columns": [
1101
+ {
1102
+ "expression": "room_id",
1103
+ "isExpression": false,
1104
+ "asc": true,
1105
+ "nulls": "last"
1106
+ },
1107
+ {
1108
+ "expression": "created_at",
1109
+ "isExpression": false,
1110
+ "asc": true,
1111
+ "nulls": "last"
1112
+ }
1113
+ ],
1114
+ "isUnique": false,
1115
+ "concurrently": false,
1116
+ "method": "btree",
1117
+ "with": {}
1118
+ },
1119
+ "chat_room_remove_user_idx": {
1120
+ "name": "chat_room_remove_user_idx",
1121
+ "columns": [
1122
+ {
1123
+ "expression": "user_id",
1124
+ "isExpression": false,
1125
+ "asc": true,
1126
+ "nulls": "last"
1127
+ }
1128
+ ],
1129
+ "isUnique": false,
1130
+ "concurrently": false,
1131
+ "method": "btree",
1132
+ "with": {}
1133
+ }
1134
+ },
1135
+ "foreignKeys": {
1136
+ "chat_room_remove_room_id_chat_room_id_fk": {
1137
+ "name": "chat_room_remove_room_id_chat_room_id_fk",
1138
+ "tableFrom": "chat_room_remove",
1139
+ "tableTo": "chat_room",
1140
+ "columnsFrom": ["room_id"],
1141
+ "columnsTo": ["id"],
1142
+ "onDelete": "cascade",
1143
+ "onUpdate": "no action"
1144
+ }
1145
+ },
1146
+ "compositePrimaryKeys": {},
1147
+ "uniqueConstraints": {},
1148
+ "policies": {},
1149
+ "checkConstraints": {},
1150
+ "isRLSEnabled": false
1151
+ },
1152
+ "public.chat_room_rule": {
1153
+ "name": "chat_room_rule",
1154
+ "schema": "",
1155
+ "columns": {
1156
+ "id": {
1157
+ "name": "id",
1158
+ "type": "uuid",
1159
+ "primaryKey": true,
1160
+ "notNull": true,
1161
+ "default": "gen_random_uuid()"
1162
+ },
1163
+ "room_id": {
1164
+ "name": "room_id",
1165
+ "type": "uuid",
1166
+ "primaryKey": false,
1167
+ "notNull": true
1168
+ },
1169
+ "created_by": {
1170
+ "name": "created_by",
1171
+ "type": "uuid",
1172
+ "primaryKey": false,
1173
+ "notNull": true
1174
+ },
1175
+ "order_num": {
1176
+ "name": "order_num",
1177
+ "type": "integer",
1178
+ "primaryKey": false,
1179
+ "notNull": true
1180
+ },
1181
+ "content": {
1182
+ "name": "content",
1183
+ "type": "text",
1184
+ "primaryKey": false,
1185
+ "notNull": true
1186
+ },
1187
+ "created_at": {
1188
+ "name": "created_at",
1189
+ "type": "timestamp with time zone",
1190
+ "primaryKey": false,
1191
+ "notNull": true,
1192
+ "default": "now()"
1193
+ },
1194
+ "updated_at": {
1195
+ "name": "updated_at",
1196
+ "type": "timestamp with time zone",
1197
+ "primaryKey": false,
1198
+ "notNull": true,
1199
+ "default": "now()"
1200
+ }
1201
+ },
1202
+ "indexes": {
1203
+ "chat_room_rule_room_order_idx": {
1204
+ "name": "chat_room_rule_room_order_idx",
1205
+ "columns": [
1206
+ {
1207
+ "expression": "room_id",
1208
+ "isExpression": false,
1209
+ "asc": true,
1210
+ "nulls": "last"
1211
+ },
1212
+ {
1213
+ "expression": "order_num",
1214
+ "isExpression": false,
1215
+ "asc": true,
1216
+ "nulls": "last"
1217
+ }
1218
+ ],
1219
+ "isUnique": false,
1220
+ "concurrently": false,
1221
+ "method": "btree",
1222
+ "with": {}
1223
+ },
1224
+ "chat_room_rule_room_idx": {
1225
+ "name": "chat_room_rule_room_idx",
1226
+ "columns": [
1227
+ {
1228
+ "expression": "room_id",
1229
+ "isExpression": false,
1230
+ "asc": true,
1231
+ "nulls": "last"
1232
+ }
1233
+ ],
1234
+ "isUnique": false,
1235
+ "concurrently": false,
1236
+ "method": "btree",
1237
+ "with": {}
1238
+ }
1239
+ },
1240
+ "foreignKeys": {
1241
+ "chat_room_rule_room_id_chat_room_id_fk": {
1242
+ "name": "chat_room_rule_room_id_chat_room_id_fk",
1243
+ "tableFrom": "chat_room_rule",
1244
+ "tableTo": "chat_room",
1245
+ "columnsFrom": ["room_id"],
1246
+ "columnsTo": ["id"],
1247
+ "onDelete": "cascade",
1248
+ "onUpdate": "no action"
1249
+ }
1250
+ },
1251
+ "compositePrimaryKeys": {},
1252
+ "uniqueConstraints": {},
1253
+ "policies": {},
1254
+ "checkConstraints": {},
1255
+ "isRLSEnabled": false
1256
+ },
1257
+ "public.chat_user_block": {
1258
+ "name": "chat_user_block",
1259
+ "schema": "",
1260
+ "columns": {
1261
+ "id": {
1262
+ "name": "id",
1263
+ "type": "uuid",
1264
+ "primaryKey": true,
1265
+ "notNull": true,
1266
+ "default": "gen_random_uuid()"
1267
+ },
1268
+ "blocker_id": {
1269
+ "name": "blocker_id",
1270
+ "type": "uuid",
1271
+ "primaryKey": false,
1272
+ "notNull": true
1273
+ },
1274
+ "blocked_id": {
1275
+ "name": "blocked_id",
1276
+ "type": "uuid",
1277
+ "primaryKey": false,
1278
+ "notNull": true
1279
+ },
1280
+ "created_at": {
1281
+ "name": "created_at",
1282
+ "type": "timestamp with time zone",
1283
+ "primaryKey": false,
1284
+ "notNull": true,
1285
+ "default": "now()"
1286
+ },
1287
+ "removed_at": {
1288
+ "name": "removed_at",
1289
+ "type": "timestamp with time zone",
1290
+ "primaryKey": false,
1291
+ "notNull": false
1292
+ }
1293
+ },
1294
+ "indexes": {
1295
+ "chat_user_block_pair_key": {
1296
+ "name": "chat_user_block_pair_key",
1297
+ "columns": [
1298
+ {
1299
+ "expression": "blocker_id",
1300
+ "isExpression": false,
1301
+ "asc": true,
1302
+ "nulls": "last"
1303
+ },
1304
+ {
1305
+ "expression": "blocked_id",
1306
+ "isExpression": false,
1307
+ "asc": true,
1308
+ "nulls": "last"
1309
+ }
1310
+ ],
1311
+ "isUnique": true,
1312
+ "where": "\"chat_user_block\".\"removed_at\" IS NULL",
1313
+ "concurrently": false,
1314
+ "method": "btree",
1315
+ "with": {}
1316
+ },
1317
+ "chat_user_block_blocker_idx": {
1318
+ "name": "chat_user_block_blocker_idx",
1319
+ "columns": [
1320
+ {
1321
+ "expression": "blocker_id",
1322
+ "isExpression": false,
1323
+ "asc": true,
1324
+ "nulls": "last"
1325
+ }
1326
+ ],
1327
+ "isUnique": false,
1328
+ "concurrently": false,
1329
+ "method": "btree",
1330
+ "with": {}
1331
+ }
1332
+ },
1333
+ "foreignKeys": {},
1334
+ "compositePrimaryKeys": {},
1335
+ "uniqueConstraints": {},
1336
+ "policies": {},
1337
+ "checkConstraints": {},
1338
+ "isRLSEnabled": false
1339
+ },
1340
+ "public.chat_user_ignore": {
1341
+ "name": "chat_user_ignore",
1342
+ "schema": "",
1343
+ "columns": {
1344
+ "id": {
1345
+ "name": "id",
1346
+ "type": "uuid",
1347
+ "primaryKey": true,
1348
+ "notNull": true,
1349
+ "default": "gen_random_uuid()"
1350
+ },
1351
+ "ignorer_id": {
1352
+ "name": "ignorer_id",
1353
+ "type": "uuid",
1354
+ "primaryKey": false,
1355
+ "notNull": true
1356
+ },
1357
+ "ignored_id": {
1358
+ "name": "ignored_id",
1359
+ "type": "uuid",
1360
+ "primaryKey": false,
1361
+ "notNull": true
1362
+ },
1363
+ "created_at": {
1364
+ "name": "created_at",
1365
+ "type": "timestamp with time zone",
1366
+ "primaryKey": false,
1367
+ "notNull": true,
1368
+ "default": "now()"
1369
+ },
1370
+ "removed_at": {
1371
+ "name": "removed_at",
1372
+ "type": "timestamp with time zone",
1373
+ "primaryKey": false,
1374
+ "notNull": false
1375
+ }
1376
+ },
1377
+ "indexes": {
1378
+ "chat_user_ignore_pair_key": {
1379
+ "name": "chat_user_ignore_pair_key",
1380
+ "columns": [
1381
+ {
1382
+ "expression": "ignorer_id",
1383
+ "isExpression": false,
1384
+ "asc": true,
1385
+ "nulls": "last"
1386
+ },
1387
+ {
1388
+ "expression": "ignored_id",
1389
+ "isExpression": false,
1390
+ "asc": true,
1391
+ "nulls": "last"
1392
+ }
1393
+ ],
1394
+ "isUnique": true,
1395
+ "where": "\"chat_user_ignore\".\"removed_at\" IS NULL",
1396
+ "concurrently": false,
1397
+ "method": "btree",
1398
+ "with": {}
1399
+ },
1400
+ "chat_user_ignore_ignorer_idx": {
1401
+ "name": "chat_user_ignore_ignorer_idx",
1402
+ "columns": [
1403
+ {
1404
+ "expression": "ignorer_id",
1405
+ "isExpression": false,
1406
+ "asc": true,
1407
+ "nulls": "last"
1408
+ }
1409
+ ],
1410
+ "isUnique": false,
1411
+ "concurrently": false,
1412
+ "method": "btree",
1413
+ "with": {}
1414
+ }
1415
+ },
1416
+ "foreignKeys": {},
1417
+ "compositePrimaryKeys": {},
1418
+ "uniqueConstraints": {},
1419
+ "policies": {},
1420
+ "checkConstraints": {},
1421
+ "isRLSEnabled": false
1422
+ }
1423
+ },
1424
+ "enums": {
1425
+ "public.chat_message_type": {
1426
+ "name": "chat_message_type",
1427
+ "schema": "public",
1428
+ "values": ["user", "system"]
1429
+ },
1430
+ "public.chat_moderation_scope": {
1431
+ "name": "chat_moderation_scope",
1432
+ "schema": "public",
1433
+ "values": ["__global", "__all_public", "__all", "room"]
1434
+ },
1435
+ "public.chat_room_category": {
1436
+ "name": "chat_room_category",
1437
+ "schema": "public",
1438
+ "values": ["games-sports", "regions", "languages", "private-channels"]
1439
+ },
1440
+ "public.chat_room_role": {
1441
+ "name": "chat_room_role",
1442
+ "schema": "public",
1443
+ "values": ["member", "moderator", "owner"]
1444
+ }
1445
+ },
1446
+ "schemas": {},
1447
+ "sequences": {},
1448
+ "roles": {},
1449
+ "policies": {},
1450
+ "views": {},
1451
+ "_meta": {
1452
+ "columns": {},
1453
+ "schemas": {},
1454
+ "tables": {}
1455
+ }
1456
+ }