@lastshotlabs/slingshot-community
npm install @lastshotlabs/slingshot-community
Functions
Section titled “Functions”createCommunityPackage
Section titled “createCommunityPackage”Community package factory.
Creates a SlingshotPackageDefinition that mounts all 19 community
entities (Container, Thread, Reply, Reaction, ContainerMember,
ContainerRule, Report, Ban, Tag, ThreadTag, ContainerInvite,
ContainerSubscription, ThreadSubscription, UserMute, Bookmark,
AutoModRule, Warning, AuditLogEntry, ContainerSetting), wires adapter-
dependent middleware (banCheck, autoMod, threadStateGuard, banNotify,
containerCreationGuard, grantManager, …), publishes the
CommunityInteractionsPeerCap capability, and registers push formatters.
Every adapter ref, middleware closure, and lazy ref is owned by the factory’s closure (Rule 3) — multiple package instances in the same process do not share state.
function createCommunityPackage(rawConfig: CommunityPluginConfig,): SlingshotPackageDefinitionSource: packages/slingshot-community/src/plugin.ts
ThreadEntity
Section titled “ThreadEntity”Entity definition for a community thread (topic post).
Exported as ThreadEntity from the package index. Threads are searchable
(syncMode: 'write-through') — the search plugin indexes them automatically
on every create/update.
Remarks: Key operations: - publish: draft → published state transition; sets publishedAt. - lock / unlock: toggle the locked flag (prevents new replies). - pin / unpin: toggle the pinned flag. - listByContainer: paginated lookup by container. - search: full-text search on title and body.
Remarks: Cascade: when auth:user.deleted fires, all threads by that user are soft-deleted (status → 'deleted', deletedBy set).
Source: packages/slingshot-community/src/entities/thread.ts
threadOperations
Section titled “threadOperations”Entity definition for a community thread (topic post).
Exported as ThreadEntity from the package index. Threads are searchable
(syncMode: 'write-through') — the search plugin indexes them automatically
on every create/update.
Remarks: Key operations: - publish: draft → published state transition; sets publishedAt. - lock / unlock: toggle the locked flag (prevents new replies). - pin / unpin: toggle the pinned flag. - listByContainer: paginated lookup by container. - search: full-text search on title and body.
Remarks: Cascade: when auth:user.deleted fires, all threads by that user are soft-deleted (status → 'deleted', deletedBy set).
Source: packages/slingshot-community/src/entities/thread.ts
Constants
Section titled “Constants”AuditLogEntryEntity
Section titled “AuditLogEntryEntity”Entity definition for a moderation audit log entry.
Audit entries are server-only (no create/update/delete HTTP routes). They are created by middleware after moderation actions (bans, report resolutions, warnings, etc.).
Source: packages/slingshot-community/src/entities/auditLogEntry.ts
auditLogEntryOperations
Section titled “auditLogEntryOperations”Entity definition for a moderation audit log entry.
Audit entries are server-only (no create/update/delete HTTP routes). They are created by middleware after moderation actions (bans, report resolutions, warnings, etc.).
Source: packages/slingshot-community/src/entities/auditLogEntry.ts
AutoModRuleEntity
Section titled “AutoModRuleEntity”Entity definition for an auto-moderation rule.
Rules are evaluated by AutoModEvaluator in the autoMod middleware
pipeline. Each rule has a matcher (keyword, regex, or heuristic) and
a decision (flag, reject, or shadow-ban).
Source: packages/slingshot-community/src/entities/autoModRule.ts
autoModRuleOperations
Section titled “autoModRuleOperations”Entity definition for an auto-moderation rule.
Rules are evaluated by AutoModEvaluator in the autoMod middleware
pipeline. Each rule has a matcher (keyword, regex, or heuristic) and
a decision (flag, reject, or shadow-ban).
Source: packages/slingshot-community/src/entities/autoModRule.ts
BanEntity
Section titled “BanEntity”Entity definition for a user ban.
Exported as BanEntity from the package index.
Remarks: Bans are never hard-deleted; they are lifted by the removeBan batch operation which sets unbannedBy and unbannedAt. The banCheck middleware queries the ban store on every thread/reply creation request and returns 403 if an active ban exists.
Remarks: The banNotify middleware fires after a ban is created, emitting a community:user.banned event and creating an in-app notification for the banned user.
Source: packages/slingshot-community/src/entities/ban.ts
banOperations
Section titled “banOperations”Entity definition for a user ban.
Exported as BanEntity from the package index.
Remarks: Bans are never hard-deleted; they are lifted by the removeBan batch operation which sets unbannedBy and unbannedAt. The banCheck middleware queries the ban store on every thread/reply creation request and returns 403 if an active ban exists.
Remarks: The banNotify middleware fires after a ban is created, emitting a community:user.banned event and creating an in-app notification for the banned user.
Source: packages/slingshot-community/src/entities/ban.ts
BookmarkEntity
Section titled “BookmarkEntity”Entity definition for a user bookmark.
Bookmarks let users save threads or replies for later. An optional
tag field supports user-defined categorization.
Source: packages/slingshot-community/src/entities/bookmark.ts
bookmarkOperations
Section titled “bookmarkOperations”Entity definition for a user bookmark.
Bookmarks let users save threads or replies for later. An optional
tag field supports user-defined categorization.
Source: packages/slingshot-community/src/entities/bookmark.ts
Community
Section titled “Community”Source: packages/slingshot-community/src/public.ts
COMMUNITY_PLUGIN_STATE_KEY
Section titled “COMMUNITY_PLUGIN_STATE_KEY”Plugin state key for slingshot-community (string form).
Single-sourced constant — no magic string 'slingshot-community' in
cross-package contracts. Kept for back-compat with consumers that use
pluginState.get(COMMUNITY_PLUGIN_STATE_KEY) directly.
New code should prefer the typed reference CommunityPluginStateRef
with readPluginState / publishPluginState so the value type is checked
at the call site.
Source: packages/slingshot-community/src/types/state.ts
CommunityEntities
Section titled “CommunityEntities”Public contract for slingshot-community.
Cross-package consumers reach community state through this surface, not by importing the plugin’s internals.
Two layers:
-
CommunityEntities— the canonical adapter surface. Each ref names a read-only slice of an entity adapter (Container.getById, Thread.list, etc.). Consumers resolve these viarequireEntityAdapter(carrier, ref)from@lastshotlabs/slingshot-core. The adapters are published into pluginState bycreateEntityPlugin()during the plugin’ssetupRoutesphase, so consumers must read insetupPostor per-request handlers. -
CommunityInteractionsPeerCap— the cross-package peer capability used byslingshot-interactionsfor component-tree resolution and updates. Resolved viactx.capabilities.require(CommunityInteractionsPeerCap).
Source: packages/slingshot-community/src/public.ts
CommunityInteractionsPeerCap
Section titled “CommunityInteractionsPeerCap”Source: packages/slingshot-community/src/public.ts
communityPluginConfigSchema
Section titled “communityPluginConfigSchema”Scoring algorithm to apply when updateScore runs after a reaction change.
net— weighted upvotes minus downvotes plus emoji bonus.hot— Reddit-style time-decaying score (log₁₀ + time offset).top— identical tonet; time-window filter applied at list time.controversial— high engagement ÷ low net; surfaces polarising content.
Config Fields
Section titled “Config Fields”| Field | Description |
|---|---|
| `/** Controls who can create containers. ‘admin’ = admin-scoped permission; ‘user’ = any authenticated user. */ | |
| containerCreation` | Who can create containers. One of: admin, user. |
/** Mount path for community routes. Default | URL path prefix for community routes. Omit to use ‘/community’. |
Source: packages/slingshot-community/src/types/config.ts
ContainerEntity
Section titled “ContainerEntity”Entity definition for a community container (space/channel).
Exported as ContainerEntity from the package index to avoid name collision
with the Container model interface.
Remarks: Soft-delete is enabled via the deletedAt field. The getBySlug custom operation provides URL-routing by slug and optional tenant scope.
Remarks: Container creation is gated by the containerCreationGuard middleware, which enforces the containerCreation: 'admin' | 'user' policy from the plugin config.
Source: packages/slingshot-community/src/entities/container.ts
ContainerInviteEntity
Section titled “ContainerInviteEntity”Entity definition for a container invite link.
Invite links carry a unique capability token. Anyone with the token can join the container (subject to ban checks and use-count limits).
Remarks: Key operations: - redeemInvite: Atomic claim + member creation. - claimInviteSlot: Internal atomic claim (no HTTP route). - releaseInviteSlot: Internal compensating op (no HTTP route).
Source: packages/slingshot-community/src/entities/containerInvite.ts
containerInviteOperations
Section titled “containerInviteOperations”Entity definition for a container invite link.
Invite links carry a unique capability token. Anyone with the token can join the container (subject to ban checks and use-count limits).
Remarks: Key operations: - redeemInvite: Atomic claim + member creation. - claimInviteSlot: Internal atomic claim (no HTTP route). - releaseInviteSlot: Internal compensating op (no HTTP route).
Source: packages/slingshot-community/src/entities/containerInvite.ts
ContainerMemberEntity
Section titled “ContainerMemberEntity”Entity definition for a container membership record.
Exported as ContainerMemberEntity from the package index.
Remarks: The create route is treated as a self-join endpoint: the authenticated user may only create their own membership and the effective role is always normalized to member. Elevated roles are granted only through assignRole.
Remarks: The assignRole upsert operation allows role changes without deleting the existing membership. The grantManager middleware reconciles the backing permission grants after promotions, demotions, and removals.
Remarks: Cascade: when auth:user.deleted fires, all memberships for that user are hard-deleted.
Source: packages/slingshot-community/src/entities/containerMember.ts
containerMemberModule
Section titled “containerMemberModule”Entity definition for a container membership record.
Exported as ContainerMemberEntity from the package index.
Remarks: The create route is treated as a self-join endpoint: the authenticated user may only create their own membership and the effective role is always normalized to member. Elevated roles are granted only through assignRole.
Remarks: The assignRole upsert operation allows role changes without deleting the existing membership. The grantManager middleware reconciles the backing permission grants after promotions, demotions, and removals.
Remarks: Cascade: when auth:user.deleted fires, all memberships for that user are hard-deleted.
Source: packages/slingshot-community/src/entities/containerMember.ts
containerMemberOperations
Section titled “containerMemberOperations”Entity definition for a container membership record.
Exported as ContainerMemberEntity from the package index.
Remarks: The create route is treated as a self-join endpoint: the authenticated user may only create their own membership and the effective role is always normalized to member. Elevated roles are granted only through assignRole.
Remarks: The assignRole upsert operation allows role changes without deleting the existing membership. The grantManager middleware reconciles the backing permission grants after promotions, demotions, and removals.
Remarks: Cascade: when auth:user.deleted fires, all memberships for that user are hard-deleted.
Source: packages/slingshot-community/src/entities/containerMember.ts
containerModule
Section titled “containerModule”Entity definition for a community container (space/channel).
Exported as ContainerEntity from the package index to avoid name collision
with the Container model interface.
Remarks: Soft-delete is enabled via the deletedAt field. The getBySlug custom operation provides URL-routing by slug and optional tenant scope.
Remarks: Container creation is gated by the containerCreationGuard middleware, which enforces the containerCreation: 'admin' | 'user' policy from the plugin config.
Source: packages/slingshot-community/src/entities/container.ts
containerOperations
Section titled “containerOperations”Entity definition for a community container (space/channel).
Exported as ContainerEntity from the package index to avoid name collision
with the Container model interface.
Remarks: Soft-delete is enabled via the deletedAt field. The getBySlug custom operation provides URL-routing by slug and optional tenant scope.
Remarks: Container creation is gated by the containerCreationGuard middleware, which enforces the containerCreation: 'admin' | 'user' policy from the plugin config.
Source: packages/slingshot-community/src/entities/container.ts
ContainerRuleEntity
Section titled “ContainerRuleEntity”Entity definition for a community rule displayed to container members.
Exported as ContainerRuleEntity from the package index.
Remarks: Rules are ordered by the order field (ascending). Create multiple rules and set order values to control display sequence. Updating order re-sorts without deleting and re-creating records. There is no enforced uniqueness on order, so stable sort by createdAt is used as a tie-breaker.
Remarks: Container rules have no auth gate on scoped reads. Write operations require container settings management permission.
Source: packages/slingshot-community/src/entities/containerRule.ts
containerRuleOperations
Section titled “containerRuleOperations”Entity definition for a community rule displayed to container members.
Exported as ContainerRuleEntity from the package index.
Remarks: Rules are ordered by the order field (ascending). Create multiple rules and set order values to control display sequence. Updating order re-sorts without deleting and re-creating records. There is no enforced uniqueness on order, so stable sort by createdAt is used as a tie-breaker.
Remarks: Container rules have no auth gate on scoped reads. Write operations require container settings management permission.
Source: packages/slingshot-community/src/entities/containerRule.ts
ContainerSettingEntity
Section titled “ContainerSettingEntity”Entity definition for per-container moderation settings.
Overrides plugin-level defaults for slow mode, word filters, and rate limits. Read by middleware at request time.
Source: packages/slingshot-community/src/entities/containerSetting.ts
containerSettingOperations
Section titled “containerSettingOperations”Entity definition for per-container moderation settings.
Overrides plugin-level defaults for slow mode, word filters, and rate limits. Read by middleware at request time.
Source: packages/slingshot-community/src/entities/containerSetting.ts
ContainerSubscriptionEntity
Section titled “ContainerSubscriptionEntity”Entity definition for a user’s subscription to a container.
Controls notification delivery preferences at the container level.
notifyOn determines which events generate notifications.
Source: packages/slingshot-community/src/entities/containerSubscription.ts
containerSubscriptionOperations
Section titled “containerSubscriptionOperations”Entity definition for a user’s subscription to a container.
Controls notification delivery preferences at the container level.
notifyOn determines which events generate notifications.
Source: packages/slingshot-community/src/entities/containerSubscription.ts
DEFAULT_SCORING_CONFIG
Section titled “DEFAULT_SCORING_CONFIG”Scoring algorithm to apply when updateScore runs after a reaction change.
net— weighted upvotes minus downvotes plus emoji bonus.hot— Reddit-style time-decaying score (log₁₀ + time offset).top— identical tonet; time-window filter applied at list time.controversial— high engagement ÷ low net; surfaces polarising content.
Source: packages/slingshot-community/src/types/config.ts
ReactionEntity
Section titled “ReactionEntity”Entity definition for a user reaction (upvote, downvote, or emoji) on a thread or reply.
Exported as ReactionEntity from the package index.
Remarks: The updateScore custom operation is the core of the scoring system. It is adapter-only (no HTTP route) and is injected by reactionBuildAdapter in plugin.ts with a handler that reads config.scoring from the plugin config closure. The handler: 1. Lists all reactions for the target entity. 2. Computes the score using the configured algorithm (computeNetScore / computeHotScore / computeControversialScore). 3. Writes score and reactionSummary back to the target thread or reply.
Remarks: Cascade: when auth:user.deleted fires, all reactions by that user are hard-deleted.
Source: packages/slingshot-community/src/entities/reaction.ts
reactionModule
Section titled “reactionModule”Entity definition for a user reaction (upvote, downvote, or emoji) on a thread or reply.
Exported as ReactionEntity from the package index.
Remarks: The updateScore custom operation is the core of the scoring system. It is adapter-only (no HTTP route) and is injected by reactionBuildAdapter in plugin.ts with a handler that reads config.scoring from the plugin config closure. The handler: 1. Lists all reactions for the target entity. 2. Computes the score using the configured algorithm (computeNetScore / computeHotScore / computeControversialScore). 3. Writes score and reactionSummary back to the target thread or reply.
Remarks: Cascade: when auth:user.deleted fires, all reactions by that user are hard-deleted.
Source: packages/slingshot-community/src/entities/reaction.ts
reactionOperations
Section titled “reactionOperations”Entity definition for a user reaction (upvote, downvote, or emoji) on a thread or reply.
Exported as ReactionEntity from the package index.
Remarks: The updateScore custom operation is the core of the scoring system. It is adapter-only (no HTTP route) and is injected by reactionBuildAdapter in plugin.ts with a handler that reads config.scoring from the plugin config closure. The handler: 1. Lists all reactions for the target entity. 2. Computes the score using the configured algorithm (computeNetScore / computeHotScore / computeControversialScore). 3. Writes score and reactionSummary back to the target thread or reply.
Remarks: Cascade: when auth:user.deleted fires, all reactions by that user are hard-deleted.
Source: packages/slingshot-community/src/entities/reaction.ts
ReplyEntity
Section titled “ReplyEntity”Entity definition for a reply within a thread.
Exported as ReplyEntity from the package index. Replies are searchable
(syncMode: 'write-through').
Remarks: Reply creation is gated by threadStateGuard (blocks replies to locked or deleted threads), banCheck (blocks banned users), and autoMod.
Remarks: Cascade: when auth:user.deleted fires, all replies by that user are soft-deleted.
Source: packages/slingshot-community/src/entities/reply.ts
replyModule
Section titled “replyModule”Entity definition for a reply within a thread.
Exported as ReplyEntity from the package index. Replies are searchable
(syncMode: 'write-through').
Remarks: Reply creation is gated by threadStateGuard (blocks replies to locked or deleted threads), banCheck (blocks banned users), and autoMod.
Remarks: Cascade: when auth:user.deleted fires, all replies by that user are soft-deleted.
Source: packages/slingshot-community/src/entities/reply.ts
replyOperations
Section titled “replyOperations”Entity definition for a reply within a thread.
Exported as ReplyEntity from the package index. Replies are searchable
(syncMode: 'write-through').
Remarks: Reply creation is gated by threadStateGuard (blocks replies to locked or deleted threads), banCheck (blocks banned users), and autoMod.
Remarks: Cascade: when auth:user.deleted fires, all replies by that user are soft-deleted.
Source: packages/slingshot-community/src/entities/reply.ts
ReportEntity
Section titled “ReportEntity”Entity definition for a user-submitted content report.
Exported as ReportEntity from the package index.
Remarks: List and get operations require the community:container.review-report permission. The package-owned auto-moderation middleware can automatically create report records when declarative moderation rules flag content for review.
Source: packages/slingshot-community/src/entities/report.ts
reportOperations
Section titled “reportOperations”Entity definition for a user-submitted content report.
Exported as ReportEntity from the package index.
Remarks: List and get operations require the community:container.review-report permission. The package-owned auto-moderation middleware can automatically create report records when declarative moderation rules flag content for review.
Source: packages/slingshot-community/src/entities/report.ts
TagEntity
Section titled “TagEntity”Entity definition for a community tag.
Tags are tenant-scoped labels that can be applied to threads via ThreadTag.
usageCount is denormalized and updated by tagUsageIncrement /
tagUsageDecrement middleware on ThreadTag create/delete.
Source: packages/slingshot-community/src/entities/tag.ts
tagOperations
Section titled “tagOperations”Entity definition for a community tag.
Tags are tenant-scoped labels that can be applied to threads via ThreadTag.
usageCount is denormalized and updated by tagUsageIncrement /
tagUsageDecrement middleware on ThreadTag create/delete.
Source: packages/slingshot-community/src/entities/tag.ts
threadModule
Section titled “threadModule”Entity definition for a community thread (topic post).
Exported as ThreadEntity from the package index. Threads are searchable
(syncMode: 'write-through') — the search plugin indexes them automatically
on every create/update.
Remarks: Key operations: - publish: draft → published state transition; sets publishedAt. - lock / unlock: toggle the locked flag (prevents new replies). - pin / unpin: toggle the pinned flag. - listByContainer: paginated lookup by container. - search: full-text search on title and body.
Remarks: Cascade: when auth:user.deleted fires, all threads by that user are soft-deleted (status → 'deleted', deletedBy set).
Source: packages/slingshot-community/src/entities/thread.ts
ThreadSubscriptionEntity
Section titled “ThreadSubscriptionEntity”Entity definition for a user’s subscription to a specific thread.
Controls notification delivery for new replies to the thread.
Source: packages/slingshot-community/src/entities/threadSubscription.ts
threadSubscriptionOperations
Section titled “threadSubscriptionOperations”Entity definition for a user’s subscription to a specific thread.
Controls notification delivery for new replies to the thread.
Source: packages/slingshot-community/src/entities/threadSubscription.ts
ThreadTagEntity
Section titled “ThreadTagEntity”Entity definition for a thread–tag association.
Each row links one thread to one tag. Middleware on create/delete maintains
the Tag.usageCount denormalized counter and syncs the Thread.tagIds
array field.
Source: packages/slingshot-community/src/entities/threadTag.ts
threadTagOperations
Section titled “threadTagOperations”Entity definition for a thread–tag association.
Each row links one thread to one tag. Middleware on create/delete maintains
the Tag.usageCount denormalized counter and syncs the Thread.tagIds
array field.
Source: packages/slingshot-community/src/entities/threadTag.ts
UserMuteEntity
Section titled “UserMuteEntity”Entity definition for a user mute.
When a user mutes another user (optionally scoped to a container), content from the muted user is hidden in lists and notifications are suppressed.
Source: packages/slingshot-community/src/entities/userMute.ts
userMuteOperations
Section titled “userMuteOperations”Entity definition for a user mute.
When a user mutes another user (optionally scoped to a container), content from the muted user is hidden in lists and notifications are suppressed.
Source: packages/slingshot-community/src/entities/userMute.ts
WarningEntity
Section titled “WarningEntity”Entity definition for a moderator warning issued to a user.
Warnings are container-scoped. The acknowledgedAt field is set when
the user acknowledges the warning via the acknowledge operation.
Source: packages/slingshot-community/src/entities/warning.ts
warningOperations
Section titled “warningOperations”Entity definition for a moderator warning issued to a user.
Warnings are container-scoped. The acknowledgedAt field is set when
the user acknowledges the warning via the acknowledge operation.
Source: packages/slingshot-community/src/entities/warning.ts
Interfaces
Section titled “Interfaces”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
CommunityAdminGate
Section titled “CommunityAdminGate”Scoring algorithm to apply when updateScore runs after a reaction change.
net— weighted upvotes minus downvotes plus emoji bonus.hot— Reddit-style time-decaying score (log₁₀ + time offset).top— identical tonet; time-window filter applied at list time.controversial— high engagement ÷ low net; surfaces polarising content.
Source: packages/slingshot-community/src/types/config.ts
CommunityInteractionsPeer
Section titled “CommunityInteractionsPeer”Public contract for slingshot-community.
Cross-package consumers reach community state through this surface, not by importing the plugin’s internals.
Two layers:
-
CommunityEntities— the canonical adapter surface. Each ref names a read-only slice of an entity adapter (Container.getById, Thread.list, etc.). Consumers resolve these viarequireEntityAdapter(carrier, ref)from@lastshotlabs/slingshot-core. The adapters are published into pluginState bycreateEntityPlugin()during the plugin’ssetupRoutesphase, so consumers must read insetupPostor per-request handlers. -
CommunityInteractionsPeerCap— the cross-package peer capability used byslingshot-interactionsfor component-tree resolution and updates. Resolved viactx.capabilities.require(CommunityInteractionsPeerCap).
Source: packages/slingshot-community/src/public.ts
CommunityPluginState
Section titled “CommunityPluginState”Plugin state key for slingshot-community (string form).
Single-sourced constant — no magic string 'slingshot-community' in
cross-package contracts. Kept for back-compat with consumers that use
pluginState.get(COMMUNITY_PLUGIN_STATE_KEY) directly.
New code should prefer the typed reference CommunityPluginStateRef
with readPluginState / publishPluginState so the value type is checked
at the call site.
Source: packages/slingshot-community/src/types/state.ts
CommunityWsConfig
Section titled “CommunityWsConfig”Scoring algorithm to apply when updateScore runs after a reaction change.
net— weighted upvotes minus downvotes plus emoji bonus.hot— Reddit-style time-decaying score (log₁₀ + time offset).top— identical tonet; time-window filter applied at list time.controversial— high engagement ÷ low net; surfaces polarising content.
Source: packages/slingshot-community/src/types/config.ts
Container
Section titled “Container”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
ContainerMember
Section titled “ContainerMember”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
ContainerRule
Section titled “ContainerRule”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
GetRepliesOptions
Section titled “GetRepliesOptions”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
ListBansOptions
Section titled “ListBansOptions”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
ListContainersOptions
Section titled “ListContainersOptions”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
ListReportsOptions
Section titled “ListReportsOptions”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
ListThreadsOptions
Section titled “ListThreadsOptions”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
ModerationTarget
Section titled “ModerationTarget”Scoring algorithm to apply when updateScore runs after a reaction change.
net— weighted upvotes minus downvotes plus emoji bonus.hot— Reddit-style time-decaying score (log₁₀ + time offset).top— identical tonet; time-window filter applied at list time.controversial— high engagement ÷ low net; surfaces polarising content.
Source: packages/slingshot-community/src/types/config.ts
Reaction
Section titled “Reaction”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
ReactionSummary
Section titled “ReactionSummary”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
Report
Section titled “Report”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
ScoringConfig
Section titled “ScoringConfig”Scoring algorithm to apply when updateScore runs after a reaction change.
net— weighted upvotes minus downvotes plus emoji bonus.hot— Reddit-style time-decaying score (log₁₀ + time offset).top— identical tonet; time-window filter applied at list time.controversial— high engagement ÷ low net; surfaces polarising content.
Source: packages/slingshot-community/src/types/config.ts
SearchOptions
Section titled “SearchOptions”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
Thread
Section titled “Thread”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
AfterHook
Section titled “AfterHook”Before-hook called with the incoming request input before the operation is executed.
Return the (optionally transformed) input to allow the operation to proceed.
Return null or undefined to reject the request with a 400 Bad Request
response.
Remarks: Before-hooks fire after request body parsing and before any write to the entity store. They run synchronously in the request lifecycle so any thrown error or rejected promise will bubble up as a 500 unless caught by the Hono error handler. Input mutations (e.g. injecting computed fields, stripping forbidden keys) should be done here rather than in after-hooks.
Source: packages/slingshot-community/src/types/hooks.ts
BeforeHook
Section titled “BeforeHook”Before-hook called with the incoming request input before the operation is executed.
Return the (optionally transformed) input to allow the operation to proceed.
Return null or undefined to reject the request with a 400 Bad Request
response.
Remarks: Before-hooks fire after request body parsing and before any write to the entity store. They run synchronously in the request lifecycle so any thrown error or rejected promise will bubble up as a 500 unless caught by the Hono error handler. Input mutations (e.g. injecting computed fields, stripping forbidden keys) should be done here rather than in after-hooks.
Source: packages/slingshot-community/src/types/hooks.ts
CommunityPluginConfig
Section titled “CommunityPluginConfig”Scoring algorithm to apply when updateScore runs after a reaction change.
net— weighted upvotes minus downvotes plus emoji bonus.hot— Reddit-style time-decaying score (log₁₀ + time offset).top— identical tonet; time-window filter applied at list time.controversial— high engagement ÷ low net; surfaces polarising content.
Source: packages/slingshot-community/src/types/config.ts
ContainerMemberRole
Section titled “ContainerMemberRole”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
ModerationDecision
Section titled “ModerationDecision”Scoring algorithm to apply when updateScore runs after a reaction change.
net— weighted upvotes minus downvotes plus emoji bonus.hot— Reddit-style time-decaying score (log₁₀ + time offset).top— identical tonet; time-window filter applied at list time.controversial— high engagement ÷ low net; surfaces polarising content.
Source: packages/slingshot-community/src/types/config.ts
ReactionType
Section titled “ReactionType”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
ReplyStatus
Section titled “ReplyStatus”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
ReportStatus
Section titled “ReportStatus”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
ReportTargetType
Section titled “ReportTargetType”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts
ThreadStatus
Section titled “ThreadStatus”Lifecycle status of a thread.
'draft': created but not yet visible to other users.'published': visible to members; set via thepublishoperation.'deleted': soft-deleted; hidden from lists but retained for audit.
Source: packages/slingshot-community/src/types/models.ts