@happyvertical/smrt-reactions 0.57.29 → 0.57.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { ObjectRegistry, SmrtCollection, SmrtObject, SmrtPolymorphicAssociation, ValidationError, crossPackageRef, field, foreignKey, smrt } from "@happyvertical/smrt-core";
2
2
  import { TenantScoped, tenantId } from "@happyvertical/smrt-tenancy";
3
3
  //#region src/__smrt-register__.ts
4
- ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-reactions","packageVersion":"0.57.29","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}`));
4
+ ObjectRegistry.registerPackageManifest(JSON.parse(`{"version":"1.0.0","timestamp":0,"packageName":"@happyvertical/smrt-reactions","packageVersion":"0.57.30","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
5
  //#endregion
6
6
  //#region src/write-authority.ts
7
7
  var authority = /* @__PURE__ */ new WeakMap();
@@ -260,4 +260,4 @@ var PollVoteCollection = class extends SmrtCollection {
260
260
  //#endregion
261
261
  export { PollVote as a, Reaction as i, PollVoteCollection as n, Poll as o, ReactionCollection as r, withParticipationWrite as s, PollCollection as t };
262
262
 
263
- //# sourceMappingURL=src-CUbOTW2v.js.map
263
+ //# sourceMappingURL=src-BXWyj3uP.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"src-CUbOTW2v.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.29\\\",\\\"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":";;;AAOA,eAAe,wBAAwB,KAAK,MAAM,42pBAA0kvB,CAAC;;;ACJ7nvB,IAAM,4BAAY,IAAI,QAAwB;AAE9C,eAAsB,uBACpB,UACA,MACY;CACZ,UAAU,IAAI,WAAW,UAAU,IAAI,QAAQ,KAAK,KAAK,CAAC;CAC1D,IAAI;EACF,OAAO,MAAM,KAAK;CACpB,UAAE;EACA,MAAM,aAAa,UAAU,IAAI,QAAQ,KAAK,KAAK;EACnD,IAAI,WAAW,UAAU,IAAI,UAAU,SAAS;OAC3C,UAAU,OAAO,QAAQ;CAChC;AACF;AACO,SAAS,yBAAyB,UAAwB;CAC/D,IAAI,CAAC,UAAU,IAAI,QAAQ,GACzB,MAAM,IAAI,gBACR,0DACA,oCACF;AACJ;;;;;;;;;;;;;;;;;;ACUO,IAAM,OAAN,cAAmB,2BAA2B;CACvC,WAAW;CACI,WAAW;CACG,cAAc;CACV,UAAuB;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1B,MAAM,EAAE,UAAU,KAAK,CAAC,CAAA,GAJd,SAIgB,WAAA,QAAA,CAAA;AAJhB,WAAN,gBAAA,CAfN,aAAa,EAAE,MAAM,WAAW,CAAC,GACjC,KAAK;CACJ,WAAW;CACX,KAAK;CACL,KAAK;CACL,KAAK;CACL,OAAO,EAAE,cAAc,uBAAuB;CAC9C,SAAS,CACP;EACE,MAAM;EACN,SAAS;GAAC;GAAY;GAAY;GAAU;GAAkB;EAAM;EACpE,QAAQ;CACV,CACF;AACF,CAAC,CAAA,GACY,QAAA;;;ACtBN,IAAM,qBAAN,cAAiC,eAAyB;CAC/D,OAAgB,aAAa;AAC/B;AACO,IAAM,iBAAN,cAA6B,eAAqB;CACvD,OAAgB,aAAa;AAC/B;AACO,IAAM,qBAAN,cAAiC,eAAyB;CAC/D,OAAgB,aAAa;AAC/B"}
1
+ {"version":3,"file":"src-BXWyj3uP.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.30\\\",\\\"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":";;;AAOA,eAAe,wB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,GACL;EACA,MAAM,OAAO;EACb,IAAI,QAAQ,aAAa,KAAA,GAAW,KAAK,WAAW,QAAQ;EAC5D,IAAI,QAAQ,mBAAmB,KAAA,GAC7B,KAAK,iBAAiB,QAAQ;EAChC,IAAI,QAAQ,SAAS,KAAA,GAAW,KAAK,OAAO,QAAQ;CACtD;CACA,uBAA6B;EAC3B,yBAAyB,KAAK,EAAE;CAClC;CACA,MAAyB,qBAAoC;EAC3D,yBAAyB,KAAK,EAAE;EAChC,MAAM,MAAM,mBAAmB;CACjC;AACF;AAzB2D,cAA9C,UAAqD,mBAAkB,+BAAA;AACtE,gBAAA,CAAX,SAAS,CAAA,GADC,SACC,WAAA,YAAA,CAAA;AAEZ,gBAAA,CADC,gBAAgB,wCAAwC,EAAE,UAAU,KAAK,CAAC,CAAA,GAFhE,SAGX,WAAA,kBAAA,CAAA;AAC2B,gBAAA,CAA1B,MAAM,EAAE,UAAU,KAAK,CAAC,CAAA,GAJd,SAIgB,WAAA,QAAA,CAAA;AAJhB,WAAN,gBAAA,CAfN,aAAa,EAAE,MAAM,WAAW,CAAC,GACjC,KAAK;CACJ,WAAW;CACX,KAAK;CACL,KAAK;CACL,KAAK;CACL,OAAO,EAAE,cAAc,uBAAuB;CAC9C,SAAS,CACP;EACE,MAAM;EACN,SAAS;GAAC;GAAY;GAAY;GAAU;GAAkB;EAAM;EACpE,QAAQ;CACV,CACF;AACF,CAAC,CAAA,GACY,QAAA;;;ACtBN,IAAM,qBAAN,cAAiC,eAAyB;CAC/D,OAAgB,aAAa;AAC/B;AACO,IAAM,iBAAN,cAA6B,eAAqB;CACvD,OAAgB,aAAa;AAC/B;AACO,IAAM,qBAAN,cAAiC,eAAyB;CAC/D,OAAgB,aAAa;AAC/B"}
package/dist/index.js CHANGED
@@ -1,3 +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-CUbOTW2v.js";
1
+ import { a as PollVote, i as Reaction, n as PollVoteCollection, o as Poll, r as ReactionCollection, t as PollCollection } from "./chunks/src-BXWyj3uP.js";
2
2
  import { REACTION_KINDS } from "./types.js";
3
3
  export { Poll, PollCollection, PollVote, PollVoteCollection, REACTION_KINDS, Reaction, ReactionCollection };
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-reactions",
5
- "packageVersion": "0.57.29",
5
+ "packageVersion": "0.57.30",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-reactions:ReactionCollection": {
8
8
  "name": "reactioncollection",
package/dist/server.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as PollVote, i as Reaction, n as PollVoteCollection, o as Poll, r as ReactionCollection, s as withParticipationWrite, t as PollCollection } from "./chunks/src-CUbOTW2v.js";
1
+ import { a as PollVote, i as Reaction, n as PollVoteCollection, o as Poll, r as ReactionCollection, s as withParticipationWrite, t as PollCollection } from "./chunks/src-BXWyj3uP.js";
2
2
  import { REACTION_KINDS } from "./types.js";
3
3
  import { ObjectRegistry } from "@happyvertical/smrt-core";
4
4
  import { withTenant } from "@happyvertical/smrt-tenancy";
@@ -3,12 +3,12 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-reactions",
6
- "packageVersion": "0.57.29",
6
+ "packageVersion": "0.57.30",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "0a3d220ace924565d81f00954d83de56afef91663bb7ded19715f6f543942285",
11
- "packageJson": "96d250350a656fb2924f170366ac74b05efb9be1a0492482ed7479c8f5085d39",
10
+ "manifest": "0729a623363a6ca0ad2f1348716d68273182ba1b36134ef4eb423ef83e607ca0",
11
+ "packageJson": "4bd5091a77724fb43975dfb4f332e4e91c84725eac19bfd03a29e4fb38f41d74",
12
12
  "agents": "c19832881616c1b4a422da22a888b71dfdeb4eea25974c30c6209f9d8c2242aa"
13
13
  },
