Plugins/googlechat: migrate to scoped plugin-sdk imports

This commit is contained in:
Gustavo Madeira Santana
2026-03-04 02:33:00 -05:00
parent 5174b38626
commit a1e21bc02d
16 changed files with 24 additions and 24 deletions

View File

@@ -1,5 +1,5 @@
import type { OpenClawPluginApi } from "openclaw/plugin-sdk/core"; import type { OpenClawPluginApi } from "openclaw/plugin-sdk/googlechat";
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk/core"; import { emptyPluginConfigSchema } from "openclaw/plugin-sdk/googlechat";
import { googlechatDock, googlechatPlugin } from "./src/channel.js"; import { googlechatDock, googlechatPlugin } from "./src/channel.js";
import { setGoogleChatRuntime } from "./src/runtime.js"; import { setGoogleChatRuntime } from "./src/runtime.js";

View File

@@ -3,8 +3,8 @@ import {
normalizeAccountId, normalizeAccountId,
normalizeOptionalAccountId, normalizeOptionalAccountId,
} from "openclaw/plugin-sdk/account-id"; } from "openclaw/plugin-sdk/account-id";
import { isSecretRef } from "openclaw/plugin-sdk/compat"; import { isSecretRef } from "openclaw/plugin-sdk/googlechat";
import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
import type { GoogleChatAccountConfig } from "./types.config.js"; import type { GoogleChatAccountConfig } from "./types.config.js";
export type GoogleChatCredentialSource = "file" | "inline" | "env" | "none"; export type GoogleChatCredentialSource = "file" | "inline" | "env" | "none";

View File

