feat: 协议册 v1.2 契约类型副本(文档为真源)

This commit is contained in:
lovefyf
2026-08-13 00:54:13 +08:00
parent 2a89abd638
commit 85e944cdcb
+23
View File
@@ -0,0 +1,23 @@
/** 真源:BPOS-Document-Share/BPOS服务消息协议.md §1.3(v1.2)。本文件是手工同步副本。 */
export type JsonValue = string | number | boolean | null | JsonValue[] | { [k: string]: JsonValue };
export type JsonObject = { [k: string]: JsonValue };
export interface Correlation {
taskId?: string;
workflowId?: string;
invocationId?: string;
}
export interface EventEnvelope<TType extends string = string, TPayload = JsonObject> {
id: string; // 全局唯一消息 id,发布方生成
type: TType; // 消息类型全名(即主题名)
correlation: Correlation;
payload: TPayload;
occurredAt: string; // ISO-8601
trace?: string; // W3C traceparent
}
export interface CommandEnvelope<TType extends string = string, TPayload = JsonObject>
extends EventEnvelope<TType, TPayload> {
idempotencyKey: string; // BUS-01
}