Skip to content

@lastshotlabs/slingshot-community

npm install @lastshotlabs/slingshot-community

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,): SlingshotPackageDefinition

Source: packages/slingshot-community/src/plugin.ts

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

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

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

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

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

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

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

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

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

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

Source: packages/slingshot-community/src/public.ts

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

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 via requireEntityAdapter(carrier, ref) from @lastshotlabs/slingshot-core. The adapters are published into pluginState by createEntityPlugin() during the plugin’s setupRoutes phase, so consumers must read in setupPost or per-request handlers.

  • CommunityInteractionsPeerCap — the cross-package peer capability used by slingshot-interactions for component-tree resolution and updates. Resolved via ctx.capabilities.require(CommunityInteractionsPeerCap).

Source: packages/slingshot-community/src/public.ts

Source: packages/slingshot-community/src/public.ts

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 to net; time-window filter applied at list time.
  • controversial — high engagement ÷ low net; surfaces polarising content.
FieldDescription
`/** 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. DefaultURL path prefix for community routes. Omit to use ‘/community’.

Source: packages/slingshot-community/src/types/config.ts

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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 to net; time-window filter applied at list time.
  • controversial — high engagement ÷ low net; surfaces polarising content.

Source: packages/slingshot-community/src/types/config.ts

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Lifecycle status of a thread.

  • 'draft': created but not yet visible to other users.
  • 'published': visible to members; set via the publish operation.
  • 'deleted': soft-deleted; hidden from lists but retained for audit.

Source: packages/slingshot-community/src/types/models.ts

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 to net; time-window filter applied at list time.
  • controversial — high engagement ÷ low net; surfaces polarising content.

Source: packages/slingshot-community/src/types/config.ts

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 via requireEntityAdapter(carrier, ref) from @lastshotlabs/slingshot-core. The adapters are published into pluginState by createEntityPlugin() during the plugin’s setupRoutes phase, so consumers must read in setupPost or per-request handlers.

  • CommunityInteractionsPeerCap — the cross-package peer capability used by slingshot-interactions for component-tree resolution and updates. Resolved via ctx.capabilities.require(CommunityInteractionsPeerCap).

Source: packages/slingshot-community/src/public.ts

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

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 to net; time-window filter applied at list time.
  • controversial — high engagement ÷ low net; surfaces polarising content.

Source: packages/slingshot-community/src/types/config.ts

Lifecycle status of a thread.

  • 'draft': created but not yet visible to other users.
  • 'published': visible to members; set via the publish operation.
  • '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 the publish operation.
  • '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 the publish operation.
  • '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 the publish operation.
  • '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 the publish operation.
  • '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 the publish operation.
  • '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 the publish operation.
  • '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 the publish operation.
  • 'deleted': soft-deleted; hidden from lists but retained for audit.

Source: packages/slingshot-community/src/types/models.ts

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 to net; time-window filter applied at list time.
  • controversial — high engagement ÷ low net; surfaces polarising content.

Source: packages/slingshot-community/src/types/config.ts

Lifecycle status of a thread.

  • 'draft': created but not yet visible to other users.
  • 'published': visible to members; set via the publish operation.
  • '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 the publish operation.
  • '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 the publish operation.
  • '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 the publish operation.
  • 'deleted': soft-deleted; hidden from lists but retained for audit.

Source: packages/slingshot-community/src/types/models.ts

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 to net; time-window filter applied at list time.
  • controversial — high engagement ÷ low net; surfaces polarising content.

Source: packages/slingshot-community/src/types/config.ts

Lifecycle status of a thread.

  • 'draft': created but not yet visible to other users.
  • 'published': visible to members; set via the publish operation.
  • '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 the publish operation.
  • 'deleted': soft-deleted; hidden from lists but retained for audit.

Source: packages/slingshot-community/src/types/models.ts

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

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

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 to net; time-window filter applied at list time.
  • controversial — high engagement ÷ low net; surfaces polarising content.

Source: packages/slingshot-community/src/types/config.ts

Lifecycle status of a thread.

  • 'draft': created but not yet visible to other users.
  • 'published': visible to members; set via the publish operation.
  • 'deleted': soft-deleted; hidden from lists but retained for audit.

Source: packages/slingshot-community/src/types/models.ts

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 to net; time-window filter applied at list time.
  • controversial — high engagement ÷ low net; surfaces polarising content.

Source: packages/slingshot-community/src/types/config.ts

Lifecycle status of a thread.

  • 'draft': created but not yet visible to other users.
  • 'published': visible to members; set via the publish operation.
  • '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 the publish operation.
  • '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 the publish operation.
  • '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 the publish operation.
  • '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 the publish operation.
  • 'deleted': soft-deleted; hidden from lists but retained for audit.

Source: packages/slingshot-community/src/types/models.ts