mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 21:50:22 +00:00
style: fix extension lint violations
This commit is contained in:
@@ -44,11 +44,7 @@ function mergeGoogleChatAccountConfig(
|
||||
accountId,
|
||||
omitKeys: ["defaultAccount"],
|
||||
});
|
||||
const defaultAccountConfig =
|
||||
resolveAccountEntry(
|
||||
raw.accounts as Record<string, GoogleChatAccountConfig> | undefined,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
) ?? {};
|
||||
const defaultAccountConfig = resolveAccountEntry(raw.accounts, DEFAULT_ACCOUNT_ID) ?? {};
|
||||
if (accountId === DEFAULT_ACCOUNT_ID) {
|
||||
return base;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
createDirectoryTestRuntime,
|
||||
expectDirectorySurface,
|
||||
} from "../../../test/helpers/plugins/directory.ts";
|
||||
import type { OpenClawConfig, PluginRuntime } from "../runtime-api.js";
|
||||
import type { OpenClawConfig } from "../runtime-api.js";
|
||||
|
||||
const uploadGoogleChatAttachmentMock = vi.hoisted(() => vi.fn());
|
||||
const sendGoogleChatMessageMock = vi.hoisted(() => vi.fn());
|
||||
|
||||
@@ -7,8 +7,6 @@ import {
|
||||
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
||||
import {
|
||||
composeAccountWarningCollectors,
|
||||
composeWarningCollectors,
|
||||
createAllowlistProviderGroupPolicyWarningCollector,
|
||||
createAllowlistProviderOpenWarningCollector,
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import {
|
||||
@@ -32,18 +30,18 @@ import {
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
fetchRemoteMedia,
|
||||
GoogleChatConfigSchema,
|
||||
isGoogleChatSpaceTarget,
|
||||
isGoogleChatUserTarget,
|
||||
listGoogleChatAccountIds,
|
||||
loadOutboundMediaFromUrl,
|
||||
missingTargetError,
|
||||
normalizeGoogleChatTarget,
|
||||
PAIRING_APPROVED_MESSAGE,
|
||||
resolveChannelMediaMaxBytes,
|
||||
resolveDefaultGoogleChatAccountId,
|
||||
resolveGoogleChatAccount,
|
||||
resolveGoogleChatOutboundSpace,
|
||||
runPassiveAccountLifecycle,
|
||||
isGoogleChatSpaceTarget,
|
||||
isGoogleChatUserTarget,
|
||||
normalizeGoogleChatTarget,
|
||||
type ChannelMessageActionAdapter,
|
||||
type ChannelStatusIssue,
|
||||
type OpenClawConfig,
|
||||
@@ -51,7 +49,6 @@ import {
|
||||
} from "./channel.deps.runtime.js";
|
||||
import { collectGoogleChatMutableAllowlistWarnings } from "./doctor.js";
|
||||
import { resolveGoogleChatGroupRequireMention } from "./group-policy.js";
|
||||
import { getGoogleChatRuntime } from "./runtime.js";
|
||||
import { collectRuntimeConfigAssignments, secretTargetRegistryEntries } from "./secret-contract.js";
|
||||
import { googlechatSetupAdapter } from "./setup-core.js";
|
||||
import { googlechatSetupWizard } from "./setup-surface.js";
|
||||
|
||||
@@ -129,7 +129,7 @@ function warnDeprecatedUsersEmailEntries(logVerbose: (message: string) => void,
|
||||
}
|
||||
const key = deprecated
|
||||
.map((v) => v.toLowerCase())
|
||||
.sort()
|
||||
.toSorted()
|
||||
.join(",");
|
||||
if (warnedDeprecatedUsersEmailAllowFrom.has(key)) {
|
||||
return;
|
||||
@@ -152,7 +152,7 @@ function warnMutableGroupKeysConfigured(
|
||||
}
|
||||
const warningKey = mutableKeys
|
||||
.map((key) => key.toLowerCase())
|
||||
.sort()
|
||||
.toSorted()
|
||||
.join(",");
|
||||
if (warnedMutableGroupKeys.has(warningKey)) {
|
||||
return;
|
||||
|
||||
@@ -15,7 +15,13 @@ import type {
|
||||
} from "./types.js";
|
||||
|
||||
function extractBearerToken(header: unknown): string {
|
||||
const authHeader = Array.isArray(header) ? String(header[0] ?? "") : String(header ?? "");
|
||||
const authHeader = Array.isArray(header)
|
||||
? typeof header[0] === "string"
|
||||
? header[0]
|
||||
: ""
|
||||
: typeof header === "string"
|
||||
? header
|
||||
: "";
|
||||
return authHeader.toLowerCase().startsWith("bearer ")
|
||||
? authHeader.slice("bearer ".length).trim()
|
||||
: "";
|
||||
@@ -63,7 +69,10 @@ function parseGoogleChatInboundPayload(
|
||||
user: chat.user,
|
||||
eventTime: chat.eventTime,
|
||||
};
|
||||
addOnBearerToken = String(rawObj.authorizationEventObject?.systemIdToken ?? "").trim();
|
||||
addOnBearerToken =
|
||||
typeof rawObj.authorizationEventObject?.systemIdToken === "string"
|
||||
? rawObj.authorizationEventObject.systemIdToken.trim()
|
||||
: "";
|
||||
}
|
||||
|
||||
const event = eventPayload as GoogleChatEvent;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {
|
||||
createPatchedAccountSetupAdapter,
|
||||
createSetupInputPresenceValidator,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
} from "openclaw/plugin-sdk/setup-runtime";
|
||||
|
||||
const channel = "googlechat" as const;
|
||||
|
||||
@@ -10,14 +10,8 @@ import {
|
||||
splitSetupEntries,
|
||||
type ChannelSetupDmPolicy,
|
||||
type ChannelSetupWizard,
|
||||
type OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/setup";
|
||||
import {
|
||||
listGoogleChatAccountIds,
|
||||
resolveDefaultGoogleChatAccountId,
|
||||
resolveGoogleChatAccount,
|
||||
} from "./accounts.js";
|
||||
import { googlechatSetupAdapter } from "./setup-core.js";
|
||||
import { resolveDefaultGoogleChatAccountId, resolveGoogleChatAccount } from "./accounts.js";
|
||||
|
||||
const channel = "googlechat" as const;
|
||||
const ENV_SERVICE_ACCOUNT = "GOOGLE_CHAT_SERVICE_ACCOUNT";
|
||||
@@ -41,7 +35,7 @@ const promptAllowFrom = createPromptParsedAllowFromForAccount({
|
||||
accountId,
|
||||
patch: {
|
||||
dm: {
|
||||
...(resolveGoogleChatAccount({ cfg, accountId }).config.dm ?? {}),
|
||||
...resolveGoogleChatAccount({ cfg, accountId }).config.dm,
|
||||
allowFrom,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user