Plugins/synology-chat: migrate to scoped plugin-sdk imports

This commit is contained in:
Gustavo Madeira Santana
2026-03-04 02:33:12 -05:00
parent 6521965e40
commit 65ffa676a5
7 changed files with 10 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core";
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk/core";
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/synology-chat";
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk/synology-chat";
import { createSynologyChatPlugin } from "./src/channel.js";
import { setSynologyRuntime } from "./src/runtime.js";

View File

@@ -11,8 +11,8 @@ type RegisteredRoute = {
const registerPluginHttpRouteMock = vi.fn<(params: RegisteredRoute) => () => void>(() => vi.fn());
const dispatchReplyWithBufferedBlockDispatcher = vi.fn().mockResolvedValue({ counts: {} });
vi.mock("openclaw/plugin-sdk/compat", async (importOriginal) => {
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/compat")>();
vi.mock("openclaw/plugin-sdk/synology-chat", async (importOriginal) => {
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/synology-chat")>();
return {
...actual,
DEFAULT_ACCOUNT_ID: "default",

View File

@@ -1,7 +1,7 @@
import { describe, it, expect, vi, beforeEach } from "vitest";
// Mock external dependencies
vi.mock("openclaw/plugin-sdk/compat", () => ({
vi.mock("openclaw/plugin-sdk/synology-chat", () => ({
DEFAULT_ACCOUNT_ID: "default",
setAccountEnabledInConfigSection: vi.fn((_opts: any) => ({})),
registerPluginHttpRoute: vi.fn(() => vi.fn()),
@@ -44,7 +44,7 @@ vi.mock("zod", () => ({
}));
const { createSynologyChatPlugin } = await import("./channel.js");
const { registerPluginHttpRoute } = await import("openclaw/plugin-sdk/compat");
const { registerPluginHttpRoute } = await import("openclaw/plugin-sdk/synology-chat");
describe("createSynologyChatPlugin", () => {
it("returns a plugin object with all required sections", () => {

View File

@@ -9,7 +9,7 @@ import {
setAccountEnabledInConfigSection,
registerPluginHttpRoute,
buildChannelConfigSchema,
} from "openclaw/plugin-sdk/compat";
} from "openclaw/plugin-sdk/synology-chat";
import { z } from "zod";
import { listAccountIds, resolveAccount } from "./accounts.js";
import { sendMessage, sendFileUrl } from "./client.js";

View File

@@ -4,7 +4,7 @@
* Used by channel.ts to access dispatch functions.
*/
import type { PluginRuntime } from "openclaw/plugin-sdk/compat";
import type { PluginRuntime } from "openclaw/plugin-sdk/synology-chat";
let runtime: PluginRuntime | null = null;

View File

@@ -6,7 +6,7 @@ import * as crypto from "node:crypto";
import {
createFixedWindowRateLimiter,
type FixedWindowRateLimiter,
} from "openclaw/plugin-sdk/compat";
} from "openclaw/plugin-sdk/synology-chat";
export type DmAuthorizationResult =
| { allowed: true }

View File

@@ -9,7 +9,7 @@ import {
isRequestBodyLimitError,
readRequestBodyWithLimit,
requestBodyErrorToText,
} from "openclaw/plugin-sdk/compat";
} from "openclaw/plugin-sdk/synology-chat";
import { sendMessage, resolveChatUserId } from "./client.js";
import { validateToken, authorizeUserForDm, sanitizeInput, RateLimiter } from "./security.js";
import type { SynologyWebhookPayload, ResolvedSynologyChatAccount } from "./types.js";