mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:40:44 +00:00
refactor: trim zalo helper exports
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
type SecretTargetRegistryEntry,
|
||||
} from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
||||
|
||||
export const secretTargetRegistryEntries = [
|
||||
export const secretTargetRegistryEntries: SecretTargetRegistryEntry[] = [
|
||||
{
|
||||
id: "channels.zalo.accounts.*.botToken",
|
||||
targetType: "channels.zalo.accounts.*.botToken",
|
||||
@@ -52,7 +52,7 @@ export const secretTargetRegistryEntries = [
|
||||
includeInConfigure: true,
|
||||
includeInAudit: true,
|
||||
},
|
||||
] satisfies SecretTargetRegistryEntry[];
|
||||
];
|
||||
|
||||
export function collectRuntimeConfigAssignments(params: {
|
||||
config: { channels?: Record<string, unknown> };
|
||||
|
||||
@@ -6,7 +6,7 @@ import { sendMessage, sendPhoto } from "./api.js";
|
||||
import { resolveZaloProxyFetch } from "./proxy.js";
|
||||
import { resolveZaloToken } from "./token.js";
|
||||
|
||||
export type ZaloSendOptions = {
|
||||
type ZaloSendOptions = {
|
||||
token?: string;
|
||||
accountId?: string;
|
||||
cfg?: OpenClawConfig;
|
||||
@@ -16,7 +16,7 @@ export type ZaloSendOptions = {
|
||||
proxy?: string;
|
||||
};
|
||||
|
||||
export type ZaloSendResult = {
|
||||
type ZaloSendResult = {
|
||||
ok: boolean;
|
||||
messageId?: string;
|
||||
error?: string;
|
||||
|
||||
@@ -10,7 +10,7 @@ function resolveLifecycleAllowFrom(params: {
|
||||
return params.allowFrom ?? (params.dmPolicy === "open" ? ["*"] : undefined);
|
||||
}
|
||||
|
||||
export function createLifecycleConfig(params: {
|
||||
function createLifecycleConfig(params: {
|
||||
accountId: string;
|
||||
dmPolicy: "open" | "pairing";
|
||||
allowFrom?: string[];
|
||||
@@ -38,7 +38,7 @@ export function createLifecycleConfig(params: {
|
||||
} as OpenClawConfig;
|
||||
}
|
||||
|
||||
export function createLifecycleAccount(params: {
|
||||
function createLifecycleAccount(params: {
|
||||
accountId: string;
|
||||
dmPolicy: "open" | "pairing";
|
||||
allowFrom?: string[];
|
||||
@@ -359,7 +359,7 @@ export async function settleAsyncWork(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
export async function postWebhookUpdate(params: {
|
||||
async function postWebhookUpdate(params: {
|
||||
baseUrl: string;
|
||||
path: string;
|
||||
secret: string;
|
||||
|
||||
@@ -51,11 +51,8 @@ const lifecycleMocks = vi.hoisted(
|
||||
}),
|
||||
);
|
||||
|
||||
export const setWebhookMock = lifecycleMocks.setWebhookMock;
|
||||
export const deleteWebhookMock = lifecycleMocks.deleteWebhookMock;
|
||||
export const getWebhookInfoMock = lifecycleMocks.getWebhookInfoMock;
|
||||
const setWebhookMock = lifecycleMocks.setWebhookMock;
|
||||
export const getUpdatesMock = lifecycleMocks.getUpdatesMock;
|
||||
export const sendChatActionMock = lifecycleMocks.sendChatActionMock;
|
||||
export const sendMessageMock = lifecycleMocks.sendMessageMock;
|
||||
export const sendPhotoMock = lifecycleMocks.sendPhotoMock;
|
||||
export const getZaloRuntimeMock: UnknownMock = lifecycleMocks.getZaloRuntimeMock;
|
||||
@@ -128,7 +125,7 @@ export function setLifecycleRuntimeCore(
|
||||
);
|
||||
}
|
||||
|
||||
export async function loadLifecycleMonitorModule(): Promise<MonitorModule> {
|
||||
async function loadLifecycleMonitorModule(): Promise<MonitorModule> {
|
||||
return await importMonitorModule({ cacheBust: "monitor", mocked: true });
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { resolveAccountEntry } from "openclaw/plugin-sdk/routing";
|
||||
import { normalizeResolvedSecretInputString, normalizeSecretInputString } from "./secret-input.js";
|
||||
import type { ZaloConfig } from "./types.js";
|
||||
|
||||
export type ZaloTokenResolution = BaseTokenResolution & {
|
||||
type ZaloTokenResolution = BaseTokenResolution & {
|
||||
source: "env" | "config" | "configFile" | "none";
|
||||
};
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ export type ZaloConfig = {
|
||||
defaultAccount?: string;
|
||||
} & ZaloAccountConfig;
|
||||
|
||||
export type ZaloTokenSource = "env" | "config" | "configFile" | "none";
|
||||
type ZaloTokenSource = "env" | "config" | "configFile" | "none";
|
||||
|
||||
export type ResolvedZaloAccount = {
|
||||
accountId: string;
|
||||
|
||||
Reference in New Issue
Block a user