@@ -2,7 +2,7 @@ import type {
ChannelMessageActionAdapter, ChannelMessageActionAdapter,
ChannelMessageActionName, ChannelMessageActionName,
OpenClawConfig, OpenClawConfig,
} from "openclaw/plugin-sdk/compat"; } from "openclaw/plugin-sdk/googlechat";
import { import {
createActionGate, createActionGate,
extractToolSend, extractToolSend,
@@ -10,7 +10,7 @@ import {
readNumberParam, readNumberParam,
readReactionParams, readReactionParams,
readStringParam, readStringParam,
} from "openclaw/plugin-sdk/compat"; } from "openclaw/plugin-sdk/googlechat";
import { listEnabledGoogleChatAccounts, resolveGoogleChatAccount } from "./accounts.js"; import { listEnabledGoogleChatAccounts, resolveGoogleChatAccount } from "./accounts.js";
import { import {
createGoogleChatReaction, createGoogleChatReaction,

View File

@@ -1,5 +1,5 @@
import crypto from "node:crypto"; import crypto from "node:crypto";
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/compat"; import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/googlechat";
import type { ResolvedGoogleChatAccount } from "./accounts.js"; import type { ResolvedGoogleChatAccount } from "./accounts.js";
import { getGoogleChatAccessToken } from "./auth.js"; import { getGoogleChatAccessToken } from "./auth.js";
import type { GoogleChatReaction } from "./types.js"; import type { GoogleChatReaction } from "./types.js";

View File

@@ -1,4 +1,4 @@
import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk"; import type { OpenClawConfig, PluginRuntime } from "openclaw/plugin-sdk/googlechat";
import { describe, expect, it, vi } from "vitest"; import { describe, expect, it, vi } from "vitest";
const uploadGoogleChatAttachmentMock = vi.hoisted(() => vi.fn()); const uploadGoogleChatAttachmentMock = vi.hoisted(() => vi.fn());

View File

@@ -1,4 +1,4 @@
import type { ChannelAccountSnapshot } from "openclaw/plugin-sdk/compat"; import type { ChannelAccountSnapshot } from "openclaw/plugin-sdk/googlechat";
import { afterEach, describe, expect, it, vi } from "vitest"; import { afterEach, describe, expect, it, vi } from "vitest";
import { createStartAccountContext } from "../../test-utils/start-account-context.js"; import { createStartAccountContext } from "../../test-utils/start-account-context.js";
import type { ResolvedGoogleChatAccount } from "./accounts.js"; import type { ResolvedGoogleChatAccount } from "./accounts.js";

View File

@@ -19,8 +19,8 @@ import {
type ChannelPlugin, type ChannelPlugin,
type ChannelStatusIssue, type ChannelStatusIssue,
type OpenClawConfig, type OpenClawConfig,
} from "openclaw/plugin-sdk/compat"; } from "openclaw/plugin-sdk/googlechat";
import { GoogleChatConfigSchema } from "openclaw/plugin-sdk/compat"; import { GoogleChatConfigSchema } from "openclaw/plugin-sdk/googlechat";
import { import {
listGoogleChatAccountIds, listGoogleChatAccountIds,
resolveDefaultGoogleChatAccountId, resolveDefaultGoogleChatAccountId,

View File

@@ -7,8 +7,8 @@ import {
resolveDmGroupAccessWithLists, resolveDmGroupAccessWithLists,
resolveMentionGatingWithBypass, resolveMentionGatingWithBypass,
warnMissingProviderGroupPolicyFallbackOnce, warnMissingProviderGroupPolicyFallbackOnce,
} from "openclaw/plugin-sdk/compat"; } from "openclaw/plugin-sdk/googlechat";
import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
import type { ResolvedGoogleChatAccount } from "./accounts.js"; import type { ResolvedGoogleChatAccount } from "./accounts.js";
import { sendGoogleChatMessage } from "./api.js"; import { sendGoogleChatMessage } from "./api.js";
import type { GoogleChatCoreRuntime } from "./monitor-types.js"; import type { GoogleChatCoreRuntime } from "./monitor-types.js";

View File

@@ -1,4 +1,4 @@
import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
import type { ResolvedGoogleChatAccount } from "./accounts.js"; import type { ResolvedGoogleChatAccount } from "./accounts.js";
import type { GoogleChatAudienceType } from "./auth.js"; import type { GoogleChatAudienceType } from "./auth.js";
import { getGoogleChatRuntime } from "./runtime.js"; import { getGoogleChatRuntime } from "./runtime.js";

View File

@@ -5,7 +5,7 @@ import {
resolveWebhookTargetWithAuthOrReject, resolveWebhookTargetWithAuthOrReject,
resolveWebhookTargets, resolveWebhookTargets,
type WebhookInFlightLimiter, type WebhookInFlightLimiter,
} from "openclaw/plugin-sdk/compat"; } from "openclaw/plugin-sdk/googlechat";
import { verifyGoogleChatRequest } from "./auth.js"; import { verifyGoogleChatRequest } from "./auth.js";
import type { WebhookTarget } from "./monitor-types.js"; import type { WebhookTarget } from "./monitor-types.js";
import type { import type {

View File

@@ -1,12 +1,12 @@
import type { IncomingMessage, ServerResponse } from "node:http"; import type { IncomingMessage, ServerResponse } from "node:http";
import type { OpenClawConfig } from "openclaw/plugin-sdk/compat"; import type { OpenClawConfig } from "openclaw/plugin-sdk/googlechat";
import { import {
createWebhookInFlightLimiter, createWebhookInFlightLimiter,
createReplyPrefixOptions, createReplyPrefixOptions,
registerWebhookTargetWithPluginRoute, registerWebhookTargetWithPluginRoute,
resolveInboundRouteEnvelopeBuilderWithRuntime, resolveInboundRouteEnvelopeBuilderWithRuntime,
resolveWebhookPath, resolveWebhookPath,
} from "openclaw/plugin-sdk/compat"; } from "openclaw/plugin-sdk/googlechat";
import { type ResolvedGoogleChatAccount } from "./accounts.js"; import { type ResolvedGoogleChatAccount } from "./accounts.js";
import { import {
downloadGoogleChatMedia, downloadGoogleChatMedia,

View File

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

View File

@@ -1,4 +1,4 @@
import type { OpenClawConfig, DmPolicy } from "openclaw/plugin-sdk/compat"; import type { OpenClawConfig, DmPolicy } from "openclaw/plugin-sdk/googlechat";
import { import {
addWildcardAllowFrom, addWildcardAllowFrom,
formatDocsLink, formatDocsLink,
@@ -10,7 +10,7 @@ import {
DEFAULT_ACCOUNT_ID, DEFAULT_ACCOUNT_ID,
normalizeAccountId, normalizeAccountId,
migrateBaseNameToDefaultAccount, migrateBaseNameToDefaultAccount,
} from "openclaw/plugin-sdk/compat"; } from "openclaw/plugin-sdk/googlechat";
import { import {
listGoogleChatAccountIds, listGoogleChatAccountIds,
resolveDefaultGoogleChatAccountId, resolveDefaultGoogleChatAccountId,

View File

@@ -6,7 +6,7 @@ const runtimeMocks = vi.hoisted(() => ({
fetchRemoteMedia: vi.fn(), fetchRemoteMedia: vi.fn(),
})); }));
vi.mock("openclaw/plugin-sdk", () => ({ vi.mock("openclaw/plugin-sdk/googlechat", () => ({
getChatChannelMeta: () => ({ id: "googlechat", label: "Google Chat" }), getChatChannelMeta: () => ({ id: "googlechat", label: "Google Chat" }),
missingTargetError: (provider: string, hint: string) => missingTargetError: (provider: string, hint: string) =>
new Error(`Delivering to ${provider} requires target ${hint}`), new Error(`Delivering to ${provider} requires target ${hint}`),
@@ -72,7 +72,7 @@ vi.mock("./targets.js", () => ({
resolveGoogleChatOutboundSpace: vi.fn(), resolveGoogleChatOutboundSpace: vi.fn(),
})); }));
import { resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk"; import { resolveChannelMediaMaxBytes } from "openclaw/plugin-sdk/googlechat";
import { resolveGoogleChatAccount } from "./accounts.js"; import { resolveGoogleChatAccount } from "./accounts.js";
import { sendGoogleChatMessage, uploadGoogleChatAttachment } from "./api.js"; import { sendGoogleChatMessage, uploadGoogleChatAttachment } from "./api.js";
import { googlechatPlugin } from "./channel.js"; import { googlechatPlugin } from "./channel.js";

View File

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

View File

@@ -1,3 +1,3 @@
import type { GoogleChatAccountConfig, GoogleChatConfig } from "openclaw/plugin-sdk/compat"; import type { GoogleChatAccountConfig, GoogleChatConfig } from "openclaw/plugin-sdk/googlechat";
export type { GoogleChatAccountConfig, GoogleChatConfig }; export type { GoogleChatAccountConfig, GoogleChatConfig };