@openclaw/googlechat 2026.7.2-beta.3 → 2026.7.2-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{actions-C9M27Xgq.js → actions-wnreW-IQ.js} +2 -2
- package/dist/api.js +2 -2
- package/dist/{approval-auth-DXkKpb-s.js → approval-auth-G-OFufNc.js} +3 -3
- package/dist/{approval-handler.runtime-DemP1cMx.js → approval-handler.runtime-BJXVLK9y.js} +3 -3
- package/dist/{channel-Bylft8ql.js → channel-CehfTiWZ.js} +13 -13
- package/dist/{channel-base-CuSSPg6I.js → channel-base-CC85hRUC.js} +92 -64
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.adapters-CAVl8EUt.js → channel.adapters-DLatFGZz.js} +289 -12
- package/dist/{channel.runtime-tLQQKXrg.js → channel.runtime-Bz0__ttC.js} +296 -112
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-BpuSvJro.js +115 -0
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{secret-contract-ZFiLJ7Yn.js → secret-contract-BFYyuE0F.js} +7 -21
- package/dist/secret-contract-api.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/gaxios/build/cjs/src/gaxios.js +1 -1
- package/node_modules/gaxios/build/cjs/src/gaxios.js.map +1 -1
- package/node_modules/gaxios/build/cjs/test/test.getch.js +66 -0
- package/node_modules/gaxios/build/cjs/test/test.getch.js.map +1 -1
- package/node_modules/gaxios/build/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/node_modules/gaxios/build/esm/src/gaxios.js +1 -1
- package/node_modules/gaxios/build/esm/src/gaxios.js.map +1 -1
- package/node_modules/gaxios/build/esm/test/test.getch.js +66 -0
- package/node_modules/gaxios/build/esm/test/test.getch.js.map +1 -1
- package/node_modules/gaxios/build/esm/tsconfig.tsbuildinfo +1 -1
- package/node_modules/gaxios/package.json +4 -4
- package/openclaw.plugin.json +403 -499
- package/package.json +81 -23
- package/dist/doctor-contract-CvhD0eoX.js +0 -167
- package/npm-shrinkwrap.json +0 -313
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Official OpenClaw channel plugin for Google Chat spaces and direct messages.
|
|
|
5
5
|
Install from OpenClaw:
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
openclaw
|
|
8
|
+
openclaw plugins install @openclaw/googlechat
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
Configure the Google Chat app credentials and allowed spaces in OpenClaw. The plugin lets agents receive Google Chat events and reply through the configured app.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount, o as listEnabledGoogleChatAccounts } from "./channel-base-
|
|
2
|
-
import { m as resolveGoogleChatOutboundSpace, v as sendGoogleChatMessage } from "./channel.adapters-
|
|
1
|
+
import { l as resolveGoogleChatAccount, o as listEnabledGoogleChatAccounts } from "./channel-base-CC85hRUC.js";
|
|
2
|
+
import { m as resolveGoogleChatOutboundSpace, v as sendGoogleChatMessage } from "./channel.adapters-DLatFGZz.js";
|
|
3
3
|
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
4
4
|
import { jsonResult, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/channel-actions";
|
|
5
5
|
//#region extensions/googlechat/src/actions.ts
|
package/dist/api.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as googlechatSetupAdapter, i as googlechatSetupWizard } from "./channel-base-
|
|
2
|
-
import { t as googlechatPlugin } from "./channel-
|
|
1
|
+
import { a as googlechatSetupAdapter, i as googlechatSetupWizard } from "./channel-base-CC85hRUC.js";
|
|
2
|
+
import { t as googlechatPlugin } from "./channel-CehfTiWZ.js";
|
|
3
3
|
export { googlechatPlugin, googlechatSetupAdapter, googlechatSetupWizard };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount } from "./channel-base-
|
|
2
|
-
import { d as isGoogleChatUserTarget, f as normalizeGoogleChatTarget } from "./channel.adapters-
|
|
1
|
+
import { l as resolveGoogleChatAccount } from "./channel-base-CC85hRUC.js";
|
|
2
|
+
import { d as isGoogleChatUserTarget, f as normalizeGoogleChatTarget } from "./channel.adapters-DLatFGZz.js";
|
|
3
3
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { createChannelApprovalAuth } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
5
5
|
//#region extensions/googlechat/src/approval-auth.ts
|
|
@@ -18,7 +18,7 @@ const googleChatApproval = createChannelApprovalAuth({
|
|
|
18
18
|
accountId
|
|
19
19
|
}).config;
|
|
20
20
|
return {
|
|
21
|
-
allowFrom: account.
|
|
21
|
+
allowFrom: account.allowFrom,
|
|
22
22
|
defaultTo: account.defaultTo
|
|
23
23
|
};
|
|
24
24
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as resolveGoogleChatAccount } from "./channel-base-
|
|
2
|
-
import { M as unregisterGoogleChatManualApprovalFollowupSuppression, O as registerGoogleChatApprovalCardBinding, S as buildGoogleChatApprovalActionParameters, T as createGoogleChatApprovalToken, j as unregisterGoogleChatApprovalCardBindings, k as registerGoogleChatManualApprovalFollowupSuppression, m as resolveGoogleChatOutboundSpace, v as sendGoogleChatMessage, x as GOOGLECHAT_APPROVAL_ACTION, y as updateGoogleChatMessage } from "./channel.adapters-
|
|
3
|
-
import { n as isGoogleChatNativeApprovalClientEnabled, r as shouldHandleGoogleChatNativeApprovalRequest } from "./channel-
|
|
1
|
+
import { l as resolveGoogleChatAccount } from "./channel-base-CC85hRUC.js";
|
|
2
|
+
import { M as unregisterGoogleChatManualApprovalFollowupSuppression, O as registerGoogleChatApprovalCardBinding, S as buildGoogleChatApprovalActionParameters, T as createGoogleChatApprovalToken, j as unregisterGoogleChatApprovalCardBindings, k as registerGoogleChatManualApprovalFollowupSuppression, m as resolveGoogleChatOutboundSpace, v as sendGoogleChatMessage, x as GOOGLECHAT_APPROVAL_ACTION, y as updateGoogleChatMessage } from "./channel.adapters-DLatFGZz.js";
|
|
3
|
+
import { n as isGoogleChatNativeApprovalClientEnabled, r as shouldHandleGoogleChatNativeApprovalRequest } from "./channel-CehfTiWZ.js";
|
|
4
4
|
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
5
5
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as resolveDefaultGoogleChatAccountId, l as resolveGoogleChatAccount, n as createGoogleChatPluginBase, s as listGoogleChatAccountIds, t as GOOGLECHAT_CHANNEL_ID } from "./channel-base-
|
|
2
|
-
import { a as googlechatPairingTextAdapter, d as isGoogleChatUserTarget, f as normalizeGoogleChatTarget, i as googlechatOutboundAdapter, n as googlechatGroupsAdapter, o as googlechatSecurityAdapter, p as resolveGoogleChatOutboundSessionRoute, r as googlechatMessageAdapter, s as googlechatThreadingAdapter, t as googlechatDirectoryAdapter, u as isGoogleChatSpaceTarget } from "./channel.adapters-
|
|
1
|
+
import { c as resolveDefaultGoogleChatAccountId, l as resolveGoogleChatAccount, n as createGoogleChatPluginBase, s as listGoogleChatAccountIds, t as GOOGLECHAT_CHANNEL_ID } from "./channel-base-CC85hRUC.js";
|
|
2
|
+
import { a as googlechatPairingTextAdapter, d as isGoogleChatUserTarget, f as normalizeGoogleChatTarget, i as googlechatOutboundAdapter, n as googlechatGroupsAdapter, o as googlechatSecurityAdapter, p as resolveGoogleChatOutboundSessionRoute, r as googlechatMessageAdapter, s as googlechatThreadingAdapter, t as googlechatDirectoryAdapter, u as isGoogleChatSpaceTarget } from "./channel.adapters-DLatFGZz.js";
|
|
3
3
|
import { n as buildChannelConfigSchema, t as GoogleChatConfigSchema } from "./config-api-CsD0IFxF.js";
|
|
4
4
|
import { t as DEFAULT_ACCOUNT_ID } from "./runtime-api-Dh0CNVS4.js";
|
|
5
|
-
import { n as googleChatApprovalAuth, r as normalizeGoogleChatApproverId, t as getGoogleChatApprovalApprovers } from "./approval-auth-
|
|
6
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
7
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-
|
|
5
|
+
import { n as googleChatApprovalAuth, r as normalizeGoogleChatApproverId, t as getGoogleChatApprovalApprovers } from "./approval-auth-G-OFufNc.js";
|
|
6
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BpuSvJro.js";
|
|
7
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-BFYyuE0F.js";
|
|
8
8
|
import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
9
9
|
import { buildPassiveProbedChannelStatusSummary } from "openclaw/plugin-sdk/extension-shared";
|
|
10
10
|
import { createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
@@ -87,7 +87,7 @@ const googleChatApprovalCapability = createApproverRestrictedNativeApprovalCapab
|
|
|
87
87
|
channelLabel: "Google Chat",
|
|
88
88
|
describeExecApprovalSetup: ({ accountId }) => {
|
|
89
89
|
const prefix = accountId && accountId !== "default" ? `channels.googlechat.accounts.${accountId}` : "channels.googlechat";
|
|
90
|
-
return `Approve it from the Web UI or terminal UI for now. Google Chat supports native approvals for this account when the webhook and service account are configured. Configure \`${prefix}.
|
|
90
|
+
return `Approve it from the Web UI or terminal UI for now. Google Chat supports native approvals for this account when the webhook and service account are configured. Configure \`${prefix}.allowFrom\` or \`${prefix}.defaultTo\` with numeric \`users/{id}\` approvers.`;
|
|
91
91
|
},
|
|
92
92
|
listAccountIds: listGoogleChatAccountIds,
|
|
93
93
|
hasApprovers: ({ cfg, accountId }) => getGoogleChatApprovalApprovers({
|
|
@@ -141,7 +141,7 @@ const googleChatApprovalCapability = createApproverRestrictedNativeApprovalCapab
|
|
|
141
141
|
approvalKind,
|
|
142
142
|
request
|
|
143
143
|
}),
|
|
144
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
144
|
+
load: async () => (await import("./approval-handler.runtime-BJXVLK9y.js")).googleChatApprovalNativeRuntime
|
|
145
145
|
})
|
|
146
146
|
});
|
|
147
147
|
const collectGoogleChatMutableAllowlistWarnings = createDangerousNameMatchingMutableAllowlistWarningCollector({
|
|
@@ -164,7 +164,7 @@ const collectGoogleChatMutableAllowlistWarnings = createDangerousNameMatchingMut
|
|
|
164
164
|
});
|
|
165
165
|
//#endregion
|
|
166
166
|
//#region extensions/googlechat/src/gateway.ts
|
|
167
|
-
const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
167
|
+
const loadGoogleChatChannelRuntime$1 = createLazyRuntimeNamedExport(() => import("./channel.runtime-Bz0__ttC.js"), "googleChatChannelRuntime");
|
|
168
168
|
async function startGoogleChatGatewayAccount(ctx) {
|
|
169
169
|
const account = ctx.account;
|
|
170
170
|
const statusSink = createAccountStatusSink({
|
|
@@ -213,7 +213,7 @@ async function startGoogleChatGatewayAccount(ctx) {
|
|
|
213
213
|
statusSink
|
|
214
214
|
}),
|
|
215
215
|
stop: async (unregister) => {
|
|
216
|
-
unregister?.();
|
|
216
|
+
await unregister?.();
|
|
217
217
|
},
|
|
218
218
|
onStop: async () => {
|
|
219
219
|
markStopped();
|
|
@@ -226,7 +226,7 @@ async function startGoogleChatGatewayAccount(ctx) {
|
|
|
226
226
|
}
|
|
227
227
|
//#endregion
|
|
228
228
|
//#region extensions/googlechat/src/channel.ts
|
|
229
|
-
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-
|
|
229
|
+
const loadGoogleChatChannelRuntime = createLazyRuntimeNamedExport(() => import("./channel.runtime-Bz0__ttC.js"), "googleChatChannelRuntime");
|
|
230
230
|
const googlechatActions = {
|
|
231
231
|
describeMessageTool: ({ cfg, accountId }) => {
|
|
232
232
|
if ((accountId ? [resolveGoogleChatAccount({
|
|
@@ -241,7 +241,7 @@ const googlechatActions = {
|
|
|
241
241
|
supportsAction: ({ action }) => action === "send",
|
|
242
242
|
extractToolSend: ({ args }) => extractToolSend(args, "sendMessage"),
|
|
243
243
|
handleAction: async (ctx) => {
|
|
244
|
-
const { googlechatMessageActions } = await import("./actions-
|
|
244
|
+
const { googlechatMessageActions } = await import("./actions-wnreW-IQ.js");
|
|
245
245
|
if (!googlechatMessageActions.handleAction) throw new Error("Google Chat actions are not available.");
|
|
246
246
|
return await googlechatMessageActions.handleAction(ctx);
|
|
247
247
|
}
|
|
@@ -301,7 +301,7 @@ const googlechatPlugin = createChatChannelPlugin({
|
|
|
301
301
|
} },
|
|
302
302
|
actions: googlechatActions,
|
|
303
303
|
doctor: {
|
|
304
|
-
dmAllowFromMode: "
|
|
304
|
+
dmAllowFromMode: "topOnly",
|
|
305
305
|
groupModel: "route",
|
|
306
306
|
groupAllowFromFallbackToAllowFrom: false,
|
|
307
307
|
warnOnEmptyGroupSenderAllowlist: false,
|
|
@@ -353,7 +353,7 @@ const googlechatPlugin = createChatChannelPlugin({
|
|
|
353
353
|
audience: account.config.audience,
|
|
354
354
|
webhookPath: account.config.webhookPath,
|
|
355
355
|
webhookUrl: account.config.webhookUrl,
|
|
356
|
-
dmPolicy: account.config.
|
|
356
|
+
dmPolicy: account.config.dmPolicy ?? "pairing"
|
|
357
357
|
}
|
|
358
358
|
})
|
|
359
359
|
}),
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { safeParseJsonWithSchema, safeParseWithSchema } from "openclaw/plugin-sdk/extension-shared";
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringifiedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { createAccountListHelpers, describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
4
|
+
import { DEFAULT_ACCOUNT_ID, normalizeAccountId, resolveAccountEntry } from "openclaw/plugin-sdk/account-resolution";
|
|
4
5
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
5
6
|
import { tryReadSecretFileSync } from "openclaw/plugin-sdk/secret-file-runtime";
|
|
6
7
|
import { isSecretRef } from "openclaw/plugin-sdk/secret-input";
|
|
7
8
|
import { resolveUserPath } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
8
9
|
import { z } from "zod";
|
|
9
|
-
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
10
10
|
import { formatNormalizedAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
11
11
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
12
|
+
import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
|
|
12
13
|
import { createPatchedAccountSetupAdapter, createSetupInputPresenceValidator } from "openclaw/plugin-sdk/setup-runtime";
|
|
13
|
-
import {
|
|
14
|
+
import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
|
|
15
|
+
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, applySetupAccountConfigPatch, createPromptParsedAllowFromForAccount, createSetupTranslator, createStandardChannelSetupStatus, formatDocsLink, mergeAllowFromEntries, migrateBaseNameToDefaultAccount, splitSetupEntries } from "openclaw/plugin-sdk/setup";
|
|
14
16
|
//#region extensions/googlechat/src/google-auth-limits.ts
|
|
15
17
|
const MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES = 64 * 1024;
|
|
16
18
|
//#endregion
|
|
@@ -18,26 +20,20 @@ const MAX_GOOGLE_CHAT_SERVICE_ACCOUNT_FILE_BYTES = 64 * 1024;
|
|
|
18
20
|
const ENV_SERVICE_ACCOUNT$1 = "GOOGLE_CHAT_SERVICE_ACCOUNT";
|
|
19
21
|
const ENV_SERVICE_ACCOUNT_FILE$1 = "GOOGLE_CHAT_SERVICE_ACCOUNT_FILE";
|
|
20
22
|
const JsonRecordSchema = z.record(z.string(), z.unknown());
|
|
21
|
-
const { listAccountIds: listGoogleChatAccountIds, resolveDefaultAccountId: resolveDefaultGoogleChatAccountId } = createAccountListHelpers("googlechat", {
|
|
22
|
-
|
|
23
|
-
"serviceAccount",
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
],
|
|
27
|
-
|
|
28
|
-
}
|
|
23
|
+
const { listAccountIds: listGoogleChatAccountIds, resolveDefaultAccountId: resolveDefaultGoogleChatAccountId, resolveAccountConfig: resolveMergedGoogleChatAccountConfig } = createAccountListHelpers("googlechat", {
|
|
24
|
+
implicitDefaultAccount: {
|
|
25
|
+
channelKeys: ["serviceAccount", "serviceAccountFile"],
|
|
26
|
+
envVars: [ENV_SERVICE_ACCOUNT$1, ENV_SERVICE_ACCOUNT_FILE$1]
|
|
27
|
+
},
|
|
28
|
+
omitKeys: ["defaultAccount"],
|
|
29
|
+
nestedObjectKeys: ["botLoopProtection"]
|
|
30
|
+
});
|
|
29
31
|
function mergeGoogleChatAccountConfig(cfg, accountId) {
|
|
30
32
|
const raw = cfg.channels?.["googlechat"] ?? {};
|
|
31
|
-
const base =
|
|
32
|
-
channelConfig: raw,
|
|
33
|
-
accounts: raw.accounts,
|
|
34
|
-
accountId,
|
|
35
|
-
omitKeys: ["defaultAccount"],
|
|
36
|
-
nestedObjectKeys: ["botLoopProtection"]
|
|
37
|
-
});
|
|
33
|
+
const base = resolveMergedGoogleChatAccountConfig(cfg, accountId);
|
|
38
34
|
const defaultAccountConfig = resolveAccountEntry(raw.accounts, DEFAULT_ACCOUNT_ID) ?? {};
|
|
39
35
|
if (accountId === DEFAULT_ACCOUNT_ID) return base;
|
|
40
|
-
const { enabled: _ignoredEnabled, dangerouslyAllowNameMatching: _ignoredDangerouslyAllowNameMatching, serviceAccount: _ignoredServiceAccount,
|
|
36
|
+
const { enabled: _ignoredEnabled, dangerouslyAllowNameMatching: _ignoredDangerouslyAllowNameMatching, serviceAccount: _ignoredServiceAccount, serviceAccountFile: _ignoredServiceAccountFile, ...defaultAccountShared } = defaultAccountConfig;
|
|
41
37
|
const botLoopProtection = mergePairLoopGuardConfig(defaultAccountShared.botLoopProtection, base.botLoopProtection);
|
|
42
38
|
return {
|
|
43
39
|
...defaultAccountShared,
|
|
@@ -67,7 +63,6 @@ function resolveCredentialsFromConfig(params) {
|
|
|
67
63
|
status: "available"
|
|
68
64
|
};
|
|
69
65
|
if (isSecretRef(account.serviceAccount)) throw new Error(`channels.googlechat.accounts.${accountId}.serviceAccount: unresolved SecretRef "${account.serviceAccount.source}:${account.serviceAccount.provider}:${account.serviceAccount.id}". Resolve this command against an active gateway runtime snapshot before reading it.`);
|
|
70
|
-
if (isSecretRef(account.serviceAccountRef)) throw new Error(`channels.googlechat.accounts.${accountId}.serviceAccount: unresolved SecretRef "${account.serviceAccountRef.source}:${account.serviceAccountRef.provider}:${account.serviceAccountRef.id}". Resolve this command against an active gateway runtime snapshot before reading it.`);
|
|
71
66
|
const file = normalizeOptionalString(account.serviceAccountFile);
|
|
72
67
|
if (file) {
|
|
73
68
|
const result = tryReadSecretFileSync(resolveUserPath(file), "Google Chat service account file", {
|
|
@@ -156,11 +151,12 @@ const googlechatSetupAdapter = createPatchedAccountSetupAdapter({
|
|
|
156
151
|
}]
|
|
157
152
|
}),
|
|
158
153
|
buildPatch: (input) => {
|
|
159
|
-
const
|
|
160
|
-
const
|
|
161
|
-
const
|
|
162
|
-
const
|
|
163
|
-
const
|
|
154
|
+
const setupInput = input;
|
|
155
|
+
const patch = setupInput.useEnv ? {} : setupInput.tokenFile ? { serviceAccountFile: setupInput.tokenFile } : setupInput.token ? { serviceAccount: setupInput.token } : {};
|
|
156
|
+
const audienceType = setupInput.audienceType?.trim();
|
|
157
|
+
const audience = setupInput.audience?.trim();
|
|
158
|
+
const webhookPath = setupInput.webhookPath?.trim();
|
|
159
|
+
const webhookUrl = setupInput.webhookUrl?.trim();
|
|
164
160
|
return {
|
|
165
161
|
...patch,
|
|
166
162
|
...audienceType ? { audienceType } : {},
|
|
@@ -170,6 +166,63 @@ const googlechatSetupAdapter = createPatchedAccountSetupAdapter({
|
|
|
170
166
|
};
|
|
171
167
|
}
|
|
172
168
|
});
|
|
169
|
+
const googlechatSetupContract = defineChannelSetupContract({
|
|
170
|
+
fields: {
|
|
171
|
+
token: {
|
|
172
|
+
kind: "string",
|
|
173
|
+
sensitive: true,
|
|
174
|
+
cli: {
|
|
175
|
+
flags: "--token <json>",
|
|
176
|
+
description: "Google Chat service account JSON"
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
tokenFile: {
|
|
180
|
+
kind: "string",
|
|
181
|
+
sensitive: true,
|
|
182
|
+
cli: {
|
|
183
|
+
flags: "--token-file <path>",
|
|
184
|
+
description: "Google Chat service account file"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
audienceType: {
|
|
188
|
+
kind: "choice",
|
|
189
|
+
choices: ["app-url", "project-number"],
|
|
190
|
+
cli: {
|
|
191
|
+
flags: "--audience-type <type>",
|
|
192
|
+
description: "Google Chat audience type"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
audience: {
|
|
196
|
+
kind: "string",
|
|
197
|
+
cli: {
|
|
198
|
+
flags: "--audience <value>",
|
|
199
|
+
description: "Google Chat audience value"
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
webhookPath: {
|
|
203
|
+
kind: "string",
|
|
204
|
+
cli: {
|
|
205
|
+
flags: "--webhook-path <path>",
|
|
206
|
+
description: "Google Chat webhook path"
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
webhookUrl: {
|
|
210
|
+
kind: "string",
|
|
211
|
+
cli: {
|
|
212
|
+
flags: "--webhook-url <url>",
|
|
213
|
+
description: "Google Chat webhook URL"
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
useEnv: {
|
|
217
|
+
kind: "boolean",
|
|
218
|
+
cli: {
|
|
219
|
+
flags: "--use-env",
|
|
220
|
+
description: "Use Google Chat environment credentials"
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
legacyAdapter: googlechatSetupAdapter
|
|
225
|
+
});
|
|
173
226
|
//#endregion
|
|
174
227
|
//#region extensions/googlechat/src/setup-surface.ts
|
|
175
228
|
const t = createSetupTranslator();
|
|
@@ -178,39 +231,19 @@ const ENV_SERVICE_ACCOUNT = "GOOGLE_CHAT_SERVICE_ACCOUNT";
|
|
|
178
231
|
const ENV_SERVICE_ACCOUNT_FILE = "GOOGLE_CHAT_SERVICE_ACCOUNT_FILE";
|
|
179
232
|
const USE_ENV_FLAG = "__googlechatUseEnv";
|
|
180
233
|
const AUTH_METHOD_FLAG = "__googlechatAuthMethod";
|
|
181
|
-
const googlechatDmPolicy = {
|
|
234
|
+
const googlechatDmPolicy = createChannelDmPolicy({
|
|
182
235
|
label: "Google Chat",
|
|
183
236
|
channel,
|
|
184
|
-
|
|
185
|
-
allowFromKey: "channels.googlechat.dm.allowFrom",
|
|
186
|
-
resolveConfigKeys: (cfg, accountId) => (accountId ?? resolveDefaultGoogleChatAccountId(cfg)) !== DEFAULT_ACCOUNT_ID$1 ? {
|
|
187
|
-
policyKey: `channels.googlechat.accounts.${accountId ?? resolveDefaultGoogleChatAccountId(cfg)}.dm.policy`,
|
|
188
|
-
allowFromKey: `channels.googlechat.accounts.${accountId ?? resolveDefaultGoogleChatAccountId(cfg)}.dm.allowFrom`
|
|
189
|
-
} : {
|
|
190
|
-
policyKey: "channels.googlechat.dm.policy",
|
|
191
|
-
allowFromKey: "channels.googlechat.dm.allowFrom"
|
|
192
|
-
},
|
|
193
|
-
getCurrent: (cfg, accountId) => resolveGoogleChatAccount({
|
|
237
|
+
resolveAccount: (cfg, accountId) => resolveGoogleChatAccount({
|
|
194
238
|
cfg,
|
|
195
239
|
accountId: accountId ?? resolveDefaultGoogleChatAccountId(cfg)
|
|
196
|
-
})
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return applySetupAccountConfigPatch({
|
|
204
|
-
cfg,
|
|
205
|
-
channelKey: channel,
|
|
206
|
-
accountId: resolvedAccountId,
|
|
207
|
-
patch: { dm: {
|
|
208
|
-
...currentDm,
|
|
209
|
-
policy,
|
|
210
|
-
...policy === "open" ? { allowFrom: addWildcardAllowFrom(currentDm?.allowFrom) } : {}
|
|
211
|
-
} }
|
|
212
|
-
});
|
|
213
|
-
},
|
|
240
|
+
}),
|
|
241
|
+
applyPatch: ({ cfg, account, patch }) => applySetupAccountConfigPatch({
|
|
242
|
+
cfg,
|
|
243
|
+
channelKey: channel,
|
|
244
|
+
accountId: account.accountId,
|
|
245
|
+
patch
|
|
246
|
+
}),
|
|
214
247
|
promptAllowFrom: createPromptParsedAllowFromForAccount({
|
|
215
248
|
defaultAccountId: resolveDefaultGoogleChatAccountId,
|
|
216
249
|
message: t("wizard.googlechat.allowFromPrompt"),
|
|
@@ -219,21 +252,15 @@ const googlechatDmPolicy = {
|
|
|
219
252
|
getExistingAllowFrom: ({ cfg, accountId }) => resolveGoogleChatAccount({
|
|
220
253
|
cfg,
|
|
221
254
|
accountId
|
|
222
|
-
}).config.
|
|
255
|
+
}).config.allowFrom ?? [],
|
|
223
256
|
applyAllowFrom: ({ cfg, accountId, allowFrom }) => applySetupAccountConfigPatch({
|
|
224
257
|
cfg,
|
|
225
258
|
channelKey: channel,
|
|
226
259
|
accountId,
|
|
227
|
-
patch: {
|
|
228
|
-
...resolveGoogleChatAccount({
|
|
229
|
-
cfg,
|
|
230
|
-
accountId
|
|
231
|
-
}).config.dm,
|
|
232
|
-
allowFrom
|
|
233
|
-
} }
|
|
260
|
+
patch: { allowFrom }
|
|
234
261
|
})
|
|
235
262
|
})
|
|
236
|
-
};
|
|
263
|
+
});
|
|
237
264
|
function createServiceAccountTextInput(params) {
|
|
238
265
|
return {
|
|
239
266
|
inputKey: params.inputKey,
|
|
@@ -392,7 +419,7 @@ const googleChatConfigAdapter = createScopedChannelConfigAdapter({
|
|
|
392
419
|
"botUser",
|
|
393
420
|
"name"
|
|
394
421
|
],
|
|
395
|
-
resolveAllowFrom: (account) => account.config.
|
|
422
|
+
resolveAllowFrom: (account) => account.config.allowFrom,
|
|
396
423
|
formatAllowFrom: (allowFrom) => formatNormalizedAllowFromEntries({
|
|
397
424
|
allowFrom,
|
|
398
425
|
normalizeEntry: formatGoogleChatAllowFromEntry
|
|
@@ -404,6 +431,7 @@ function createGoogleChatPluginBase(params = {}) {
|
|
|
404
431
|
id: GOOGLECHAT_CHANNEL_ID,
|
|
405
432
|
meta: { ...googlechatMeta },
|
|
406
433
|
setup: googlechatSetupAdapter,
|
|
434
|
+
setupContract: googlechatSetupContract,
|
|
407
435
|
setupWizard: googlechatSetupWizard,
|
|
408
436
|
capabilities: {
|
|
409
437
|
chatTypes: [
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as googlechatPlugin } from "./channel-
|
|
1
|
+
import { t as googlechatPlugin } from "./channel-CehfTiWZ.js";
|
|
2
2
|
export { googlechatPlugin };
|