mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 08:50:43 +00:00
refactor: trim line helper exports
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 };
|
||||
|
||||
@@ -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, "");
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -15,7 +15,7 @@ type LineChannelRuntime = {
|
||||
sendMessageLine?: typeof import("./send.js").sendMessageLine;
|
||||
};
|
||||
|
||||
export type LineRuntime = PluginRuntime & {
|
||||
type LineRuntime = PluginRuntime & {
|
||||
channel: PluginRuntime["channel"] & {
|
||||
line?: LineChannelRuntime;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user