Extensions: migrate zalo plugin-sdk imports

This commit is contained in:
Gustavo Madeira Santana
2026-03-04 01:20:20 -05:00
parent b361cac753
commit dda86af866
19 changed files with 29 additions and 25 deletions

View File

@@ -1,9 +1,9 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk";
import {
DEFAULT_ACCOUNT_ID,
normalizeAccountId,
normalizeOptionalAccountId,
} from "openclaw/plugin-sdk/account-id";
import type { OpenClawConfig } from "openclaw/plugin-sdk/compat";
import { resolveZaloToken } from "./token.js";
import type { ResolvedZaloAccount, ZaloAccountConfig, ZaloConfig } from "./types.js";

View File

@@ -2,8 +2,8 @@ import type {
ChannelMessageActionAdapter,
ChannelMessageActionName,
OpenClawConfig,
} from "openclaw/plugin-sdk";
import { extractToolSend, jsonResult, readStringParam } from "openclaw/plugin-sdk";
} from "openclaw/plugin-sdk/compat";
import { extractToolSend, jsonResult, readStringParam } from "openclaw/plugin-sdk/compat";
import { listEnabledZaloAccounts } from "./accounts.js";
import { sendMessageZalo } from "./send.js";

View File

@@ -1,4 +1,4 @@
import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk";
import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk/compat";
import { describe, expect, it } from "vitest";
import { zaloPlugin } from "./channel.js";

View File

@@ -1,4 +1,4 @@
import type { ReplyPayload } from "openclaw/plugin-sdk";
import type { ReplyPayload } from "openclaw/plugin-sdk/compat";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { zaloPlugin } from "./channel.js";

View File

@@ -3,7 +3,7 @@ import type {
ChannelDock,
ChannelPlugin,
OpenClawConfig,
} from "openclaw/plugin-sdk";
} from "openclaw/plugin-sdk/compat";
import {
applyAccountNameToChannelSection,
buildChannelConfigSchema,
@@ -20,7 +20,7 @@ import {
resolveOpenProviderRuntimeGroupPolicy,
resolveChannelAccountConfigBasePath,
setAccountEnabledInConfigSection,
} from "openclaw/plugin-sdk";
} from "openclaw/plugin-sdk/compat";
import {
listZaloAccountIds,
resolveDefaultZaloAccountId,

View File

@@ -1,4 +1,4 @@
import { MarkdownConfigSchema } from "openclaw/plugin-sdk";
import { MarkdownConfigSchema } from "openclaw/plugin-sdk/compat";
import { z } from "zod";
import { buildSecretInputSchema } from "./secret-input.js";

View File

@@ -1,9 +1,9 @@
import type { GroupPolicy, SenderGroupAccessDecision } from "openclaw/plugin-sdk";
import type { GroupPolicy, SenderGroupAccessDecision } from "openclaw/plugin-sdk/compat";
import {
evaluateSenderGroupAccess,
isNormalizedSenderAllowed,
resolveOpenProviderRuntimeGroupPolicy,
} from "openclaw/plugin-sdk";
} from "openclaw/plugin-sdk/compat";
const ZALO_ALLOW_FROM_PREFIX_RE = /^(zalo|zl):/i;

View File

