@yaghmori/messaging-contracts
v0.1.0
Published
Ports, Kafka topics, TCP message patterns, and Zod DTOs for platform email, storage, and notification services
Readme
@yaghmori/messaging-contracts
Shared ports, Kafka topics, TCP message patterns, and Zod DTOs for public platform services:
| Service | TCP port | Role | |---------|----------|------| | email-service | 4003 | Transactional email (template key + data) | | storage-service | 4002 | Platform object storage (avatars, docs, images) | | notification-service | 4004 | In-app inbox + prefs + fan-out (Phase B) |
Install
pnpm add @yaghmori/messaging-contracts zodPublished from main to npmjs.com via CD (main).
Requires npm user yaghmori + repo secret NPM_TOKEN (Automation / CI token with 2FA bypass).dev runs CI (dev) only (build/typecheck, no publish). Bump version in package.json before merging to main when you want a new release.
Optional Nest helpers (interceptors / middleware / RPC filters):
import { RequestContextMiddleware, RpcLoggingInterceptor } from '@yaghmori/messaging-contracts/nest';Integrate in 10 minutes
- Import constants instead of hard-coding topics/ports:
import {
SERVICE_PORTS,
KAFKA_TOPICS,
MESSAGE_PATTERNS,
sendEmailRequestSchema,
} from '@yaghmori/messaging-contracts';Publish email send requests on
KAFKA_TOPICS.EMAIL_SEND_REQUESTEDwith payload matchingEmailSendRequestedPayloadSchema, or call TCPMESSAGE_PATTERNS.EMAIL.SEND_EMAILon portSERVICE_PORTS.EMAIL_SERVICE_TCP.Upload assets via storage HTTP; use TCP
MESSAGE_PATTERNS.STORAGE.*on portSERVICE_PORTS.STORAGE_SERVICE_TCPfor metadata / signed URL / delete.
Explicit non-goals
- No Allyfe / Parslinks product domain types
- Notification workflow catalogs belong in consumer apps (see notification Phase B)
- Deployment artifact registry is not part of storage V1
License
MIT
