@happyvertical/smrt-reactions 0.0.0-stage → 0.57.23

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 (43) hide show
  1. package/AGENTS.md +5 -0
  2. package/CLAUDE.md +1 -0
  3. package/LICENSE +7 -0
  4. package/README.md +38 -2
  5. package/dist/__smrt-register__.d.ts +2 -0
  6. package/dist/__smrt-register__.d.ts.map +1 -0
  7. package/dist/chunks/src-Cfi_AjeE.js +263 -0
  8. package/dist/chunks/src-Cfi_AjeE.js.map +1 -0
  9. package/dist/collections/index.d.ts +14 -0
  10. package/dist/collections/index.d.ts.map +1 -0
  11. package/dist/index.d.ts +10 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +3 -0
  14. package/dist/manifest.json +1265 -0
  15. package/dist/models/Poll.d.ts +28 -0
  16. package/dist/models/Poll.d.ts.map +1 -0
  17. package/dist/models/PollVote.d.ts +20 -0
  18. package/dist/models/PollVote.d.ts.map +1 -0
  19. package/dist/models/Reaction.d.ts +15 -0
  20. package/dist/models/Reaction.d.ts.map +1 -0
  21. package/dist/server.d.ts +4 -0
  22. package/dist/server.d.ts.map +1 -0
  23. package/dist/server.js +323 -0
  24. package/dist/server.js.map +1 -0
  25. package/dist/services.d.ts +59 -0
  26. package/dist/services.d.ts.map +1 -0
  27. package/dist/smrt-knowledge.json +480 -0
  28. package/dist/svelte/PollCard.svelte +40 -0
  29. package/dist/svelte/PollCard.svelte.d.ts +13 -0
  30. package/dist/svelte/PollCard.svelte.d.ts.map +1 -0
  31. package/dist/svelte/ReactionBar.svelte +33 -0
  32. package/dist/svelte/ReactionBar.svelte.d.ts +13 -0
  33. package/dist/svelte/ReactionBar.svelte.d.ts.map +1 -0
  34. package/dist/svelte/index.d.ts +3 -0
  35. package/dist/svelte/index.d.ts.map +1 -0
  36. package/dist/svelte/index.js +2 -0
  37. package/dist/types.d.ts +63 -0
  38. package/dist/types.d.ts.map +1 -0
  39. package/dist/types.js +12 -0
  40. package/dist/types.js.map +1 -0
  41. package/dist/write-authority.d.ts +4 -0
  42. package/dist/write-authority.d.ts.map +1 -0
  43. package/package.json +67 -3
