From 92ca60e55be96df29573e4ca14426c3129f023ef Mon Sep 17 00:00:00 2001 From: kang Date: Thu, 12 Feb 2026 13:19:55 +0800 Subject: [PATCH] fix(types): narrow tag_color type to supported color literals Replace `string` with `'red' | 'yellow' | 'green' | 'gray' | 'blue'` for `tag_color` in EntityTypedField, EntityStringField, and EntityCustomField to match the Slack API specification. Per https://docs.slack.dev/messaging/work-objects/#supported-properties-for-a-field: Can only be set when the type is string. Allows the string to be highlighted in one of the following colors: red, yellow, green, gray, blue. e.g., tag_color: "red". --- packages/types/src/message-metadata.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/types/src/message-metadata.ts b/packages/types/src/message-metadata.ts index 3bb8c97c7..f0d8c2903 100644 --- a/packages/types/src/message-metadata.ts +++ b/packages/types/src/message-metadata.ts @@ -201,7 +201,7 @@ export interface EntityTypedField { slack_file?: SlackFile; alt_text?: string; edit?: EntityEditSupport; - tag_color?: string; + tag_color?: 'red' | 'yellow' | 'green' | 'gray' | 'blue'; user?: EntityUserIDField | EntityUserField; entity_ref?: EntityRefField; } @@ -214,7 +214,7 @@ export interface EntityStringField { icon?: EntityIconField; long?: boolean; type?: string; - tag_color?: string; + tag_color?: 'red' | 'yellow' | 'green' | 'gray' | 'blue'; edit?: EntityEditSupport; } @@ -279,7 +279,7 @@ export interface EntityCustomField { image_url?: string; slack_file?: SlackFile; alt_text?: string; - tag_color?: string; + tag_color?: 'red' | 'yellow' | 'green' | 'gray' | 'blue'; edit?: EntityEditSupport; item_type?: string; user?: EntityUserIDField | EntityUserField;