refactor(core): dedupe schema and command parsing helpers

This commit is contained in:
Peter Steinberger
2026-02-16 23:47:48 +00:00
parent c55e017c19
commit 4088c0b89d
3 changed files with 71 additions and 109 deletions

View File

@@ -18,11 +18,9 @@ type SelectOption = {
text?: { text?: string };
};
type InteractionSummary = {
interactionType?: "block_action" | "view_submission" | "view_closed";
actionId: string;
blockId?: string;
type InteractionSelectionFields = {
actionType?: string;
blockId?: string;
inputKind?: "text" | "number" | "email" | "url" | "rich_text";
value?: string;
selectedValues?: string[];
@@ -39,6 +37,11 @@ type InteractionSummary = {
inputUrl?: string;
richTextValue?: unknown;
richTextPreview?: string;
};
type InteractionSummary = InteractionSelectionFields & {
interactionType?: "block_action" | "view_submission" | "view_closed";
actionId: string;
userId?: string;
teamId?: string;
triggerId?: string;
@@ -50,26 +53,9 @@ type InteractionSummary = {
threadTs?: string;
};
type ModalInputSummary = {
type ModalInputSummary = InteractionSelectionFields & {
blockId: string;
actionId: string;
actionType?: string;
inputKind?: "text" | "number" | "email" | "url" | "rich_text";
value?: string;
selectedValues?: string[];
selectedUsers?: string[];
selectedChannels?: string[];
selectedConversations?: string[];
selectedLabels?: string[];
selectedDate?: string;
selectedTime?: string;
selectedDateTime?: number;
inputValue?: string;
inputNumber?: number;
inputEmail?: string;
inputUrl?: string;
richTextValue?: unknown;
richTextPreview?: string;
};
function readOptionValues(options: unknown): string[] | undefined {