@kodelyth/googlechat 2026.5.42 → 2026.6.2
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/klaw.plugin.json +967 -2
- package/package.json +18 -6
- package/api.ts +0 -3
- package/channel-config-api.ts +0 -1
- package/channel-plugin-api.ts +0 -1
- package/config-api.ts +0 -2
- package/contract-api.ts +0 -5
- package/doctor-contract-api.ts +0 -1
- package/index.ts +0 -20
- package/runtime-api.ts +0 -55
- package/secret-contract-api.ts +0 -5
- package/setup-entry.ts +0 -13
- package/setup-plugin-api.ts +0 -3
- package/src/accounts.ts +0 -181
- package/src/actions.test.ts +0 -289
- package/src/actions.ts +0 -227
- package/src/api.ts +0 -316
- package/src/approval-auth.test.ts +0 -24
- package/src/approval-auth.ts +0 -32
- package/src/auth.ts +0 -218
- package/src/channel-config.test.ts +0 -39
- package/src/channel.adapters.ts +0 -340
- package/src/channel.deps.runtime.ts +0 -29
- package/src/channel.runtime.ts +0 -17
- package/src/channel.setup.ts +0 -98
- package/src/channel.test.ts +0 -784
- package/src/channel.ts +0 -277
- package/src/config-schema.test.ts +0 -31
- package/src/config-schema.ts +0 -3
- package/src/doctor-contract.test.ts +0 -75
- package/src/doctor-contract.ts +0 -182
- package/src/doctor.ts +0 -57
- package/src/gateway.ts +0 -63
- package/src/google-auth.runtime.test.ts +0 -543
- package/src/google-auth.runtime.ts +0 -568
- package/src/group-policy.ts +0 -17
- package/src/monitor-access.test.ts +0 -491
- package/src/monitor-access.ts +0 -465
- package/src/monitor-durable.test.ts +0 -39
- package/src/monitor-durable.ts +0 -23
- package/src/monitor-reply-delivery.ts +0 -156
- package/src/monitor-routing.ts +0 -65
- package/src/monitor-types.ts +0 -33
- package/src/monitor-webhook.test.ts +0 -587
- package/src/monitor-webhook.ts +0 -303
- package/src/monitor.reply-delivery.test.ts +0 -144
- package/src/monitor.test.ts +0 -159
- package/src/monitor.ts +0 -527
- package/src/monitor.webhook-routing.test.ts +0 -257
- package/src/runtime.ts +0 -9
- package/src/secret-contract.test.ts +0 -60
- package/src/secret-contract.ts +0 -161
- package/src/setup-core.ts +0 -40
- package/src/setup-surface.ts +0 -243
- package/src/setup.test.ts +0 -619
- package/src/targets.test.ts +0 -453
- package/src/targets.ts +0 -66
- package/src/types.config.ts +0 -3
- package/src/types.ts +0 -73
- package/test-api.ts +0 -2
- package/tsconfig.json +0 -16
package/src/channel.setup.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
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
|
-
};
|