@kodelyth/googlechat 2026.5.39 → 2026.5.42
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/api.ts +3 -0
- package/channel-config-api.ts +1 -0
- package/channel-plugin-api.ts +1 -0
- package/config-api.ts +2 -0
- package/contract-api.ts +5 -0
- package/dist/actions-YK1wn4ed.js +160 -0
- package/dist/api-BkZX4VNX.js +633 -0
- package/dist/api.js +3 -0
- package/dist/channel-DFZdjXD6.js +584 -0
- package/dist/channel-config-api.js +6 -0
- package/dist/channel-plugin-api.js +2 -0
- package/dist/channel.runtime-en3RNg9S.js +998 -0
- package/dist/contract-api.js +3 -0
- package/dist/doctor-contract-8SF6XoKj.js +151 -0
- package/dist/doctor-contract-api.js +2 -0
- package/dist/index.js +22 -0
- package/dist/runtime-api-DUH2Cg-0.js +29 -0
- package/dist/runtime-api.js +2 -0
- package/dist/secret-contract-DWX4ikgT.js +99 -0
- package/dist/secret-contract-api.js +2 -0
- package/dist/setup-entry.js +15 -0
- package/dist/setup-plugin-api.js +75 -0
- package/dist/setup-surface-B3Fa7XRx.js +321 -0
- package/dist/test-api.js +3 -0
- package/doctor-contract-api.ts +1 -0
- package/index.ts +20 -0
- package/klaw.plugin.json +2 -967
- package/package.json +4 -4
- package/runtime-api.ts +55 -0
- package/secret-contract-api.ts +5 -0
- package/setup-entry.ts +13 -0
- package/setup-plugin-api.ts +3 -0
- package/src/accounts.ts +181 -0
- package/src/actions.test.ts +289 -0
- package/src/actions.ts +227 -0
- package/src/api.ts +316 -0
- package/src/approval-auth.test.ts +24 -0
- package/src/approval-auth.ts +32 -0
- package/src/auth.ts +218 -0
- package/src/channel-config.test.ts +39 -0
- package/src/channel.adapters.ts +340 -0
- package/src/channel.deps.runtime.ts +29 -0
- package/src/channel.runtime.ts +17 -0
- package/src/channel.setup.ts +98 -0
- package/src/channel.test.ts +784 -0
- package/src/channel.ts +277 -0
- package/src/config-schema.test.ts +31 -0
- package/src/config-schema.ts +3 -0
- package/src/doctor-contract.test.ts +75 -0
- package/src/doctor-contract.ts +182 -0
- package/src/doctor.ts +57 -0
- package/src/gateway.ts +63 -0
- package/src/google-auth.runtime.test.ts +543 -0
- package/src/google-auth.runtime.ts +568 -0
- package/src/group-policy.ts +17 -0
- package/src/monitor-access.test.ts +491 -0
- package/src/monitor-access.ts +465 -0
- package/src/monitor-durable.test.ts +39 -0
- package/src/monitor-durable.ts +23 -0
- package/src/monitor-reply-delivery.ts +156 -0
- package/src/monitor-routing.ts +65 -0
- package/src/monitor-types.ts +33 -0
- package/src/monitor-webhook.test.ts +587 -0
- package/src/monitor-webhook.ts +303 -0
- package/src/monitor.reply-delivery.test.ts +144 -0
- package/src/monitor.test.ts +159 -0
- package/src/monitor.ts +527 -0
- package/src/monitor.webhook-routing.test.ts +257 -0
- package/src/runtime.ts +9 -0
- package/src/secret-contract.test.ts +60 -0
- package/src/secret-contract.ts +161 -0
- package/src/setup-core.ts +40 -0
- package/src/setup-surface.ts +243 -0
- package/src/setup.test.ts +619 -0
- package/src/targets.test.ts +453 -0
- package/src/targets.ts +66 -0
- package/src/types.config.ts +3 -0
- package/src/types.ts +73 -0
- package/test-api.ts +2 -0
- package/tsconfig.json +16 -0
- package/api.js +0 -7
- package/channel-config-api.js +0 -7
- package/channel-plugin-api.js +0 -7
- package/contract-api.js +0 -7
- package/doctor-contract-api.js +0 -7
- package/index.js +0 -7
- package/runtime-api.js +0 -7
- package/secret-contract-api.js +0 -7
- package/setup-entry.js +0 -7
- package/setup-plugin-api.js +0 -7
- package/test-api.js +0 -7
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { describeAccountSnapshot } from "klaw/plugin-sdk/account-helpers";
|
|
2
|
+
import { formatNormalizedAllowFromEntries } from "klaw/plugin-sdk/allow-from";
|
|
3
|
+
import {
|
|
4
|
+
adaptScopedAccountAccessor,
|
|
5
|
+
createScopedChannelConfigAdapter,
|
|
6
|
+
} from "klaw/plugin-sdk/channel-config-helpers";
|
|
7
|
+
import type { ChannelPlugin } from "klaw/plugin-sdk/channel-core";
|
|
8
|
+
import { normalizeLowercaseStringOrEmpty } from "klaw/plugin-sdk/string-coerce-runtime";
|
|
9
|
+
import {
|
|
10
|
+
type GoogleChatConfigAccessorAccount,
|
|
11
|
+
listGoogleChatAccountIds,
|
|
12
|
+
resolveGoogleChatConfigAccessorAccount,
|
|
13
|
+
resolveDefaultGoogleChatAccountId,
|
|
14
|
+
resolveGoogleChatAccount,
|
|
15
|
+
type ResolvedGoogleChatAccount,
|
|
16
|
+
} from "./accounts.js";
|
|
17
|
+
import { googlechatSetupAdapter } from "./setup-core.js";
|
|
18
|
+
import { googlechatSetupWizard } from "./setup-surface.js";
|
|
19
|
+
|
|
20
|
+
const formatGoogleChatAllowFromEntry = (entry: string) =>
|
|
21
|
+
normalizeLowercaseStringOrEmpty(
|
|
22
|
+
entry
|
|
23
|
+
.trim()
|
|
24
|
+
.replace(/^(googlechat|google-chat|gchat):/i, "")
|
|
25
|
+
.replace(/^user:/i, "")
|
|
26
|
+
.replace(/^users\//i, ""),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const googleChatConfigAdapter = createScopedChannelConfigAdapter<
|
|
30
|
+
ResolvedGoogleChatAccount,
|
|
31
|
+
GoogleChatConfigAccessorAccount
|
|
32
|
+
>({
|
|
33
|
+
sectionKey: "googlechat",
|
|
34
|
+
listAccountIds: listGoogleChatAccountIds,
|
|
35
|
+
resolveAccount: adaptScopedAccountAccessor(resolveGoogleChatAccount),
|
|
36
|
+
resolveAccessorAccount: resolveGoogleChatConfigAccessorAccount,
|
|
37
|
+
defaultAccountId: resolveDefaultGoogleChatAccountId,
|
|
38
|
+
clearBaseFields: [
|
|
39
|
+
"serviceAccount",
|
|
40
|
+
"serviceAccountFile",
|
|
41
|
+
"audienceType",
|
|
42
|
+
"audience",
|
|
43
|
+
"webhookPath",
|
|
44
|
+
"webhookUrl",
|
|
45
|
+
"botUser",
|
|
46
|
+
"name",
|
|
47
|
+
],
|
|
48
|
+
resolveAllowFrom: (account) => account.config.dm?.allowFrom,
|
|
49
|
+
formatAllowFrom: (allowFrom) =>
|
|
50
|
+
formatNormalizedAllowFromEntries({
|
|
51
|
+
allowFrom,
|
|
52
|
+
normalizeEntry: formatGoogleChatAllowFromEntry,
|
|
53
|
+
}),
|
|
54
|
+
resolveDefaultTo: (account) => account.config.defaultTo,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export const googlechatSetupPlugin: ChannelPlugin<ResolvedGoogleChatAccount> = {
|
|
58
|
+
id: "googlechat",
|
|
59
|
+
meta: {
|
|
60
|
+
id: "googlechat",
|
|
61
|
+
label: "Google Chat",
|
|
62
|
+
selectionLabel: "Google Chat (Chat API)",
|
|
63
|
+
docsPath: "/channels/googlechat",
|
|
64
|
+
docsLabel: "googlechat",
|
|
65
|
+
blurb: "Google Workspace Chat app with HTTP webhook.",
|
|
66
|
+
aliases: ["gchat", "google-chat"],
|
|
67
|
+
order: 55,
|
|
68
|
+
detailLabel: "Google Chat",
|
|
69
|
+
systemImage: "message.badge",
|
|
70
|
+
markdownCapable: true,
|
|
71
|
+
},
|
|
72
|
+
setup: googlechatSetupAdapter,
|
|
73
|
+
setupWizard: googlechatSetupWizard,
|
|
74
|
+
capabilities: {
|
|
75
|
+
chatTypes: ["direct", "group", "thread"],
|
|
76
|
+
reactions: true,
|
|
77
|
+
threads: true,
|
|
78
|
+
media: true,
|
|
79
|
+
nativeCommands: false,
|
|
80
|
+
blockStreaming: true,
|
|
81
|
+
},
|
|
82
|
+
streaming: {
|
|
83
|
+
blockStreamingCoalesceDefaults: { minChars: 1500, idleMs: 1000 },
|
|
84
|
+
},
|
|
85
|
+
reload: { configPrefixes: ["channels.googlechat"] },
|
|
86
|
+
config: {
|
|
87
|
+
...googleChatConfigAdapter,
|
|
88
|
+
isConfigured: (account) => account.credentialSource !== "none",
|
|
89
|
+
describeAccount: (account) =>
|
|
90
|
+
describeAccountSnapshot({
|
|
91
|
+
account,
|
|
92
|
+
configured: account.credentialSource !== "none",
|
|
93
|
+
extra: {
|
|
94
|
+
credentialSource: account.credentialSource,
|
|
95
|
+
},
|
|
96
|
+
}),
|
|
97
|
+
},
|
|
98
|
+
};
|