@@ -0,0 +1,1265 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "timestamp": 0,
4
+ "packageName": "@happyvertical/smrt-reactions",
5
+ "packageVersion": "0.57.23",
6
+ "objects": {
7
+ "@happyvertical/smrt-reactions:ReactionCollection": {
8
+ "name": "reactioncollection",
9
+ "className": "ReactionCollection",
10
+ "qualifiedName": "@happyvertical/smrt-reactions:ReactionCollection",
11
+ "collection": "reactions",
12
+ "filePath": "/home/runner/work/smrt/smrt/packages/reactions/src/collections/index.ts",
13
+ "packageName": "@happyvertical/smrt-reactions",
14
+ "fields": {},
15
+ "methods": {},
16
+ "decoratorConfig": {
17
+ "tableName": "record_reactions",
18
+ "api": false,
19
+ "mcp": false,
20
+ "cli": false
21
+ },
22
+ "extends": "SmrtCollection",
23
+ "extendsTypeArg": "Reaction",
24
+ "exportName": "ReactionCollection",
25
+ "collectionExportName": "ReactionCollectionCollection",
26
+ "schema": {
27
+ "tableName": "record_reactions",
28
+ "ddl": "CREATE TABLE IF NOT EXISTS \"record_reactions\" (\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 \"actor_profile_id\" UUID NOT NULL,\n \"kind\" TEXT NOT NULL DEFAULT 'like'\n);",
29
+ "columns": {
30
+ "id": {
31
+ "type": "UUID",
32
+ "primaryKey": true,
33
+ "referenceKind": "id",
34
+ "notNull": true
35
+ },
36
+ "slug": {
37
+ "type": "TEXT",
38
+ "notNull": true
39
+ },
40
+ "context": {
41
+ "type": "TEXT",
42
+ "notNull": true,
43
+ "default": ""
44
+ },
45
+ "created_at": {
46
+ "type": "TIMESTAMP",
47
+ "notNull": true,
48
+ "default": "current_timestamp"
49
+ },
50
+ "updated_at": {
51
+ "type": "TIMESTAMP",
52
+ "notNull": true,
53
+ "default": "current_timestamp"
54
+ },
55
+ "meta_type": {
56
+ "type": "TEXT",
57
+ "notNull": true,
58
+ "unique": false
59
+ },
60
+ "meta_id": {
61
+ "type": "TEXT",
62
+ "notNull": true,
63
+ "unique": false
64
+ },
65
+ "role": {
66
+ "type": "TEXT",
67
+ "notNull": true,
68
+ "unique": false
69
+ },
70
+ "sort_order": {
71
+ "type": "INTEGER",
72
+ "notNull": false,
73
+ "unique": false,
74
+ "default": 0
75
+ },
76
+ "tenant_id": {
77
+ "type": "UUID",
78
+ "referenceKind": "tenantId",
79
+ "notNull": true,
80
+ "unique": false
81
+ },
82
+ "actor_profile_id": {
83
+ "type": "UUID",
84
+ "referenceKind": "crossPackageRef",
85
+ "notNull": true,
86
+ "unique": false
87
+ },
88
+ "kind": {
89
+ "type": "TEXT",
90
+ "notNull": true,
91
+ "unique": false,
92
+ "default": "like"
93
+ }
94
+ },
95
+ "indexes": [
96
+ {
97
+ "name": "record_reactions_slug_context_idx",
98
+ "columns": [
99
+ "tenant_id",
100
+ "slug",
101
+ "context"
102
+ ],
103
+ "unique": true
104
+ },
105
+ {
106
+ "name": "record_reactions_actor_kind",
107
+ "columns": [
108
+ "tenant_id",
109
+ "meta_type",
110
+ "meta_id",
111
+ "actor_profile_id",
112
+ "kind"
113
+ ],
114
+ "unique": true
115
+ },
116
+ {
117
+ "name": "record_reactions_tenant_id_created_at_idx",
118
+ "columns": [
119
+ "tenant_id",
120
+ "created_at"
121
+ ]
122
+ },
123
+ {
124
+ "name": "record_reactions_meta_type_meta_id_idx",
125
+ "columns": [
126
+ "meta_type",
127
+ "meta_id"
128
+ ]
129
+ },
130
+ {
131
+ "name": "record_reactions_actor_profile_id_idx",
132
+ "columns": [
133
+ "actor_profile_id"
134
+ ]
135
+ }
136
+ ],
137
+ "version": "678ebe0f"
138
+ },
139
+ "importPath": "@happyvertical/smrt-reactions"
140
+ },
141
+ "@happyvertical/smrt-reactions:PollCollection": {
142
+ "name": "pollcollection",
143
+ "className": "PollCollection",
144
+ "qualifiedName": "@happyvertical/smrt-reactions:PollCollection",
145
+ "collection": "polls",
146
+ "filePath": "/home/runner/work/smrt/smrt/packages/reactions/src/collections/index.ts",
147
+ "packageName": "@happyvertical/smrt-reactions",
148
+ "fields": {},
149
+ "methods": {},
150
+ "decoratorConfig": {
151
+ "tableName": "record_polls",
152
+ "api": false,
153
+ "mcp": false,
154
+ "cli": false
155
+ },
156
+ "extends": "SmrtCollection",
157
+ "extendsTypeArg": "Poll",
158
+ "exportName": "PollCollection",
159
+ "collectionExportName": "PollCollectionCollection",
160
+ "schema": {
161
+ "tableName": "record_polls",
162
+ "ddl": "CREATE TABLE IF NOT EXISTS \"record_polls\" (\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 \"question\" TEXT NOT NULL,\n \"options_json\" TEXT,\n \"opens_at\" TIMESTAMP,\n \"closes_at\" TIMESTAMP,\n \"visibility\" TEXT DEFAULT 'always',\n \"one_vote_per_actor\" BOOLEAN NOT NULL DEFAULT TRUE,\n \"anonymous_tally\" BOOLEAN NOT NULL DEFAULT TRUE,\n \"closed\" BOOLEAN NOT NULL DEFAULT FALSE\n);",
163
+ "columns": {
164
+ "id": {
165
+ "type": "UUID",
166
+ "primaryKey": true,
167
+ "referenceKind": "id",
168
+ "notNull": true
169
+ },
170
+ "slug": {
171
+ "type": "TEXT",
172
+ "notNull": true
173
+ },
174
+ "context": {
175
+ "type": "TEXT",
176
+ "notNull": true,
177
+ "default": ""
178
+ },
179
+ "created_at": {
180
+ "type": "TIMESTAMP",
181
+ "notNull": true,
182
+ "default": "current_timestamp"
183
+ },
184
+ "updated_at": {
185
+ "type": "TIMESTAMP",
186
+ "notNull": true,
187
+ "default": "current_timestamp"
188
+ },
189
+ "meta_type": {
190
+ "type": "TEXT",
191
+ "notNull": true,
192
+ "unique": false
193
+ },
194
+ "meta_id": {
195
+ "type": "TEXT",
196
+ "notNull": true,
197
+ "unique": false
198
+ },
199
+ "role": {
200
+ "type": "TEXT",
201
+ "notNull": true,
202
+ "unique": false
203
+ },
204
+ "sort_order": {
205
+ "type": "INTEGER",
206
+ "notNull": false,
207
+ "unique": false,
208
+ "default": 0
209
+ },
210
+ "tenant_id": {
211
+ "type": "UUID",
212
+ "referenceKind": "tenantId",
213
+ "notNull": true,
214
+ "unique": false
215
+ },
216
+ "question": {
217
+ "type": "TEXT",
218
+ "notNull": true,
219
+ "unique": false
220
+ },
221
+ "options_json": {
222
+ "type": "TEXT",
223
+ "notNull": false,
224
+ "unique": false
225
+ },
226
+ "opens_at": {
227
+ "type": "TIMESTAMP",
228
+ "notNull": false,
229
+ "unique": false
230
+ },
231
+ "closes_at": {
232
+ "type": "TIMESTAMP",
233
+ "notNull": false,
234
+ "unique": false
235
+ },
236
+ "visibility": {
237
+ "type": "TEXT",
238
+ "notNull": false,
239
+ "unique": false,
240
+ "default": "always"
241
+ },
242
+ "one_vote_per_actor": {
243
+ "type": "BOOLEAN",
244
+ "notNull": true,
245
+ "unique": false,
246
+ "default": true
247
+ },
248
+ "anonymous_tally": {
249
+ "type": "BOOLEAN",
250
+ "notNull": true,
251
+ "unique": false,
252
+ "default": true
253
+ },
254
+ "closed": {
255
+ "type": "BOOLEAN",
256
+ "notNull": true,
257
+ "unique": false,
258
+ "default": false
259
+ }
260
+ },
261
+ "indexes": [
262
+ {
263
+ "name": "record_polls_slug_context_idx",
264
+ "columns": [
265
+ "tenant_id",
266
+ "slug",
267
+ "context"
268
+ ],
269
+ "unique": true
270
+ },
271
+ {
272
+ "name": "record_polls_target",
273
+ "columns": [
274
+ "tenant_id",
275
+ "meta_type",
276
+ "meta_id"
277
+ ]
278
+ },
279
+ {
280
+ "name": "record_polls_tenant_id_created_at_idx",
281
+ "columns": [
282
+ "tenant_id",
283
+ "created_at"
284
+ ]
285
+ },
286
+ {
287
+ "name": "record_polls_meta_type_meta_id_idx",
288
+ "columns": [
289
+ "meta_type",
290
+ "meta_id"
291
+ ]
292
+ }
293
+ ],
294
+ "version": "f6713370"
295
+ },
296
+ "importPath": "@happyvertical/smrt-reactions"
297
+ },
298
+ "@happyvertical/smrt-reactions:PollVoteCollection": {
299
+ "name": "pollvotecollection",
300
+ "className": "PollVoteCollection",
301
+ "qualifiedName": "@happyvertical/smrt-reactions:PollVoteCollection",
302
+ "collection": "pollvotes",
303
+ "filePath": "/home/runner/work/smrt/smrt/packages/reactions/src/collections/index.ts",
304
+ "packageName": "@happyvertical/smrt-reactions",
305
+ "fields": {},
306
+ "methods": {},
307
+ "decoratorConfig": {
308
+ "tableName": "poll_votes",
309
+ "api": false,
310
+ "mcp": false,
311
+ "cli": false
312
+ },
313
+ "extends": "SmrtCollection",
314
+ "extendsTypeArg": "PollVote",
315
+ "exportName": "PollVoteCollection",
316
+ "collectionExportName": "PollVoteCollectionCollection",
317
+ "schema": {
318
+ "tableName": "poll_votes",
319
+ "ddl": "CREATE TABLE IF NOT EXISTS \"poll_votes\" (\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 \"poll_id\" UUID NOT NULL,\n \"actor_profile_id\" UUID NOT NULL,\n \"option_id\" TEXT NOT NULL,\n \"participation_snapshot\" TEXT NOT NULL\n);",
320
+ "columns": {
321
+ "id": {
322
+ "type": "UUID",
323
+ "primaryKey": true,
324
+ "referenceKind": "id",
325
+ "notNull": true
326
+ },
327
+ "slug": {
328
+ "type": "TEXT",
329
+ "notNull": true
330
+ },
331
+ "context": {
332
+ "type": "TEXT",
333
+ "notNull": true,
334
+ "default": ""
335
+ },
336
+ "created_at": {
337
+ "type": "TIMESTAMP",
338
+ "notNull": true,
339
+ "default": "current_timestamp"
340
+ },
341
+ "updated_at": {
342
+ "type": "TIMESTAMP",
343
+ "notNull": true,
344
+ "default": "current_timestamp"
345
+ },
346
+ "tenant_id": {
347
+ "type": "UUID",
348
+ "referenceKind": "tenantId",
349
+ "notNull": true,
350
+ "unique": false
351
+ },
352
+ "poll_id": {
353
+ "type": "UUID",
354
+ "referenceKind": "foreignKey",
355
+ "notNull": true,
356
+ "unique": false,
357
+ "foreignKey": {
358
+ "table": "record_polls",
359
+ "column": "id",
360
+ "onDelete": "NO ACTION",
361
+ "onUpdate": "NO ACTION"
362
+ }
363
+ },
364
+ "actor_profile_id": {
365
+ "type": "UUID",
366
+ "referenceKind": "crossPackageRef",
367
+ "notNull": true,
368
+ "unique": false
369
+ },
370
+ "option_id": {
371
+ "type": "TEXT",
372
+ "notNull": true,
373
+ "unique": false
374
+ },
375
+ "participation_snapshot": {
376
+ "type": "TEXT",
377
+ "notNull": true,
378
+ "unique": false
379
+ }
380
+ },
381
+ "indexes": [
382
+ {
383
+ "name": "poll_votes_slug_context_idx",
384
+ "columns": [
385
+ "tenant_id",
386
+ "slug",
387
+ "context"
388
+ ],
389
+ "unique": true
390
+ },
391
+ {
392
+ "name": "poll_votes_actor",
393
+ "columns": [
394
+ "tenant_id",
395
+ "poll_id",
396
+ "actor_profile_id"
397
+ ],
398
+ "unique": true
399
+ },
400
+ {
401
+ "name": "poll_votes_tenant_id_created_at_idx",
402
+ "columns": [
403
+ "tenant_id",
404
+ "created_at"
405
+ ]
406
+ },
407
+ {
408
+ "name": "poll_votes_poll_id_idx",
409
+ "columns": [
410
+ "poll_id"
411
+ ]
412
+ },
413
+ {
414
+ "name": "poll_votes_actor_profile_id_idx",
415
+ "columns": [
416
+ "actor_profile_id"
417
+ ]
418
+ }
419
+ ],
420
+ "version": "c22797d0"
421
+ },
422
+ "importPath": "@happyvertical/smrt-reactions"
423
+ },
424
+ "@happyvertical/smrt-reactions:Poll": {
425
+ "name": "poll",
426
+ "className": "Poll",
427
+ "qualifiedName": "@happyvertical/smrt-reactions:Poll",
428
+ "collection": "polls",
429
+ "filePath": "/home/runner/work/smrt/smrt/packages/reactions/src/models/Poll.ts",
430
+ "packageName": "@happyvertical/smrt-reactions",
431
+ "fields": {
432
+ "metaType": {
433
+ "type": "text",
434
+ "required": true,
435
+ "_meta": {
436
+ "required": true
437
+ }
438
+ },
439
+ "metaId": {
440
+ "type": "text",
441
+ "required": true,
442
+ "_meta": {
443
+ "required": true
444
+ }
445
+ },
446
+ "role": {
447
+ "type": "text",
448
+ "required": true,
449
+ "_meta": {
450
+ "required": true
451
+ }
452
+ },
453
+ "sortOrder": {
454
+ "type": "integer",
455
+ "required": false,
456
+ "default": 0
457
+ },
458
+ "tenantId": {
459
+ "type": "text",
460
+ "required": true,
461
+ "_meta": {
462
+ "sqlType": "UUID",
463
+ "__tenancy": {
464
+ "isTenantIdField": true,
465
+ "autoFilter": true,
466
+ "required": true,
467
+ "autoPopulate": true,
468
+ "nullable": false,
469
+ "mode": "required",
470
+ "field": "tenantId",
471
+ "allowSuperAdminBypass": false
472
+ }
473
+ }
474
+ },
475
+ "question": {
476
+ "type": "text",
477
+ "required": true,
478
+ "_meta": {
479
+ "required": true
480
+ }
481
+ },
482
+ "optionsJson": {
483
+ "type": "text",
484
+ "required": false,
485
+ "_meta": {
486
+ "readonly": true
487
+ },
488
+ "readonly": true
489
+ },
490
+ "opensAt": {
491
+ "type": "datetime",
492
+ "required": false,
493
+ "_meta": {
494
+ "nullable": true
495
+ }
496
+ },
497
+ "closesAt": {
498
+ "type": "datetime",
499
+ "required": false,
500
+ "_meta": {
501
+ "nullable": true
502
+ }
503
+ },
504
+ "visibility": {
505
+ "type": "text",
506
+ "required": false,
507
+ "default": "always",
508
+ "enum": [
509
+ "always",
510
+ "after_vote",
511
+ "after_close"
512
+ ]
513
+ },
514
+ "oneVotePerActor": {
515
+ "type": "boolean",
516
+ "required": true,
517
+ "default": true
518
+ },
519
+ "anonymousTally": {
520
+ "type": "boolean",
521
+ "required": true,
522
+ "default": true
523
+ },
524
+ "closed": {
525
+ "type": "boolean",
526
+ "required": true,
527
+ "default": false
528
+ }
529
+ },
530
+ "methods": {
531
+ "hydrate": {
532
+ "name": "hydrate",
533
+ "async": true,
534
+ "parameters": [],
535
+ "returnType": "Promise<T | null>",
536
+ "isStatic": false,
537
+ "isPublic": true
538
+ },
539
+ "assertWriteAuthority": {
540
+ "name": "assertWriteAuthority",
541
+ "async": false,
542
+ "parameters": [],
543
+ "returnType": "void",
544
+ "isStatic": false,
545
+ "isPublic": true
546
+ }
547
+ },
548
+ "decoratorConfig": {
549
+ "tableName": "record_polls",
550
+ "api": false,
551
+ "mcp": false,
552
+ "cli": false,
553
+ "hooks": {
554
+ "beforeDelete": "assertWriteAuthority"
555
+ },
556
+ "indexes": [
557
+ {
558
+ "name": "record_polls_target",
559
+ "columns": [
560
+ "tenantId",
561
+ "metaType",
562
+ "metaId"
563
+ ]
564
+ }
565
+ ],
566
+ "tenantScoped": {
567
+ "mode": "required"
568
+ },
569
+ "conflictColumns": [
570
+ "tenant_id",
571
+ "slug",
572
+ "context"
573
+ ]
574
+ },
575
+ "extends": "SmrtPolymorphicAssociation",
576
+ "exportName": "Poll",
577
+ "collectionExportName": "PollCollection",
578
+ "validationRules": [
579
+ {
580
+ "field": "metaType",
581
+ "rule": "required",
582
+ "fieldType": "text"
583
+ },
584
+ {
585
+ "field": "metaId",
586
+ "rule": "required",
587
+ "fieldType": "text"
588
+ },
589
+ {
590
+ "field": "role",
591
+ "rule": "required",
592
+ "fieldType": "text"
593
+ },
594
+ {
595
+ "field": "question",
596
+ "rule": "required",
597
+ "fieldType": "text"
598
+ },
599
+ {
600
+ "field": "oneVotePerActor",
601
+ "rule": "required",
602
+ "fieldType": "boolean"
603
+ },
604
+ {
605
+ "field": "anonymousTally",
606
+ "rule": "required",
607
+ "fieldType": "boolean"
608
+ },
609
+ {
610
+ "field": "closed",
611
+ "rule": "required",
612
+ "fieldType": "boolean"
613
+ }
614
+ ],
615
+ "schema": {
616
+ "tableName": "record_polls",
617
+ "ddl": "CREATE TABLE IF NOT EXISTS \"record_polls\" (\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 \"question\" TEXT NOT NULL,\n \"options_json\" TEXT,\n \"opens_at\" TIMESTAMP,\n \"closes_at\" TIMESTAMP,\n \"visibility\" TEXT DEFAULT 'always',\n \"one_vote_per_actor\" BOOLEAN NOT NULL DEFAULT TRUE,\n \"anonymous_tally\" BOOLEAN NOT NULL DEFAULT TRUE,\n \"closed\" BOOLEAN NOT NULL DEFAULT FALSE\n);",
618
+ "columns": {
619
+ "id": {
620
+ "type": "UUID",
621
+ "primaryKey": true,
622
+ "referenceKind": "id",
623
+ "notNull": true
624
+ },
625
+ "slug": {
626
+ "type": "TEXT",
627
+ "notNull": true
628
+ },
629
+ "context": {
630
+ "type": "TEXT",
631
+ "notNull": true,
632
+ "default": ""
633
+ },
634
+ "created_at": {
635
+ "type": "TIMESTAMP",
636
+ "notNull": true,
637
+ "default": "current_timestamp"
638
+ },
639
+ "updated_at": {
640
+ "type": "TIMESTAMP",
641
+ "notNull": true,
642
+ "default": "current_timestamp"
643
+ },
644
+ "meta_type": {
645
+ "type": "TEXT",
646
+ "notNull": true,
647
+ "unique": false
648
+ },
649
+ "meta_id": {
650
+ "type": "TEXT",
651
+ "notNull": true,
652
+ "unique": false
653
+ },
654
+ "role": {
655
+ "type": "TEXT",
656
+ "notNull": true,
657
+ "unique": false
658
+ },
659
+ "sort_order": {
660
+ "type": "INTEGER",
661
+ "notNull": false,
662
+ "unique": false,
663
+ "default": 0
664
+ },
665
+ "tenant_id": {
666
+ "type": "UUID",
667
+ "referenceKind": "tenantId",
668
+ "notNull": true,
669
+ "unique": false
670
+ },
671
+ "question": {
672
+ "type": "TEXT",
673
+ "notNull": true,
674
+ "unique": false
675
+ },
676
+ "options_json": {
677
+ "type": "TEXT",
678
+ "notNull": false,
679
+ "unique": false
680
+ },
681
+ "opens_at": {
682
+ "type": "TIMESTAMP",
683
+ "notNull": false,
684
+ "unique": false
685
+ },
686
+ "closes_at": {
687
+ "type": "TIMESTAMP",
688
+ "notNull": false,
689
+ "unique": false
690
+ },
691
+ "visibility": {
692
+ "type": "TEXT",
693
+ "notNull": false,
694
+ "unique": false,
695
+ "default": "always"
696
+ },
697
+ "one_vote_per_actor": {
698
+ "type": "BOOLEAN",
699
+ "notNull": true,
700
+ "unique": false,
701
+ "default": true
702
+ },
703
+ "anonymous_tally": {
704
+ "type": "BOOLEAN",
705
+ "notNull": true,
706
+ "unique": false,
707
+ "default": true
708
+ },
709
+ "closed": {
710
+ "type": "BOOLEAN",
711
+ "notNull": true,
712
+ "unique": false,
713
+ "default": false
714
+ }
715
+ },
716
+ "indexes": [
717
+ {
718
+ "name": "record_polls_slug_context_idx",
719
+ "columns": [
720
+ "tenant_id",
721
+ "slug",
722
+ "context"
723
+ ],
724
+ "unique": true
725
+ },
726
+ {
727
+ "name": "record_polls_target",
728
+ "columns": [
729
+ "tenant_id",
730
+ "meta_type",
731
+ "meta_id"
732
+ ]
733
+ },
734
+ {
735
+ "name": "record_polls_tenant_id_created_at_idx",
736
+ "columns": [
737
+ "tenant_id",
738
+ "created_at"
739
+ ]
740
+ },
741
+ {
742
+ "name": "record_polls_meta_type_meta_id_idx",
743
+ "columns": [
744
+ "meta_type",
745
+ "meta_id"
746
+ ]
747
+ }
748
+ ],
749
+ "version": "f6713370"
750
+ },
751
+ "importPath": "@happyvertical/smrt-reactions"
752
+ },
753
+ "@happyvertical/smrt-reactions:PollVote": {
754
+ "name": "pollvote",
755
+ "className": "PollVote",
756
+ "qualifiedName": "@happyvertical/smrt-reactions:PollVote",
757
+ "collection": "pollvotes",
758
+ "description": "Append-only through PollService; no generated write API.",
759
+ "filePath": "/home/runner/work/smrt/smrt/packages/reactions/src/models/PollVote.ts",
760
+ "packageName": "@happyvertical/smrt-reactions",
761
+ "fields": {
762
+ "tenantId": {
763
+ "type": "text",
764
+ "required": true,
765
+ "_meta": {
766
+ "sqlType": "UUID",
767
+ "__tenancy": {
768
+ "isTenantIdField": true,
769
+ "autoFilter": true,
770
+ "required": true,
771
+ "autoPopulate": true,
772
+ "nullable": false,
773
+ "mode": "required",
774
+ "field": "tenantId",
775
+ "allowSuperAdminBypass": false
776
+ }
777
+ }
778
+ },
779
+ "pollId": {
780
+ "type": "foreignKey",
781
+ "required": true,
782
+ "related": "Poll",
783
+ "_meta": {
784
+ "required": true,
785
+ "onDelete": "NO ACTION",
786
+ "onUpdate": "NO ACTION"
787
+ }
788
+ },
789
+ "actorProfileId": {
790
+ "type": "crossPackageRef",
791
+ "required": true,
792
+ "related": "@happyvertical/smrt-profiles:Profile"
793
+ },
794
+ "optionId": {
795
+ "type": "text",
796
+ "required": true,
797
+ "_meta": {
798
+ "required": true,
799
+ "readonly": true
800
+ },
801
+ "readonly": true
802
+ },
803
+ "participationSnapshot": {
804
+ "type": "text",
805
+ "required": true,
806
+ "_meta": {
807
+ "required": true,
808
+ "readonly": true
809
+ },
810
+ "readonly": true
811
+ }
812
+ },
813
+ "methods": {
814
+ "assertWriteAuthority": {
815
+ "name": "assertWriteAuthority",
816
+ "async": false,
817
+ "parameters": [],
818
+ "returnType": "void",
819
+ "isStatic": false,
820
+ "isPublic": true
821
+ }
822
+ },
823
+ "decoratorConfig": {
824
+ "tableName": "poll_votes",
825
+ "api": false,
826
+ "mcp": false,
827
+ "cli": false,
828
+ "hooks": {
829
+ "beforeDelete": "assertWriteAuthority"
830
+ },
831
+ "indexes": [
832
+ {
833
+ "name": "poll_votes_actor",
834
+ "columns": [
835
+ "tenantId",
836
+ "pollId",
837
+ "actorProfileId"
838
+ ],
839
+ "unique": true
840
+ }
841
+ ],
842
+ "tenantScoped": {
843
+ "mode": "required"
844
+ },
845
+ "conflictColumns": [
846
+ "tenant_id",
847
+ "slug",
848
+ "context"
849
+ ]
850
+ },
851
+ "extends": "SmrtObject",
852
+ "exportName": "PollVote",
853
+ "collectionExportName": "PollVoteCollection",
854
+ "validationRules": [
855
+ {
856
+ "field": "pollId",
857
+ "rule": "required",
858
+ "fieldType": "foreignKey"
859
+ },
860
+ {
861
+ "field": "actorProfileId",
862
+ "rule": "required",
863
+ "fieldType": "crossPackageRef"
864
+ },
865
+ {
866
+ "field": "optionId",
867
+ "rule": "required",
868
+ "fieldType": "text"
869
+ },
870
+ {
871
+ "field": "participationSnapshot",
872
+ "rule": "required",
873
+ "fieldType": "text"
874
+ }
875
+ ],
876
+ "schema": {
877
+ "tableName": "poll_votes",
878
+ "ddl": "CREATE TABLE IF NOT EXISTS \"poll_votes\" (\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 \"poll_id\" UUID NOT NULL,\n \"actor_profile_id\" UUID NOT NULL,\n \"option_id\" TEXT NOT NULL,\n \"participation_snapshot\" TEXT NOT NULL\n);",
879
+ "columns": {
880
+ "id": {
881
+ "type": "UUID",
882
+ "primaryKey": true,
883
+ "referenceKind": "id",
884
+ "notNull": true
885
+ },
886
+ "slug": {
887
+ "type": "TEXT",
888
+ "notNull": true
889
+ },
890
+ "context": {
891
+ "type": "TEXT",
892
+ "notNull": true,
893
+ "default": ""
894
+ },
895
+ "created_at": {
896
+ "type": "TIMESTAMP",
897
+ "notNull": true,
898
+ "default": "current_timestamp"
899
+ },
900
+ "updated_at": {
901
+ "type": "TIMESTAMP",
902
+ "notNull": true,
903
+ "default": "current_timestamp"
904
+ },
905
+ "tenant_id": {
906
+ "type": "UUID",
907
+ "referenceKind": "tenantId",
908
+ "notNull": true,
909
+ "unique": false
910
+ },
911
+ "poll_id": {
912
+ "type": "UUID",
913
+ "referenceKind": "foreignKey",
914
+ "notNull": true,
915
+ "unique": false,
916
+ "foreignKey": {
917
+ "table": "record_polls",
918
+ "column": "id",
919
+ "onDelete": "NO ACTION",
920
+ "onUpdate": "NO ACTION"
921
+ }
922
+ },
923
+ "actor_profile_id": {
924
+ "type": "UUID",
925
+ "referenceKind": "crossPackageRef",
926
+ "notNull": true,
927
+ "unique": false
928
+ },
929
+ "option_id": {
930
+ "type": "TEXT",
931
+ "notNull": true,
932
+ "unique": false
933
+ },
934
+ "participation_snapshot": {
935
+ "type": "TEXT",
936
+ "notNull": true,
937
+ "unique": false
938
+ }
939
+ },
940
+ "indexes": [
941
+ {
942
+ "name": "poll_votes_slug_context_idx",
943
+ "columns": [
944
+ "tenant_id",
945
+ "slug",
946
+ "context"
947
+ ],
948
+ "unique": true
949
+ },
950
+ {
951
+ "name": "poll_votes_actor",
952
+ "columns": [
953
+ "tenant_id",
954
+ "poll_id",
955
+ "actor_profile_id"
956
+ ],
957
+ "unique": true
958
+ },
959
+ {
960
+ "name": "poll_votes_tenant_id_created_at_idx",
961
+ "columns": [
962
+ "tenant_id",
963
+ "created_at"
964
+ ]
965
+ },
966
+ {
967
+ "name": "poll_votes_poll_id_idx",
968
+ "columns": [
969
+ "poll_id"
970
+ ]
971
+ },
972
+ {
973
+ "name": "poll_votes_actor_profile_id_idx",
974
+ "columns": [
975
+ "actor_profile_id"
976
+ ]
977
+ }
978
+ ],
979
+ "version": "c22797d0"
980
+ },
981
+ "importPath": "@happyvertical/smrt-reactions"
982
+ },
983
+ "@happyvertical/smrt-reactions:Reaction": {
984
+ "name": "reaction",
985
+ "className": "Reaction",
986
+ "qualifiedName": "@happyvertical/smrt-reactions:Reaction",
987
+ "collection": "reactions",
988
+ "filePath": "/home/runner/work/smrt/smrt/packages/reactions/src/models/Reaction.ts",
989
+ "packageName": "@happyvertical/smrt-reactions",
990
+ "fields": {
991
+ "metaType": {
992
+ "type": "text",
993
+ "required": true,
994
+ "_meta": {
995
+ "required": true
996
+ }
997
+ },
998
+ "metaId": {
999
+ "type": "text",
1000
+ "required": true,
1001
+ "_meta": {
1002
+ "required": true
1003
+ }
1004
+ },
1005
+ "role": {
1006
+ "type": "text",
1007
+ "required": true,
1008
+ "_meta": {
1009
+ "required": true
1010
+ }
1011
+ },
1012
+ "sortOrder": {
1013
+ "type": "integer",
1014
+ "required": false,
1015
+ "default": 0
1016
+ },
1017
+ "tenantId": {
1018
+ "type": "text",
1019
+ "required": true,
1020
+ "_meta": {
1021
+ "sqlType": "UUID",
1022
+ "__tenancy": {
1023
+ "isTenantIdField": true,
1024
+ "autoFilter": true,
1025
+ "required": true,
1026
+ "autoPopulate": true,
1027
+ "nullable": false,
1028
+ "mode": "required",
1029
+ "field": "tenantId",
1030
+ "allowSuperAdminBypass": false
1031
+ }
1032
+ }
1033
+ },
1034
+ "actorProfileId": {
1035
+ "type": "crossPackageRef",
1036
+ "required": true,
1037
+ "related": "@happyvertical/smrt-profiles:Profile"
1038
+ },
1039
+ "kind": {
1040
+ "type": "text",
1041
+ "required": true,
1042
+ "default": "like",
1043
+ "_meta": {
1044
+ "required": true
1045
+ },
1046
+ "enum": [
1047
+ "like",
1048
+ "love",
1049
+ "celebrate",
1050
+ "insightful",
1051
+ "support"
1052
+ ]
1053
+ }
1054
+ },
1055
+ "methods": {
1056
+ "hydrate": {
1057
+ "name": "hydrate",
1058
+ "async": true,
1059
+ "parameters": [],
1060
+ "returnType": "Promise<T | null>",
1061
+ "isStatic": false,
1062
+ "isPublic": true
1063
+ },
1064
+ "assertWriteAuthority": {
1065
+ "name": "assertWriteAuthority",
1066
+ "async": false,
1067
+ "parameters": [],
1068
+ "returnType": "void",
1069
+ "isStatic": false,
1070
+ "isPublic": true
1071
+ }
1072
+ },
1073
+ "decoratorConfig": {
1074
+ "tableName": "record_reactions",
1075
+ "api": false,
1076
+ "mcp": false,
1077
+ "cli": false,
1078
+ "hooks": {
1079
+ "beforeDelete": "assertWriteAuthority"
1080
+ },
1081
+ "indexes": [
1082
+ {
1083
+ "name": "record_reactions_actor_kind",
1084
+ "columns": [
1085
+ "tenantId",
1086
+ "metaType",
1087
+ "metaId",
1088
+ "actorProfileId",
1089
+ "kind"
1090
+ ],
1091
+ "unique": true
1092
+ }
1093
+ ],
1094
+ "tenantScoped": {
1095
+ "mode": "required"
1096
+ },
1097
+ "conflictColumns": [
1098
+ "tenant_id",
1099
+ "slug",
1100
+ "context"
1101
+ ]
1102
+ },
1103
+ "extends": "SmrtPolymorphicAssociation",
1104
+ "exportName": "Reaction",
1105
+ "collectionExportName": "ReactionCollection",
1106
+ "validationRules": [
1107
+ {
1108
+ "field": "metaType",
1109
+ "rule": "required",
1110
+ "fieldType": "text"
1111
+ },
1112
+ {
1113
+ "field": "metaId",
1114
+ "rule": "required",
1115
+ "fieldType": "text"
1116
+ },
1117
+ {
1118
+ "field": "role",
1119
+ "rule": "required",
1120
+ "fieldType": "text"
1121
+ },
1122
+ {
1123
+ "field": "actorProfileId",
1124
+ "rule": "required",
1125
+ "fieldType": "crossPackageRef"
1126
+ },
1127
+ {
1128
+ "field": "kind",
1129
+ "rule": "required",
1130
+ "fieldType": "text"
1131
+ }
1132
+ ],
1133
+ "schema": {
1134
+ "tableName": "record_reactions",
1135
+ "ddl": "CREATE TABLE IF NOT EXISTS \"record_reactions\" (\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 \"actor_profile_id\" UUID NOT NULL,\n \"kind\" TEXT NOT NULL DEFAULT 'like'\n);",
1136
+ "columns": {
1137
+ "id": {
1138
+ "type": "UUID",
1139
+ "primaryKey": true,
1140
+ "referenceKind": "id",
1141
+ "notNull": true
1142
+ },
1143
+ "slug": {
1144
+ "type": "TEXT",
1145
+ "notNull": true
1146
+ },
1147
+ "context": {
1148
+ "type": "TEXT",
1149
+ "notNull": true,
1150
+ "default": ""
1151
+ },
1152
+ "created_at": {
1153
+ "type": "TIMESTAMP",
1154
+ "notNull": true,
1155
+ "default": "current_timestamp"
1156
+ },
1157
+ "updated_at": {
1158
+ "type": "TIMESTAMP",
1159
+ "notNull": true,
1160
+ "default": "current_timestamp"
1161
+ },
1162
+ "meta_type": {
1163
+ "type": "TEXT",
1164
+ "notNull": true,
1165
+ "unique": false
1166
+ },
1167
+ "meta_id": {
1168
+ "type": "TEXT",
1169
+ "notNull": true,
1170
+ "unique": false
1171
+ },
1172
+ "role": {
1173
+ "type": "TEXT",
1174
+ "notNull": true,
1175
+ "unique": false
1176
+ },
1177
+ "sort_order": {
1178
+ "type": "INTEGER",
1179
+ "notNull": false,
1180
+ "unique": false,
1181
+ "default": 0
1182
+ },
1183
+ "tenant_id": {
1184
+ "type": "UUID",
1185
+ "referenceKind": "tenantId",
1186
+ "notNull": true,
1187
+ "unique": false
1188
+ },
1189
+ "actor_profile_id": {
1190
+ "type": "UUID",
1191
+ "referenceKind": "crossPackageRef",
1192
+ "notNull": true,
1193
+ "unique": false
1194
+ },
1195
+ "kind": {
1196
+ "type": "TEXT",
1197
+ "notNull": true,
1198
+ "unique": false,
1199
+ "default": "like"
1200
+ }
1201
+ },
1202
+ "indexes": [
1203
+ {
1204
+ "name": "record_reactions_slug_context_idx",
1205
+ "columns": [
1206
+ "tenant_id",
1207
+ "slug",
1208
+ "context"
1209
+ ],
1210
+ "unique": true
1211
+ },
1212
+ {
1213
+ "name": "record_reactions_actor_kind",
1214
+ "columns": [
1215
+ "tenant_id",
1216
+ "meta_type",
1217
+ "meta_id",
1218
+ "actor_profile_id",
1219
+ "kind"
1220
+ ],
1221
+ "unique": true
1222
+ },
1223
+ {
1224
+ "name": "record_reactions_tenant_id_created_at_idx",
1225
+ "columns": [
1226
+ "tenant_id",
1227
+ "created_at"
1228
+ ]
1229
+ },
1230
+ {
1231
+ "name": "record_reactions_meta_type_meta_id_idx",
1232
+ "columns": [
1233
+ "meta_type",
1234
+ "meta_id"
1235
+ ]
1236
+ },
1237
+ {
1238
+ "name": "record_reactions_actor_profile_id_idx",
1239
+ "columns": [
1240
+ "actor_profile_id"
1241
+ ]
1242
+ }
1243
+ ],
1244
+ "version": "678ebe0f"
1245
+ },
1246
+ "importPath": "@happyvertical/smrt-reactions"
1247
+ }
1248
+ },
1249
+ "moduleType": "smrt",
1250
+ "smrtDependencies": [
1251
+ "@happyvertical/smrt-comments",
1252
+ "@happyvertical/smrt-core",
1253
+ "@happyvertical/smrt-tenancy"
1254
+ ],
1255
+ "browser": {
1256
+ "status": "server-only",
1257
+ "issues": [
1258
+ "#3624"
1259
+ ],
1260
+ "via": [
1261
+ "@happyvertical/smrt-tenancy"
1262
+ ]
1263
+ },
1264
+ "stampsConstructors": true
1265
+ }