Skip to content

@lastshotlabs/slingshot-organizations

npm install @lastshotlabs/slingshot-organizations

Result of a sliding-window rate-limit check.

function createMemoryOrganizationsRateLimitStore(options?: { maxEntries?: number; }): OrganizationsRateLimitStore

Source: packages/slingshot-organizations/src/lib/rateLimit.ts

Organizations package factory.

Creates a SlingshotPackageDefinition that mounts the Organization, OrganizationMember, OrganizationInvite, Group, and GroupMembership entities (conditionally enabled by config), wires the invite rate-limit middleware and admin-role guards, and publishes the org service + reconcile service for cross-package consumers.

Every adapter ref, middleware closure, and rate-limit backend is owned by the factory’s closure (Rule 3) — multiple package instances in the same process do not share state.

function createOrganizationsPackage(rawConfig: OrganizationsPluginConfig = {}, deps: OrganizationsPluginDeps = {},): SlingshotPackageDefinition

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

Minimal Redis client contract satisfied by ioredis, Upstash Redis, etc. Re-exported from @lastshotlabs/slingshot-core so callers don’t need an extra import.

function createRedisOrganizationsRateLimitStore(redis: RedisLike, keyPrefix = 'org-rl:',): OrganizationsRateLimitStore

Source: packages/slingshot-organizations/src/lib/rateLimitRedis.ts

Runtime organization service published through plugin state.

Peer plugins use this contract to resolve organizations by slug, create organizations, and add members without depending on a concrete adapter.

function getOrganizationsOrgService(input: PluginStateMap | PluginStateCarrier | object | null | undefined,): OrganizationsOrgService

Source: packages/slingshot-organizations/src/orgService.ts

Runtime organization service published through plugin state.

Peer plugins use this contract to resolve organizations by slug, create organizations, and add members without depending on a concrete adapter.

function getOrganizationsOrgServiceOrNull(input: PluginStateMap | PluginStateCarrier | object | null | undefined,): OrganizationsOrgService | null

Source: packages/slingshot-organizations/src/orgService.ts

Result of reconcileOrphanedOrgRecords. Reports which dependent collections still had orphaned rows when reconciliation began and which (if any) failed to clean up. An empty failed list means the org has no remaining orphans.

function getOrganizationsReconcile(input: PluginStateMap | PluginStateCarrier | object | null | undefined,): OrganizationsReconcileService

Source: packages/slingshot-organizations/src/reconcile.ts

Result of reconcileOrphanedOrgRecords. Reports which dependent collections still had orphaned rows when reconciliation began and which (if any) failed to clean up. An empty failed list means the org has no remaining orphans.

function getOrganizationsReconcileOrNull(input: PluginStateMap | PluginStateCarrier | object | null | undefined,): OrganizationsReconcileService | null

Source: packages/slingshot-organizations/src/reconcile.ts

Stable error code emitted in responses and logs when a slug uniqueness conflict is detected.

function isUniqueViolationError(err: unknown): boolean

Source: packages/slingshot-organizations/src/errors.ts

Public contract for slingshot-organizations.

Cross-package consumers resolve OrganizationsOrgServiceCap through ctx.capabilities.require(...). The legacy getOrganizationsOrgService(...) helper is retained as a thin wrapper that resolves through the same contract path.

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

Result of reconcileOrphanedOrgRecords. Reports which dependent collections still had orphaned rows when reconciliation began and which (if any) failed to clean up. An empty failed list means the org has no remaining orphans.

Source: packages/slingshot-organizations/src/reconcile.ts

Public contract for slingshot-organizations.

Cross-package consumers resolve OrganizationsOrgServiceCap through ctx.capabilities.require(...). The legacy getOrganizationsOrgService(...) helper is retained as a thin wrapper that resolves through the same contract path.

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

Stable error code emitted in responses and logs when a slug uniqueness conflict is detected.

Source: packages/slingshot-organizations/src/errors.ts

Fine-grained access-control options for the groups management routes.

Either adminRole or middleware can be used to protect the routes — providing middleware overrides adminRole entirely.

Source: packages/slingshot-organizations/src/types/groups.ts

Fine-grained access-control options for the groups management routes.

Either adminRole or middleware can be used to protect the routes — providing middleware overrides adminRole entirely.

Source: packages/slingshot-organizations/src/types/groups.ts

Organizations package factory.

Creates a SlingshotPackageDefinition that mounts the Organization, OrganizationMember, OrganizationInvite, Group, and GroupMembership entities (conditionally enabled by config), wires the invite rate-limit middleware and admin-role guards, and publishes the org service + reconcile service for cross-package consumers.

Every adapter ref, middleware closure, and rate-limit backend is owned by the factory’s closure (Rule 3) — multiple package instances in the same process do not share state.

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

Result of a sliding-window rate-limit check.

Source: packages/slingshot-organizations/src/lib/rateLimit.ts

Result of reconcileOrphanedOrgRecords. Reports which dependent collections still had orphaned rows when reconciliation began and which (if any) failed to clean up. An empty failed list means the org has no remaining orphans.

Source: packages/slingshot-organizations/src/reconcile.ts

Result of reconcileOrphanedOrgRecords. Reports which dependent collections still had orphaned rows when reconciliation began and which (if any) failed to clean up. An empty failed list means the org has no remaining orphans.

Source: packages/slingshot-organizations/src/reconcile.ts

Canonical Redis client interface used across all slingshot packages.

Concrete implementations (ioredis, Upstash Redis, etc.) satisfy this contract. Typed as an interface rather than a class so that any Redis-compatible client can be used without an adapter layer.

Remarks: getdel is optional because it is not supported by all Redis versions (requires Redis 6.2+). Framework code that calls getdel should fall back to GET+DEL when it is absent.

Source: packages/slingshot-core/src/redis.ts

Runtime organization service published through plugin state.

Peer plugins use this contract to resolve organizations by slug, create organizations, and add members without depending on a concrete adapter.

Source: packages/slingshot-organizations/src/orgService.ts

Organizations package factory.

Creates a SlingshotPackageDefinition that mounts the Organization, OrganizationMember, OrganizationInvite, Group, and GroupMembership entities (conditionally enabled by config), wires the invite rate-limit middleware and admin-role guards, and publishes the org service + reconcile service for cross-package consumers.

Every adapter ref, middleware closure, and rate-limit backend is owned by the factory’s closure (Rule 3) — multiple package instances in the same process do not share state.

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

Result of a sliding-window rate-limit check.

Source: packages/slingshot-organizations/src/lib/rateLimit.ts