14
14
  "exports": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-reactions",
3
- "version": "0.57.29",
3
+ "version": "0.57.30",
4
4
  "description": "Tenant-scoped reactions and lightweight polls with shared participation enforcement",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -28,10 +28,10 @@
28
28
  }
29
29
  },
30
30
  "dependencies": {
31
- "@happyvertical/smrt-core": "0.57.29",
32
- "@happyvertical/smrt-tenancy": "0.57.29",
33
- "@happyvertical/smrt-comments": "0.57.29",
34
- "@happyvertical/sql": "^0.107.0"
31
+ "@happyvertical/smrt-core": "0.57.30",
32
+ "@happyvertical/smrt-tenancy": "0.57.30",
33
+ "@happyvertical/smrt-comments": "0.57.30",
34
+ "@happyvertical/sql": "^0.108.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "svelte": "^5.57.0"
@@ -49,7 +49,7 @@
49
49
  "directory": "packages/reactions"
50
50
  },
51
51
  "devDependencies": {
52
- "@happyvertical/smrt-vitest": "0.57.29",
52
+ "@happyvertical/smrt-vitest": "0.57.30",
53
53
  "@sveltejs/package": "^2.5.8",
54
54
  "@sveltejs/vite-plugin-svelte": "^7.3.0",
55
55
  "@testing-library/svelte": "^5.4.2",