@@ -1,5 +1,9 @@
import type { IncomingMessage, ServerResponse } from "node:http";
import type { MarkdownTableMode, OpenClawConfig, OutboundReplyPayload } from "openclaw/plugin-sdk";
import type {
MarkdownTableMode,
OpenClawConfig,
OutboundReplyPayload,
} from "openclaw/plugin-sdk/compat";
import {
createScopedPairingAccess,
createReplyPrefixOptions,
@@ -11,7 +15,7 @@ import {
sendMediaWithLeadingCaption,
resolveWebhookPath,
warnMissingProviderGroupPolicyFallbackOnce,
} from "openclaw/plugin-sdk";
} from "openclaw/plugin-sdk/compat";
import type { ResolvedZaloAccount } from "./accounts.js";
import {
ZaloApiError,

View File

@@ -1,6 +1,6 @@
import { createServer, type RequestListener } from "node:http";
import type { AddressInfo } from "node:net";
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk";
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk/compat";
import { afterEach, describe, expect, it, vi } from "vitest";
import { createEmptyPluginRegistry } from "../../../src/plugins/registry.js";
import { setActivePluginRegistry } from "../../../src/plugins/runtime.js";

View File

@@ -1,6 +1,6 @@
import { timingSafeEqual } from "node:crypto";
import type { IncomingMessage, ServerResponse } from "node:http";
import type { OpenClawConfig } from "openclaw/plugin-sdk";
import type { OpenClawConfig } from "openclaw/plugin-sdk/compat";
import {
createDedupeCache,
createFixedWindowRateLimiter,
@@ -15,7 +15,7 @@ import {
resolveWebhookTargets,
WEBHOOK_ANOMALY_COUNTER_DEFAULTS,
WEBHOOK_RATE_LIMIT_DEFAULTS,
} from "openclaw/plugin-sdk";
} from "openclaw/plugin-sdk/compat";
import type { ResolvedZaloAccount } from "./accounts.js";
import type { ZaloFetch, ZaloUpdate } from "./api.js";
import type { ZaloRuntimeEnv } from "./monitor.js";

View File

@@ -1,4 +1,4 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk";
import type { OpenClawConfig } from "openclaw/plugin-sdk/compat";
import { describe, expect, it } from "vitest";
import { zaloOnboardingAdapter } from "./onboarding.js";

View File

@@ -4,7 +4,7 @@ import type {
OpenClawConfig,
SecretInput,
WizardPrompter,
} from "openclaw/plugin-sdk";
} from "openclaw/plugin-sdk/compat";
import {
addWildcardAllowFrom,
DEFAULT_ACCOUNT_ID,
@@ -13,7 +13,7 @@ import {
normalizeAccountId,
promptAccountId,
promptSingleChannelSecretInput,
} from "openclaw/plugin-sdk";
} from "openclaw/plugin-sdk/compat";
import { listZaloAccountIds, resolveDefaultZaloAccountId, resolveZaloAccount } from "./accounts.js";
const channel = "zalo" as const;

View File

@@ -1,4 +1,4 @@
import type { BaseProbeResult } from "openclaw/plugin-sdk";
import type { BaseProbeResult } from "openclaw/plugin-sdk/compat";
import { getMe, ZaloApiError, type ZaloBotInfo, type ZaloFetch } from "./api.js";
export type ZaloProbeResult = BaseProbeResult<string> & {

View File

@@ -1,4 +1,4 @@
import type { PluginRuntime } from "openclaw/plugin-sdk";
import type { PluginRuntime } from "openclaw/plugin-sdk/compat";
let runtime: PluginRuntime | null = null;

View File

@@ -2,7 +2,7 @@ import {
hasConfiguredSecretInput,
normalizeResolvedSecretInputString,
normalizeSecretInputString,
} from "openclaw/plugin-sdk";
} from "openclaw/plugin-sdk/compat";
import { z } from "zod";
export { hasConfiguredSecretInput, normalizeResolvedSecretInputString, normalizeSecretInputString };

View File

@@ -1,4 +1,4 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk";
import type { OpenClawConfig } from "openclaw/plugin-sdk/compat";
import { resolveZaloAccount } from "./accounts.js";
import type { ZaloFetch } from "./api.js";
import { sendMessage, sendPhoto } from "./api.js";

View File

@@ -1,4 +1,4 @@
import type { ChannelAccountSnapshot, ChannelStatusIssue } from "openclaw/plugin-sdk";
import type { ChannelAccountSnapshot, ChannelStatusIssue } from "openclaw/plugin-sdk/compat";
type ZaloAccountStatus = {
accountId?: unknown;

View File

@@ -1,6 +1,6 @@
import { readFileSync } from "node:fs";
import type { BaseTokenResolution } from "openclaw/plugin-sdk";
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import type { BaseTokenResolution } from "openclaw/plugin-sdk/compat";
import { normalizeResolvedSecretInputString, normalizeSecretInputString } from "./secret-input.js";
import type { ZaloConfig } from "./types.js";

View File

@@ -1,4 +1,4 @@
import type { SecretInput } from "openclaw/plugin-sdk";
import type { SecretInput } from "openclaw/plugin-sdk/compat";
export type ZaloAccountConfig = {
/** Optional display name for this account (used in CLI/UI lists). */