@happyvertical/smrt-reactions 0.0.0-stage → 0.57.24

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-DyRzkrHh.js +263 -0
  8. package/dist/chunks/src-DyRzkrHh.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
package/AGENTS.md ADDED
@@ -0,0 +1,5 @@
1
+ # @happyvertical/smrt-reactions
2
+
3
+ The model-only root exports models/collections/types; `/server` exports ParticipationRuntime. Its factory owns SQLite/PostgreSQL connections and returns reaction/poll services that require trusted host actor/profile binding and record authorization. ParticipationService from smrt-comments/participation exclusively owns entitlement, bans and quota; mutations share its transaction. DuckDB is refused before open pending SDK #1452. Models require package-private executor-bound write authority (unique transaction executors only) and disable generated mutation endpoints: hosts call services. PollVote rows retain immutable snapshot evidence; never amend a recorded vote or poll options. Svelte receives authorized projections/callbacks, never credentials or actor lists.
4
+
5
+ Run package `test`, `typecheck`, `check`, `build`; PostgreSQL CI uses `test:postgres`. See README.md and agents/test-design.md.
package/CLAUDE.md ADDED
@@ -0,0 +1 @@
1
+ @AGENTS.md
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright <2025> <Happy Vertical Corporation>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,39 @@
1
- # Temporary Holding Version
1
+ # @happyvertical/smrt-reactions
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Generic reactions and lightweight multi-option polls on arbitrary tenant-owned records. The package root exports models, collections and types without this package’s Node runtime; the Node-owned runtime lives at `/server`. This is not a governance ballot, secret election, quorum or legal audit system.
4
+
5
+ `Reaction`, `Poll`, `PollVote` and their collections publish s-m-r-t manifests.
6
+
7
+ This release is a **SQLite/PostgreSQL milestone**. DuckDB is refused before any connection or mutation, pending [SDK #1452](https://github.com/happyvertical/sdk/issues/1452): independent public DuckDB adapters do not share committed visibility. PGlite, JSON and unknown backends are also refused. Full issue #3837 remains open until the DuckDB guarantee is implemented and verified upstream. Apply the host's normal manifest migrations before using services. The factory always opens an uncached owned adapter (`cache: false`); `cache: true` and arbitrary executor-shaped configurations are rejected. Generated API/CLI/MCP mutations are disabled; the services enforce the authorization and transaction boundary.
8
+
9
+ ```ts
10
+ import { ParticipationRuntime } from '@happyvertical/smrt-reactions/server';
11
+ const options = {
12
+ database: { type: 'postgres' as const, url: databaseUrl },
13
+ actor: { tenantId, userId, profileId },
14
+ authorizeRecord: async (access) => hostRecordAccess(access),
15
+ participation: { authorize: async (request) => hostParticipation(request) },
16
+ };
17
+ const runtime = await ParticipationRuntime.create(options);
18
+ // Apply manifest migrations to runtime.database before use.
19
+ const { reactions, polls } = runtime;
20
+ await reactions.setReaction('app:Article', articleId, 'like', true);
21
+ await reactions.retract('app:Article', articleId, 'like');
22
+ const poll = await polls.create({
23
+ recordType: 'app:Article', recordId: articleId, question: 'Next topic?',
24
+ options: [{ id: 'parks', label: 'Parks' }, { id: 'roads', label: 'Roads' }],
25
+ visibility: 'after_vote', anonymousTally: true,
26
+ });
27
+ await polls.vote(poll.id!, 'parks');
28
+ const projection = await polls.results(poll.id!);
29
+ ```
30
+
31
+ Hosts authenticate the actor and verify the profile belongs to that user and tenant. `authorizeRecord` must check the actor's active context, target ownership and requested action (`read`, `react`, `vote`, `manage`). Missing callbacks/actor IDs and rejected or throwing callbacks fail closed. Never construct these options from untrusted request actor fields. Hosts connect subscriptions/identity and record-date eligibility through the **exact** `ParticipationAuthorizer` from `@happyvertical/smrt-comments/participation`. Votes require a nonempty JSON-serializable decision `snapshot`, such as `{ planKey, eligibilityRecordDate }`; services serialize this at first write. No identity, subscriptions, Anytown, or membership policy is duplicated here.
32
+
33
+ The shared `ParticipationService` owns policies, bans and fixed-window quotas. Configure those using the comments package's public collections. New reactions/votes reserve quota in the same transaction as persistence; failures roll both back. Replays recheck permission and bans but preserve existing vote evidence and avoid charging new quota. Retractions do not consume quota. Reaction uniqueness is arbitrated inside the transaction before quota is reserved: simultaneous identical retries charge once, and a denied candidate insertion rolls back. A desired reaction state is idempotent; each `(tenant, target type, target ID, profile, kind)` is unique. Supported kinds are exported as `REACTION_KINDS`. Concurrent writes are arbitrated by database uniqueness; transaction conflicts may be retried by the host. When SQLite reports a connection invalidated after `SQLITE_BUSY`, acquire a fresh runtime and retry the entire operation. No process-local lock is used.
34
+
35
+ Poll options are fixed at creation (2–50 unique IDs). A profile can vote once per poll: an identical retry succeeds, a different choice fails, and evidence never changes through the service. Poll row writes serialize vote and administrative close/reopen. Opening is inclusive, closing exclusive. Reopening clears only manual closure and never bypasses the configured time window. A retained identical vote may replay after closure. `visibility` is `always`, `after_vote`, or `after_close`; hidden results omit both counts and total. Every projection omits voter IDs and snapshots; `anonymousTally` records the host's presentation intent, and this package always returns aggregates even when false. Direct model/collection create, save and delete are refused outside the package service write scope. Authority is bound to the exact unique transaction executor and removed when that operation ends; shared root adapters are never authorized. The exported readonly `runtime.database` exposes the owned adapter for host migrations and administrative database access. Services own transactions; arbitrary adapter injection and caller-owned transaction composition are intentionally unavailable until the SQL contract can attest supported executor identity.
36
+
37
+ `ReactionBar` and `PollCard` from `/svelte` take authorized tally/projection props and async callbacks. Refresh props after mutation and remount on actor/tenant/record changes. Components perform no fetch or authorization. Pending and disabled actions cannot submit; callback failures show an accessible error.
38
+
39
+ Validation: `pnpm --filter @happyvertical/smrt-reactions test`, `typecheck`, `check`, `build`. Tests exercise SQLite and PostgreSQL when `SMRT_TEST_POSTGRES_URL` is supplied (`test:postgres` uses the repository CI launcher). See [test design](agents/test-design.md).
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=__smrt-register__.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__smrt-register__.d.ts","sourceRoot":"","sources":["../src/__smrt-register__.ts"],"names":[],"mappings":""}
@@ -0,0 +1,263 @@
1
+ import { ObjectRegistry, SmrtCollection, SmrtObject, SmrtPolymorphicAssociation, ValidationError, crossPackageRef, field, foreignKey, smrt } from "@happyvertical/smrt-core";
2
+ import { TenantScoped, tenantId } from "@happyvertical/smrt-tenancy";
3
+ //#region src/__smrt-register__.ts
4
+ ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-reactions","packageVersion":"0.57.24","objects":{"@happyvertical/smrt-reactions:ReactionCollection":{"name":"reactioncollection","className":"ReactionCollection","qualifiedName":"@happyvertical/smrt-reactions:ReactionCollection","collection":"reactions","filePath":"/home/runner/work/smrt/smrt/packages/reactions/src/collections/index.ts","packageName":"@happyvertical/smrt-reactions","fields":{},"methods":{},"decoratorConfig":{"tableName":"record_reactions","api":false,"mcp":false,"cli":false},"extends":"SmrtCollection","extendsTypeArg":"Reaction","exportName":"ReactionCollection","collectionExportName":"ReactionCollectionCollection","schema":{"tableName":"record_reactions","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);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"meta_type":{"type":"TEXT","notNull":true,"unique":false},"meta_id":{"type":"TEXT","notNull":true,"unique":false},"role":{"type":"TEXT","notNull":true,"unique":false},"sort_order":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":true,"unique":false},"kind":{"type":"TEXT","notNull":true,"unique":false,"default":"like"}},"indexes":[{"name":"record_reactions_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"record_reactions_actor_kind","columns":["tenant_id","meta_type","meta_id","actor_profile_id","kind"],"unique":true},{"name":"record_reactions_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"record_reactions_meta_type_meta_id_idx","columns":["meta_type","meta_id"]},{"name":"record_reactions_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"678ebe0f"},"importPath":"@happyvertical/smrt-reactions"},"@happyvertical/smrt-reactions:PollCollection":{"name":"pollcollection","className":"PollCollection","qualifiedName":"@happyvertical/smrt-reactions:PollCollection","collection":"polls","filePath":"/home/runner/work/smrt/smrt/packages/reactions/src/collections/index.ts","packageName":"@happyvertical/smrt-reactions","fields":{},"methods":{},"decoratorConfig":{"tableName":"record_polls","api":false,"mcp":false,"cli":false},"extends":"SmrtCollection","extendsTypeArg":"Poll","exportName":"PollCollection","collectionExportName":"PollCollectionCollection","schema":{"tableName":"record_polls","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);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"meta_type":{"type":"TEXT","notNull":true,"unique":false},"meta_id":{"type":"TEXT","notNull":true,"unique":false},"role":{"type":"TEXT","notNull":true,"unique":false},"sort_order":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"question":{"type":"TEXT","notNull":true,"unique":false},"options_json":{"type":"TEXT","notNull":false,"unique":false},"opens_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"closes_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"visibility":{"type":"TEXT","notNull":false,"unique":false,"default":"always"},"one_vote_per_actor":{"type":"BOOLEAN","notNull":true,"unique":false,"default":true},"anonymous_tally":{"type":"BOOLEAN","notNull":true,"unique":false,"default":true},"closed":{"type":"BOOLEAN","notNull":true,"unique":false,"default":false}},"indexes":[{"name":"record_polls_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"record_polls_target","columns":["tenant_id","meta_type","meta_id"]},{"name":"record_polls_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"record_polls_meta_type_meta_id_idx","columns":["meta_type","meta_id"]}],"version":"f6713370"},"importPath":"@happyvertical/smrt-reactions"},"@happyvertical/smrt-reactions:PollVoteCollection":{"name":"pollvotecollection","className":"PollVoteCollection","qualifiedName":"@happyvertical/smrt-reactions:PollVoteCollection","collection":"pollvotes","filePath":"/home/runner/work/smrt/smrt/packages/reactions/src/collections/index.ts","packageName":"@happyvertical/smrt-reactions","fields":{},"methods":{},"decoratorConfig":{"tableName":"poll_votes","api":false,"mcp":false,"cli":false},"extends":"SmrtCollection","extendsTypeArg":"PollVote","exportName":"PollVoteCollection","collectionExportName":"PollVoteCollectionCollection","schema":{"tableName":"poll_votes","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);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"poll_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"record_polls","column":"id","onDelete":"NO ACTION","onUpdate":"NO ACTION"}},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":true,"unique":false},"option_id":{"type":"TEXT","notNull":true,"unique":false},"participation_snapshot":{"type":"TEXT","notNull":true,"unique":false}},"indexes":[{"name":"poll_votes_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"poll_votes_actor","columns":["tenant_id","poll_id","actor_profile_id"],"unique":true},{"name":"poll_votes_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"poll_votes_poll_id_idx","columns":["poll_id"]},{"name":"poll_votes_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"c22797d0"},"importPath":"@happyvertical/smrt-reactions"},"@happyvertical/smrt-reactions:Poll":{"name":"poll","className":"Poll","qualifiedName":"@happyvertical/smrt-reactions:Poll","collection":"polls","filePath":"/home/runner/work/smrt/smrt/packages/reactions/src/models/Poll.ts","packageName":"@happyvertical/smrt-reactions","fields":{"metaType":{"type":"text","required":true,"_meta":{"required":true}},"metaId":{"type":"text","required":true,"_meta":{"required":true}},"role":{"type":"text","required":true,"_meta":{"required":true}},"sortOrder":{"type":"integer","required":false,"default":0},"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"question":{"type":"text","required":true,"_meta":{"required":true}},"optionsJson":{"type":"text","required":false,"_meta":{"readonly":true},"readonly":true},"opensAt":{"type":"datetime","required":false,"_meta":{"nullable":true}},"closesAt":{"type":"datetime","required":false,"_meta":{"nullable":true}},"visibility":{"type":"text","required":false,"default":"always","enum":["always","after_vote","after_close"]},"oneVotePerActor":{"type":"boolean","required":true,"default":true},"anonymousTally":{"type":"boolean","required":true,"default":true},"closed":{"type":"boolean","required":true,"default":false}},"methods":{"hydrate":{"name":"hydrate","async":true,"parameters":[],"returnType":"Promise<T | null>","isStatic":false,"isPublic":true},"assertWriteAuthority":{"name":"assertWriteAuthority","async":false,"parameters":[],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"record_polls","api":false,"mcp":false,"cli":false,"hooks":{"beforeDelete":"assertWriteAuthority"},"indexes":[{"name":"record_polls_target","columns":["tenantId","metaType","metaId"]}],"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtPolymorphicAssociation","exportName":"Poll","collectionExportName":"PollCollection","validationRules":[{"field":"metaType","rule":"required","fieldType":"text"},{"field":"metaId","rule":"required","fieldType":"text"},{"field":"role","rule":"required","fieldType":"text"},{"field":"question","rule":"required","fieldType":"text"},{"field":"oneVotePerActor","rule":"required","fieldType":"boolean"},{"field":"anonymousTally","rule":"required","fieldType":"boolean"},{"field":"closed","rule":"required","fieldType":"boolean"}],"schema":{"tableName":"record_polls","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);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"meta_type":{"type":"TEXT","notNull":true,"unique":false},"meta_id":{"type":"TEXT","notNull":true,"unique":false},"role":{"type":"TEXT","notNull":true,"unique":false},"sort_order":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"question":{"type":"TEXT","notNull":true,"unique":false},"options_json":{"type":"TEXT","notNull":false,"unique":false},"opens_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"closes_at":{"type":"TIMESTAMP","notNull":false,"unique":false},"visibility":{"type":"TEXT","notNull":false,"unique":false,"default":"always"},"one_vote_per_actor":{"type":"BOOLEAN","notNull":true,"unique":false,"default":true},"anonymous_tally":{"type":"BOOLEAN","notNull":true,"unique":false,"default":true},"closed":{"type":"BOOLEAN","notNull":true,"unique":false,"default":false}},"indexes":[{"name":"record_polls_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"record_polls_target","columns":["tenant_id","meta_type","meta_id"]},{"name":"record_polls_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"record_polls_meta_type_meta_id_idx","columns":["meta_type","meta_id"]}],"version":"f6713370"},"importPath":"@happyvertical/smrt-reactions"},"@happyvertical/smrt-reactions:PollVote":{"name":"pollvote","className":"PollVote","qualifiedName":"@happyvertical/smrt-reactions:PollVote","collection":"pollvotes","description":"Append-only through PollService; no generated write API.","filePath":"/home/runner/work/smrt/smrt/packages/reactions/src/models/PollVote.ts","packageName":"@happyvertical/smrt-reactions","fields":{"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"pollId":{"type":"foreignKey","required":true,"related":"Poll","_meta":{"required":true,"onDelete":"NO ACTION","onUpdate":"NO ACTION"}},"actorProfileId":{"type":"crossPackageRef","required":true,"related":"@happyvertical/smrt-profiles:Profile"},"optionId":{"type":"text","required":true,"_meta":{"required":true,"readonly":true},"readonly":true},"participationSnapshot":{"type":"text","required":true,"_meta":{"required":true,"readonly":true},"readonly":true}},"methods":{"assertWriteAuthority":{"name":"assertWriteAuthority","async":false,"parameters":[],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"poll_votes","api":false,"mcp":false,"cli":false,"hooks":{"beforeDelete":"assertWriteAuthority"},"indexes":[{"name":"poll_votes_actor","columns":["tenantId","pollId","actorProfileId"],"unique":true}],"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtObject","exportName":"PollVote","collectionExportName":"PollVoteCollection","validationRules":[{"field":"pollId","rule":"required","fieldType":"foreignKey"},{"field":"actorProfileId","rule":"required","fieldType":"crossPackageRef"},{"field":"optionId","rule":"required","fieldType":"text"},{"field":"participationSnapshot","rule":"required","fieldType":"text"}],"schema":{"tableName":"poll_votes","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);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"poll_id":{"type":"UUID","referenceKind":"foreignKey","notNull":true,"unique":false,"foreignKey":{"table":"record_polls","column":"id","onDelete":"NO ACTION","onUpdate":"NO ACTION"}},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":true,"unique":false},"option_id":{"type":"TEXT","notNull":true,"unique":false},"participation_snapshot":{"type":"TEXT","notNull":true,"unique":false}},"indexes":[{"name":"poll_votes_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"poll_votes_actor","columns":["tenant_id","poll_id","actor_profile_id"],"unique":true},{"name":"poll_votes_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"poll_votes_poll_id_idx","columns":["poll_id"]},{"name":"poll_votes_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"c22797d0"},"importPath":"@happyvertical/smrt-reactions"},"@happyvertical/smrt-reactions:Reaction":{"name":"reaction","className":"Reaction","qualifiedName":"@happyvertical/smrt-reactions:Reaction","collection":"reactions","filePath":"/home/runner/work/smrt/smrt/packages/reactions/src/models/Reaction.ts","packageName":"@happyvertical/smrt-reactions","fields":{"metaType":{"type":"text","required":true,"_meta":{"required":true}},"metaId":{"type":"text","required":true,"_meta":{"required":true}},"role":{"type":"text","required":true,"_meta":{"required":true}},"sortOrder":{"type":"integer","required":false,"default":0},"tenantId":{"type":"text","required":true,"_meta":{"sqlType":"UUID","__tenancy":{"isTenantIdField":true,"autoFilter":true,"required":true,"autoPopulate":true,"nullable":false,"mode":"required","field":"tenantId","allowSuperAdminBypass":false}}},"actorProfileId":{"type":"crossPackageRef","required":true,"related":"@happyvertical/smrt-profiles:Profile"},"kind":{"type":"text","required":true,"default":"like","_meta":{"required":true},"enum":["like","love","celebrate","insightful","support"]}},"methods":{"hydrate":{"name":"hydrate","async":true,"parameters":[],"returnType":"Promise<T | null>","isStatic":false,"isPublic":true},"assertWriteAuthority":{"name":"assertWriteAuthority","async":false,"parameters":[],"returnType":"void","isStatic":false,"isPublic":true}},"decoratorConfig":{"tableName":"record_reactions","api":false,"mcp":false,"cli":false,"hooks":{"beforeDelete":"assertWriteAuthority"},"indexes":[{"name":"record_reactions_actor_kind","columns":["tenantId","metaType","metaId","actorProfileId","kind"],"unique":true}],"tenantScoped":{"mode":"required"},"conflictColumns":["tenant_id","slug","context"]},"extends":"SmrtPolymorphicAssociation","exportName":"Reaction","collectionExportName":"ReactionCollection","validationRules":[{"field":"metaType","rule":"required","fieldType":"text"},{"field":"metaId","rule":"required","fieldType":"text"},{"field":"role","rule":"required","fieldType":"text"},{"field":"actorProfileId","rule":"required","fieldType":"crossPackageRef"},{"field":"kind","rule":"required","fieldType":"text"}],"schema":{"tableName":"record_reactions","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);","columns":{"id":{"type":"UUID","primaryKey":true,"referenceKind":"id","notNull":true},"slug":{"type":"TEXT","notNull":true},"context":{"type":"TEXT","notNull":true,"default":""},"created_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"updated_at":{"type":"TIMESTAMP","notNull":true,"default":"current_timestamp"},"meta_type":{"type":"TEXT","notNull":true,"unique":false},"meta_id":{"type":"TEXT","notNull":true,"unique":false},"role":{"type":"TEXT","notNull":true,"unique":false},"sort_order":{"type":"INTEGER","notNull":false,"unique":false,"default":0},"tenant_id":{"type":"UUID","referenceKind":"tenantId","notNull":true,"unique":false},"actor_profile_id":{"type":"UUID","referenceKind":"crossPackageRef","notNull":true,"unique":false},"kind":{"type":"TEXT","notNull":true,"unique":false,"default":"like"}},"indexes":[{"name":"record_reactions_slug_context_idx","columns":["tenant_id","slug","context"],"unique":true},{"name":"record_reactions_actor_kind","columns":["tenant_id","meta_type","meta_id","actor_profile_id","kind"],"unique":true},{"name":"record_reactions_tenant_id_created_at_idx","columns":["tenant_id","created_at"]},{"name":"record_reactions_meta_type_meta_id_idx","columns":["meta_type","meta_id"]},{"name":"record_reactions_actor_profile_id_idx","columns":["actor_profile_id"]}],"version":"678ebe0f"},"importPath":"@happyvertical/smrt-reactions"}},"moduleType":"smrt","smrtDependencies":["@happyvertical/smrt-comments","@happyvertical/smrt-core","@happyvertical/smrt-tenancy"],"browser":{"status":"server-only","issues":["#3624"],"via":["@happyvertical/smrt-tenancy"]},"stampsConstructors":true}`));
5
+ //#endregion
6
+ //#region src/write-authority.ts
7
+ var authority = /* @__PURE__ */ new WeakMap();
8
+ async function withParticipationWrite(executor, work) {
9
+ authority.set(executor, (authority.get(executor) ?? 0) + 1);
10
+ try {
11
+ return await work();
12
+ } finally {
13
+ const remaining = (authority.get(executor) ?? 1) - 1;
14
+ if (remaining) authority.set(executor, remaining);
15
+ else authority.delete(executor);
16
+ }
17
+ }
18
+ function assertParticipationWrite(executor) {
19
+ if (!authority.has(executor)) throw new ValidationError("Participation records require service write authority.", "VALIDATION_PARTICIPATION_AUTHORITY");
20
+ }
21
+ //#endregion
22
+ //#region src/models/Poll.ts
23
+ var __defProp$2 = Object.defineProperty;
24
+ var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
25
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, {
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true,
29
+ value
30
+ }) : obj[key] = value;
31
+ var __decorateClass$2 = (decorators, target, key, kind) => {
32
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
33
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
34
+ if (kind && result) __defProp$2(target, key, result);
35
+ return result;
36
+ };
37
+ var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
38
+ var Poll = class extends SmrtPolymorphicAssociation {
39
+ tenantId = "";
40
+ question = "";
41
+ optionsJson = "[]";
42
+ opensAt = null;
43
+ closesAt = null;
44
+ visibility = "always";
45
+ oneVotePerActor = true;
46
+ anonymousTally = true;
47
+ closed = false;
48
+ constructor(options = {}) {
49
+ super(options);
50
+ if (options.tenantId !== void 0) this.tenantId = options.tenantId;
51
+ if (options.question !== void 0) this.question = options.question;
52
+ if (options.optionsJson !== void 0) this.optionsJson = options.optionsJson;
53
+ if (options.opensAt !== void 0) this.opensAt = options.opensAt;
54
+ if (options.closesAt !== void 0) this.closesAt = options.closesAt;
55
+ if (options.visibility !== void 0) this.visibility = options.visibility;
56
+ if (options.anonymousTally !== void 0) this.anonymousTally = options.anonymousTally;
57
+ if (options.closed !== void 0) this.closed = options.closed;
58
+ }
59
+ assertWriteAuthority() {
60
+ assertParticipationWrite(this.db);
61
+ }
62
+ async validateBeforeSave() {
63
+ assertParticipationWrite(this.db);
64
+ await super.validateBeforeSave();
65
+ this.pollOptions;
66
+ if (this.id) {
67
+ const existing = await this.getCanonicalPersistedRow({ id: this.id });
68
+ if (existing && (existing.options_json !== this.optionsJson || existing.tenant_id !== this.tenantId || existing.meta_type !== this.metaType || existing.meta_id !== this.metaId)) throw new ValidationError("Poll target and options are immutable.", "VALIDATION_IMMUTABLE_POLL");
69
+ }
70
+ }
71
+ get pollOptions() {
72
+ const parsed = JSON.parse(this.optionsJson);
73
+ if (!Array.isArray(parsed) || parsed.length < 2 || parsed.length > 50 || parsed.some((o) => !o || typeof o.id !== "string" || !o.id.trim() || typeof o.label !== "string" || !o.label.trim()) || new Set(parsed.map((o) => o.id)).size !== parsed.length) throw new TypeError("Invalid poll options.");
74
+ return parsed.map((o) => ({
75
+ id: o.id,
76
+ label: o.label
77
+ }));
78
+ }
79
+ };
80
+ __publicField$2(Poll, "__smrtPackage__", "@happyvertical/smrt-reactions");
81
+ __decorateClass$2([tenantId()], Poll.prototype, "tenantId", 2);
82
+ __decorateClass$2([field({ required: true })], Poll.prototype, "question", 2);
83
+ __decorateClass$2([field({
84
+ type: "text",
85
+ readonly: true
86
+ })], Poll.prototype, "optionsJson", 2);
87
+ __decorateClass$2([field({
88
+ type: "datetime",
89
+ nullable: true
90
+ })], Poll.prototype, "opensAt", 2);
91
+ __decorateClass$2([field({
92
+ type: "datetime",
93
+ nullable: true
94
+ })], Poll.prototype, "closesAt", 2);
95
+ __decorateClass$2([field()], Poll.prototype, "visibility", 2);
96
+ __decorateClass$2([field()], Poll.prototype, "oneVotePerActor", 2);
97
+ __decorateClass$2([field()], Poll.prototype, "anonymousTally", 2);
98
+ __decorateClass$2([field()], Poll.prototype, "closed", 2);
99
+ Poll = __decorateClass$2([TenantScoped({ mode: "required" }), smrt({
100
+ tableName: "record_polls",
101
+ api: false,
102
+ mcp: false,
103
+ cli: false,
104
+ hooks: { beforeDelete: "assertWriteAuthority" },
105
+ indexes: [{
106
+ name: "record_polls_target",
107
+ columns: [
108
+ "tenantId",
109
+ "metaType",
110
+ "metaId"
111
+ ]
112
+ }]
113
+ })], Poll);
114
+ //#endregion
115
+ //#region src/models/PollVote.ts
116
+ var __defProp$1 = Object.defineProperty;
117
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
118
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, {
119
+ enumerable: true,
120
+ configurable: true,
121
+ writable: true,
122
+ value
123
+ }) : obj[key] = value;
124
+ var __decorateClass$1 = (decorators, target, key, kind) => {
125
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
126
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
127
+ if (kind && result) __defProp$1(target, key, result);
128
+ return result;
129
+ };
130
+ var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
131
+ var PollVote = class extends SmrtObject {
132
+ tenantId = "";
133
+ pollId = "";
134
+ actorProfileId = "";
135
+ optionId = "";
136
+ participationSnapshot = "{}";
137
+ constructor(options = {}) {
138
+ super(options);
139
+ if (options.tenantId !== void 0) this.tenantId = options.tenantId;
140
+ if (options.pollId !== void 0) this.pollId = options.pollId;
141
+ if (options.actorProfileId !== void 0) this.actorProfileId = options.actorProfileId;
142
+ if (options.optionId !== void 0) this.optionId = options.optionId;
143
+ if (options.participationSnapshot !== void 0) this.participationSnapshot = options.participationSnapshot;
144
+ }
145
+ assertWriteAuthority() {
146
+ assertParticipationWrite(this.db);
147
+ }
148
+ async validateBeforeSave() {
149
+ assertParticipationWrite(this.db);
150
+ await super.validateBeforeSave();
151
+ const evidence = JSON.parse(this.participationSnapshot);
152
+ if (!evidence || typeof evidence !== "object" || Array.isArray(evidence) || Object.keys(evidence).length === 0) throw new TypeError("Participation snapshot must be a nonempty JSON object.");
153
+ if (this.id) {
154
+ const existing = await this.getCanonicalPersistedRow({ id: this.id });
155
+ if (existing && (existing.participation_snapshot !== this.participationSnapshot || existing.option_id !== this.optionId || existing.tenant_id !== this.tenantId || existing.poll_id !== this.pollId || existing.actor_profile_id !== this.actorProfileId)) throw new ValidationError("Recorded votes are immutable.", "VALIDATION_IMMUTABLE_VOTE");
156
+ }
157
+ }
158
+ };
159
+ __publicField$1(PollVote, "__smrtPackage__", "@happyvertical/smrt-reactions");
160
+ __decorateClass$1([tenantId()], PollVote.prototype, "tenantId", 2);
161
+ __decorateClass$1([foreignKey(Poll, {
162
+ required: true,
163
+ onUpdate: "NO ACTION",
164
+ onDelete: "NO ACTION"
165
+ })], PollVote.prototype, "pollId", 2);
166
+ __decorateClass$1([crossPackageRef("@happyvertical/smrt-profiles:Profile", { required: true })], PollVote.prototype, "actorProfileId", 2);
167
+ __decorateClass$1([field({
168
+ required: true,
169
+ readonly: true
170
+ })], PollVote.prototype, "optionId", 2);
171
+ __decorateClass$1([field({
172
+ type: "text",
173
+ required: true,
174
+ readonly: true
175
+ })], PollVote.prototype, "participationSnapshot", 2);
176
+ PollVote = __decorateClass$1([TenantScoped({ mode: "required" }), smrt({
177
+ tableName: "poll_votes",
178
+ api: false,
179
+ mcp: false,
180
+ cli: false,
181
+ hooks: { beforeDelete: "assertWriteAuthority" },
182
+ indexes: [{
183
+ name: "poll_votes_actor",
184
+ columns: [
185
+ "tenantId",
186
+ "pollId",
187
+ "actorProfileId"
188
+ ],
189
+ unique: true
190
+ }]
191
+ })], PollVote);
192
+ //#endregion
193
+ //#region src/models/Reaction.ts
194
+ var __defProp = Object.defineProperty;
195
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
196
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
197
+ enumerable: true,
198
+ configurable: true,
199
+ writable: true,
200
+ value
201
+ }) : obj[key] = value;
202
+ var __decorateClass = (decorators, target, key, kind) => {
203
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
204
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
205
+ if (kind && result) __defProp(target, key, result);
206
+ return result;
207
+ };
208
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
209
+ var Reaction = class extends SmrtPolymorphicAssociation {
210
+ tenantId = "";
211
+ actorProfileId = "";
212
+ kind = "like";
213
+ constructor(options = {}) {
214
+ super(options);
215
+ if (options.tenantId !== void 0) this.tenantId = options.tenantId;
216
+ if (options.actorProfileId !== void 0) this.actorProfileId = options.actorProfileId;
217
+ if (options.kind !== void 0) this.kind = options.kind;
218
+ }
219
+ assertWriteAuthority() {
220
+ assertParticipationWrite(this.db);
221
+ }
222
+ async validateBeforeSave() {
223
+ assertParticipationWrite(this.db);
224
+ await super.validateBeforeSave();
225
+ }
226
+ };
227
+ __publicField(Reaction, "__smrtPackage__", "@happyvertical/smrt-reactions");
228
+ __decorateClass([tenantId()], Reaction.prototype, "tenantId", 2);
229
+ __decorateClass([crossPackageRef("@happyvertical/smrt-profiles:Profile", { required: true })], Reaction.prototype, "actorProfileId", 2);
230
+ __decorateClass([field({ required: true })], Reaction.prototype, "kind", 2);
231
+ Reaction = __decorateClass([TenantScoped({ mode: "required" }), smrt({
232
+ tableName: "record_reactions",
233
+ api: false,
234
+ mcp: false,
235
+ cli: false,
236
+ hooks: { beforeDelete: "assertWriteAuthority" },
237
+ indexes: [{
238
+ name: "record_reactions_actor_kind",
239
+ columns: [
240
+ "tenantId",
241
+ "metaType",
242
+ "metaId",
243
+ "actorProfileId",
244
+ "kind"
245
+ ],
246
+ unique: true
247
+ }]
248
+ })], Reaction);
249
+ //#endregion
250
+ //#region src/collections/index.ts
251
+ var ReactionCollection = class extends SmrtCollection {
252
+ static _itemClass = Reaction;
253
+ };
254
+ var PollCollection = class extends SmrtCollection {
255
+ static _itemClass = Poll;
256
+ };
257
+ var PollVoteCollection = class extends SmrtCollection {
258
+ static _itemClass = PollVote;
259
+ };
260
+ //#endregion
261
+ export { PollVote as a, Reaction as i, PollVoteCollection as n, Poll as o, ReactionCollection as r, withParticipationWrite as s, PollCollection as t };
262
+
263
+ //# sourceMappingURL=src-DyRzkrHh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"src-DyRzkrHh.js","names":[],"sources":["../../src/__smrt-register__.ts","../../src/write-authority.ts","../../src/models/Poll.ts","../../src/models/PollVote.ts","../../src/models/Reaction.ts","../../src/collections/index.ts"],"sourcesContent":["// Generated by @happyvertical/smrt-core smrtPlugin at library build time.\n// The package manifest is inlined so self-registration cannot miss when a\n// downstream bundler relocates this module away from dist/manifest.json\n// (https://github.com/happyvertical/smrt/issues/1506,\n// https://github.com/happyvertical/smrt/issues/1507).\nimport { ObjectRegistry } from '@happyvertical/smrt-core';\n\nObjectRegistry.registerPackageManifest(JSON.parse(\"{\\\"version\\\":\\\"1.0.0\\\",\\\"timestamp\\\":0,\\\"packageName\\\":\\\"@happyvertical/smrt-reactions\\\",\\\"packageVersion\\\":\\\"0.57.24\\\",\\\"objects\\\":{\\\"@happyvertical/smrt-reactions:ReactionCollection\\\":{\\\"name\\\":\\\"reactioncollection\\\",\\\"className\\\":\\\"ReactionCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-reactions:ReactionCollection\\\",\\\"collection\\\":\\\"reactions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/reactions/src/collections/index.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-reactions\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"record_reactions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Reaction\\\",\\\"exportName\\\":\\\"ReactionCollection\\\",\\\"collectionExportName\\\":\\\"ReactionCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"record_reactions\\\",\\\"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);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"actor_profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"like\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"record_reactions_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"record_reactions_actor_kind\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\",\\\"actor_profile_id\\\",\\\"kind\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"record_reactions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"record_reactions_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]},{\\\"name\\\":\\\"record_reactions_actor_profile_id_idx\\\",\\\"columns\\\":[\\\"actor_profile_id\\\"]}],\\\"version\\\":\\\"678ebe0f\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-reactions\\\"},\\\"@happyvertical/smrt-reactions:PollCollection\\\":{\\\"name\\\":\\\"pollcollection\\\",\\\"className\\\":\\\"PollCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-reactions:PollCollection\\\",\\\"collection\\\":\\\"polls\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/reactions/src/collections/index.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-reactions\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"record_polls\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"Poll\\\",\\\"exportName\\\":\\\"PollCollection\\\",\\\"collectionExportName\\\":\\\"PollCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"record_polls\\\",\\\"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);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"question\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"options_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"opens_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"closes_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"always\\\"},\\\"one_vote_per_actor\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true},\\\"anonymous_tally\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true},\\\"closed\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"record_polls_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"record_polls_target\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\"]},{\\\"name\\\":\\\"record_polls_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"record_polls_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"f6713370\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-reactions\\\"},\\\"@happyvertical/smrt-reactions:PollVoteCollection\\\":{\\\"name\\\":\\\"pollvotecollection\\\",\\\"className\\\":\\\"PollVoteCollection\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-reactions:PollVoteCollection\\\",\\\"collection\\\":\\\"pollvotes\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/reactions/src/collections/index.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-reactions\\\",\\\"fields\\\":{},\\\"methods\\\":{},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"poll_votes\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false},\\\"extends\\\":\\\"SmrtCollection\\\",\\\"extendsTypeArg\\\":\\\"PollVote\\\",\\\"exportName\\\":\\\"PollVoteCollection\\\",\\\"collectionExportName\\\":\\\"PollVoteCollectionCollection\\\",\\\"schema\\\":{\\\"tableName\\\":\\\"poll_votes\\\",\\\"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);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"poll_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"record_polls\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"NO ACTION\\\"}},\\\"actor_profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"option_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"participation_snapshot\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"poll_votes_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"poll_votes_actor\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"poll_id\\\",\\\"actor_profile_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"poll_votes_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"poll_votes_poll_id_idx\\\",\\\"columns\\\":[\\\"poll_id\\\"]},{\\\"name\\\":\\\"poll_votes_actor_profile_id_idx\\\",\\\"columns\\\":[\\\"actor_profile_id\\\"]}],\\\"version\\\":\\\"c22797d0\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-reactions\\\"},\\\"@happyvertical/smrt-reactions:Poll\\\":{\\\"name\\\":\\\"poll\\\",\\\"className\\\":\\\"Poll\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-reactions:Poll\\\",\\\"collection\\\":\\\"polls\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/reactions/src/models/Poll.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-reactions\\\",\\\"fields\\\":{\\\"metaType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"metaId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"role\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"question\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"optionsJson\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"readonly\\\":true},\\\"readonly\\\":true},\\\"opensAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"closesAt\\\":{\\\"type\\\":\\\"datetime\\\",\\\"required\\\":false,\\\"_meta\\\":{\\\"nullable\\\":true}},\\\"visibility\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":false,\\\"default\\\":\\\"always\\\",\\\"enum\\\":[\\\"always\\\",\\\"after_vote\\\",\\\"after_close\\\"]},\\\"oneVotePerActor\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":true,\\\"default\\\":true},\\\"anonymousTally\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":true,\\\"default\\\":true},\\\"closed\\\":{\\\"type\\\":\\\"boolean\\\",\\\"required\\\":true,\\\"default\\\":false}},\\\"methods\\\":{\\\"hydrate\\\":{\\\"name\\\":\\\"hydrate\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<T | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"assertWriteAuthority\\\":{\\\"name\\\":\\\"assertWriteAuthority\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"record_polls\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"hooks\\\":{\\\"beforeDelete\\\":\\\"assertWriteAuthority\\\"},\\\"indexes\\\":[{\\\"name\\\":\\\"record_polls_target\\\",\\\"columns\\\":[\\\"tenantId\\\",\\\"metaType\\\",\\\"metaId\\\"]}],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtPolymorphicAssociation\\\",\\\"exportName\\\":\\\"Poll\\\",\\\"collectionExportName\\\":\\\"PollCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"metaType\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"metaId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"role\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"question\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"oneVotePerActor\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"boolean\\\"},{\\\"field\\\":\\\"anonymousTally\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"boolean\\\"},{\\\"field\\\":\\\"closed\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"boolean\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"record_polls\\\",\\\"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);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"question\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"options_json\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"opens_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"closes_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":false,\\\"unique\\\":false},\\\"visibility\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":\\\"always\\\"},\\\"one_vote_per_actor\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true},\\\"anonymous_tally\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":true},\\\"closed\\\":{\\\"type\\\":\\\"BOOLEAN\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"record_polls_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"record_polls_target\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\"]},{\\\"name\\\":\\\"record_polls_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"record_polls_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]}],\\\"version\\\":\\\"f6713370\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-reactions\\\"},\\\"@happyvertical/smrt-reactions:PollVote\\\":{\\\"name\\\":\\\"pollvote\\\",\\\"className\\\":\\\"PollVote\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-reactions:PollVote\\\",\\\"collection\\\":\\\"pollvotes\\\",\\\"description\\\":\\\"Append-only through PollService; no generated write API.\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/reactions/src/models/PollVote.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-reactions\\\",\\\"fields\\\":{\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"pollId\\\":{\\\"type\\\":\\\"foreignKey\\\",\\\"required\\\":true,\\\"related\\\":\\\"Poll\\\",\\\"_meta\\\":{\\\"required\\\":true,\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"NO ACTION\\\"}},\\\"actorProfileId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":true,\\\"related\\\":\\\"@happyvertical/smrt-profiles:Profile\\\"},\\\"optionId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true,\\\"readonly\\\":true},\\\"readonly\\\":true},\\\"participationSnapshot\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true,\\\"readonly\\\":true},\\\"readonly\\\":true}},\\\"methods\\\":{\\\"assertWriteAuthority\\\":{\\\"name\\\":\\\"assertWriteAuthority\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"poll_votes\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"hooks\\\":{\\\"beforeDelete\\\":\\\"assertWriteAuthority\\\"},\\\"indexes\\\":[{\\\"name\\\":\\\"poll_votes_actor\\\",\\\"columns\\\":[\\\"tenantId\\\",\\\"pollId\\\",\\\"actorProfileId\\\"],\\\"unique\\\":true}],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtObject\\\",\\\"exportName\\\":\\\"PollVote\\\",\\\"collectionExportName\\\":\\\"PollVoteCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"pollId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"foreignKey\\\"},{\\\"field\\\":\\\"actorProfileId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"crossPackageRef\\\"},{\\\"field\\\":\\\"optionId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"participationSnapshot\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"poll_votes\\\",\\\"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);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"poll_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"foreignKey\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"foreignKey\\\":{\\\"table\\\":\\\"record_polls\\\",\\\"column\\\":\\\"id\\\",\\\"onDelete\\\":\\\"NO ACTION\\\",\\\"onUpdate\\\":\\\"NO ACTION\\\"}},\\\"actor_profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"option_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"participation_snapshot\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false}},\\\"indexes\\\":[{\\\"name\\\":\\\"poll_votes_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"poll_votes_actor\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"poll_id\\\",\\\"actor_profile_id\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"poll_votes_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"poll_votes_poll_id_idx\\\",\\\"columns\\\":[\\\"poll_id\\\"]},{\\\"name\\\":\\\"poll_votes_actor_profile_id_idx\\\",\\\"columns\\\":[\\\"actor_profile_id\\\"]}],\\\"version\\\":\\\"c22797d0\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-reactions\\\"},\\\"@happyvertical/smrt-reactions:Reaction\\\":{\\\"name\\\":\\\"reaction\\\",\\\"className\\\":\\\"Reaction\\\",\\\"qualifiedName\\\":\\\"@happyvertical/smrt-reactions:Reaction\\\",\\\"collection\\\":\\\"reactions\\\",\\\"filePath\\\":\\\"/home/runner/work/smrt/smrt/packages/reactions/src/models/Reaction.ts\\\",\\\"packageName\\\":\\\"@happyvertical/smrt-reactions\\\",\\\"fields\\\":{\\\"metaType\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"metaId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"role\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"required\\\":true}},\\\"sortOrder\\\":{\\\"type\\\":\\\"integer\\\",\\\"required\\\":false,\\\"default\\\":0},\\\"tenantId\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"_meta\\\":{\\\"sqlType\\\":\\\"UUID\\\",\\\"__tenancy\\\":{\\\"isTenantIdField\\\":true,\\\"autoFilter\\\":true,\\\"required\\\":true,\\\"autoPopulate\\\":true,\\\"nullable\\\":false,\\\"mode\\\":\\\"required\\\",\\\"field\\\":\\\"tenantId\\\",\\\"allowSuperAdminBypass\\\":false}}},\\\"actorProfileId\\\":{\\\"type\\\":\\\"crossPackageRef\\\",\\\"required\\\":true,\\\"related\\\":\\\"@happyvertical/smrt-profiles:Profile\\\"},\\\"kind\\\":{\\\"type\\\":\\\"text\\\",\\\"required\\\":true,\\\"default\\\":\\\"like\\\",\\\"_meta\\\":{\\\"required\\\":true},\\\"enum\\\":[\\\"like\\\",\\\"love\\\",\\\"celebrate\\\",\\\"insightful\\\",\\\"support\\\"]}},\\\"methods\\\":{\\\"hydrate\\\":{\\\"name\\\":\\\"hydrate\\\",\\\"async\\\":true,\\\"parameters\\\":[],\\\"returnType\\\":\\\"Promise<T | null>\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true},\\\"assertWriteAuthority\\\":{\\\"name\\\":\\\"assertWriteAuthority\\\",\\\"async\\\":false,\\\"parameters\\\":[],\\\"returnType\\\":\\\"void\\\",\\\"isStatic\\\":false,\\\"isPublic\\\":true}},\\\"decoratorConfig\\\":{\\\"tableName\\\":\\\"record_reactions\\\",\\\"api\\\":false,\\\"mcp\\\":false,\\\"cli\\\":false,\\\"hooks\\\":{\\\"beforeDelete\\\":\\\"assertWriteAuthority\\\"},\\\"indexes\\\":[{\\\"name\\\":\\\"record_reactions_actor_kind\\\",\\\"columns\\\":[\\\"tenantId\\\",\\\"metaType\\\",\\\"metaId\\\",\\\"actorProfileId\\\",\\\"kind\\\"],\\\"unique\\\":true}],\\\"tenantScoped\\\":{\\\"mode\\\":\\\"required\\\"},\\\"conflictColumns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"]},\\\"extends\\\":\\\"SmrtPolymorphicAssociation\\\",\\\"exportName\\\":\\\"Reaction\\\",\\\"collectionExportName\\\":\\\"ReactionCollection\\\",\\\"validationRules\\\":[{\\\"field\\\":\\\"metaType\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"metaId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"role\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"},{\\\"field\\\":\\\"actorProfileId\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"crossPackageRef\\\"},{\\\"field\\\":\\\"kind\\\",\\\"rule\\\":\\\"required\\\",\\\"fieldType\\\":\\\"text\\\"}],\\\"schema\\\":{\\\"tableName\\\":\\\"record_reactions\\\",\\\"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);\\\",\\\"columns\\\":{\\\"id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"primaryKey\\\":true,\\\"referenceKind\\\":\\\"id\\\",\\\"notNull\\\":true},\\\"slug\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true},\\\"context\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"\\\"},\\\"created_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"updated_at\\\":{\\\"type\\\":\\\"TIMESTAMP\\\",\\\"notNull\\\":true,\\\"default\\\":\\\"current_timestamp\\\"},\\\"meta_type\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"meta_id\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"role\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"sort_order\\\":{\\\"type\\\":\\\"INTEGER\\\",\\\"notNull\\\":false,\\\"unique\\\":false,\\\"default\\\":0},\\\"tenant_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"tenantId\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"actor_profile_id\\\":{\\\"type\\\":\\\"UUID\\\",\\\"referenceKind\\\":\\\"crossPackageRef\\\",\\\"notNull\\\":true,\\\"unique\\\":false},\\\"kind\\\":{\\\"type\\\":\\\"TEXT\\\",\\\"notNull\\\":true,\\\"unique\\\":false,\\\"default\\\":\\\"like\\\"}},\\\"indexes\\\":[{\\\"name\\\":\\\"record_reactions_slug_context_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"slug\\\",\\\"context\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"record_reactions_actor_kind\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"meta_type\\\",\\\"meta_id\\\",\\\"actor_profile_id\\\",\\\"kind\\\"],\\\"unique\\\":true},{\\\"name\\\":\\\"record_reactions_tenant_id_created_at_idx\\\",\\\"columns\\\":[\\\"tenant_id\\\",\\\"created_at\\\"]},{\\\"name\\\":\\\"record_reactions_meta_type_meta_id_idx\\\",\\\"columns\\\":[\\\"meta_type\\\",\\\"meta_id\\\"]},{\\\"name\\\":\\\"record_reactions_actor_profile_id_idx\\\",\\\"columns\\\":[\\\"actor_profile_id\\\"]}],\\\"version\\\":\\\"678ebe0f\\\"},\\\"importPath\\\":\\\"@happyvertical/smrt-reactions\\\"}},\\\"moduleType\\\":\\\"smrt\\\",\\\"smrtDependencies\\\":[\\\"@happyvertical/smrt-comments\\\",\\\"@happyvertical/smrt-core\\\",\\\"@happyvertical/smrt-tenancy\\\"],\\\"browser\\\":{\\\"status\\\":\\\"server-only\\\",\\\"issues\\\":[\\\"#3624\\\"],\\\"via\\\":[\\\"@happyvertical/smrt-tenancy\\\"]},\\\"stampsConstructors\\\":true}\"));\n","import { ValidationError } from '@happyvertical/smrt-core';\n\n/** Authority belongs only to a unique operation transaction, never a root adapter. */\nconst authority = new WeakMap<object, number>();\n/** Package-private authority; never re-export from a public entry point. */\nexport async function withParticipationWrite<T>(\n executor: object,\n work: () => Promise<T>,\n): Promise<T> {\n authority.set(executor, (authority.get(executor) ?? 0) + 1);\n try {\n return await work();\n } finally {\n const remaining = (authority.get(executor) ?? 1) - 1;\n if (remaining) authority.set(executor, remaining);\n else authority.delete(executor);\n }\n}\nexport function assertParticipationWrite(executor: object): void {\n if (!authority.has(executor))\n throw new ValidationError(\n 'Participation records require service write authority.',\n 'VALIDATION_PARTICIPATION_AUTHORITY',\n );\n}\n","import {\n field,\n SmrtPolymorphicAssociation,\n type SmrtPolymorphicAssociationOptions,\n smrt,\n ValidationError,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { PollOption, PollVisibility } from '../types.js';\nimport { assertParticipationWrite } from '../write-authority.js';\nexport interface PollOptions extends SmrtPolymorphicAssociationOptions {\n tenantId?: string;\n question?: string;\n optionsJson?: string;\n opensAt?: Date | null;\n closesAt?: Date | null;\n visibility?: PollVisibility;\n anonymousTally?: boolean;\n closed?: boolean;\n}\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'record_polls',\n api: false,\n mcp: false,\n cli: false,\n hooks: { beforeDelete: 'assertWriteAuthority' },\n indexes: [\n {\n name: 'record_polls_target',\n columns: ['tenantId', 'metaType', 'metaId'],\n },\n ],\n})\nexport class Poll extends SmrtPolymorphicAssociation { static __smrtPackage__ = \"@happyvertical/smrt-reactions\";\n @tenantId() tenantId = '';\n @field({ required: true }) question = '';\n @field({ type: 'text', readonly: true }) optionsJson = '[]';\n @field({ type: 'datetime', nullable: true }) opensAt: Date | null = null;\n @field({ type: 'datetime', nullable: true }) closesAt: Date | null = null;\n @field() visibility: PollVisibility = 'always';\n @field() oneVotePerActor = true;\n @field() anonymousTally = true;\n @field() closed = false;\n constructor(options: PollOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.question !== undefined) this.question = options.question;\n if (options.optionsJson !== undefined)\n this.optionsJson = options.optionsJson;\n if (options.opensAt !== undefined) this.opensAt = options.opensAt;\n if (options.closesAt !== undefined) this.closesAt = options.closesAt;\n if (options.visibility !== undefined) this.visibility = options.visibility;\n if (options.anonymousTally !== undefined)\n this.anonymousTally = options.anonymousTally;\n if (options.closed !== undefined) this.closed = options.closed;\n }\n assertWriteAuthority(): void {\n assertParticipationWrite(this.db);\n }\n protected override async validateBeforeSave(): Promise<void> {\n assertParticipationWrite(this.db);\n await super.validateBeforeSave();\n this.pollOptions;\n if (this.id) {\n const existing = await this.getCanonicalPersistedRow({ id: this.id });\n if (\n existing &&\n (existing.options_json !== this.optionsJson ||\n existing.tenant_id !== this.tenantId ||\n existing.meta_type !== this.metaType ||\n existing.meta_id !== this.metaId)\n )\n throw new ValidationError(\n 'Poll target and options are immutable.',\n 'VALIDATION_IMMUTABLE_POLL',\n );\n }\n }\n get pollOptions(): PollOption[] {\n const parsed: unknown = JSON.parse(this.optionsJson);\n if (\n !Array.isArray(parsed) ||\n parsed.length < 2 ||\n parsed.length > 50 ||\n parsed.some(\n (o) =>\n !o ||\n typeof o.id !== 'string' ||\n !o.id.trim() ||\n typeof o.label !== 'string' ||\n !o.label.trim(),\n ) ||\n new Set(parsed.map((o) => o.id)).size !== parsed.length\n )\n throw new TypeError('Invalid poll options.');\n return parsed.map((o) => ({ id: o.id, label: o.label }));\n }\n}\n","import {\n crossPackageRef,\n field,\n foreignKey,\n type SmrtClassOptions,\n SmrtObject,\n smrt,\n ValidationError,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport { assertParticipationWrite } from '../write-authority.js';\nimport { Poll } from './Poll.js';\nexport interface PollVoteOptions extends SmrtClassOptions {\n tenantId?: string;\n pollId?: string;\n optionId?: string;\n actorProfileId?: string;\n participationSnapshot?: string;\n}\n/** Append-only through PollService; no generated write API. */\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'poll_votes',\n api: false,\n mcp: false,\n cli: false,\n hooks: { beforeDelete: 'assertWriteAuthority' },\n indexes: [\n {\n name: 'poll_votes_actor',\n columns: ['tenantId', 'pollId', 'actorProfileId'],\n unique: true,\n },\n ],\n})\nexport class PollVote extends SmrtObject { static __smrtPackage__ = \"@happyvertical/smrt-reactions\";\n @tenantId() tenantId = '';\n @foreignKey(Poll, {\n required: true,\n onUpdate: 'NO ACTION',\n onDelete: 'NO ACTION',\n })\n pollId = '';\n @crossPackageRef('@happyvertical/smrt-profiles:Profile', { required: true })\n actorProfileId = '';\n @field({ required: true, readonly: true }) optionId = '';\n @field({ type: 'text', required: true, readonly: true })\n participationSnapshot = '{}';\n constructor(options: PollVoteOptions = {}) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.pollId !== undefined) this.pollId = options.pollId;\n if (options.actorProfileId !== undefined)\n this.actorProfileId = options.actorProfileId;\n if (options.optionId !== undefined) this.optionId = options.optionId;\n if (options.participationSnapshot !== undefined)\n this.participationSnapshot = options.participationSnapshot;\n }\n assertWriteAuthority(): void {\n assertParticipationWrite(this.db);\n }\n protected override async validateBeforeSave(): Promise<void> {\n assertParticipationWrite(this.db);\n await super.validateBeforeSave();\n const evidence: unknown = JSON.parse(this.participationSnapshot);\n if (\n !evidence ||\n typeof evidence !== 'object' ||\n Array.isArray(evidence) ||\n Object.keys(evidence).length === 0\n )\n throw new TypeError(\n 'Participation snapshot must be a nonempty JSON object.',\n );\n if (this.id) {\n const existing = await this.getCanonicalPersistedRow({ id: this.id });\n if (\n existing &&\n (existing.participation_snapshot !== this.participationSnapshot ||\n existing.option_id !== this.optionId ||\n existing.tenant_id !== this.tenantId ||\n existing.poll_id !== this.pollId ||\n existing.actor_profile_id !== this.actorProfileId)\n )\n throw new ValidationError(\n 'Recorded votes are immutable.',\n 'VALIDATION_IMMUTABLE_VOTE',\n );\n }\n }\n}\n","import {\n crossPackageRef,\n field,\n SmrtPolymorphicAssociation,\n type SmrtPolymorphicAssociationOptions,\n smrt,\n} from '@happyvertical/smrt-core';\nimport { TenantScoped, tenantId } from '@happyvertical/smrt-tenancy';\nimport type { ReactionKind } from '../types.js';\nimport { assertParticipationWrite } from '../write-authority.js';\n\n@TenantScoped({ mode: 'required' })\n@smrt({\n tableName: 'record_reactions',\n api: false,\n mcp: false,\n cli: false,\n hooks: { beforeDelete: 'assertWriteAuthority' },\n indexes: [\n {\n name: 'record_reactions_actor_kind',\n columns: ['tenantId', 'metaType', 'metaId', 'actorProfileId', 'kind'],\n unique: true,\n },\n ],\n})\nexport class Reaction extends SmrtPolymorphicAssociation { static __smrtPackage__ = \"@happyvertical/smrt-reactions\";\n @tenantId() tenantId = '';\n @crossPackageRef('@happyvertical/smrt-profiles:Profile', { required: true })\n actorProfileId = '';\n @field({ required: true }) kind: ReactionKind = 'like';\n constructor(\n options: SmrtPolymorphicAssociationOptions & {\n tenantId?: string;\n actorProfileId?: string;\n kind?: ReactionKind;\n } = {},\n ) {\n super(options);\n if (options.tenantId !== undefined) this.tenantId = options.tenantId;\n if (options.actorProfileId !== undefined)\n this.actorProfileId = options.actorProfileId;\n if (options.kind !== undefined) this.kind = options.kind;\n }\n assertWriteAuthority(): void {\n assertParticipationWrite(this.db);\n }\n protected override async validateBeforeSave(): Promise<void> {\n assertParticipationWrite(this.db);\n await super.validateBeforeSave();\n }\n}\n","import { SmrtCollection } from '@happyvertical/smrt-core';\nimport { Poll } from '../models/Poll.js';\nimport { PollVote } from '../models/PollVote.js';\nimport { Reaction } from '../models/Reaction.js';\nexport class ReactionCollection extends SmrtCollection<Reaction> {\n static readonly _itemClass = Reaction;\n}\nexport class PollCollection extends SmrtCollection<Poll> {\n static readonly _itemClass = Poll;\n}\nexport class PollVoteCollection extends SmrtCollection<PollVote> {\n static readonly _itemClass = PollVote;\n}\n"],"mappings":"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"}
@@ -0,0 +1,14 @@
1
+ import { SmrtCollection } from '@happyvertical/smrt-core';
2
+ import { Poll } from '../models/Poll.js';
3
+ import { PollVote } from '../models/PollVote.js';
4
+ import { Reaction } from '../models/Reaction.js';
5
+ export declare class ReactionCollection extends SmrtCollection<Reaction> {
6
+ static readonly _itemClass: typeof Reaction;
7
+ }
8
+ export declare class PollCollection extends SmrtCollection<Poll> {
9
+ static readonly _itemClass: typeof Poll;
10
+ }
11
+ export declare class PollVoteCollection extends SmrtCollection<PollVote> {
12
+ static readonly _itemClass: typeof PollVote;
13
+ }
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collections/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,qBAAa,kBAAmB,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAC9D,MAAM,CAAC,QAAQ,CAAC,UAAU,kBAAY;CACvC;AACD,qBAAa,cAAe,SAAQ,cAAc,CAAC,IAAI,CAAC;IACtD,MAAM,CAAC,QAAQ,CAAC,UAAU,cAAQ;CACnC;AACD,qBAAa,kBAAmB,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAC9D,MAAM,CAAC,QAAQ,CAAC,UAAU,kBAAY;CACvC"}
@@ -0,0 +1,10 @@
1
+ import './__smrt-register__.js';
2
+ export { PollCollection, PollVoteCollection, ReactionCollection, } from './collections/index.js';
3
+ export type { PollOptions } from './models/Poll.js';
4
+ export { Poll } from './models/Poll.js';
5
+ export type { PollVoteOptions } from './models/PollVote.js';
6
+ export { PollVote } from './models/PollVote.js';
7
+ export { Reaction } from './models/Reaction.js';
8
+ export type { PollService, ReactionService } from './services.js';
9
+ export * from './types.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAClE,cAAc,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import { a as PollVote, i as Reaction, n as PollVoteCollection, o as Poll, r as ReactionCollection, t as PollCollection } from "./chunks/src-DyRzkrHh.js";
2
+ import { REACTION_KINDS } from "./types.js";
3
+ export { Poll, PollCollection, PollVote, PollVoteCollection, REACTION_KINDS, Reaction, ReactionCollection };