mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
Extensions: migrate msteams plugin-sdk imports
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { PluginRuntime, SsrFPolicy } from "openclaw/plugin-sdk";
|
||||
import type { PluginRuntime, SsrFPolicy } from "openclaw/plugin-sdk/compat";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { createPluginRuntimeMock } from "../../test-utils/plugin-runtime-mock.js";
|
||||
import {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { fetchWithSsrFGuard, type SsrFPolicy } from "openclaw/plugin-sdk";
|
||||
import { fetchWithSsrFGuard, type SsrFPolicy } from "openclaw/plugin-sdk/compat";
|
||||
import { getMSTeamsRuntime } from "../runtime.js";
|
||||
import { downloadMSTeamsAttachments } from "./download.js";
|
||||
import { downloadAndStoreMSTeamsRemoteMedia } from "./remote-media.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { buildMediaPayload } from "openclaw/plugin-sdk";
|
||||
import { buildMediaPayload } from "openclaw/plugin-sdk/compat";
|
||||
|
||||
export function buildMSTeamsMediaPayload(
|
||||
mediaList: Array<{ path: string; contentType?: string }>,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { SsrFPolicy } from "openclaw/plugin-sdk";
|
||||
import type { SsrFPolicy } from "openclaw/plugin-sdk/compat";
|
||||
import { getMSTeamsRuntime } from "../runtime.js";
|
||||
import { inferPlaceholder } from "./shared.js";
|
||||
import type { MSTeamsInboundMedia } from "./types.js";
|
||||
|
||||
@@ -4,8 +4,8 @@ import {
|
||||
isHttpsUrlAllowedByHostnameSuffixAllowlist,
|
||||
isPrivateIpAddress,
|
||||
normalizeHostnameSuffixAllowlist,
|
||||
} from "openclaw/plugin-sdk";
|
||||
import type { SsrFPolicy } from "openclaw/plugin-sdk";
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import type { SsrFPolicy } from "openclaw/plugin-sdk/compat";
|
||||
import type { MSTeamsAttachmentLike } from "./types.js";
|
||||
|
||||
type InlineImageCandidate =
|
||||
|
||||
@@ -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 { msteamsPlugin } from "./channel.js";
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import type { ChannelMessageActionName, ChannelPlugin, OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
import type {
|
||||
ChannelMessageActionName,
|
||||
ChannelPlugin,
|
||||
OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import {
|
||||
buildBaseChannelStatusSummary,
|
||||
buildChannelConfigSchema,
|
||||
@@ -8,7 +12,7 @@ import {
|
||||
PAIRING_APPROVED_MESSAGE,
|
||||
resolveAllowlistProviderRuntimeGroupPolicy,
|
||||
resolveDefaultGroupPolicy,
|
||||
} from "openclaw/plugin-sdk";
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import { listMSTeamsDirectoryGroupsLive, listMSTeamsDirectoryPeersLive } from "./directory-live.js";
|
||||
import { msteamsOnboardingAdapter } from "./onboarding.js";
|
||||
import { msteamsOutbound } from "./outbound.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ChannelDirectoryEntry } from "openclaw/plugin-sdk";
|
||||
import type { ChannelDirectoryEntry } from "openclaw/plugin-sdk/compat";
|
||||
import { searchGraphUsers } from "./graph-users.js";
|
||||
import {
|
||||
type GraphChannel,
|
||||
|
||||
@@ -1 +1 @@
|
||||
export { withFileLock } from "openclaw/plugin-sdk";
|
||||
export { withFileLock } from "openclaw/plugin-sdk/compat";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MSTeamsConfig } from "openclaw/plugin-sdk";
|
||||
import type { MSTeamsConfig } from "openclaw/plugin-sdk/compat";
|
||||
import { GRAPH_ROOT } from "./attachments/shared.js";
|
||||
import { loadMSTeamsSdkWithAuth } from "./sdk.js";
|
||||
import { readAccessToken } from "./token-response.js";
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
extensionForMime,
|
||||
extractOriginalFilename,
|
||||
getFileExtension,
|
||||
} from "openclaw/plugin-sdk";
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
|
||||
/**
|
||||
* Detect MIME type from URL extension or data URL.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { SILENT_REPLY_TOKEN, type PluginRuntime } from "openclaw/plugin-sdk";
|
||||
import { SILENT_REPLY_TOKEN, type PluginRuntime } from "openclaw/plugin-sdk/compat";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { createPluginRuntimeMock } from "../../test-utils/plugin-runtime-mock.js";
|
||||
import type { StoredConversationReference } from "./conversation-store.js";
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
type ReplyPayload,
|
||||
SILENT_REPLY_TOKEN,
|
||||
sleep,
|
||||
} from "openclaw/plugin-sdk";
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import type { MSTeamsAccessTokenProvider } from "./attachments/types.js";
|
||||
import type { StoredConversationReference } from "./conversation-store.js";
|
||||
import { classifyMSTeamsSendError } from "./errors.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { OpenClawConfig, PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk";
|
||||
import type { OpenClawConfig, PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk/compat";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { MSTeamsConversationStore } from "./conversation-store.js";
|
||||
import type { MSTeamsAdapter } from "./messenger.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk";
|
||||
import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk/compat";
|
||||
import type { MSTeamsConversationStore } from "./conversation-store.js";
|
||||
import { buildFileInfoCard, parseFileConsentInvoke, uploadToConsentUrl } from "./file-consent.js";
|
||||
import { normalizeMSTeamsConversationId } from "./inbound.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { OpenClawConfig, PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk";
|
||||
import type { OpenClawConfig, PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk/compat";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import type { MSTeamsMessageHandlerDeps } from "../monitor-handler.js";
|
||||
import { setMSTeamsRuntime } from "../runtime.js";
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
resolveEffectiveAllowFromLists,
|
||||
resolveDmGroupAccessWithLists,
|
||||
type HistoryEntry,
|
||||
} from "openclaw/plugin-sdk";
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import {
|
||||
buildMSTeamsAttachmentPlaceholder,
|
||||
buildMSTeamsMediaPayload,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { EventEmitter } from "node:events";
|
||||
import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk";
|
||||
import type { OpenClawConfig, RuntimeEnv } from "openclaw/plugin-sdk/compat";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import type { MSTeamsConversationStore } from "./conversation-store.js";
|
||||
import type { MSTeamsPollStore } from "./polls.js";
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
summarizeMapping,
|
||||
type OpenClawConfig,
|
||||
type RuntimeEnv,
|
||||
} from "openclaw/plugin-sdk";
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js";
|
||||
import type { MSTeamsConversationStore } from "./conversation-store.js";
|
||||
import { formatUnknownError } from "./errors.js";
|
||||
|
||||
@@ -5,14 +5,14 @@ import type {
|
||||
DmPolicy,
|
||||
WizardPrompter,
|
||||
MSTeamsTeamConfig,
|
||||
} from "openclaw/plugin-sdk";
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import {
|
||||
addWildcardAllowFrom,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
formatDocsLink,
|
||||
mergeAllowFromEntries,
|
||||
promptChannelAccessConfig,
|
||||
} from "openclaw/plugin-sdk";
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import {
|
||||
parseMSTeamsTeamEntry,
|
||||
resolveMSTeamsChannelAllowlist,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { ChannelOutboundAdapter } from "openclaw/plugin-sdk";
|
||||
import type { ChannelOutboundAdapter } from "openclaw/plugin-sdk/compat";
|
||||
import { createMSTeamsPollStoreFs } from "./polls.js";
|
||||
import { getMSTeamsRuntime } from "./runtime.js";
|
||||
import { sendMessageMSTeams, sendPollMSTeams } from "./send.js";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MSTeamsConfig } from "openclaw/plugin-sdk";
|
||||
import type { MSTeamsConfig } from "openclaw/plugin-sdk/compat";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
isMSTeamsGroupAllowed,
|
||||
|
||||
@@ -7,7 +7,7 @@ import type {
|
||||
MSTeamsConfig,
|
||||
MSTeamsReplyStyle,
|
||||
MSTeamsTeamConfig,
|
||||
} from "openclaw/plugin-sdk";
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import {
|
||||
buildChannelKeyCandidates,
|
||||
normalizeChannelSlug,
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
resolveToolsBySender,
|
||||
resolveChannelEntryMatchWithFallback,
|
||||
resolveNestedAllowlistDecision,
|
||||
} from "openclaw/plugin-sdk";
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
|
||||
export type MSTeamsResolvedRouteConfig = {
|
||||
teamConfig?: MSTeamsTeamConfig;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MSTeamsConfig } from "openclaw/plugin-sdk";
|
||||
import type { MSTeamsConfig } from "openclaw/plugin-sdk/compat";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
const hostMockState = vi.hoisted(() => ({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { BaseProbeResult, MSTeamsConfig } from "openclaw/plugin-sdk";
|
||||
import type { BaseProbeResult, MSTeamsConfig } from "openclaw/plugin-sdk/compat";
|
||||
import { formatUnknownError } from "./errors.js";
|
||||
import { loadMSTeamsSdkWithAuth } from "./sdk.js";
|
||||
import { readAccessToken } from "./token-response.js";
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
type OpenClawConfig,
|
||||
type MSTeamsReplyStyle,
|
||||
type RuntimeEnv,
|
||||
} from "openclaw/plugin-sdk";
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import type { MSTeamsAccessTokenProvider } from "./attachments/types.js";
|
||||
import type { StoredConversationReference } from "./conversation-store.js";
|
||||
import {
|
||||
|
||||
@@ -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,6 +2,6 @@ import {
|
||||
hasConfiguredSecretInput,
|
||||
normalizeResolvedSecretInputString,
|
||||
normalizeSecretInputString,
|
||||
} from "openclaw/plugin-sdk";
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
|
||||
export { hasConfiguredSecretInput, normalizeResolvedSecretInputString, normalizeSecretInputString };
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
resolveChannelMediaMaxBytes,
|
||||
type OpenClawConfig,
|
||||
type PluginRuntime,
|
||||
} from "openclaw/plugin-sdk";
|
||||
} from "openclaw/plugin-sdk/compat";
|
||||
import type { MSTeamsAccessTokenProvider } from "./attachments/types.js";
|
||||
import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js";
|
||||
import type {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/compat";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { sendMessageMSTeams } from "./send.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk";
|
||||
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk";
|
||||
import type { OpenClawConfig } from "openclaw/plugin-sdk/compat";
|
||||
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/compat";
|
||||
import { createMSTeamsConversationStoreFs } from "./conversation-store-fs.js";
|
||||
import {
|
||||
classifyMSTeamsSendError,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import fs from "node:fs";
|
||||
import { readJsonFileWithFallback, writeJsonFileAtomically } from "openclaw/plugin-sdk";
|
||||
import { readJsonFileWithFallback, writeJsonFileAtomically } from "openclaw/plugin-sdk/compat";
|
||||
import { withFileLock as withPathLock } from "./file-lock.js";
|
||||
|
||||
const STORE_LOCK_OPTIONS = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk";
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/compat";
|
||||
|
||||
export const msteamsRuntimeStub = {
|
||||
state: {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { MSTeamsConfig } from "openclaw/plugin-sdk";
|
||||
import type { MSTeamsConfig } from "openclaw/plugin-sdk/compat";
|
||||
import {
|
||||
hasConfiguredSecretInput,
|
||||
normalizeResolvedSecretInputString,
|
||||
|
||||
Reference in New Issue
Block a user