From 71715506c35b7b47fbc1783985f1d781e021fbd8 Mon Sep 17 00:00:00 2001 From: OG T Date: Mon, 6 Apr 2026 11:50:43 +0800 Subject: [PATCH] =?UTF-8?q?chore(types):=20=E9=87=8D=E6=96=B0=E7=94=A2?= =?UTF-8?q?=E7=94=9F=20TypeScript=20=E5=9E=8B=E5=88=A5=20=E2=80=94=20Phase?= =?UTF-8?q?=2026=20ApprovalRequest=20+=20namespace=20=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- packages/shared-types/schemas/api-types.json | 13 +++++++++++++ packages/shared-types/src/api-types.ts | 13 +++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/packages/shared-types/schemas/api-types.json b/packages/shared-types/schemas/api-types.json index 16737849..76001854 100644 --- a/packages/shared-types/schemas/api-types.json +++ b/packages/shared-types/schemas/api-types.json @@ -324,6 +324,19 @@ "format": "date-time", "title": "Last Seen At", "type": "string" + }, + "incident_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "關聯的 Incident ID", + "title": "Incident Id" } }, "required": [ diff --git a/packages/shared-types/src/api-types.ts b/packages/shared-types/src/api-types.ts index f9b3cc51..3a8f4506 100644 --- a/packages/shared-types/src/api-types.ts +++ b/packages/shared-types/src/api-types.ts @@ -143,6 +143,10 @@ export type HitCount = number; * 最後觸發時間 */ export type LastSeenAt = string; +/** + * 關聯的 Incident ID + */ +export type IncidentId = string | null; /** * 執行動作描述 */ @@ -384,7 +388,7 @@ export type Fingerprint2 = string | null; /** * 事件唯一識別碼 (如 INC-20260322-A1B2C3) */ -export type IncidentId = string; +export type IncidentId1 = string; /** * 事件狀態 */ @@ -435,7 +439,7 @@ export type PersistedToPg = boolean; export type Vectorized = boolean; export type Signals1 = Signal[]; export type AffectedServices1 = string[]; -export type IncidentId1 = string; +export type IncidentId2 = string; export type Signals2 = Signal[]; export type AffectedServices2 = string[]; export type ProposalIds1 = string[]; @@ -827,6 +831,7 @@ export interface ApprovalRequest { fingerprint?: Fingerprint; hit_count?: HitCount; last_seen_at?: LastSeenAt; + incident_id?: IncidentId; [k: string]: unknown; } /** @@ -1074,7 +1079,7 @@ export interface Annotations { * via the `definition` "Incident". */ export interface Incident { - incident_id?: IncidentId; + incident_id?: IncidentId1; status?: IncidentStatus1; severity: Severity2; signals?: Signals; @@ -1120,7 +1125,7 @@ export interface IncidentCreate { * via the `definition` "IncidentResponse". */ export interface IncidentResponse { - incident_id: IncidentId1; + incident_id: IncidentId2; status: IncidentStatus; severity: Severity; signals: Signals2;