mirror of https://github.com/openclaw/openclaw.git
refactor(zalo): narrow action runtime imports
This commit is contained in:
parent
0ba93afda9
commit
abc3f27ba9
|
|
@ -1,11 +1,12 @@
|
|||
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
||||
import { listEnabledZaloAccounts, resolveZaloAccount } from "./accounts.js";
|
||||
import { jsonResult, readStringParam } from "openclaw/plugin-sdk/channel-actions";
|
||||
import type {
|
||||
ChannelMessageActionAdapter,
|
||||
ChannelMessageActionName,
|
||||
OpenClawConfig,
|
||||
} from "./runtime-api.js";
|
||||
import { extractToolSend, jsonResult, readStringParam } from "./runtime-api.js";
|
||||
} from "openclaw/plugin-sdk/channel-contract";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
||||
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
||||
import { listEnabledZaloAccounts, resolveZaloAccount } from "./accounts.js";
|
||||
|
||||
const loadZaloActionsRuntime = createLazyRuntimeNamedExport(
|
||||
() => import("./actions.runtime.js"),
|
||||
|
|
@ -15,9 +16,9 @@ const loadZaloActionsRuntime = createLazyRuntimeNamedExport(
|
|||
const providerId = "zalo";
|
||||
|
||||
function listEnabledAccounts(cfg: OpenClawConfig, accountId?: string | null) {
|
||||
return (accountId ? [resolveZaloAccount({ cfg, accountId })] : listEnabledZaloAccounts(cfg)).filter(
|
||||
(account) => account.enabled && account.tokenSource !== "none",
|
||||
);
|
||||
return (
|
||||
accountId ? [resolveZaloAccount({ cfg, accountId })] : listEnabledZaloAccounts(cfg)
|
||||
).filter((account) => account.enabled && account.tokenSource !== "none");
|
||||
}
|
||||
|
||||
export const zaloMessageActions: ChannelMessageActionAdapter = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue