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;