@openclaw/msteams 2026.7.1 → 2026.7.2-beta.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/dist/api.cjs +8 -0
- package/dist/{channel-Cf5LJ4aO.js → channel-BKc8zroK.cjs} +648 -240
- package/dist/channel-config-api.cjs +3 -0
- package/dist/channel-plugin-api.cjs +3 -0
- package/dist/channel.runtime-hd1Zsoo2.cjs +1372 -0
- package/dist/{config-schema-BL4qQZiA.js → config-schema-BSNLJUta.cjs} +13 -3
- package/dist/{directory-contract-api.js → directory-contract-api.cjs} +8 -7
- package/dist/{doctor-contract-api.js → doctor-contract-api.cjs} +73 -57
- package/dist/index.cjs +21 -0
- package/dist/{probe-BnyZRZsD.js → messenger-BVcKl6dv.cjs} +436 -891
- package/dist/{oauth-BifWxWzq.js → oauth-yNoKtU_3.cjs} +21 -21
- package/dist/{polls-B_hs4aKm.js → polls-BhoI4VaN.cjs} +188 -38
- package/dist/{resolve-allowlist-Dnw4aNOu.js → resolve-allowlist-DXd097EP.cjs} +849 -140
- package/dist/rolldown-runtime-D6vf50IK.cjs +28 -0
- package/dist/runtime-api.cjs +207 -0
- package/dist/runtime-gZTAuFux.cjs +24 -0
- package/dist/secret-contract-api.cjs +31 -0
- package/dist/setup-entry.cjs +14 -0
- package/dist/setup-plugin-api.cjs +65 -0
- package/dist/{setup-surface-qW-ECHL-.js → setup-surface-D4f6x5cx.cjs} +127 -61
- package/dist/{src-DZFs5XtZ.js → src-20YasZEp.cjs} +686 -748
- package/dist/{sso-token-store-DrVbnCUF.js → sso-token-store-CktCz88k.cjs} +51 -10
- package/npm-shrinkwrap.json +3 -3
- package/openclaw.plugin.json +10 -31
- package/package.json +8 -7
- package/dist/api.js +0 -3
- package/dist/channel-config-api.js +0 -2
- package/dist/channel-plugin-api.js +0 -2
- package/dist/channel.runtime-Bwu6Tjhf.js +0 -664
- package/dist/index.js +0 -22
- package/dist/runtime-BS5AZrKK.js +0 -8
- package/dist/runtime-api.js +0 -20
- package/dist/secret-contract-api.js +0 -35
- package/dist/setup-entry.js +0 -15
- package/dist/setup-plugin-api.js +0 -64
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
const require_resolve_allowlist = require("./resolve-allowlist-DXd097EP.cjs");
|
|
2
|
+
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
3
|
+
let openclaw_plugin_sdk_number_runtime = require("openclaw/plugin-sdk/number-runtime");
|
|
4
|
+
let openclaw_plugin_sdk_setup = require("openclaw/plugin-sdk/setup");
|
|
5
|
+
let openclaw_plugin_sdk_setup_tools = require("openclaw/plugin-sdk/setup-tools");
|
|
6
|
+
let openclaw_plugin_sdk_retry_runtime = require("openclaw/plugin-sdk/retry-runtime");
|
|
7
|
+
let openclaw_plugin_sdk_secret_input = require("openclaw/plugin-sdk/secret-input");
|
|
6
8
|
//#region extensions/msteams/src/setup-core.ts
|
|
7
|
-
const t$1 = createSetupTranslator();
|
|
9
|
+
const t$1 = (0, openclaw_plugin_sdk_setup.createSetupTranslator)();
|
|
8
10
|
const msteamsSetupAdapter = {
|
|
9
|
-
resolveAccountId: () => DEFAULT_ACCOUNT_ID,
|
|
11
|
+
resolveAccountId: () => openclaw_plugin_sdk_setup.DEFAULT_ACCOUNT_ID,
|
|
10
12
|
applyAccountConfig: ({ cfg }) => ({
|
|
11
13
|
...cfg,
|
|
12
14
|
channels: {
|
|
@@ -41,15 +43,15 @@ async function noteMSTeamsCredentialHelp(prompter) {
|
|
|
41
43
|
t$1("wizard.msteams.helpClientSecret"),
|
|
42
44
|
t$1("wizard.msteams.helpWebhook"),
|
|
43
45
|
t$1("wizard.msteams.helpEnvTip"),
|
|
44
|
-
t$1("wizard.channels.docs", { link: formatDocsLink("/channels/msteams", "msteams") })
|
|
46
|
+
t$1("wizard.channels.docs", { link: (0, openclaw_plugin_sdk_setup_tools.formatDocsLink)("/channels/msteams", "msteams") })
|
|
45
47
|
].join("\n"), t$1("wizard.msteams.credentialsTitle"));
|
|
46
48
|
}
|
|
47
49
|
function createMSTeamsSetupWizardBase() {
|
|
48
50
|
return {
|
|
49
51
|
channel: channel$1,
|
|
50
|
-
resolveAccountIdForConfigure: () => DEFAULT_ACCOUNT_ID,
|
|
52
|
+
resolveAccountIdForConfigure: () => openclaw_plugin_sdk_setup.DEFAULT_ACCOUNT_ID,
|
|
51
53
|
resolveShouldPromptAccountIds: () => false,
|
|
52
|
-
status: createStandardChannelSetupStatus({
|
|
54
|
+
status: (0, openclaw_plugin_sdk_setup.createStandardChannelSetupStatus)({
|
|
53
55
|
channelLabel: "MS Teams",
|
|
54
56
|
configuredLabel: t$1("wizard.channels.statusConfigured"),
|
|
55
57
|
unconfiguredLabel: t$1("wizard.channels.statusNeedsAppCredentials"),
|
|
@@ -58,13 +60,13 @@ function createMSTeamsSetupWizardBase() {
|
|
|
58
60
|
configuredScore: 2,
|
|
59
61
|
unconfiguredScore: 0,
|
|
60
62
|
includeStatusLine: true,
|
|
61
|
-
resolveConfigured: ({ cfg }) => Boolean(resolveMSTeamsCredentials(cfg.channels?.msteams)) || hasConfiguredMSTeamsCredentials(cfg.channels?.msteams)
|
|
63
|
+
resolveConfigured: ({ cfg }) => Boolean(require_resolve_allowlist.resolveMSTeamsCredentials(cfg.channels?.msteams)) || require_resolve_allowlist.hasConfiguredMSTeamsCredentials(cfg.channels?.msteams)
|
|
62
64
|
}),
|
|
63
65
|
credentials: [],
|
|
64
66
|
finalize: async ({ cfg, prompter }) => {
|
|
65
|
-
const resolved = resolveMSTeamsCredentials(cfg.channels?.msteams);
|
|
66
|
-
const hasConfigCreds = hasConfiguredMSTeamsCredentials(cfg.channels?.msteams);
|
|
67
|
-
const canUseEnv = Boolean(!hasConfigCreds && normalizeSecretInputString(process.env.MSTEAMS_APP_ID) && normalizeSecretInputString(process.env.MSTEAMS_APP_PASSWORD) && normalizeSecretInputString(process.env.MSTEAMS_TENANT_ID));
|
|
67
|
+
const resolved = require_resolve_allowlist.resolveMSTeamsCredentials(cfg.channels?.msteams);
|
|
68
|
+
const hasConfigCreds = require_resolve_allowlist.hasConfiguredMSTeamsCredentials(cfg.channels?.msteams);
|
|
69
|
+
const canUseEnv = Boolean(!hasConfigCreds && (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_APP_ID) && (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_APP_PASSWORD) && (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_TENANT_ID));
|
|
68
70
|
let next = cfg;
|
|
69
71
|
let appId = null;
|
|
70
72
|
let appPassword = null;
|
|
@@ -75,7 +77,7 @@ function createMSTeamsSetupWizardBase() {
|
|
|
75
77
|
initialValue: true
|
|
76
78
|
})) next = msteamsSetupAdapter.applyAccountConfig({
|
|
77
79
|
cfg: next,
|
|
78
|
-
accountId: DEFAULT_ACCOUNT_ID,
|
|
80
|
+
accountId: openclaw_plugin_sdk_setup.DEFAULT_ACCOUNT_ID,
|
|
79
81
|
input: {}
|
|
80
82
|
});
|
|
81
83
|
else ({appId, appPassword, tenantId} = await promptMSTeamsCredentials(prompter));
|
|
@@ -100,7 +102,7 @@ function createMSTeamsSetupWizardBase() {
|
|
|
100
102
|
};
|
|
101
103
|
return {
|
|
102
104
|
cfg: next,
|
|
103
|
-
accountId: DEFAULT_ACCOUNT_ID
|
|
105
|
+
accountId: openclaw_plugin_sdk_setup.DEFAULT_ACCOUNT_ID
|
|
104
106
|
};
|
|
105
107
|
}
|
|
106
108
|
};
|
|
@@ -123,7 +125,7 @@ function formatUnknownError(err) {
|
|
|
123
125
|
}
|
|
124
126
|
}
|
|
125
127
|
function extractStatusCode(err) {
|
|
126
|
-
if (!isRecord(err)) return null;
|
|
128
|
+
if (!(0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(err)) return null;
|
|
127
129
|
const parseStatusCode = (value) => {
|
|
128
130
|
if (typeof value === "number") return Number.isInteger(value) && value >= 100 && value <= 599 ? value : null;
|
|
129
131
|
if (typeof value === "string") {
|
|
@@ -137,34 +139,34 @@ function extractStatusCode(err) {
|
|
|
137
139
|
const directStatus = parseStatusCode(err.statusCode ?? err.status);
|
|
138
140
|
if (directStatus !== null) return directStatus;
|
|
139
141
|
const response = err.response;
|
|
140
|
-
if (isRecord(response)) {
|
|
142
|
+
if ((0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(response)) {
|
|
141
143
|
const responseStatus = parseStatusCode(response.status);
|
|
142
144
|
if (responseStatus !== null) return responseStatus;
|
|
143
145
|
}
|
|
144
146
|
return null;
|
|
145
147
|
}
|
|
146
148
|
function extractErrorCode(err) {
|
|
147
|
-
if (!isRecord(err)) return null;
|
|
149
|
+
if (!(0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(err)) return null;
|
|
148
150
|
const direct = err.code;
|
|
149
151
|
if (typeof direct === "string" && direct.trim()) return direct;
|
|
150
152
|
const response = err.response;
|
|
151
|
-
if (!isRecord(response)) return null;
|
|
153
|
+
if (!(0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(response)) return null;
|
|
152
154
|
const body = response.body;
|
|
153
|
-
if (isRecord(body)) {
|
|
155
|
+
if ((0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(body)) {
|
|
154
156
|
const error = body.error;
|
|
155
|
-
if (isRecord(error) && typeof error.code === "string" && error.code.trim()) return error.code;
|
|
157
|
+
if ((0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(error) && typeof error.code === "string" && error.code.trim()) return error.code;
|
|
156
158
|
}
|
|
157
159
|
return null;
|
|
158
160
|
}
|
|
159
161
|
function extractRetryAfterMs(err) {
|
|
160
|
-
if (!isRecord(err)) return null;
|
|
161
|
-
const directMs = asFiniteNumberInRange(err.retryAfterMs ?? err.retry_after_ms, {
|
|
162
|
+
if (!(0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(err)) return null;
|
|
163
|
+
const directMs = (0, openclaw_plugin_sdk_number_runtime.asFiniteNumberInRange)(err.retryAfterMs ?? err.retry_after_ms, {
|
|
162
164
|
min: 0,
|
|
163
165
|
max: Number.MAX_SAFE_INTEGER
|
|
164
166
|
});
|
|
165
167
|
if (directMs !== void 0) return directMs;
|
|
166
168
|
const retryAfter = err.retryAfter ?? err.retry_after;
|
|
167
|
-
const retryAfterSeconds = asFiniteNumberInRange(retryAfter, {
|
|
169
|
+
const retryAfterSeconds = (0, openclaw_plugin_sdk_number_runtime.asFiniteNumberInRange)(retryAfter, {
|
|
168
170
|
min: 0,
|
|
169
171
|
max: MAX_SAFE_RETRY_AFTER_SECONDS
|
|
170
172
|
});
|
|
@@ -174,20 +176,20 @@ function extractRetryAfterMs(err) {
|
|
|
174
176
|
if (parsed !== void 0) return parsed * 1e3;
|
|
175
177
|
}
|
|
176
178
|
const response = err.response;
|
|
177
|
-
if (!isRecord(response)) return null;
|
|
179
|
+
if (!(0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(response)) return null;
|
|
178
180
|
const headers = response.headers;
|
|
179
181
|
if (!headers) return null;
|
|
180
|
-
if (isRecord(headers)) {
|
|
182
|
+
if ((0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(headers)) {
|
|
181
183
|
const raw = headers["retry-after"] ?? headers["Retry-After"];
|
|
182
184
|
if (typeof raw === "string") {
|
|
183
|
-
const parsed =
|
|
185
|
+
const parsed = (0, openclaw_plugin_sdk_retry_runtime.parseRetryAfterHeaderSeconds)(raw);
|
|
184
186
|
if (parsed !== void 0) return parsed * 1e3;
|
|
185
187
|
}
|
|
186
188
|
}
|
|
187
189
|
if (typeof headers === "object" && headers !== null && "get" in headers && typeof headers.get === "function") {
|
|
188
190
|
const raw = headers.get("retry-after");
|
|
189
191
|
if (raw) {
|
|
190
|
-
const parsed =
|
|
192
|
+
const parsed = (0, openclaw_plugin_sdk_retry_runtime.parseRetryAfterHeaderSeconds)(raw);
|
|
191
193
|
if (parsed !== void 0) return parsed * 1e3;
|
|
192
194
|
}
|
|
193
195
|
}
|
|
@@ -196,7 +198,7 @@ function extractRetryAfterMs(err) {
|
|
|
196
198
|
function parseNonNegativeRetryAfterSeconds(raw) {
|
|
197
199
|
const trimmed = raw.trim();
|
|
198
200
|
if (!/^\d+(?:\.\d+)?$/.test(trimmed)) return;
|
|
199
|
-
return asFiniteNumberInRange(parseStrictFiniteNumber(trimmed), {
|
|
201
|
+
return (0, openclaw_plugin_sdk_number_runtime.asFiniteNumberInRange)((0, openclaw_plugin_sdk_number_runtime.parseStrictFiniteNumber)(trimmed), {
|
|
200
202
|
min: 0,
|
|
201
203
|
max: MAX_SAFE_RETRY_AFTER_SECONDS
|
|
202
204
|
});
|
|
@@ -248,7 +250,7 @@ function classifyMSTeamsSendError(err) {
|
|
|
248
250
|
errorCode
|
|
249
251
|
};
|
|
250
252
|
if (statusCode == null) {
|
|
251
|
-
const networkCode = isRecord(err) && typeof err.code === "string" ? err.code : null;
|
|
253
|
+
const networkCode = (0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(err) && typeof err.code === "string" ? err.code : null;
|
|
252
254
|
if (networkCode === "ECONNREFUSED" || networkCode === "ENOTFOUND" || networkCode === "EHOSTUNREACH" || networkCode === "ETIMEDOUT" || networkCode === "ECONNRESET") return {
|
|
253
255
|
kind: "network",
|
|
254
256
|
errorCode: networkCode
|
|
@@ -282,10 +284,10 @@ function formatMSTeamsSendErrorHint(classification) {
|
|
|
282
284
|
}
|
|
283
285
|
//#endregion
|
|
284
286
|
//#region extensions/msteams/src/setup-surface.ts
|
|
285
|
-
const t = createSetupTranslator();
|
|
287
|
+
const t = (0, openclaw_plugin_sdk_setup.createSetupTranslator)();
|
|
286
288
|
const channel = "msteams";
|
|
287
|
-
const setMSTeamsAllowFrom = createTopLevelChannelAllowFromSetter({ channel });
|
|
288
|
-
const setMSTeamsGroupPolicy = createTopLevelChannelGroupPolicySetter({
|
|
289
|
+
const setMSTeamsAllowFrom = (0, openclaw_plugin_sdk_setup.createTopLevelChannelAllowFromSetter)({ channel });
|
|
290
|
+
const setMSTeamsGroupPolicy = (0, openclaw_plugin_sdk_setup.createTopLevelChannelGroupPolicySetter)({
|
|
289
291
|
channel,
|
|
290
292
|
enabled: true
|
|
291
293
|
});
|
|
@@ -306,7 +308,7 @@ async function promptMSTeamsAllowFrom(params) {
|
|
|
306
308
|
"- 00000000-0000-0000-0000-000000000000"
|
|
307
309
|
].join("\n"), t("wizard.msteams.allowlistTitle"));
|
|
308
310
|
while (true) {
|
|
309
|
-
const parts = splitSetupEntries(await params.prompter.text({
|
|
311
|
+
const parts = (0, openclaw_plugin_sdk_setup.splitSetupEntries)(await params.prompter.text({
|
|
310
312
|
message: t("wizard.msteams.allowFromPrompt"),
|
|
311
313
|
placeholder: "alex@example.com, Alex Johnson",
|
|
312
314
|
initialValue: existing[0] ? existing[0] : void 0,
|
|
@@ -316,7 +318,7 @@ async function promptMSTeamsAllowFrom(params) {
|
|
|
316
318
|
await params.prompter.note(t("wizard.msteams.enterAtLeastOneUser"), t("wizard.msteams.allowlistTitle"));
|
|
317
319
|
continue;
|
|
318
320
|
}
|
|
319
|
-
const resolved = await resolveMSTeamsUserAllowlist({
|
|
321
|
+
const resolved = await require_resolve_allowlist.resolveMSTeamsUserAllowlist({
|
|
320
322
|
cfg: params.cfg,
|
|
321
323
|
entries: parts
|
|
322
324
|
}).catch(() => null);
|
|
@@ -326,7 +328,7 @@ async function promptMSTeamsAllowFrom(params) {
|
|
|
326
328
|
await params.prompter.note(t("wizard.msteams.graphLookupUnavailable"), t("wizard.msteams.allowlistTitle"));
|
|
327
329
|
continue;
|
|
328
330
|
}
|
|
329
|
-
const unique = mergeAllowFromEntries(existing, ids);
|
|
331
|
+
const unique = (0, openclaw_plugin_sdk_setup.mergeAllowFromEntries)(existing, ids);
|
|
330
332
|
return setMSTeamsAllowFrom(params.cfg, unique);
|
|
331
333
|
}
|
|
332
334
|
const unresolved = resolved.filter((item) => !item.resolved || !item.id);
|
|
@@ -334,7 +336,7 @@ async function promptMSTeamsAllowFrom(params) {
|
|
|
334
336
|
await params.prompter.note(t("wizard.msteams.couldNotResolve", { entries: unresolved.map((item) => item.input).join(", ") }), t("wizard.msteams.allowlistTitle"));
|
|
335
337
|
continue;
|
|
336
338
|
}
|
|
337
|
-
const unique = mergeAllowFromEntries(existing, resolved.map((item) => item.id));
|
|
339
|
+
const unique = (0, openclaw_plugin_sdk_setup.mergeAllowFromEntries)(existing, resolved.map((item) => item.id));
|
|
338
340
|
return setMSTeamsAllowFrom(params.cfg, unique);
|
|
339
341
|
}
|
|
340
342
|
}
|
|
@@ -374,10 +376,10 @@ function listMSTeamsGroupEntries(cfg) {
|
|
|
374
376
|
});
|
|
375
377
|
}
|
|
376
378
|
async function resolveMSTeamsGroupAllowlist(params) {
|
|
377
|
-
let resolvedEntries = params.entries.map((entry) => parseMSTeamsTeamEntry(entry)).filter(Boolean);
|
|
378
|
-
if (params.entries.length === 0 || !resolveMSTeamsCredentials(params.cfg.channels?.msteams)) return resolvedEntries;
|
|
379
|
+
let resolvedEntries = params.entries.map((entry) => require_resolve_allowlist.parseMSTeamsTeamEntry(entry)).filter(Boolean);
|
|
380
|
+
if (params.entries.length === 0 || !require_resolve_allowlist.resolveMSTeamsCredentials(params.cfg.channels?.msteams)) return resolvedEntries;
|
|
379
381
|
try {
|
|
380
|
-
const lookups = await resolveMSTeamsChannelAllowlist({
|
|
382
|
+
const lookups = await require_resolve_allowlist.resolveMSTeamsChannelAllowlist({
|
|
381
383
|
cfg: params.cfg,
|
|
382
384
|
entries: params.entries
|
|
383
385
|
});
|
|
@@ -390,7 +392,7 @@ async function resolveMSTeamsGroupAllowlist(params) {
|
|
|
390
392
|
channelKey: entry.channelId
|
|
391
393
|
})),
|
|
392
394
|
...resolvedTeams.map((entry) => ({ teamKey: entry.teamId })),
|
|
393
|
-
...unresolved.map((entry) => parseMSTeamsTeamEntry(entry)).filter(Boolean)
|
|
395
|
+
...unresolved.map((entry) => require_resolve_allowlist.parseMSTeamsTeamEntry(entry)).filter(Boolean)
|
|
394
396
|
];
|
|
395
397
|
const summary = [];
|
|
396
398
|
if (resolvedChannels.length > 0) summary.push(t("wizard.msteams.resolvedChannels", { entries: resolvedChannels.map((entry) => entry.channelId).filter(Boolean).join(", ") }));
|
|
@@ -417,7 +419,7 @@ const msteamsGroupAccess = {
|
|
|
417
419
|
}),
|
|
418
420
|
applyAllowlist: ({ cfg, resolved }) => setMSTeamsTeamsAllowlist(cfg, resolved)
|
|
419
421
|
};
|
|
420
|
-
const msteamsDmPolicy = createTopLevelChannelDmPolicy({
|
|
422
|
+
const msteamsDmPolicy = (0, openclaw_plugin_sdk_setup.createTopLevelChannelDmPolicy)({
|
|
421
423
|
label: "MS Teams",
|
|
422
424
|
channel,
|
|
423
425
|
policyKey: "channels.msteams.dmPolicy",
|
|
@@ -432,7 +434,7 @@ const msteamsSetupWizard = {
|
|
|
432
434
|
const baseFinalize = msteamsSetupWizardBase.finalize;
|
|
433
435
|
const baseResult = baseFinalize ? await baseFinalize(params) : void 0;
|
|
434
436
|
let next = baseResult?.cfg ?? params.cfg;
|
|
435
|
-
const finalCreds = resolveMSTeamsCredentials(next.channels?.msteams);
|
|
437
|
+
const finalCreds = require_resolve_allowlist.resolveMSTeamsCredentials(next.channels?.msteams);
|
|
436
438
|
if (finalCreds?.type === "secret") {
|
|
437
439
|
if (await params.prompter.confirm({
|
|
438
440
|
message: t("wizard.msteams.delegatedAuthPrompt"),
|
|
@@ -448,10 +450,24 @@ const msteamsSetupWizard = {
|
|
|
448
450
|
}
|
|
449
451
|
}
|
|
450
452
|
};
|
|
453
|
+
const noteDelegatedAuthFailure = async (err) => {
|
|
454
|
+
await params.prompter.note(`Delegated auth setup failed: ${formatUnknownError(err)}\n` + t("wizard.msteams.delegatedAuthRetry"), t("wizard.msteams.delegatedAuthTitle"));
|
|
455
|
+
};
|
|
456
|
+
let oauthModule;
|
|
457
|
+
try {
|
|
458
|
+
oauthModule = await Promise.resolve().then(() => require("./oauth-yNoKtU_3.cjs"));
|
|
459
|
+
} catch (err) {
|
|
460
|
+
await noteDelegatedAuthFailure(err);
|
|
461
|
+
return {
|
|
462
|
+
...baseResult,
|
|
463
|
+
cfg: next
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
await params.options?.beforePersistentEffect?.();
|
|
467
|
+
const progress = params.prompter.progress(t("wizard.msteams.delegatedOAuthProgress"));
|
|
468
|
+
let tokens;
|
|
451
469
|
try {
|
|
452
|
-
|
|
453
|
-
const progress = params.prompter.progress(t("wizard.msteams.delegatedOAuthProgress"));
|
|
454
|
-
saveDelegatedTokens(await loginMSTeamsDelegated({
|
|
470
|
+
tokens = await oauthModule.loginMSTeamsDelegated({
|
|
455
471
|
isRemote: true,
|
|
456
472
|
openUrl: openDelegatedOAuthUrl,
|
|
457
473
|
log: (msg) => {
|
|
@@ -464,11 +480,23 @@ const msteamsSetupWizard = {
|
|
|
464
480
|
tenantId: finalCreds.tenantId,
|
|
465
481
|
clientId: finalCreds.appId,
|
|
466
482
|
clientSecret: finalCreds.appPassword
|
|
467
|
-
})
|
|
468
|
-
progress.stop(t("wizard.msteams.delegatedAuthConfigured"));
|
|
483
|
+
});
|
|
469
484
|
} catch (err) {
|
|
470
|
-
|
|
485
|
+
progress.stop();
|
|
486
|
+
await noteDelegatedAuthFailure(err);
|
|
487
|
+
return {
|
|
488
|
+
...baseResult,
|
|
489
|
+
cfg: next
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
try {
|
|
493
|
+
await params.options?.beforePersistentEffect?.();
|
|
494
|
+
} catch (err) {
|
|
495
|
+
progress.stop();
|
|
496
|
+
throw err;
|
|
471
497
|
}
|
|
498
|
+
require_resolve_allowlist.saveDelegatedTokens(tokens);
|
|
499
|
+
progress.stop(t("wizard.msteams.delegatedAuthConfigured"));
|
|
472
500
|
}
|
|
473
501
|
}
|
|
474
502
|
return {
|
|
@@ -478,16 +506,54 @@ const msteamsSetupWizard = {
|
|
|
478
506
|
},
|
|
479
507
|
dmPolicy: msteamsDmPolicy,
|
|
480
508
|
groupAccess: msteamsGroupAccess,
|
|
481
|
-
disable: (cfg) => (
|
|
482
|
-
...cfg,
|
|
483
|
-
channels: {
|
|
484
|
-
...cfg.channels,
|
|
485
|
-
msteams: {
|
|
486
|
-
...cfg.channels?.msteams,
|
|
487
|
-
enabled: false
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
})
|
|
509
|
+
disable: (cfg) => (0, openclaw_plugin_sdk_setup.setSetupChannelEnabled)(cfg, channel, false)
|
|
491
510
|
};
|
|
492
511
|
//#endregion
|
|
493
|
-
|
|
512
|
+
Object.defineProperty(exports, "classifyMSTeamsSendError", {
|
|
513
|
+
enumerable: true,
|
|
514
|
+
get: function() {
|
|
515
|
+
return classifyMSTeamsSendError;
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
Object.defineProperty(exports, "createMSTeamsSetupWizardBase", {
|
|
519
|
+
enumerable: true,
|
|
520
|
+
get: function() {
|
|
521
|
+
return createMSTeamsSetupWizardBase;
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
Object.defineProperty(exports, "formatMSTeamsSendErrorHint", {
|
|
525
|
+
enumerable: true,
|
|
526
|
+
get: function() {
|
|
527
|
+
return formatMSTeamsSendErrorHint;
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
Object.defineProperty(exports, "formatUnknownError", {
|
|
531
|
+
enumerable: true,
|
|
532
|
+
get: function() {
|
|
533
|
+
return formatUnknownError;
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
Object.defineProperty(exports, "isRevokedProxyError", {
|
|
537
|
+
enumerable: true,
|
|
538
|
+
get: function() {
|
|
539
|
+
return isRevokedProxyError;
|
|
540
|
+
}
|
|
541
|
+
});
|
|
542
|
+
Object.defineProperty(exports, "msteamsSetupAdapter", {
|
|
543
|
+
enumerable: true,
|
|
544
|
+
get: function() {
|
|
545
|
+
return msteamsSetupAdapter;
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
Object.defineProperty(exports, "msteamsSetupWizard", {
|
|
549
|
+
enumerable: true,
|
|
550
|
+
get: function() {
|
|
551
|
+
return msteamsSetupWizard;
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
Object.defineProperty(exports, "openDelegatedOAuthUrl", {
|
|
555
|
+
enumerable: true,
|
|
556
|
+
get: function() {
|
|
557
|
+
return openDelegatedOAuthUrl;
|
|
558
|
+
}
|
|
559
|
+
});
|