@happyvertical/smrt-comments 0.57.1 → 0.57.3

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 (50) hide show
  1. package/README.md +72 -0
  2. package/dist/chunks/participation-LA_cfrM2.js +276 -0
  3. package/dist/chunks/participation-LA_cfrM2.js.map +1 -0
  4. package/dist/collections/CommentReportCollection.d.ts +6 -0
  5. package/dist/collections/CommentReportCollection.d.ts.map +1 -0
  6. package/dist/collections/CommentRevisionCollection.d.ts +6 -0
  7. package/dist/collections/CommentRevisionCollection.d.ts.map +1 -0
  8. package/dist/collections/ParticipationCollection.d.ts +14 -0
  9. package/dist/collections/ParticipationCollection.d.ts.map +1 -0
  10. package/dist/index.d.ts +10 -0
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +364 -59
  13. package/dist/index.js.map +1 -1
  14. package/dist/manifest.json +1853 -224
  15. package/dist/models/Comment.d.ts +8 -1
  16. package/dist/models/Comment.d.ts.map +1 -1
  17. package/dist/models/CommentReport.d.ts +10 -0
  18. package/dist/models/CommentReport.d.ts.map +1 -0
  19. package/dist/models/CommentRevision.d.ts +9 -0
  20. package/dist/models/CommentRevision.d.ts.map +1 -0
  21. package/dist/models/ParticipationBan.d.ts +12 -0
  22. package/dist/models/ParticipationBan.d.ts.map +1 -0
  23. package/dist/models/ParticipationPolicy.d.ts +13 -0
  24. package/dist/models/ParticipationPolicy.d.ts.map +1 -0
  25. package/dist/models/ParticipationRateBucket.d.ts +8 -0
  26. package/dist/models/ParticipationRateBucket.d.ts.map +1 -0
  27. package/dist/participation-contract.d.ts +37 -0
  28. package/dist/participation-contract.d.ts.map +1 -0
  29. package/dist/participation.d.ts +4 -0
  30. package/dist/participation.d.ts.map +1 -0
  31. package/dist/participation.js +2 -0
  32. package/dist/recipes.d.ts +6 -1
  33. package/dist/recipes.d.ts.map +1 -1
  34. package/dist/services/CommentService.d.ts +10 -1
  35. package/dist/services/CommentService.d.ts.map +1 -1
  36. package/dist/services/ParticipationService.d.ts +25 -0
  37. package/dist/services/ParticipationService.d.ts.map +1 -0
  38. package/dist/smrt-knowledge.json +477 -12
  39. package/dist/svelte/ModerationQueue.svelte +60 -0
  40. package/dist/svelte/ModerationQueue.svelte.d.ts +17 -0
  41. package/dist/svelte/ModerationQueue.svelte.d.ts.map +1 -0
  42. package/dist/svelte/RecordComments.svelte +21 -6
  43. package/dist/svelte/RecordComments.svelte.d.ts +2 -0
  44. package/dist/svelte/RecordComments.svelte.d.ts.map +1 -1
  45. package/dist/svelte/index.d.ts +2 -0
  46. package/dist/svelte/index.d.ts.map +1 -1
  47. package/dist/svelte/index.js +1 -0
  48. package/dist/types.d.ts +7 -1
  49. package/dist/types.d.ts.map +1 -1
  50. package/package.json +9 -5
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-comments",
5
- "packageVersion": "0.57.1",
5
+ "packageVersion": "0.57.3",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-comments:CommentCollection": {
8
8
  "name": "commentcollection",
@@ -45,7 +45,7 @@
45
45
  "collectionExportName": "CommentCollectionCollection",
