@lastshotlabs/slingshot-emoji
npm install @lastshotlabs/slingshot-emoji
Functions
Section titled “Functions”createEmojiPackage
Section titled “createEmojiPackage”Create the emoji package: custom emoji metadata management with org-scoped shortcode uniqueness, permission-guarded CRUD, and event-driven notifications.
Emoji assets are managed by the framework upload system — this package stores
only the uploadKey reference. The update route is intentionally disabled
(emojis are immutable; delete and re-upload to change).
Permissions resolve through the slingshot-permissions package, which must be
registered before this one. Shortcodes must match /^[a-z0-9_]{2,32}$/; the
shortcodeGuard middleware enforces this on the create route and returns 400
with a clear error when violated.
When the framework upload system is configured (ctx.upload.adapter is set),
the package subscribes to emoji:emoji.deleted and removes the uploaded file
via storageAdapter.delete(uploadKey). When no storage adapter is configured,
a warning is logged and the cascade is skipped.
function createEmojiPackage(rawConfig: unknown): SlingshotPackageDefinitionSource: packages/slingshot-emoji/src/plugin.ts
shortcodeGuard
Section titled “shortcodeGuard”Shortcode format: 2-32 lowercase alphanumeric + underscores.
Source: packages/slingshot-emoji/src/middleware/shortcodeGuard.ts
Constants
Section titled “Constants”Public contract for slingshot-emoji.
Provider-owned contract slot used by cross-package consumers. The package does not currently expose runtime capabilities; the contract is declared here so future entity or capability publication has a stable home.
Source: packages/slingshot-emoji/src/public.ts
EmojiEntity
Section titled “EmojiEntity”Custom emoji entity.
Shortcode uniqueness is enforced by the [orgId, shortcode] unique index.
The uploadKey field references a file managed by the framework upload
system. Clients presign, upload to storage, then POST emoji metadata with
the key. Emojis are immutable once created — the update route is
intentionally disabled.
Source: packages/slingshot-emoji/src/entities/emoji.ts
emojiModule
Section titled “emojiModule”Source: packages/slingshot-emoji/src/entities/emoji.ts
emojiOperations
Section titled “emojiOperations”Source: packages/slingshot-emoji/src/entities/emoji.ts
emojiPackageConfigSchema
Section titled “emojiPackageConfigSchema”Zod validation schema for EmojiPackageConfig.
Used by createEmojiPackage() to validate the raw config at construction time.
Source: packages/slingshot-emoji/src/types.ts
Interfaces
Section titled “Interfaces”EmojiRecord
Section titled “EmojiRecord”Zod validation schema for EmojiPackageConfig.
Used by createEmojiPackage() to validate the raw config at construction time.
Source: packages/slingshot-emoji/src/types.ts
EmojiPackageConfig
Section titled “EmojiPackageConfig”Zod validation schema for EmojiPackageConfig.
Used by createEmojiPackage() to validate the raw config at construction time.
Source: packages/slingshot-emoji/src/types.ts
EmojiPluginConfig
Section titled “EmojiPluginConfig”Zod validation schema for EmojiPackageConfig.
Used by createEmojiPackage() to validate the raw config at construction time.
Source: packages/slingshot-emoji/src/types.ts