refactor: trim line helper exports

This commit is contained in:
Peter Steinberger
2026-05-01 16:43:59 +01:00
parent d29c470d7c
commit 57fcd7b56d
8 changed files with 13 additions and 15 deletions

View File

@@ -42,7 +42,7 @@ interface BuildLineMessageContextParams {
historyLimit?: number;
}
export type LineSourceInfo = {
type LineSourceInfo = {
userId?: string;
groupId?: string;
roomId?: string;
@@ -576,6 +576,6 @@ export async function buildLinePostbackContext(params: {
};
}
export type LineMessageContext = NonNullable<Awaited<ReturnType<typeof buildLineMessageContext>>>;
export type LinePostbackContext = NonNullable<Awaited<ReturnType<typeof buildLinePostbackContext>>>;
type LineMessageContext = NonNullable<Awaited<ReturnType<typeof buildLineMessageContext>>>;
type LinePostbackContext = NonNullable<Awaited<ReturnType<typeof buildLinePostbackContext>>>;
export type LineInboundContext = LineMessageContext | LinePostbackContext;

View File

@@ -12,7 +12,7 @@ import { createLineWebhookReplayCache, handleLineWebhookEvents } from "./bot-han
import type { LineInboundContext } from "./bot-message-context.js";
import type { ResolvedLineAccount } from "./types.js";
export interface LineBotOptions {
interface LineBotOptions {
channelAccessToken: string;
channelSecret: string;
accountId?: string;
@@ -22,7 +22,7 @@ export interface LineBotOptions {
onMessage?: (ctx: LineInboundContext) => Promise<void>;
}
export interface LineBot {
interface LineBot {
handleWebhook: (body: webhook.CallbackRequest) => Promise<void>;
account: ResolvedLineAccount;
}

View File

@@ -1,10 +1,10 @@
import { describeWebhookAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
import { hasLineCredentials, parseLineAllowFromId } from "./account-helpers.js";
import { hasLineCredentials } from "./account-helpers.js";
import { type ChannelPlugin, type ResolvedLineAccount } from "./channel-api.js";
import { lineConfigAdapter } from "./config-adapter.js";
import { LineChannelConfigSchema } from "./config-schema.js";
export const lineChannelMeta = {
const lineChannelMeta = {
id: "line",
label: "LINE",
selectionLabel: "LINE (Messaging API)",
@@ -46,5 +46,3 @@ export const lineChannelPluginCommon = {
ChannelPlugin<ResolvedLineAccount>,
"meta" | "capabilities" | "reload" | "configSchema" | "config"
>;
export { parseLineAllowFromId };

View File

@@ -6,7 +6,7 @@ import {
type ResolvedLineAccount,
} from "./channel-api.js";
export function normalizeLineAllowFrom(entry: string): string {
function normalizeLineAllowFrom(entry: string): string {
return entry.replace(/^line:(?:user:)?/i, "");
}

View File

@@ -1,7 +1,7 @@
import { resolvePinnedHostnameWithPolicy, type SsrFPolicy } from "openclaw/plugin-sdk/ssrf-runtime";
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
export type LineOutboundMediaKind = "image" | "video" | "audio";
type LineOutboundMediaKind = "image" | "video" | "audio";
export type LineOutboundMediaResolved = {
mediaUrl: string;

View File

@@ -1,7 +1,7 @@
import type { messagingApi } from "@line/bot-sdk";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-types";
export type LineReplyMessage = messagingApi.TextMessage;
type LineReplyMessage = messagingApi.TextMessage;
export type SendLineReplyChunksParams = {
to: string;

View File

@@ -15,7 +15,7 @@ type LineChannelRuntime = {
sendMessageLine?: typeof import("./send.js").sendMessageLine;
};
export type LineRuntime = PluginRuntime & {
type LineRuntime = PluginRuntime & {
channel: PluginRuntime["channel"] & {
line?: LineChannelRuntime;
};

View File

@@ -2,7 +2,7 @@ import type { BaseProbeResult } from "openclaw/plugin-sdk/channel-contract";
export type LineTokenSource = "config" | "env" | "file" | "none";
export interface LineThreadBindingsConfig {
interface LineThreadBindingsConfig {
enabled?: boolean;
idleHours?: number;
maxAgeHours?: number;
@@ -67,7 +67,7 @@ export type LineProbeResult = BaseProbeResult<string> & {
};
};
export type LineFlexMessagePayload = {
type LineFlexMessagePayload = {
altText: string;
contents: unknown;
};