refactor: trim zalo helper exports · openclaw/openclaw@f77acff
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,7 +7,7 @@ import {
|
7 | 7 | type SecretTargetRegistryEntry, |
8 | 8 | } from "openclaw/plugin-sdk/channel-secret-basic-runtime"; |
9 | 9 | |
10 | | -export const secretTargetRegistryEntries = [ |
| 10 | +export const secretTargetRegistryEntries: SecretTargetRegistryEntry[] = [ |
11 | 11 | { |
12 | 12 | id: "channels.zalo.accounts.*.botToken", |
13 | 13 | targetType: "channels.zalo.accounts.*.botToken", |
@@ -52,7 +52,7 @@ export const secretTargetRegistryEntries = [
|
52 | 52 | includeInConfigure: true, |
53 | 53 | includeInAudit: true, |
54 | 54 | }, |
55 | | -] satisfies SecretTargetRegistryEntry[]; |
| 55 | +]; |
56 | 56 | |
57 | 57 | export function collectRuntimeConfigAssignments(params: { |
58 | 58 | config: { channels?: Record<string, unknown> }; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -6,7 +6,7 @@ import { sendMessage, sendPhoto } from "./api.js";
|
6 | 6 | import { resolveZaloProxyFetch } from "./proxy.js"; |
7 | 7 | import { resolveZaloToken } from "./token.js"; |
8 | 8 | |
9 | | -export type ZaloSendOptions = { |
| 9 | +type ZaloSendOptions = { |
10 | 10 | token?: string; |
11 | 11 | accountId?: string; |
12 | 12 | cfg?: OpenClawConfig; |
@@ -16,7 +16,7 @@ export type ZaloSendOptions = {
|
16 | 16 | proxy?: string; |
17 | 17 | }; |
18 | 18 | |
19 | | -export type ZaloSendResult = { |
| 19 | +type ZaloSendResult = { |
20 | 20 | ok: boolean; |
21 | 21 | messageId?: string; |
22 | 22 | error?: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,7 @@ function resolveLifecycleAllowFrom(params: {
|
10 | 10 | return params.allowFrom ?? (params.dmPolicy === "open" ? ["*"] : undefined); |
11 | 11 | } |
12 | 12 | |
13 | | -export function createLifecycleConfig(params: { |
| 13 | +function createLifecycleConfig(params: { |
14 | 14 | accountId: string; |
15 | 15 | dmPolicy: "open" | "pairing"; |
16 | 16 | allowFrom?: string[]; |
@@ -38,7 +38,7 @@ export function createLifecycleConfig(params: {
|
38 | 38 | } as OpenClawConfig; |
39 | 39 | } |
40 | 40 | |
41 | | -export function createLifecycleAccount(params: { |
| 41 | +function createLifecycleAccount(params: { |
42 | 42 | accountId: string; |
43 | 43 | dmPolicy: "open" | "pairing"; |
44 | 44 | allowFrom?: string[]; |
@@ -359,7 +359,7 @@ export async function settleAsyncWork(): Promise<void> {
|
359 | 359 | } |
360 | 360 | } |
361 | 361 | |
362 | | -export async function postWebhookUpdate(params: { |
| 362 | +async function postWebhookUpdate(params: { |
363 | 363 | baseUrl: string; |
364 | 364 | path: string; |
365 | 365 | secret: string; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -51,11 +51,8 @@ const lifecycleMocks = vi.hoisted(
|
51 | 51 | }), |
52 | 52 | ); |
53 | 53 | |
54 | | -export const setWebhookMock = lifecycleMocks.setWebhookMock; |
55 | | -export const deleteWebhookMock = lifecycleMocks.deleteWebhookMock; |
56 | | -export const getWebhookInfoMock = lifecycleMocks.getWebhookInfoMock; |
| 54 | +const setWebhookMock = lifecycleMocks.setWebhookMock; |
57 | 55 | export const getUpdatesMock = lifecycleMocks.getUpdatesMock; |
58 | | -export const sendChatActionMock = lifecycleMocks.sendChatActionMock; |
59 | 56 | export const sendMessageMock = lifecycleMocks.sendMessageMock; |
60 | 57 | export const sendPhotoMock = lifecycleMocks.sendPhotoMock; |
61 | 58 | export const getZaloRuntimeMock: UnknownMock = lifecycleMocks.getZaloRuntimeMock; |
@@ -128,7 +125,7 @@ export function setLifecycleRuntimeCore(
|
128 | 125 | ); |
129 | 126 | } |
130 | 127 | |
131 | | -export async function loadLifecycleMonitorModule(): Promise<MonitorModule> { |
| 128 | +async function loadLifecycleMonitorModule(): Promise<MonitorModule> { |
132 | 129 | return await importMonitorModule({ cacheBust: "monitor", mocked: true }); |
133 | 130 | } |
134 | 131 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -5,7 +5,7 @@ import { resolveAccountEntry } from "openclaw/plugin-sdk/routing";
|
5 | 5 | import { normalizeResolvedSecretInputString, normalizeSecretInputString } from "./secret-input.js"; |
6 | 6 | import type { ZaloConfig } from "./types.js"; |
7 | 7 | |
8 | | -export type ZaloTokenResolution = BaseTokenResolution & { |
| 8 | +type ZaloTokenResolution = BaseTokenResolution & { |
9 | 9 | source: "env" | "config" | "configFile" | "none"; |
10 | 10 | }; |
11 | 11 | |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -38,7 +38,7 @@ export type ZaloConfig = {
|
38 | 38 | defaultAccount?: string; |
39 | 39 | } & ZaloAccountConfig; |
40 | 40 | |
41 | | -export type ZaloTokenSource = "env" | "config" | "configFile" | "none"; |
| 41 | +type ZaloTokenSource = "env" | "config" | "configFile" | "none"; |
42 | 42 | |
43 | 43 | export type ResolvedZaloAccount = { |
44 | 44 | accountId: string; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。