
Security News
PolinRider: North Korea-Linked Supply Chain Campaign Expands Across Open Source Ecosystems
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.
zpms-redis-message-sdk
Advanced tools
ZPMS 中台内部 Redis 隧道消息发布 SDK。
该包用于统一不同业务服务向 Redis Pub/Sub 隧道发布消息的格式、路由和基础校验逻辑。
messageIdtimestamp,允许外部覆盖type、staffCd、source、tenantId、hotelId 等协议字段payload 保持宽松约束sse:system:channelsse:{tenantId}:-1:channelsse:{tenantId}:{hotelId}:channelnpm install @zpms/redis-message-sdk
import Redis from 'ioredis';
import { createRedisMessagePublisher, SystemChannel } from '@zpms/redis-message-sdk';
const redisClient = new Redis({
host: '127.0.0.1',
port: 6379,
});
const publisher = createRedisMessagePublisher({
publisher: redisClient,
});
await publisher.publishSystemMessage({
systemChannel: SystemChannel.NOTICE,
type: 'system.notice',
eventName: 'system.global.notice',
staffCd: 'EMP001',
source: 'zpms-message-center',
payload: {
title: '系统通知',
content: '全局消息通知',
},
});
await publisher.publishBusinessMessage({
tenantId: '10001',
hotelId: '20001',
type: 'order.created',
eventName: 'order.status.changed',
staffCd: 'EMP001',
source: 'zpms-order-service',
businessKey: 'order',
businessId: 'ORDER_202605150001',
payload: {
orderNo: 'ORDER_202605150001',
status: 'CREATED',
},
});
await publisher.publishBusinessMessage({
tenantId: '10001',
hotelId: '-1',
type: 'member.updated',
eventName: 'member.profile.updated',
staffCd: 'EMP002',
source: 'zpms-member-service',
businessKey: 'member',
businessId: 'MEMBER_10086',
payload: {
memberId: '10086',
level: 'GOLD',
},
});
systemChannel 当前仅支持 SystemChannel.NOTICEtype 必须以 system. 开头tenantIdhotelIdeventName 为可选字符串字段tenantId 必填hotelId 必填hotelId = '-1' 时表示租户级业务消息eventName 为可选字符串字段,位于 businessId 同级staffCd 必填source 必填payload 必须为对象type 仅允许小写字母和 .type 正则:^[a-z]+(\.[a-z]+)*$interface PublishMessageResult {
success: boolean;
messageId: string;
route: string;
subscriberCount: number;
}
npm install
npm run typecheck
npm run test
npm run build
npm run check
npm run pack:dry-run
发布到公共 npm 前,请先确认:
versionCHANGELOG.mdnpm pack --dry-run 输出文件列表@zpms scope 的发布权限发布检查清单见 docs/publish-checklist.md。
docs/redis-message-protocol-v1.mddocs/redis-message-sdk-design-v1.mddocs/publish-checklist.mdFAQs
ZPMS Redis tunnel message publisher SDK
The npm package zpms-redis-message-sdk receives a total of 5 weekly downloads. As such, zpms-redis-message-sdk popularity was classified as not popular.
We found that zpms-redis-message-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.