46
46
  "schema": {
47
47
  "tableName": "record_comments",
48
- "ddl": "CREATE TABLE IF NOT EXISTS \"record_comments\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"meta_type\" TEXT NOT NULL,\n \"meta_id\" TEXT NOT NULL,\n \"role\" TEXT NOT NULL,\n \"sort_order\" INTEGER DEFAULT 0,\n \"tenant_id\" UUID NOT NULL,\n \"author_user_id\" UUID NOT NULL,\n \"body\" TEXT NOT NULL,\n \"mentions\" TEXT,\n \"idempotency_key\" TEXT,\n \"retry_tenant_id\" TEXT,\n \"request_digest\" TEXT\n);",
48
+ "ddl": "CREATE TABLE IF NOT EXISTS \"record_comments\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"meta_type\" TEXT NOT NULL,\n \"meta_id\" TEXT NOT NULL,\n \"role\" TEXT NOT NULL,\n \"sort_order\" INTEGER DEFAULT 0,\n \"tenant_id\" UUID NOT NULL,\n \"author_user_id\" UUID NOT NULL,\n \"body\" TEXT NOT NULL,\n \"mentions\" TEXT,\n \"idempotency_key\" TEXT,\n \"retry_tenant_id\" TEXT,\n \"request_digest\" TEXT,\n \"parent_comment_id\" UUID,\n \"status\" TEXT NOT NULL DEFAULT 'visible',\n \"participation_snapshot\" TEXT,\n \"edited_at\" TIMESTAMP\n);",
49
49
  "columns": {
50
50
  "id": {
51
51
  "type": "UUID",
@@ -129,11 +129,1814 @@
129
129
  "type": "TEXT",
130
130
  "notNull": false,
131
131
  "unique": false
132
+ },
133
+ "parent_comment_id": {
134
+ "type": "UUID",
135
+ "referenceKind": "foreignKey",
136
+ "notNull": false,
137
+ "unique": false
138
+ },
139
+ "status": {
140
+ "type": "TEXT",
141
+ "notNull": true,
142
+ "unique": false,
143
+ "default": "visible"
144
+ },
145
+ "participation_snapshot": {
146
+ "type": "TEXT",
147
+ "notNull": false,
148
+ "unique": false
149
+ },
150
+ "edited_at": {
151
+ "type": "TIMESTAMP",
152
+ "notNull": false,
153
+ "unique": false
154
+ }
155
+ },
156
+ "indexes": [
157
+ {
158
+ "name": "record_comments_slug_context_idx",
159
+ "columns": [
160
+ "tenant_id",
161
+ "slug",
162
+ "context"
163
+ ],
164
+ "unique": true
165
+ },
166
+ {
167
+ "name": "record_comments_tenant_request_key",
168
+ "columns": [
169
+ "retry_tenant_id",
170
+ "idempotency_key"
171
+ ],
172
+ "unique": true
173
+ },
174
+ {
175
+ "name": "record_comments_record_created_idx",
176
+ "columns": [
177
+ "tenant_id",
178
+ "meta_type",
179
+ "meta_id",
180
+ "created_at"
181
+ ]
182
+ },
183
+ {
184
+ "name": "record_comments_parent_created_idx",
185
+ "columns": [
186
+ "tenant_id",
187
+ "parent_comment_id",
188
+ "created_at"
189
+ ]
190
+ },
191
+ {
192
+ "name": "record_comments_moderation_idx",
193
+ "columns": [
194
+ "tenant_id",
195
+ "status",
196
+ "created_at"
197
+ ]
198
+ },
199
+ {
200
+ "name": "record_comments_tenant_id_created_at_idx",
201
+ "columns": [
202
+ "tenant_id",
203
+ "created_at"
204
+ ]
205
+ },
206
+ {
207
+ "name": "record_comments_meta_type_meta_id_idx",
208
+ "columns": [
209
+ "meta_type",
210
+ "meta_id"
211
+ ]
212
+ },
213
+ {
214
+ "name": "record_comments_author_user_id_idx",
215
+ "columns": [
216
+ "author_user_id"
217
+ ]
218
+ },
219
+ {
220
+ "name": "record_comments_parent_comment_id_idx",
221
+ "columns": [
222
+ "parent_comment_id"
223
+ ]
224
+ }
225
+ ],
226
+ "version": "35c502ab"
227
+ },
228
+ "importPath": "@happyvertical/smrt-comments"
229
+ },
230
+ "@happyvertical/smrt-comments:CommentReportCollection": {
231
+ "name": "commentreportcollection",
232
+ "className": "CommentReportCollection",
233
+ "qualifiedName": "@happyvertical/smrt-comments:CommentReportCollection",
234
+ "collection": "commentreports",
235
+ "filePath": "/home/runner/work/smrt/smrt/packages/comments/src/collections/CommentReportCollection.ts",
236
+ "packageName": "@happyvertical/smrt-comments",
237
+ "fields": {},
238
+ "methods": {},
239
+ "decoratorConfig": {
240
+ "tableName": "comment_reports",
241
+ "api": false,
242
+ "mcp": false,
243
+ "cli": false
244
+ },
245
+ "extends": "SmrtCollection",
246
+ "extendsTypeArg": "CommentReport",
247
+ "exportName": "CommentReportCollection",
248
+ "collectionExportName": "CommentReportCollectionCollection",
249
+ "schema": {
250
+ "tableName": "comment_reports",
251
+ "ddl": "CREATE TABLE IF NOT EXISTS \"comment_reports\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"comment_id\" UUID NOT NULL,\n \"reporter_user_id\" UUID NOT NULL,\n \"reason\" TEXT NOT NULL,\n \"status\" TEXT NOT NULL DEFAULT 'open'\n);",
252
+ "columns": {
253
+ "id": {
254
+ "type": "UUID",
255
+ "primaryKey": true,
256
+ "referenceKind": "id",
257
+ "notNull": true
258
+ },
259
+ "slug": {
260
+ "type": "TEXT",
261
+ "notNull": true
262
+ },
263
+ "context": {
264
+ "type": "TEXT",
265
+ "notNull": true,
266
+ "default": ""
267
+ },
268
+ "created_at": {
269
+ "type": "TIMESTAMP",
270
+ "notNull": true,
271
+ "default": "current_timestamp"
272
+ },
273
+ "updated_at": {
274
+ "type": "TIMESTAMP",
275
+ "notNull": true,
276
+ "default": "current_timestamp"
277
+ },
278
+ "tenant_id": {
279
+ "type": "UUID",
280
+ "referenceKind": "tenantId",
281
+ "notNull": true,
282
+ "unique": false
283
+ },
284
+ "comment_id": {
285
+ "type": "UUID",
286
+ "referenceKind": "foreignKey",
287
+ "notNull": true,
288
+ "unique": false
289
+ },
290
+ "reporter_user_id": {
291
+ "type": "UUID",
292
+ "referenceKind": "crossPackageRef",
293
+ "notNull": true,
294
+ "unique": false
295
+ },
296
+ "reason": {
297
+ "type": "TEXT",
298
+ "notNull": true,
299
+ "unique": false
300
+ },
301
+ "status": {
302
+ "type": "TEXT",
303
+ "notNull": true,
304
+ "unique": false,
305
+ "default": "open"
306
+ }
307
+ },
308
+ "indexes": [
309
+ {
310
+ "name": "comment_reports_slug_context_idx",
311
+ "columns": [
312
+ "tenant_id",
313
+ "slug",
314
+ "context"
315
+ ],
316
+ "unique": true
317
+ },
318
+ {
319
+ "name": "comment_reports_actor_target_unique",
320
+ "columns": [
321
+ "tenant_id",
322
+ "reporter_user_id",
323
+ "comment_id"
324
+ ],
325
+ "unique": true
326
+ },
327
+ {
328
+ "name": "comment_reports_queue_idx",
329
+ "columns": [
330
+ "tenant_id",
331
+ "status",
332
+ "created_at"
333
+ ]
334
+ },
335
+ {
336
+ "name": "comment_reports_tenant_id_created_at_idx",
337
+ "columns": [
338
+ "tenant_id",
339
+ "created_at"
340
+ ]
341
+ },
342
+ {
343
+ "name": "comment_reports_comment_id_idx",
344
+ "columns": [
345
+ "comment_id"
346
+ ]
347
+ },
348
+ {
349
+ "name": "comment_reports_reporter_user_id_idx",
350
+ "columns": [
351
+ "reporter_user_id"
352
+ ]
353
+ }
354
+ ],
355
+ "version": "001951c2"
356
+ },
357
+ "importPath": "@happyvertical/smrt-comments"
358
+ },
359
+ "@happyvertical/smrt-comments:CommentRevisionCollection": {
360
+ "name": "commentrevisioncollection",
361
+ "className": "CommentRevisionCollection",
362
+ "qualifiedName": "@happyvertical/smrt-comments:CommentRevisionCollection",
363
+ "collection": "commentrevisions",
364
+ "filePath": "/home/runner/work/smrt/smrt/packages/comments/src/collections/CommentRevisionCollection.ts",
365
+ "packageName": "@happyvertical/smrt-comments",
366
+ "fields": {},
367
+ "methods": {},
368
+ "decoratorConfig": {
369
+ "tableName": "comment_revisions",
370
+ "api": false,
371
+ "mcp": false,
372
+ "cli": false
373
+ },
374
+ "extends": "SmrtCollection",
375
+ "extendsTypeArg": "CommentRevision",
376
+ "exportName": "CommentRevisionCollection",
377
+ "collectionExportName": "CommentRevisionCollectionCollection",
378
+ "schema": {
379
+ "tableName": "comment_revisions",
380
+ "ddl": "CREATE TABLE IF NOT EXISTS \"comment_revisions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"comment_id\" UUID NOT NULL,\n \"editor_user_id\" UUID NOT NULL,\n \"body\" TEXT NOT NULL\n);",
381
+ "columns": {
382
+ "id": {
383
+ "type": "UUID",
384
+ "primaryKey": true,
385
+ "referenceKind": "id",
386
+ "notNull": true
387
+ },
388
+ "slug": {
389
+ "type": "TEXT",
390
+ "notNull": true
391
+ },
392
+ "context": {
393
+ "type": "TEXT",
394
+ "notNull": true,
395
+ "default": ""
396
+ },
397
+ "created_at": {
398
+ "type": "TIMESTAMP",
399
+ "notNull": true,
400
+ "default": "current_timestamp"
401
+ },
402
+ "updated_at": {
403
+ "type": "TIMESTAMP",
404
+ "notNull": true,
405
+ "default": "current_timestamp"
406
+ },
407
+ "tenant_id": {
408
+ "type": "UUID",
409
+ "referenceKind": "tenantId",
410
+ "notNull": true,
411
+ "unique": false
412
+ },
413
+ "comment_id": {
414
+ "type": "UUID",
415
+ "referenceKind": "foreignKey",
416
+ "notNull": true,
417
+ "unique": false
418
+ },
419
+ "editor_user_id": {
420
+ "type": "UUID",
421
+ "referenceKind": "crossPackageRef",
422
+ "notNull": true,
423
+ "unique": false
424
+ },
425
+ "body": {
426
+ "type": "TEXT",
427
+ "notNull": true,
428
+ "unique": false
429
+ }
430
+ },
431
+ "indexes": [
432
+ {
433
+ "name": "comment_revisions_slug_context_idx",
434
+ "columns": [
435
+ "tenant_id",
436
+ "slug",
437
+ "context"
438
+ ],
439
+ "unique": true
440
+ },
441
+ {
442
+ "name": "comment_revisions_tenant_id_created_at_idx",
443
+ "columns": [
444
+ "tenant_id",
445
+ "created_at"
446
+ ]
447
+ },
448
+ {
449
+ "name": "comment_revisions_comment_id_idx",
450
+ "columns": [
451
+ "comment_id"
452
+ ]
453
+ },
454
+ {
455
+ "name": "comment_revisions_editor_user_id_idx",
456
+ "columns": [
457
+ "editor_user_id"
458
+ ]
459
+ }
460
+ ],
461
+ "version": "69ea301e"
462
+ },
463
+ "importPath": "@happyvertical/smrt-comments"
464
+ },
465
+ "@happyvertical/smrt-comments:ParticipationPolicyCollection": {
466
+ "name": "participationpolicycollection",
467
+ "className": "ParticipationPolicyCollection",
468
+ "qualifiedName": "@happyvertical/smrt-comments:ParticipationPolicyCollection",
469
+ "collection": "participationpolicies",
470
+ "filePath": "/home/runner/work/smrt/smrt/packages/comments/src/collections/ParticipationCollection.ts",
471
+ "packageName": "@happyvertical/smrt-comments",
472
+ "fields": {},
473
+ "methods": {},
474
+ "decoratorConfig": {
475
+ "tableName": "participation_policies",
476
+ "api": false,
477
+ "mcp": false,
478
+ "cli": false
479
+ },
480
+ "extends": "SmrtCollection",
481
+ "extendsTypeArg": "ParticipationPolicy",
482
+ "exportName": "ParticipationPolicyCollection",
483
+ "collectionExportName": "ParticipationPolicyCollectionCollection",
484
+ "schema": {
485
+ "tableName": "participation_policies",
486
+ "ddl": "CREATE TABLE IF NOT EXISTS \"participation_policies\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"record_type\" TEXT,\n \"record_id\" TEXT,\n \"action\" TEXT NOT NULL,\n \"moderation_mode\" TEXT NOT NULL DEFAULT 'open',\n \"max_actions\" INTEGER NOT NULL DEFAULT 0,\n \"window_seconds\" INTEGER NOT NULL DEFAULT 0\n);",
487
+ "columns": {
488
+ "id": {
489
+ "type": "UUID",
490
+ "primaryKey": true,
491
+ "referenceKind": "id",
492
+ "notNull": true
493
+ },
494
+ "slug": {
495
+ "type": "TEXT",
496
+ "notNull": true
497
+ },
498
+ "context": {
499
+ "type": "TEXT",
500
+ "notNull": true,
501
+ "default": ""
502
+ },
503
+ "created_at": {
504
+ "type": "TIMESTAMP",
505
+ "notNull": true,
506
+ "default": "current_timestamp"
507
+ },
508
+ "updated_at": {
509
+ "type": "TIMESTAMP",
510
+ "notNull": true,
511
+ "default": "current_timestamp"
512
+ },
513
+ "tenant_id": {
514
+ "type": "UUID",
515
+ "referenceKind": "tenantId",
516
+ "notNull": true,
517
+ "unique": false
518
+ },
519
+ "record_type": {
520
+ "type": "TEXT",
521
+ "notNull": false,
522
+ "unique": false
523
+ },
524
+ "record_id": {
525
+ "type": "TEXT",
526
+ "notNull": false,
527
+ "unique": false
528
+ },
529
+ "action": {
530
+ "type": "TEXT",
531
+ "notNull": true,
532
+ "unique": false
533
+ },
534
+ "moderation_mode": {
535
+ "type": "TEXT",
536
+ "notNull": true,
537
+ "unique": false,
538
+ "default": "open"
539
+ },
540
+ "max_actions": {
541
+ "type": "INTEGER",
542
+ "notNull": true,
543
+ "unique": false,
544
+ "default": 0
545
+ },
546
+ "window_seconds": {
547
+ "type": "INTEGER",
548
+ "notNull": true,
549
+ "unique": false,
550
+ "default": 0
551
+ }
552
+ },
553
+ "indexes": [
554
+ {
555
+ "name": "participation_policies_slug_context_idx",
556
+ "columns": [
557
+ "tenant_id",
558
+ "slug",
559
+ "context"
560
+ ],
561
+ "unique": true
562
+ },
563
+ {
564
+ "name": "participation_policies_tenant_id_created_at_idx",
565
+ "columns": [
566
+ "tenant_id",
567
+ "created_at"
568
+ ]
569
+ }
570
+ ],
571
+ "version": "7f2fdd9d"
572
+ },
573
+ "importPath": "@happyvertical/smrt-comments"
574
+ },
575
+ "@happyvertical/smrt-comments:ParticipationBanCollection": {
576
+ "name": "participationbancollection",
577
+ "className": "ParticipationBanCollection",
578
+ "qualifiedName": "@happyvertical/smrt-comments:ParticipationBanCollection",
579
+ "collection": "participationbans",
580
+ "filePath": "/home/runner/work/smrt/smrt/packages/comments/src/collections/ParticipationCollection.ts",
581
+ "packageName": "@happyvertical/smrt-comments",
582
+ "fields": {},
583
+ "methods": {},
584
+ "decoratorConfig": {
585
+ "tableName": "participation_bans",
586
+ "api": false,
587
+ "mcp": false,
588
+ "cli": false
589
+ },
590
+ "extends": "SmrtCollection",
591
+ "extendsTypeArg": "ParticipationBan",
592
+ "exportName": "ParticipationBanCollection",
593
+ "collectionExportName": "ParticipationBanCollectionCollection",
594
+ "schema": {
595
+ "tableName": "participation_bans",
596
+ "ddl": "CREATE TABLE IF NOT EXISTS \"participation_bans\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"actor_user_id\" TEXT NOT NULL,\n \"record_type\" TEXT,\n \"record_id\" TEXT,\n \"reason\" TEXT NOT NULL,\n \"expires_at\" TIMESTAMP\n);",
597
+ "columns": {
598
+ "id": {
599
+ "type": "UUID",
600
+ "primaryKey": true,
601
+ "referenceKind": "id",
602
+ "notNull": true
603
+ },
604
+ "slug": {
605
+ "type": "TEXT",
606
+ "notNull": true
607
+ },
608
+ "context": {
609
+ "type": "TEXT",
610
+ "notNull": true,
611
+ "default": ""
612
+ },
613
+ "created_at": {
614
+ "type": "TIMESTAMP",
615
+ "notNull": true,
616
+ "default": "current_timestamp"
617
+ },
618
+ "updated_at": {
619
+ "type": "TIMESTAMP",
620
+ "notNull": true,
621
+ "default": "current_timestamp"
622
+ },
623
+ "tenant_id": {
624
+ "type": "UUID",
625
+ "referenceKind": "tenantId",
626
+ "notNull": true,
627
+ "unique": false
628
+ },
629
+ "actor_user_id": {
630
+ "type": "TEXT",
631
+ "notNull": true,
632
+ "unique": false
633
+ },
634
+ "record_type": {
635
+ "type": "TEXT",
636
+ "notNull": false,
637
+ "unique": false
638
+ },
639
+ "record_id": {
640
+ "type": "TEXT",
641
+ "notNull": false,
642
+ "unique": false
643
+ },
644
+ "reason": {
645
+ "type": "TEXT",
646
+ "notNull": true,
647
+ "unique": false
648
+ },
649
+ "expires_at": {
650
+ "type": "TIMESTAMP",
651
+ "notNull": false,
652
+ "unique": false
653
+ }
654
+ },
655
+ "indexes": [
656
+ {
657
+ "name": "participation_bans_slug_context_idx",
658
+ "columns": [
659
+ "tenant_id",
660
+ "slug",
661
+ "context"
662
+ ],
663
+ "unique": true
664
+ },
665
+ {
666
+ "name": "participation_bans_tenant_id_created_at_idx",
667
+ "columns": [
668
+ "tenant_id",
669
+ "created_at"
670
+ ]
671
+ }
672
+ ],
673
+ "version": "27bbfb94"
674
+ },
675
+ "importPath": "@happyvertical/smrt-comments"
676
+ },
677
+ "@happyvertical/smrt-comments:ParticipationRateBucketCollection": {
678
+ "name": "participationratebucketcollection",
679
+ "className": "ParticipationRateBucketCollection",
680
+ "qualifiedName": "@happyvertical/smrt-comments:ParticipationRateBucketCollection",
681
+ "collection": "participationratebuckets",
682
+ "filePath": "/home/runner/work/smrt/smrt/packages/comments/src/collections/ParticipationCollection.ts",
683
+ "packageName": "@happyvertical/smrt-comments",
684
+ "fields": {},
685
+ "methods": {},
686
+ "decoratorConfig": {
687
+ "tableName": "participation_rate_buckets",
688
+ "api": false,
689
+ "mcp": false,
690
+ "cli": false
691
+ },
692
+ "extends": "SmrtCollection",
693
+ "extendsTypeArg": "ParticipationRateBucket",
694
+ "exportName": "ParticipationRateBucketCollection",
695
+ "collectionExportName": "ParticipationRateBucketCollectionCollection",
696
+ "schema": {
697
+ "tableName": "participation_rate_buckets",
698
+ "ddl": "CREATE TABLE IF NOT EXISTS \"participation_rate_buckets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"bucket_key\" TEXT NOT NULL,\n \"action_count\" INTEGER NOT NULL DEFAULT 0\n);",
699
+ "columns": {
700
+ "id": {
701
+ "type": "UUID",
702
+ "primaryKey": true,
703
+ "referenceKind": "id",
704
+ "notNull": true
705
+ },
706
+ "slug": {
707
+ "type": "TEXT",
708
+ "notNull": true
709
+ },
710
+ "context": {
711
+ "type": "TEXT",
712
+ "notNull": true,
713
+ "default": ""
714
+ },
715
+ "created_at": {
716
+ "type": "TIMESTAMP",
717
+ "notNull": true,
718
+ "default": "current_timestamp"
719
+ },
720
+ "updated_at": {
721
+ "type": "TIMESTAMP",
722
+ "notNull": true,
723
+ "default": "current_timestamp"
724
+ },
725
+ "tenant_id": {
726
+ "type": "UUID",
727
+ "referenceKind": "tenantId",
728
+ "notNull": true,
729
+ "unique": false
730
+ },
731
+ "bucket_key": {
732
+ "type": "TEXT",
733
+ "notNull": true,
734
+ "unique": false
735
+ },
736
+ "action_count": {
737
+ "type": "INTEGER",
738
+ "notNull": true,
739
+ "unique": false,
740
+ "default": 0
741
+ }
742
+ },
743
+ "indexes": [
744
+ {
745
+ "name": "participation_rate_buckets_slug_context_idx",
746
+ "columns": [
747
+ "tenant_id",
748
+ "slug",
749
+ "context"
750
+ ],
751
+ "unique": true
752
+ },
753
+ {
754
+ "name": "participation_rate_bucket_unique",
755
+ "columns": [
756
+ "tenant_id",
757
+ "bucket_key"
758
+ ],
759
+ "unique": true
760
+ },
761
+ {
762
+ "name": "participation_rate_buckets_tenant_id_created_at_idx",
763
+ "columns": [
764
+ "tenant_id",
765
+ "created_at"
766
+ ]
767
+ }
768
+ ],
769
+ "version": "9f3707e0"
770
+ },
771
+ "importPath": "@happyvertical/smrt-comments"
772
+ },
773
+ "@happyvertical/smrt-comments:Comment": {
774
+ "name": "comment",
775
+ "className": "Comment",
776
+ "qualifiedName": "@happyvertical/smrt-comments:Comment",
777
+ "collection": "comments",
778
+ "filePath": "/home/runner/work/smrt/smrt/packages/comments/src/models/Comment.ts",
779
+ "packageName": "@happyvertical/smrt-comments",
780
+ "fields": {
781
+ "metaType": {
782
+ "type": "text",
783
+ "required": true,
784
+ "_meta": {
785
+ "required": true
786
+ }
787
+ },
788
+ "metaId": {
789
+ "type": "text",
790
+ "required": true,
791
+ "_meta": {
792
+ "required": true
793
+ }
794
+ },
795
+ "role": {
796
+ "type": "text",
797
+ "required": true,
798
+ "_meta": {
799
+ "required": true
800
+ }
801
+ },
802
+ "sortOrder": {
803
+ "type": "integer",
804
+ "required": false,
805
+ "default": 0
806
+ },
807
+ "tenantId": {
808
+ "type": "text",
809
+ "required": true,
810
+ "_meta": {
811
+ "sqlType": "UUID",
812
+ "__tenancy": {
813
+ "isTenantIdField": true,
814
+ "autoFilter": true,
815
+ "required": true,
816
+ "autoPopulate": true,
817
+ "nullable": false,
818
+ "mode": "required",
819
+ "field": "tenantId",
820
+ "allowSuperAdminBypass": false
821
+ }
822
+ }
823
+ },
824
+ "authorUserId": {
825
+ "type": "crossPackageRef",
826
+ "required": true,
827
+ "related": "@happyvertical/smrt-users:User"
828
+ },
829
+ "body": {
830
+ "type": "text",
831
+ "required": true,
832
+ "_meta": {
833
+ "required": true
834
+ }
835
+ },
836
+ "mentions": {
837
+ "type": "text",
838
+ "required": false
839
+ },
840
+ "idempotencyKey": {
841
+ "type": "text",
842
+ "required": false,
843
+ "_meta": {
844
+ "nullable": true,
845
+ "readonly": true
846
+ },
847
+ "readonly": true
848
+ },
849
+ "retryTenantId": {
850
+ "type": "text",
851
+ "required": false,
852
+ "_meta": {
853
+ "nullable": true,
854
+ "readonly": true
855
+ },
856
+ "readonly": true
857
+ },
858
+ "requestDigest": {
859
+ "type": "text",
860
+ "required": false,
861
+ "_meta": {
862
+ "nullable": true,
863
+ "readonly": true
864
+ },
865
+ "readonly": true
866
+ },
867
+ "parentCommentId": {
868
+ "type": "foreignKey",
869
+ "required": false,
870
+ "related": "Comment",
871
+ "_meta": {
872
+ "nullable": true,
873
+ "constraint": false
874
+ }
875
+ },
876
+ "status": {
877
+ "type": "text",
878
+ "required": true,
879
+ "default": "visible",
880
+ "_meta": {
881
+ "required": true
882
+ },
883
+ "enum": [
884
+ "visible",
885
+ "hidden",
886
+ "pending",
887
+ "deleted"
888
+ ]
889
+ },
890
+ "participationSnapshot": {
891
+ "type": "text",
892
+ "required": false,
893
+ "_meta": {
894
+ "nullable": true,
895
+ "readonly": true
896
+ },
897
+ "readonly": true
898
+ },
899
+ "editedAt": {
900
+ "type": "datetime",
901
+ "required": false,
902
+ "_meta": {
903
+ "nullable": true,
904
+ "readonly": true
905
+ },
906
+ "readonly": true
907
+ }
908
+ },
909
+ "methods": {
910
+ "hydrate": {
911
+ "name": "hydrate",
912
+ "async": true,
913
+ "parameters": [],
914
+ "returnType": "Promise<T | null>",
915
+ "isStatic": false,
916
+ "isPublic": true
917
+ }
918
+ },
919
+ "decoratorConfig": {
920
+ "tableName": "record_comments",
921
+ "api": false,
922
+ "mcp": false,
923
+ "cli": false,
924
+ "indexes": [
925
+ {
926
+ "name": "record_comments_tenant_request_key",
927
+ "columns": [
928
+ "retryTenantId",
929
+ "idempotencyKey"
930
+ ],
931
+ "unique": true
932
+ },
933
+ {
934
+ "name": "record_comments_record_created_idx",
935
+ "columns": [
936
+ "tenantId",
937
+ "metaType",
938
+ "metaId",
939
+ "createdAt"
940
+ ]
941
+ },
942
+ {
943
+ "name": "record_comments_parent_created_idx",
944
+ "columns": [
945
+ "tenantId",
946
+ "parentCommentId",
947
+ "createdAt"
948
+ ]
949
+ },
950
+ {
951
+ "name": "record_comments_moderation_idx",
952
+ "columns": [
953
+ "tenantId",
954
+ "status",
955
+ "createdAt"
956
+ ]
957
+ }
958
+ ],
959
+ "tenantScoped": {
960
+ "mode": "required"
961
+ },
962
+ "conflictColumns": [
963
+ "tenant_id",
964
+ "slug",
965
+ "context"
966
+ ]
967
+ },
968
+ "extends": "SmrtPolymorphicAssociation",
969
+ "exportName": "Comment",
970
+ "collectionExportName": "CommentCollection",
971
+ "validationRules": [
972
+ {
973
+ "field": "metaType",
974
+ "rule": "required",
975
+ "fieldType": "text"
976
+ },
977
+ {
978
+ "field": "metaId",
979
+ "rule": "required",
980
+ "fieldType": "text"
981
+ },
982
+ {
983
+ "field": "role",
984
+ "rule": "required",
985
+ "fieldType": "text"
986
+ },
987
+ {
988
+ "field": "authorUserId",
989
+ "rule": "required",
990
+ "fieldType": "crossPackageRef"
991
+ },
992
+ {
993
+ "field": "body",
994
+ "rule": "required",
995
+ "fieldType": "text"
996
+ },
997
+ {
998
+ "field": "status",
999
+ "rule": "required",
1000
+ "fieldType": "text"
1001
+ }
1002
+ ],
1003
+ "schema": {
1004
+ "tableName": "record_comments",
1005
+ "ddl": "CREATE TABLE IF NOT EXISTS \"record_comments\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"meta_type\" TEXT NOT NULL,\n \"meta_id\" TEXT NOT NULL,\n \"role\" TEXT NOT NULL,\n \"sort_order\" INTEGER DEFAULT 0,\n \"tenant_id\" UUID NOT NULL,\n \"author_user_id\" UUID NOT NULL,\n \"body\" TEXT NOT NULL,\n \"mentions\" TEXT,\n \"idempotency_key\" TEXT,\n \"retry_tenant_id\" TEXT,\n \"request_digest\" TEXT,\n \"parent_comment_id\" UUID,\n \"status\" TEXT NOT NULL DEFAULT 'visible',\n \"participation_snapshot\" TEXT,\n \"edited_at\" TIMESTAMP\n);",
1006
+ "columns": {
1007
+ "id": {
1008
+ "type": "UUID",
1009
+ "primaryKey": true,
1010
+ "referenceKind": "id",
1011
+ "notNull": true
1012
+ },
1013
+ "slug": {
1014
+ "type": "TEXT",
1015
+ "notNull": true
1016
+ },
1017
+ "context": {
1018
+ "type": "TEXT",
1019
+ "notNull": true,
1020
+ "default": ""
1021
+ },
1022
+ "created_at": {
1023
+ "type": "TIMESTAMP",
1024
+ "notNull": true,
1025
+ "default": "current_timestamp"
1026
+ },
1027
+ "updated_at": {
1028
+ "type": "TIMESTAMP",
1029
+ "notNull": true,
1030
+ "default": "current_timestamp"
1031
+ },
1032
+ "meta_type": {
1033
+ "type": "TEXT",
1034
+ "notNull": true,
1035
+ "unique": false
1036
+ },
1037
+ "meta_id": {
1038
+ "type": "TEXT",
1039
+ "notNull": true,
1040
+ "unique": false
1041
+ },
1042
+ "role": {
1043
+ "type": "TEXT",
1044
+ "notNull": true,
1045
+ "unique": false
1046
+ },
1047
+ "sort_order": {
1048
+ "type": "INTEGER",
1049
+ "notNull": false,
1050
+ "unique": false,
1051
+ "default": 0
1052
+ },
1053
+ "tenant_id": {
1054
+ "type": "UUID",
1055
+ "referenceKind": "tenantId",
1056
+ "notNull": true,
1057
+ "unique": false
1058
+ },
1059
+ "author_user_id": {
1060
+ "type": "UUID",
1061
+ "referenceKind": "crossPackageRef",
1062
+ "notNull": true,
1063
+ "unique": false
1064
+ },
1065
+ "body": {
1066
+ "type": "TEXT",
1067
+ "notNull": true,
1068
+ "unique": false
1069
+ },
1070
+ "mentions": {
1071
+ "type": "TEXT",
1072
+ "notNull": false,
1073
+ "unique": false
1074
+ },
1075
+ "idempotency_key": {
1076
+ "type": "TEXT",
1077
+ "notNull": false,
1078
+ "unique": false
1079
+ },
1080
+ "retry_tenant_id": {
1081
+ "type": "TEXT",
1082
+ "notNull": false,
1083
+ "unique": false
1084
+ },
1085
+ "request_digest": {
1086
+ "type": "TEXT",
1087
+ "notNull": false,
1088
+ "unique": false
1089
+ },
1090
+ "parent_comment_id": {
1091
+ "type": "UUID",
1092
+ "referenceKind": "foreignKey",
1093
+ "notNull": false,
1094
+ "unique": false
1095
+ },
1096
+ "status": {
1097
+ "type": "TEXT",
1098
+ "notNull": true,
1099
+ "unique": false,
1100
+ "default": "visible"
1101
+ },
1102
+ "participation_snapshot": {
1103
+ "type": "TEXT",
1104
+ "notNull": false,
1105
+ "unique": false
1106
+ },
1107
+ "edited_at": {
1108
+ "type": "TIMESTAMP",
1109
+ "notNull": false,
1110
+ "unique": false
1111
+ }
1112
+ },
1113
+ "indexes": [
1114
+ {
1115
+ "name": "record_comments_slug_context_idx",
1116
+ "columns": [
1117
+ "tenant_id",
1118
+ "slug",
1119
+ "context"
1120
+ ],
1121
+ "unique": true
1122
+ },
1123
+ {
1124
+ "name": "record_comments_tenant_request_key",
1125
+ "columns": [
1126
+ "retry_tenant_id",
1127
+ "idempotency_key"
1128
+ ],
1129
+ "unique": true
1130
+ },
1131
+ {
1132
+ "name": "record_comments_record_created_idx",
1133
+ "columns": [
1134
+ "tenant_id",
1135
+ "meta_type",
1136
+ "meta_id",
1137
+ "created_at"
1138
+ ]
1139
+ },
1140
+ {
1141
+ "name": "record_comments_parent_created_idx",
1142
+ "columns": [
1143
+ "tenant_id",
1144
+ "parent_comment_id",
1145
+ "created_at"
1146
+ ]
1147
+ },
1148
+ {
1149
+ "name": "record_comments_moderation_idx",
1150
+ "columns": [
1151
+ "tenant_id",
1152
+ "status",
1153
+ "created_at"
1154
+ ]
1155
+ },
1156
+ {
1157
+ "name": "record_comments_tenant_id_created_at_idx",
1158
+ "columns": [
1159
+ "tenant_id",
1160
+ "created_at"
1161
+ ]
1162
+ },
1163
+ {
1164
+ "name": "record_comments_meta_type_meta_id_idx",
1165
+ "columns": [
1166
+ "meta_type",
1167
+ "meta_id"
1168
+ ]
1169
+ },
1170
+ {
1171
+ "name": "record_comments_author_user_id_idx",
1172
+ "columns": [
1173
+ "author_user_id"
1174
+ ]
1175
+ },
1176
+ {
1177
+ "name": "record_comments_parent_comment_id_idx",
1178
+ "columns": [
1179
+ "parent_comment_id"
1180
+ ]
1181
+ }
1182
+ ],
1183
+ "version": "35c502ab"
1184
+ },
1185
+ "importPath": "@happyvertical/smrt-comments"
1186
+ },
1187
+ "@happyvertical/smrt-comments:CommentReport": {
1188
+ "name": "commentreport",
1189
+ "className": "CommentReport",
1190
+ "qualifiedName": "@happyvertical/smrt-comments:CommentReport",
1191
+ "collection": "commentreports",
1192
+ "description": "A tenant-local report; moderation resolution never deletes the report.",
1193
+ "filePath": "/home/runner/work/smrt/smrt/packages/comments/src/models/CommentReport.ts",
1194
+ "packageName": "@happyvertical/smrt-comments",
1195
+ "fields": {
1196
+ "tenantId": {
1197
+ "type": "text",
1198
+ "required": true,
1199
+ "_meta": {
1200
+ "sqlType": "UUID",
1201
+ "__tenancy": {
1202
+ "isTenantIdField": true,
1203
+ "autoFilter": true,
1204
+ "required": true,
1205
+ "autoPopulate": true,
1206
+ "nullable": false,
1207
+ "mode": "required",
1208
+ "field": "tenantId",
1209
+ "allowSuperAdminBypass": false
1210
+ }
1211
+ }
1212
+ },
1213
+ "commentId": {
1214
+ "type": "foreignKey",
1215
+ "required": true,
1216
+ "related": "Comment",
1217
+ "_meta": {
1218
+ "required": true,
1219
+ "constraint": false
1220
+ }
1221
+ },
1222
+ "reporterUserId": {
1223
+ "type": "crossPackageRef",
1224
+ "required": true,
1225
+ "related": "@happyvertical/smrt-users:User"
1226
+ },
1227
+ "reason": {
1228
+ "type": "text",
1229
+ "required": true,
1230
+ "_meta": {
1231
+ "required": true
1232
+ }
1233
+ },
1234
+ "status": {
1235
+ "type": "text",
1236
+ "required": true,
1237
+ "default": "open",
1238
+ "_meta": {
1239
+ "required": true
1240
+ },
1241
+ "enum": [
1242
+ "open",
1243
+ "resolved",
1244
+ "dismissed"
1245
+ ]
1246
+ }
1247
+ },
1248
+ "methods": {},
1249
+ "decoratorConfig": {
1250
+ "tableName": "comment_reports",
1251
+ "api": false,
1252
+ "mcp": false,
1253
+ "cli": false,
1254
+ "indexes": [
1255
+ {
1256
+ "name": "comment_reports_actor_target_unique",
1257
+ "columns": [
1258
+ "tenantId",
1259
+ "reporterUserId",
1260
+ "commentId"
1261
+ ],
1262
+ "unique": true
1263
+ },
1264
+ {
1265
+ "name": "comment_reports_queue_idx",
1266
+ "columns": [
1267
+ "tenantId",
1268
+ "status",
1269
+ "createdAt"
1270
+ ]
1271
+ }
1272
+ ],
1273
+ "tenantScoped": {
1274
+ "mode": "required"
1275
+ },
1276
+ "conflictColumns": [
1277
+ "tenant_id",
1278
+ "slug",
1279
+ "context"
1280
+ ]
1281
+ },
1282
+ "extends": "SmrtObject",
1283
+ "exportName": "CommentReport",
1284
+ "collectionExportName": "CommentReportCollection",
1285
+ "validationRules": [
1286
+ {
1287
+ "field": "commentId",
1288
+ "rule": "required",
1289
+ "fieldType": "foreignKey"
1290
+ },
1291
+ {
1292
+ "field": "reporterUserId",
1293
+ "rule": "required",
1294
+ "fieldType": "crossPackageRef"
1295
+ },
1296
+ {
1297
+ "field": "reason",
1298
+ "rule": "required",
1299
+ "fieldType": "text"
1300
+ },
1301
+ {
1302
+ "field": "status",
1303
+ "rule": "required",
1304
+ "fieldType": "text"
1305
+ }
1306
+ ],
1307
+ "schema": {
1308
+ "tableName": "comment_reports",
1309
+ "ddl": "CREATE TABLE IF NOT EXISTS \"comment_reports\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"comment_id\" UUID NOT NULL,\n \"reporter_user_id\" UUID NOT NULL,\n \"reason\" TEXT NOT NULL,\n \"status\" TEXT NOT NULL DEFAULT 'open'\n);",
1310
+ "columns": {
1311
+ "id": {
1312
+ "type": "UUID",
1313
+ "primaryKey": true,
1314
+ "referenceKind": "id",
1315
+ "notNull": true
1316
+ },
1317
+ "slug": {
1318
+ "type": "TEXT",
1319
+ "notNull": true
1320
+ },
1321
+ "context": {
1322
+ "type": "TEXT",
1323
+ "notNull": true,
1324
+ "default": ""
1325
+ },
1326
+ "created_at": {
1327
+ "type": "TIMESTAMP",
1328
+ "notNull": true,
1329
+ "default": "current_timestamp"
1330
+ },
1331
+ "updated_at": {
1332
+ "type": "TIMESTAMP",
1333
+ "notNull": true,
1334
+ "default": "current_timestamp"
1335
+ },
1336
+ "tenant_id": {
1337
+ "type": "UUID",
1338
+ "referenceKind": "tenantId",
1339
+ "notNull": true,
1340
+ "unique": false
1341
+ },
1342
+ "comment_id": {
1343
+ "type": "UUID",
1344
+ "referenceKind": "foreignKey",
1345
+ "notNull": true,
1346
+ "unique": false
1347
+ },
1348
+ "reporter_user_id": {
1349
+ "type": "UUID",
1350
+ "referenceKind": "crossPackageRef",
1351
+ "notNull": true,
1352
+ "unique": false
1353
+ },
1354
+ "reason": {
1355
+ "type": "TEXT",
1356
+ "notNull": true,
1357
+ "unique": false
1358
+ },
1359
+ "status": {
1360
+ "type": "TEXT",
1361
+ "notNull": true,
1362
+ "unique": false,
1363
+ "default": "open"
1364
+ }
1365
+ },
1366
+ "indexes": [
1367
+ {
1368
+ "name": "comment_reports_slug_context_idx",
1369
+ "columns": [
1370
+ "tenant_id",
1371
+ "slug",
1372
+ "context"
1373
+ ],
1374
+ "unique": true
1375
+ },
1376
+ {
1377
+ "name": "comment_reports_actor_target_unique",
1378
+ "columns": [
1379
+ "tenant_id",
1380
+ "reporter_user_id",
1381
+ "comment_id"
1382
+ ],
1383
+ "unique": true
1384
+ },
1385
+ {
1386
+ "name": "comment_reports_queue_idx",
1387
+ "columns": [
1388
+ "tenant_id",
1389
+ "status",
1390
+ "created_at"
1391
+ ]
1392
+ },
1393
+ {
1394
+ "name": "comment_reports_tenant_id_created_at_idx",
1395
+ "columns": [
1396
+ "tenant_id",
1397
+ "created_at"
1398
+ ]
1399
+ },
1400
+ {
1401
+ "name": "comment_reports_comment_id_idx",
1402
+ "columns": [
1403
+ "comment_id"
1404
+ ]
1405
+ },
1406
+ {
1407
+ "name": "comment_reports_reporter_user_id_idx",
1408
+ "columns": [
1409
+ "reporter_user_id"
1410
+ ]
1411
+ }
1412
+ ],
1413
+ "version": "001951c2"
1414
+ },
1415
+ "importPath": "@happyvertical/smrt-comments"
1416
+ },
1417
+ "@happyvertical/smrt-comments:CommentRevision": {
1418
+ "name": "commentrevision",
1419
+ "className": "CommentRevision",
1420
+ "qualifiedName": "@happyvertical/smrt-comments:CommentRevision",
1421
+ "collection": "commentrevisions",
1422
+ "description": "Immutable prior body retained whenever an author edits a comment.",
1423
+ "filePath": "/home/runner/work/smrt/smrt/packages/comments/src/models/CommentRevision.ts",
1424
+ "packageName": "@happyvertical/smrt-comments",
1425
+ "fields": {
1426
+ "tenantId": {
1427
+ "type": "text",
1428
+ "required": true,
1429
+ "_meta": {
1430
+ "sqlType": "UUID",
1431
+ "__tenancy": {
1432
+ "isTenantIdField": true,
1433
+ "autoFilter": true,
1434
+ "required": true,
1435
+ "autoPopulate": true,
1436
+ "nullable": false,
1437
+ "mode": "required",
1438
+ "field": "tenantId",
1439
+ "allowSuperAdminBypass": false
1440
+ }
1441
+ }
1442
+ },
1443
+ "commentId": {
1444
+ "type": "foreignKey",
1445
+ "required": true,
1446
+ "related": "Comment",
1447
+ "_meta": {
1448
+ "required": true,
1449
+ "constraint": false
1450
+ }
1451
+ },
1452
+ "editorUserId": {
1453
+ "type": "crossPackageRef",
1454
+ "required": true,
1455
+ "related": "@happyvertical/smrt-users:User"
1456
+ },
1457
+ "body": {
1458
+ "type": "text",
1459
+ "required": true,
1460
+ "_meta": {
1461
+ "required": true
1462
+ }
1463
+ }
1464
+ },
1465
+ "methods": {},
1466
+ "decoratorConfig": {
1467
+ "tableName": "comment_revisions",
1468
+ "api": false,
1469
+ "mcp": false,
1470
+ "cli": false,
1471
+ "tenantScoped": {
1472
+ "mode": "required"
1473
+ },
1474
+ "conflictColumns": [
1475
+ "tenant_id",
1476
+ "slug",
1477
+ "context"
1478
+ ]
1479
+ },
1480
+ "extends": "SmrtObject",
1481
+ "exportName": "CommentRevision",
1482
+ "collectionExportName": "CommentRevisionCollection",
1483
+ "validationRules": [
1484
+ {
1485
+ "field": "commentId",
1486
+ "rule": "required",
1487
+ "fieldType": "foreignKey"
1488
+ },
1489
+ {
1490
+ "field": "editorUserId",
1491
+ "rule": "required",
1492
+ "fieldType": "crossPackageRef"
1493
+ },
1494
+ {
1495
+ "field": "body",
1496
+ "rule": "required",
1497
+ "fieldType": "text"
1498
+ }
1499
+ ],
1500
+ "schema": {
1501
+ "tableName": "comment_revisions",
1502
+ "ddl": "CREATE TABLE IF NOT EXISTS \"comment_revisions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"comment_id\" UUID NOT NULL,\n \"editor_user_id\" UUID NOT NULL,\n \"body\" TEXT NOT NULL\n);",
1503
+ "columns": {
1504
+ "id": {
1505
+ "type": "UUID",
1506
+ "primaryKey": true,
1507
+ "referenceKind": "id",
1508
+ "notNull": true
1509
+ },
1510
+ "slug": {
1511
+ "type": "TEXT",
1512
+ "notNull": true
1513
+ },
1514
+ "context": {
1515
+ "type": "TEXT",
1516
+ "notNull": true,
1517
+ "default": ""
1518
+ },
1519
+ "created_at": {
1520
+ "type": "TIMESTAMP",
1521
+ "notNull": true,
1522
+ "default": "current_timestamp"
1523
+ },
1524
+ "updated_at": {
1525
+ "type": "TIMESTAMP",
1526
+ "notNull": true,
1527
+ "default": "current_timestamp"
1528
+ },
1529
+ "tenant_id": {
1530
+ "type": "UUID",
1531
+ "referenceKind": "tenantId",
1532
+ "notNull": true,
1533
+ "unique": false
1534
+ },
1535
+ "comment_id": {
1536
+ "type": "UUID",
1537
+ "referenceKind": "foreignKey",
1538
+ "notNull": true,
1539
+ "unique": false
1540
+ },
1541
+ "editor_user_id": {
1542
+ "type": "UUID",
1543
+ "referenceKind": "crossPackageRef",
1544
+ "notNull": true,
1545
+ "unique": false
1546
+ },
1547
+ "body": {
1548
+ "type": "TEXT",
1549
+ "notNull": true,
1550
+ "unique": false
1551
+ }
1552
+ },
1553
+ "indexes": [
1554
+ {
1555
+ "name": "comment_revisions_slug_context_idx",
1556
+ "columns": [
1557
+ "tenant_id",
1558
+ "slug",
1559
+ "context"
1560
+ ],
1561
+ "unique": true
1562
+ },
1563
+ {
1564
+ "name": "comment_revisions_tenant_id_created_at_idx",
1565
+ "columns": [
1566
+ "tenant_id",
1567
+ "created_at"
1568
+ ]
1569
+ },
1570
+ {
1571
+ "name": "comment_revisions_comment_id_idx",
1572
+ "columns": [
1573
+ "comment_id"
1574
+ ]
1575
+ },
1576
+ {
1577
+ "name": "comment_revisions_editor_user_id_idx",
1578
+ "columns": [
1579
+ "editor_user_id"
1580
+ ]
1581
+ }
1582
+ ],
1583
+ "version": "69ea301e"
1584
+ },
1585
+ "importPath": "@happyvertical/smrt-comments"
1586
+ },
1587
+ "@happyvertical/smrt-comments:ParticipationBan": {
1588
+ "name": "participationban",
1589
+ "className": "ParticipationBan",
1590
+ "qualifiedName": "@happyvertical/smrt-comments:ParticipationBan",
1591
+ "collection": "participationbans",
1592
+ "description": "Tenant-local, reusable participation ban; a blank target applies tenant-wide.",
1593
+ "filePath": "/home/runner/work/smrt/smrt/packages/comments/src/models/ParticipationBan.ts",
1594
+ "packageName": "@happyvertical/smrt-comments",
1595
+ "fields": {
1596
+ "tenantId": {
1597
+ "type": "text",
1598
+ "required": true,
1599
+ "_meta": {
1600
+ "sqlType": "UUID",
1601
+ "__tenancy": {
1602
+ "isTenantIdField": true,
1603
+ "autoFilter": true,
1604
+ "required": true,
1605
+ "autoPopulate": true,
1606
+ "nullable": false,
1607
+ "mode": "required",
1608
+ "field": "tenantId",
1609
+ "allowSuperAdminBypass": false
1610
+ }
1611
+ }
1612
+ },
1613
+ "actorUserId": {
1614
+ "type": "text",
1615
+ "required": true,
1616
+ "_meta": {
1617
+ "required": true
1618
+ }
1619
+ },
1620
+ "recordType": {
1621
+ "type": "text",
1622
+ "required": false
1623
+ },
1624
+ "recordId": {
1625
+ "type": "text",
1626
+ "required": false
1627
+ },
1628
+ "reason": {
1629
+ "type": "text",
1630
+ "required": true,
1631
+ "_meta": {
1632
+ "required": true
1633
+ }
1634
+ },
1635
+ "expiresAt": {
1636
+ "type": "datetime",
1637
+ "required": false,
1638
+ "_meta": {
1639
+ "nullable": true
1640
+ }
1641
+ }
1642
+ },
1643
+ "methods": {},
1644
+ "decoratorConfig": {
1645
+ "tableName": "participation_bans",
1646
+ "api": false,
1647
+ "mcp": false,
1648
+ "cli": false,
1649
+ "tenantScoped": {
1650
+ "mode": "required"
1651
+ },
1652
+ "conflictColumns": [
1653
+ "tenant_id",
1654
+ "slug",
1655
+ "context"
1656
+ ]
1657
+ },
1658
+ "extends": "SmrtObject",
1659
+ "exportName": "ParticipationBan",
1660
+ "collectionExportName": "ParticipationBanCollection",
1661
+ "validationRules": [
1662
+ {
1663
+ "field": "actorUserId",
1664
+ "rule": "required",
1665
+ "fieldType": "text"
1666
+ },
1667
+ {
1668
+ "field": "reason",
1669
+ "rule": "required",
1670
+ "fieldType": "text"
1671
+ }
1672
+ ],
1673
+ "schema": {
1674
+ "tableName": "participation_bans",
1675
+ "ddl": "CREATE TABLE IF NOT EXISTS \"participation_bans\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"actor_user_id\" TEXT NOT NULL,\n \"record_type\" TEXT,\n \"record_id\" TEXT,\n \"reason\" TEXT NOT NULL,\n \"expires_at\" TIMESTAMP\n);",
1676
+ "columns": {
1677
+ "id": {
1678
+ "type": "UUID",
1679
+ "primaryKey": true,
1680
+ "referenceKind": "id",
1681
+ "notNull": true
1682
+ },
1683
+ "slug": {
1684
+ "type": "TEXT",
1685
+ "notNull": true
1686
+ },
1687
+ "context": {
1688
+ "type": "TEXT",
1689
+ "notNull": true,
1690
+ "default": ""
1691
+ },
1692
+ "created_at": {
1693
+ "type": "TIMESTAMP",
1694
+ "notNull": true,
1695
+ "default": "current_timestamp"
1696
+ },
1697
+ "updated_at": {
1698
+ "type": "TIMESTAMP",
1699
+ "notNull": true,
1700
+ "default": "current_timestamp"
1701
+ },
1702
+ "tenant_id": {
1703
+ "type": "UUID",
1704
+ "referenceKind": "tenantId",
1705
+ "notNull": true,
1706
+ "unique": false
1707
+ },
1708
+ "actor_user_id": {
1709
+ "type": "TEXT",
1710
+ "notNull": true,
1711
+ "unique": false
1712
+ },
1713
+ "record_type": {
1714
+ "type": "TEXT",
1715
+ "notNull": false,
1716
+ "unique": false
1717
+ },
1718
+ "record_id": {
1719
+ "type": "TEXT",
1720
+ "notNull": false,
1721
+ "unique": false
1722
+ },
1723
+ "reason": {
1724
+ "type": "TEXT",
1725
+ "notNull": true,
1726
+ "unique": false
1727
+ },
1728
+ "expires_at": {
1729
+ "type": "TIMESTAMP",
1730
+ "notNull": false,
1731
+ "unique": false
1732
+ }
1733
+ },
1734
+ "indexes": [
1735
+ {
1736
+ "name": "participation_bans_slug_context_idx",
1737
+ "columns": [
1738
+ "tenant_id",
1739
+ "slug",
1740
+ "context"
1741
+ ],
1742
+ "unique": true
1743
+ },
1744
+ {
1745
+ "name": "participation_bans_tenant_id_created_at_idx",
1746
+ "columns": [
1747
+ "tenant_id",
1748
+ "created_at"
1749
+ ]
1750
+ }
1751
+ ],
1752
+ "version": "27bbfb94"
1753
+ },
1754
+ "importPath": "@happyvertical/smrt-comments"
1755
+ },
1756
+ "@happyvertical/smrt-comments:ParticipationPolicy": {
1757
+ "name": "participationpolicy",
1758
+ "className": "ParticipationPolicy",
1759
+ "qualifiedName": "@happyvertical/smrt-comments:ParticipationPolicy",
1760
+ "collection": "participationpolicies",
1761
+ "description": "A generic tenant default or exact-record override for participation actions.",
1762
+ "filePath": "/home/runner/work/smrt/smrt/packages/comments/src/models/ParticipationPolicy.ts",
1763
+ "packageName": "@happyvertical/smrt-comments",
1764
+ "fields": {
1765
+ "tenantId": {
1766
+ "type": "text",
1767
+ "required": true,
1768
+ "_meta": {
1769
+ "sqlType": "UUID",
1770
+ "__tenancy": {
1771
+ "isTenantIdField": true,
1772
+ "autoFilter": true,
1773
+ "required": true,
1774
+ "autoPopulate": true,
1775
+ "nullable": false,
1776
+ "mode": "required",
1777
+ "field": "tenantId",
1778
+ "allowSuperAdminBypass": false
1779
+ }
1780
+ }
1781
+ },
1782
+ "recordType": {
1783
+ "type": "text",
1784
+ "required": false
1785
+ },
1786
+ "recordId": {
1787
+ "type": "text",
1788
+ "required": false
1789
+ },
1790
+ "action": {
1791
+ "type": "text",
1792
+ "required": true,
1793
+ "_meta": {
1794
+ "required": true
1795
+ }
1796
+ },
1797
+ "moderationMode": {
1798
+ "type": "text",
1799
+ "required": true,
1800
+ "default": "open",
1801
+ "_meta": {
1802
+ "required": true
1803
+ },
1804
+ "enum": [
1805
+ "open",
1806
+ "pre_moderated",
1807
+ "members_only",
1808
+ "closed"
1809
+ ]
1810
+ },
1811
+ "maxActions": {
1812
+ "type": "integer",
1813
+ "required": true,
1814
+ "default": 0,
1815
+ "_meta": {
1816
+ "required": true
1817
+ }
1818
+ },
1819
+ "windowSeconds": {
1820
+ "type": "integer",
1821
+ "required": true,
1822
+ "default": 0,
1823
+ "_meta": {
1824
+ "required": true
1825
+ }
1826
+ }
1827
+ },
1828
+ "methods": {},
1829
+ "decoratorConfig": {
1830
+ "tableName": "participation_policies",
1831
+ "api": false,
1832
+ "mcp": false,
1833
+ "cli": false,
1834
+ "tenantScoped": {
1835
+ "mode": "required"
1836
+ },
1837
+ "conflictColumns": [
1838
+ "tenant_id",
1839
+ "slug",
1840
+ "context"
1841
+ ]
1842
+ },
1843
+ "extends": "SmrtObject",
1844
+ "exportName": "ParticipationPolicy",
1845
+ "collectionExportName": "ParticipationPolicyCollection",
1846
+ "validationRules": [
1847
+ {
1848
+ "field": "action",
1849
+ "rule": "required",
1850
+ "fieldType": "text"
1851
+ },
1852
+ {
1853
+ "field": "moderationMode",
1854
+ "rule": "required",
1855
+ "fieldType": "text"
1856
+ },
1857
+ {
1858
+ "field": "maxActions",
1859
+ "rule": "required",
1860
+ "fieldType": "integer"
1861
+ },
1862
+ {
1863
+ "field": "windowSeconds",
1864
+ "rule": "required",
1865
+ "fieldType": "integer"
1866
+ }
1867
+ ],
1868
+ "schema": {
1869
+ "tableName": "participation_policies",
1870
+ "ddl": "CREATE TABLE IF NOT EXISTS \"participation_policies\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"record_type\" TEXT,\n \"record_id\" TEXT,\n \"action\" TEXT NOT NULL,\n \"moderation_mode\" TEXT NOT NULL DEFAULT 'open',\n \"max_actions\" INTEGER NOT NULL DEFAULT 0,\n \"window_seconds\" INTEGER NOT NULL DEFAULT 0\n);",
1871
+ "columns": {
1872
+ "id": {
1873
+ "type": "UUID",
1874
+ "primaryKey": true,
1875
+ "referenceKind": "id",
1876
+ "notNull": true
1877
+ },
1878
+ "slug": {
1879
+ "type": "TEXT",
1880
+ "notNull": true
1881
+ },
1882
+ "context": {
1883
+ "type": "TEXT",
1884
+ "notNull": true,
1885
+ "default": ""
1886
+ },
1887
+ "created_at": {
1888
+ "type": "TIMESTAMP",
1889
+ "notNull": true,
1890
+ "default": "current_timestamp"
1891
+ },
1892
+ "updated_at": {
1893
+ "type": "TIMESTAMP",
1894
+ "notNull": true,
1895
+ "default": "current_timestamp"
1896
+ },
1897
+ "tenant_id": {
1898
+ "type": "UUID",
1899
+ "referenceKind": "tenantId",
1900
+ "notNull": true,
1901
+ "unique": false
1902
+ },
1903
+ "record_type": {
1904
+ "type": "TEXT",
1905
+ "notNull": false,
1906
+ "unique": false
1907
+ },
1908
+ "record_id": {
1909
+ "type": "TEXT",
1910
+ "notNull": false,
1911
+ "unique": false
1912
+ },
1913
+ "action": {
1914
+ "type": "TEXT",
1915
+ "notNull": true,
1916
+ "unique": false
1917
+ },
1918
+ "moderation_mode": {
1919
+ "type": "TEXT",
1920
+ "notNull": true,
1921
+ "unique": false,
1922
+ "default": "open"
1923
+ },
1924
+ "max_actions": {
1925
+ "type": "INTEGER",
1926
+ "notNull": true,
1927
+ "unique": false,
1928
+ "default": 0
1929
+ },
1930
+ "window_seconds": {
1931
+ "type": "INTEGER",
1932
+ "notNull": true,
1933
+ "unique": false,
1934
+ "default": 0
132
1935
  }
133
1936
  },
134
1937
  "indexes": [
135
1938
  {
136
- "name": "record_comments_slug_context_idx",
1939
+ "name": "participation_policies_slug_context_idx",
137
1940
  "columns": [
138
1941
  "tenant_id",
139
1942
  "slug",
@@ -142,81 +1945,26 @@
142
1945
  "unique": true
143
1946
  },
144
1947
  {
145
- "name": "record_comments_tenant_request_key",
146
- "columns": [
147
- "retry_tenant_id",
148
- "idempotency_key"
149
- ],
150
- "unique": true
151
- },
152
- {
153
- "name": "record_comments_record_created_idx",
154
- "columns": [
155
- "tenant_id",
156
- "meta_type",
157
- "meta_id",
158
- "created_at"
159
- ]
160
- },
161
- {
162
- "name": "record_comments_tenant_id_created_at_idx",
1948
+ "name": "participation_policies_tenant_id_created_at_idx",
163
1949
  "columns": [
164
1950
  "tenant_id",
165
1951
  "created_at"
166
1952
  ]
167
- },
168
- {
169
- "name": "record_comments_meta_type_meta_id_idx",
170
- "columns": [
171
- "meta_type",
172
- "meta_id"
173
- ]
174
- },
175
- {
176
- "name": "record_comments_author_user_id_idx",
177
- "columns": [
178
- "author_user_id"
179
- ]
180
1953
  }
181
1954
  ],
182
- "version": "5095dfc9"
1955
+ "version": "7f2fdd9d"
183
1956
  },
184
1957
  "importPath": "@happyvertical/smrt-comments"
185
1958
  },
186
- "@happyvertical/smrt-comments:Comment": {
187
- "name": "comment",
188
- "className": "Comment",
189
- "qualifiedName": "@happyvertical/smrt-comments:Comment",
190
- "collection": "comments",
191
- "filePath": "/home/runner/work/smrt/smrt/packages/comments/src/models/Comment.ts",
1959
+ "@happyvertical/smrt-comments:ParticipationRateBucket": {
1960
+ "name": "participationratebucket",
1961
+ "className": "ParticipationRateBucket",
1962
+ "qualifiedName": "@happyvertical/smrt-comments:ParticipationRateBucket",
1963
+ "collection": "participationratebuckets",
1964
+ "description": "Service-owned fixed-window counter. Never delete a currently active bucket.",
1965
+ "filePath": "/home/runner/work/smrt/smrt/packages/comments/src/models/ParticipationRateBucket.ts",
192
1966
  "packageName": "@happyvertical/smrt-comments",
193
1967
  "fields": {
194
- "metaType": {
195
- "type": "text",
196
- "required": true,
197
- "_meta": {
198
- "required": true
199
- }
200
- },
201
- "metaId": {
202
- "type": "text",
203
- "required": true,
204
- "_meta": {
205
- "required": true
206
- }
207
- },
208
- "role": {
209
- "type": "text",
210
- "required": true,
211
- "_meta": {
212
- "required": true
213
- }
214
- },
215
- "sortOrder": {
216
- "type": "integer",
217
- "required": false,
218
- "default": 0
219
- },
220
1968
  "tenantId": {
221
1969
  "type": "text",
222
1970
  "required": true,
@@ -234,82 +1982,36 @@
234
1982
  }
235
1983
  }
236
1984
  },
237
- "authorUserId": {
238
- "type": "crossPackageRef",
239
- "required": true,
240
- "related": "@happyvertical/smrt-users:User"
241
- },
242
- "body": {
1985
+ "bucketKey": {
243
1986
  "type": "text",
244
1987
  "required": true,
245
1988
  "_meta": {
246
1989
  "required": true
247
1990
  }
248
1991
  },
249
- "mentions": {
250
- "type": "text",
251
- "required": false
252
- },
253
- "idempotencyKey": {
254
- "type": "text",
255
- "required": false,
256
- "_meta": {
257
- "nullable": true,
258
- "readonly": true
259
- },
260
- "readonly": true
261
- },
262
- "retryTenantId": {
263
- "type": "text",
264
- "required": false,
265
- "_meta": {
266
- "nullable": true,
267
- "readonly": true
268
- },
269
- "readonly": true
270
- },
271
- "requestDigest": {
272
- "type": "text",
273
- "required": false,
1992
+ "actionCount": {
1993
+ "type": "integer",
1994
+ "required": true,
1995
+ "default": 0,
274
1996
  "_meta": {
275
- "nullable": true,
276
- "readonly": true
277
- },
278
- "readonly": true
279
- }
280
- },
281
- "methods": {
282
- "hydrate": {
283
- "name": "hydrate",
284
- "async": true,
285
- "parameters": [],
286
- "returnType": "Promise<T | null>",
287
- "isStatic": false,
288
- "isPublic": true
1997
+ "required": true
1998
+ }
289
1999
  }
290
2000
  },
2001
+ "methods": {},
291
2002
  "decoratorConfig": {
292
- "tableName": "record_comments",
2003
+ "tableName": "participation_rate_buckets",
293
2004
  "api": false,
294
2005
  "mcp": false,
295
2006
  "cli": false,
296
2007
  "indexes": [
297
2008
  {
298
- "name": "record_comments_tenant_request_key",
2009
+ "name": "participation_rate_bucket_unique",
299
2010
  "columns": [
300
- "retryTenantId",
301
- "idempotencyKey"
2011
+ "tenantId",
2012
+ "bucketKey"
302
2013
  ],
303
2014
  "unique": true
304
- },
305
- {
306
- "name": "record_comments_record_created_idx",
307
- "columns": [
308
- "tenantId",
309
- "metaType",
310
- "metaId",
311
- "createdAt"
312
- ]
313
2015
  }
314
2016
  ],
315
2017
  "tenantScoped": {
@@ -321,39 +2023,24 @@
321
2023
  "context"
322
2024
  ]
323
2025
  },
324
- "extends": "SmrtPolymorphicAssociation",
325
- "exportName": "Comment",
326
- "collectionExportName": "CommentCollection",
2026
+ "extends": "SmrtObject",
2027
+ "exportName": "ParticipationRateBucket",
2028
+ "collectionExportName": "ParticipationRateBucketCollection",
327
2029
  "validationRules": [
328
2030
  {
329
- "field": "metaType",
330
- "rule": "required",
331
- "fieldType": "text"
332
- },
333
- {
334
- "field": "metaId",
335
- "rule": "required",
336
- "fieldType": "text"
337
- },
338
- {
339
- "field": "role",
2031
+ "field": "bucketKey",
340
2032
  "rule": "required",
341
2033
  "fieldType": "text"
342
2034
  },
343
2035
  {
344
- "field": "authorUserId",
345
- "rule": "required",
346
- "fieldType": "crossPackageRef"
347
- },
348
- {
349
- "field": "body",
2036
+ "field": "actionCount",
350
2037
  "rule": "required",
351
- "fieldType": "text"
2038
+ "fieldType": "integer"
352
2039
  }
353
2040
  ],
354
2041
  "schema": {
355
- "tableName": "record_comments",
356
- "ddl": "CREATE TABLE IF NOT EXISTS \"record_comments\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"meta_type\" TEXT NOT NULL,\n \"meta_id\" TEXT NOT NULL,\n \"role\" TEXT NOT NULL,\n \"sort_order\" INTEGER DEFAULT 0,\n \"tenant_id\" UUID NOT NULL,\n \"author_user_id\" UUID NOT NULL,\n \"body\" TEXT NOT NULL,\n \"mentions\" TEXT,\n \"idempotency_key\" TEXT,\n \"retry_tenant_id\" TEXT,\n \"request_digest\" TEXT\n);",
2042
+ "tableName": "participation_rate_buckets",
2043
+ "ddl": "CREATE TABLE IF NOT EXISTS \"participation_rate_buckets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID NOT NULL,\n \"bucket_key\" TEXT NOT NULL,\n \"action_count\" INTEGER NOT NULL DEFAULT 0\n);",
357
2044
  "columns": {
358
2045
  "id": {
359
2046
  "type": "UUID",
@@ -380,68 +2067,27 @@
380
2067
  "notNull": true,
381
2068
  "default": "current_timestamp"
382
2069
  },
383
- "meta_type": {
384
- "type": "TEXT",
385
- "notNull": true,
386
- "unique": false
387
- },
388
- "meta_id": {
389
- "type": "TEXT",
390
- "notNull": true,
391
- "unique": false
392
- },
393
- "role": {
394
- "type": "TEXT",
395
- "notNull": true,
396
- "unique": false
397
- },
398
- "sort_order": {
399
- "type": "INTEGER",
400
- "notNull": false,
401
- "unique": false,
402
- "default": 0
403
- },
404
2070
  "tenant_id": {
405
2071
  "type": "UUID",
406
2072
  "referenceKind": "tenantId",
407
2073
  "notNull": true,
408
2074
  "unique": false
409
2075
  },
410
- "author_user_id": {
411
- "type": "UUID",
412
- "referenceKind": "crossPackageRef",
413
- "notNull": true,
414
- "unique": false
415
- },
416
- "body": {
2076
+ "bucket_key": {
417
2077
  "type": "TEXT",
418
2078
  "notNull": true,
419
2079
  "unique": false
420
2080
  },
421
- "mentions": {
422
- "type": "TEXT",
423
- "notNull": false,
424
- "unique": false
425
- },
426
- "idempotency_key": {
427
- "type": "TEXT",
428
- "notNull": false,
429
- "unique": false
430
- },
431
- "retry_tenant_id": {
432
- "type": "TEXT",
433
- "notNull": false,
434
- "unique": false
435
- },
436
- "request_digest": {
437
- "type": "TEXT",
438
- "notNull": false,
439
- "unique": false
2081
+ "action_count": {
2082
+ "type": "INTEGER",
2083
+ "notNull": true,
2084
+ "unique": false,
2085
+ "default": 0
440
2086
  }
441
2087
  },
442
2088
  "indexes": [
443
2089
  {
444
- "name": "record_comments_slug_context_idx",
2090
+ "name": "participation_rate_buckets_slug_context_idx",
445
2091
  "columns": [
446
2092
  "tenant_id",
447
2093
  "slug",
@@ -450,44 +2096,22 @@
450
2096
  "unique": true
451
2097
  },
452
2098
  {
453
- "name": "record_comments_tenant_request_key",
2099
+ "name": "participation_rate_bucket_unique",
454
2100
  "columns": [
455
- "retry_tenant_id",
456
- "idempotency_key"
2101
+ "tenant_id",
2102
+ "bucket_key"
457
2103
  ],
458
2104
  "unique": true
459
2105
  },
460
2106
  {
461
- "name": "record_comments_record_created_idx",
462
- "columns": [
463
- "tenant_id",
464
- "meta_type",
465
- "meta_id",
466
- "created_at"
467
- ]
468
- },
469
- {
470
- "name": "record_comments_tenant_id_created_at_idx",
2107
+ "name": "participation_rate_buckets_tenant_id_created_at_idx",
471
2108
  "columns": [
472
2109
  "tenant_id",
473
2110
  "created_at"
474
2111
  ]
475
- },
476
- {
477
- "name": "record_comments_meta_type_meta_id_idx",
478
- "columns": [
479
- "meta_type",
480
- "meta_id"
481
- ]
482
- },
483
- {
484
- "name": "record_comments_author_user_id_idx",
485
- "columns": [
486
- "author_user_id"
487
- ]
488
2112
  }
489
2113
  ],
490
- "version": "5095dfc9"
2114
+ "version": "9f3707e0"
491
2115
  },
492
2116
  "importPath": "@happyvertical/smrt-comments"
493
2117
  }
@@ -505,7 +2129,12 @@
505
2129
  "discussion"
506
2130
  ],
507
2131
  "models": [
508
- "@happyvertical/smrt-comments:Comment"
2132
+ "@happyvertical/smrt-comments:Comment",
2133
+ "@happyvertical/smrt-comments:CommentRevision",
2134
+ "@happyvertical/smrt-comments:CommentReport",
2135
+ "@happyvertical/smrt-comments:ParticipationPolicy",
2136
+ "@happyvertical/smrt-comments:ParticipationBan",
2137
+ "@happyvertical/smrt-comments:ParticipationRateBucket"
509
2138
  ],
510
2139
  "nav": [],
511
2140
  "requires": [],