Skip to content

@lastshotlabs/slingshot-emoji

npm install @lastshotlabs/slingshot-emoji

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

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

Shortcode format: 2-32 lowercase alphanumeric + underscores.

Source: packages/slingshot-emoji/src/middleware/shortcodeGuard.ts

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

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

Source: packages/slingshot-emoji/src/entities/emoji.ts

Source: packages/slingshot-emoji/src/entities/emoji.ts

Zod validation schema for EmojiPackageConfig.

Used by createEmojiPackage() to validate the raw config at construction time.

Source: packages/slingshot-emoji/src/types.ts

Zod validation schema for EmojiPackageConfig.

Used by createEmojiPackage() to validate the raw config at construction time.

Source: packages/slingshot-emoji/src/types.ts

Zod validation schema for EmojiPackageConfig.

Used by createEmojiPackage() to validate the raw config at construction time.

Source: packages/slingshot-emoji/src/types.ts

Zod validation schema for EmojiPackageConfig.

Used by createEmojiPackage() to validate the raw config at construction time.

Source: packages/slingshot-emoji/src/types.ts