mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
Extensions: migrate zalo plugin-sdk imports
This commit is contained in:
@@ -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";
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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> & {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/compat";
|
||||
|
||||
let runtime: PluginRuntime | null = null;
|
||||
|
||||
|
||||
@@ -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 };
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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). */
|
||||
|
||||
Reference in New Issue
Block a user