refactor(line): reuse reply chunk deps type

This commit is contained in:
Peter Steinberger
2026-02-16 02:29:07 +00:00
parent 35c5d2be5c
commit 39d5590230

View File

@@ -2,7 +2,7 @@ import type { messagingApi } from "@line/bot-sdk";
import type { ReplyPayload } from "../auto-reply/types.js";
import type { FlexContainer } from "./flex-templates.js";
import type { ProcessedLineMessage } from "./markdown-to-line.js";
import type { LineReplyMessage, SendLineReplyChunksParams } from "./reply-chunks.js";
import type { SendLineReplyChunksParams } from "./reply-chunks.js";
import type { LineChannelData, LineTemplateMessagePayload } from "./types.js";
export type LineAutoReplyDeps = {
@@ -12,19 +12,6 @@ export type LineAutoReplyDeps = {
processLineMessage: (text: string) => ProcessedLineMessage;
chunkMarkdownText: (text: string, limit: number) => string[];
sendLineReplyChunks: (params: SendLineReplyChunksParams) => Promise<{ replyTokenUsed: boolean }>;
replyMessageLine: (
replyToken: string,
messages: messagingApi.Message[],
opts?: { accountId?: string },
) => Promise<unknown>;
pushMessageLine: (to: string, text: string, opts?: { accountId?: string }) => Promise<unknown>;
pushTextMessageWithQuickReplies: (
to: string,
text: string,
quickReplies: string[],
opts?: { accountId?: string },
) => Promise<unknown>;
createTextMessageWithQuickReplies: (text: string, quickReplies: string[]) => LineReplyMessage;
createQuickReplyItems: (labels: string[]) => messagingApi.QuickReply;
pushMessagesLine: (
to: string,
@@ -42,8 +29,14 @@ export type LineAutoReplyDeps = {
latitude: number;
longitude: number;
}) => messagingApi.LocationMessage;
onReplyError?: (err: unknown) => void;
};
} & Pick<
SendLineReplyChunksParams,
| "replyMessageLine"
| "pushMessageLine"
| "pushTextMessageWithQuickReplies"
| "createTextMessageWithQuickReplies"
| "onReplyError"
>;
export async function deliverLineAutoReply(params: {
payload: ReplyPayload;