From 85e944cdcb898fb95c4e59c8c17fa4fa721f28e7 Mon Sep 17 00:00:00 2001 From: lovefyf Date: Thu, 13 Aug 2026 00:54:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8D=8F=E8=AE=AE=E5=86=8C=20v1.2=20?= =?UTF-8?q?=E5=A5=91=E7=BA=A6=E7=B1=BB=E5=9E=8B=E5=89=AF=E6=9C=AC=EF=BC=88?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E4=B8=BA=E7=9C=9F=E6=BA=90=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/contracts/envelope.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/contracts/envelope.ts diff --git a/src/contracts/envelope.ts b/src/contracts/envelope.ts new file mode 100644 index 0000000..ef21bdf --- /dev/null +++ b/src/contracts/envelope.ts @@ -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 { + id: string; // 全局唯一消息 id,发布方生成 + type: TType; // 消息类型全名(即主题名) + correlation: Correlation; + payload: TPayload; + occurredAt: string; // ISO-8601 + trace?: string; // W3C traceparent +} + +export interface CommandEnvelope + extends EventEnvelope { + idempotencyKey: string; // BUS-01 +}