@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,20 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-D6vf50IK.cjs");
|
|
2
|
+
const require_runtime = require("./runtime-gZTAuFux.cjs");
|
|
3
|
+
require("./runtime-api.cjs");
|
|
4
|
+
let openclaw_plugin_sdk_allow_from = require("openclaw/plugin-sdk/allow-from");
|
|
5
|
+
let openclaw_plugin_sdk_lazy_runtime = require("openclaw/plugin-sdk/lazy-runtime");
|
|
6
|
+
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
7
|
+
let openclaw_plugin_sdk_ssrf_runtime = require("openclaw/plugin-sdk/ssrf-runtime");
|
|
8
|
+
let openclaw_plugin_sdk_provider_http = require("openclaw/plugin-sdk/provider-http");
|
|
9
|
+
let node_buffer = require("node:buffer");
|
|
10
|
+
let node_dns_promises = require("node:dns/promises");
|
|
11
|
+
let openclaw_plugin_sdk_ssrf_policy = require("openclaw/plugin-sdk/ssrf-policy");
|
|
12
|
+
let openclaw_plugin_sdk_number_runtime = require("openclaw/plugin-sdk/number-runtime");
|
|
13
|
+
let openclaw_plugin_sdk_text_utility_runtime = require("openclaw/plugin-sdk/text-utility-runtime");
|
|
14
|
+
let node_fs = require("node:fs");
|
|
15
|
+
node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
|
|
16
|
+
let node_module = require("node:module");
|
|
17
|
+
let node_path = require("node:path");
|
|
18
|
+
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
19
|
+
let openclaw_plugin_sdk_security_runtime = require("openclaw/plugin-sdk/security-runtime");
|
|
20
|
+
let openclaw_plugin_sdk_secret_input = require("openclaw/plugin-sdk/secret-input");
|
|
21
|
+
//#region extensions/msteams/src/request-timeout.ts
|
|
22
|
+
const MSTEAMS_REQUEST_TIMEOUT_MS = 3e4;
|
|
23
|
+
const MSTEAMS_SHAREPOINT_UPLOAD_BASE_TIMEOUT_MS = 5 * 6e4;
|
|
24
|
+
const MSTEAMS_SHAREPOINT_UPLOAD_MIN_BYTES_PER_SECOND = 256 * 1024;
|
|
25
|
+
const MSTEAMS_INBOUND_PREPROCESS_TIMEOUT_MS = 1e4;
|
|
26
|
+
function createMSTeamsInboundDeadline() {
|
|
27
|
+
return (0, openclaw_plugin_sdk_provider_http.createProviderOperationDeadline)({
|
|
28
|
+
label: "MS Teams inbound preprocessing",
|
|
29
|
+
timeoutMs: MSTEAMS_INBOUND_PREPROCESS_TIMEOUT_MS
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function resolveMSTeamsRequestTimeoutMs(deadline) {
|
|
33
|
+
return deadline ? (0, openclaw_plugin_sdk_provider_http.resolveProviderOperationTimeoutMs)({
|
|
34
|
+
deadline,
|
|
35
|
+
defaultTimeoutMs: MSTEAMS_REQUEST_TIMEOUT_MS
|
|
36
|
+
}) : MSTEAMS_REQUEST_TIMEOUT_MS;
|
|
37
|
+
}
|
|
38
|
+
/** Bound non-abortable SDK and credential work to the same operation deadline as fetches. */
|
|
39
|
+
async function withMSTeamsRequestDeadline(params) {
|
|
40
|
+
const timeoutMs = resolveMSTeamsRequestTimeoutMs(params.deadline);
|
|
41
|
+
return await (0, openclaw_plugin_sdk_text_utility_runtime.withTimeout)(params.work(), timeoutMs, params.label);
|
|
42
|
+
}
|
|
43
|
+
function resolveMSTeamsSharePointUploadTimeoutMs(sizeInBytes) {
|
|
44
|
+
const transferBudgetMs = Math.ceil((Number.isFinite(sizeInBytes) && sizeInBytes > 0 ? Math.ceil(sizeInBytes) : 0) / MSTEAMS_SHAREPOINT_UPLOAD_MIN_BYTES_PER_SECOND * 1e3);
|
|
45
|
+
return (0, openclaw_plugin_sdk_number_runtime.resolveTimerTimeoutMs)(MSTEAMS_SHAREPOINT_UPLOAD_BASE_TIMEOUT_MS + transferBudgetMs, MSTEAMS_SHAREPOINT_UPLOAD_BASE_TIMEOUT_MS, 1);
|
|
46
|
+
}
|
|
47
|
+
function createMSTeamsRequestTimeoutError(label, timeoutMs) {
|
|
48
|
+
const error = /* @__PURE__ */ new Error(`${label} timed out after ${timeoutMs}ms`);
|
|
49
|
+
error.name = "TimeoutError";
|
|
50
|
+
return error;
|
|
51
|
+
}
|
|
52
|
+
async function withMSTeamsAbortableRequestTimeout(params) {
|
|
53
|
+
const controller = new AbortController();
|
|
54
|
+
const timeoutMs = (0, openclaw_plugin_sdk_number_runtime.resolveTimerTimeoutMs)(params.timeoutMs, MSTEAMS_REQUEST_TIMEOUT_MS, 1);
|
|
55
|
+
const work = Promise.resolve().then(() => params.work(controller.signal));
|
|
56
|
+
try {
|
|
57
|
+
return await (0, openclaw_plugin_sdk_text_utility_runtime.withTimeout)(work, timeoutMs, { createError: () => createMSTeamsRequestTimeoutError(params.label, timeoutMs) });
|
|
58
|
+
} catch (error) {
|
|
59
|
+
controller.abort(error);
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//#endregion
|
|
18
64
|
//#region extensions/msteams/src/response-with-release.ts
|
|
19
65
|
const NULL_BODY_STATUSES = /* @__PURE__ */ new Set([
|
|
20
66
|
101,
|
|
@@ -147,7 +193,7 @@ const GRAPH_SHARED_LINK_HOST_SUFFIXES = [
|
|
|
147
193
|
function isGraphSharedLinkUrl(url) {
|
|
148
194
|
let host;
|
|
149
195
|
try {
|
|
150
|
-
host = normalizeLowercaseStringOrEmpty(new URL(url).hostname);
|
|
196
|
+
host = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeLowercaseStringOrEmpty)(new URL(url).hostname);
|
|
151
197
|
} catch {
|
|
152
198
|
return false;
|
|
153
199
|
}
|
|
@@ -160,7 +206,7 @@ function isGraphSharedLinkUrl(url) {
|
|
|
160
206
|
* https://learn.microsoft.com/en-us/graph/api/shares-get#encoding-sharing-urls
|
|
161
207
|
*/
|
|
162
208
|
function encodeGraphShareId(url) {
|
|
163
|
-
return `u!${Buffer.from(url, "utf8").toString("base64url")}`;
|
|
209
|
+
return `u!${node_buffer.Buffer.from(url, "utf8").toString("base64url")}`;
|
|
164
210
|
}
|
|
165
211
|
/**
|
|
166
212
|
* When `url` is a SharePoint/OneDrive shared link, return the matching
|
|
@@ -172,14 +218,6 @@ function tryBuildGraphSharesUrlForSharedLink(url) {
|
|
|
172
218
|
if (!isGraphSharedLinkUrl(url)) return;
|
|
173
219
|
return `${GRAPH_ROOT}/shares/${encodeGraphShareId(url)}/driveItem/content`;
|
|
174
220
|
}
|
|
175
|
-
function readNestedString(value, keys) {
|
|
176
|
-
let current = value;
|
|
177
|
-
for (const key of keys) {
|
|
178
|
-
if (!isRecord$1(current)) return;
|
|
179
|
-
current = current[key];
|
|
180
|
-
}
|
|
181
|
-
return normalizeOptionalString(current);
|
|
182
|
-
}
|
|
183
221
|
function resolveRequestUrl(input) {
|
|
184
222
|
if (typeof input === "string") return input;
|
|
185
223
|
if (input instanceof URL) return input.toString();
|
|
@@ -191,14 +229,16 @@ function resolveRequestUrl(input) {
|
|
|
191
229
|
}
|
|
192
230
|
}
|
|
193
231
|
function normalizeContentType(value) {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
232
|
+
const trimmed = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(value);
|
|
233
|
+
if (!trimmed) return;
|
|
234
|
+
const parameterIndex = trimmed.indexOf(";");
|
|
235
|
+
if (parameterIndex === -1) return trimmed.toLowerCase();
|
|
236
|
+
return `${trimmed.slice(0, parameterIndex).trim().toLowerCase()}${trimmed.slice(parameterIndex)}`;
|
|
197
237
|
}
|
|
198
238
|
function inferPlaceholder(params) {
|
|
199
|
-
const mime = normalizeLowercaseStringOrEmpty(params.contentType ?? "");
|
|
200
|
-
const name = normalizeLowercaseStringOrEmpty(params.fileName ?? "");
|
|
201
|
-
const fileType = normalizeLowercaseStringOrEmpty(params.fileType ?? "");
|
|
239
|
+
const mime = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeLowercaseStringOrEmpty)(params.contentType ?? "");
|
|
240
|
+
const name = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeLowercaseStringOrEmpty)(params.fileName ?? "");
|
|
241
|
+
const fileType = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeLowercaseStringOrEmpty)(params.fileType ?? "");
|
|
202
242
|
return mime.startsWith("image/") || IMAGE_EXT_RE.test(name) || IMAGE_EXT_RE.test(`x.${fileType}`) ? "<media:image>" : "<media:document>";
|
|
203
243
|
}
|
|
204
244
|
function isLikelyImageAttachment(att) {
|
|
@@ -206,7 +246,7 @@ function isLikelyImageAttachment(att) {
|
|
|
206
246
|
const name = typeof att.name === "string" ? att.name : "";
|
|
207
247
|
if (contentType.startsWith("image/")) return true;
|
|
208
248
|
if (IMAGE_EXT_RE.test(name)) return true;
|
|
209
|
-
if (contentType === "application/vnd.microsoft.teams.file.download.info" && isRecord
|
|
249
|
+
if (contentType === "application/vnd.microsoft.teams.file.download.info" && (0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(att.content)) {
|
|
210
250
|
const fileType = typeof att.content.fileType === "string" ? att.content.fileType : "";
|
|
211
251
|
if (fileType && IMAGE_EXT_RE.test(`x.${fileType}`)) return true;
|
|
212
252
|
const fileName = typeof att.content.fileName === "string" ? att.content.fileName : "";
|
|
@@ -219,7 +259,7 @@ function isLikelyImageAttachment(att) {
|
|
|
219
259
|
* Used when downloading all files, not just images.
|
|
220
260
|
*/
|
|
221
261
|
function isDownloadableAttachment(att) {
|
|
222
|
-
if ((normalizeContentType(att.contentType) ?? "") === "application/vnd.microsoft.teams.file.download.info" && isRecord
|
|
262
|
+
if ((normalizeContentType(att.contentType) ?? "") === "application/vnd.microsoft.teams.file.download.info" && (0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(att.content) && typeof att.content.downloadUrl === "string") return true;
|
|
223
263
|
if (typeof att.contentUrl === "string" && att.contentUrl.trim()) return true;
|
|
224
264
|
return false;
|
|
225
265
|
}
|
|
@@ -229,7 +269,7 @@ function isHtmlAttachment(att) {
|
|
|
229
269
|
function extractHtmlFromAttachment(att) {
|
|
230
270
|
if (!isHtmlAttachment(att)) return;
|
|
231
271
|
if (typeof att.content === "string") return att.content;
|
|
232
|
-
if (!isRecord
|
|
272
|
+
if (!(0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(att.content)) return;
|
|
233
273
|
return typeof att.content.text === "string" ? att.content.text : typeof att.content.body === "string" ? att.content.body : typeof att.content.content === "string" ? att.content.content : void 0;
|
|
234
274
|
}
|
|
235
275
|
function canonicalizeInlineBase64Payload(value) {
|
|
@@ -257,7 +297,7 @@ function decodeDataImageWithLimits(src, opts) {
|
|
|
257
297
|
candidate: null,
|
|
258
298
|
estimatedBytes: 0
|
|
259
299
|
};
|
|
260
|
-
const contentType = normalizeLowercaseStringOrEmpty(match[1] ?? "");
|
|
300
|
+
const contentType = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeLowercaseStringOrEmpty)(match[1] ?? "");
|
|
261
301
|
if (!Boolean(match[2])) return {
|
|
262
302
|
candidate: null,
|
|
263
303
|
estimatedBytes: 0
|
|
@@ -280,7 +320,7 @@ function decodeDataImageWithLimits(src, opts) {
|
|
|
280
320
|
return {
|
|
281
321
|
candidate: {
|
|
282
322
|
kind: "data",
|
|
283
|
-
data: Buffer.from(canonicalPayload, "base64"),
|
|
323
|
+
data: node_buffer.Buffer.from(canonicalPayload, "base64"),
|
|
284
324
|
contentType,
|
|
285
325
|
placeholder: "<media:image>"
|
|
286
326
|
},
|
|
@@ -331,16 +371,16 @@ function extractInlineImageCandidates(attachments, limits) {
|
|
|
331
371
|
}
|
|
332
372
|
function safeHostForUrl(url) {
|
|
333
373
|
try {
|
|
334
|
-
return normalizeLowercaseStringOrEmpty(new URL(url).hostname);
|
|
374
|
+
return (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeLowercaseStringOrEmpty)(new URL(url).hostname);
|
|
335
375
|
} catch {
|
|
336
376
|
return "invalid-url";
|
|
337
377
|
}
|
|
338
378
|
}
|
|
339
379
|
function resolveAllowedHosts(input) {
|
|
340
|
-
return normalizeHostnameSuffixAllowlist(input, DEFAULT_MEDIA_HOST_ALLOWLIST);
|
|
380
|
+
return (0, openclaw_plugin_sdk_ssrf_policy.normalizeHostnameSuffixAllowlist)(input, DEFAULT_MEDIA_HOST_ALLOWLIST);
|
|
341
381
|
}
|
|
342
382
|
function resolveAuthAllowedHosts(input) {
|
|
343
|
-
return normalizeHostnameSuffixAllowlist(input, DEFAULT_MEDIA_AUTH_HOST_ALLOWLIST);
|
|
383
|
+
return (0, openclaw_plugin_sdk_ssrf_policy.normalizeHostnameSuffixAllowlist)(input, DEFAULT_MEDIA_AUTH_HOST_ALLOWLIST);
|
|
344
384
|
}
|
|
345
385
|
function isMockFetchFn(fetchFn) {
|
|
346
386
|
const candidate = fetchFn;
|
|
@@ -363,7 +403,7 @@ function resolveAttachmentFetchPolicy(params) {
|
|
|
363
403
|
};
|
|
364
404
|
}
|
|
365
405
|
function isUrlAllowed(url, allowlist) {
|
|
366
|
-
return isHttpsUrlAllowedByHostnameSuffixAllowlist(url, allowlist);
|
|
406
|
+
return (0, openclaw_plugin_sdk_ssrf_policy.isHttpsUrlAllowedByHostnameSuffixAllowlist)(url, allowlist);
|
|
367
407
|
}
|
|
368
408
|
function applyAuthorizationHeaderForUrl(params) {
|
|
369
409
|
if (!params.bearerToken) {
|
|
@@ -377,7 +417,7 @@ function applyAuthorizationHeaderForUrl(params) {
|
|
|
377
417
|
params.headers.delete("Authorization");
|
|
378
418
|
}
|
|
379
419
|
function resolveMediaSsrfPolicy(allowHosts) {
|
|
380
|
-
return buildHostnameAllowlistPolicyFromSuffixAllowlist(allowHosts);
|
|
420
|
+
return (0, openclaw_plugin_sdk_ssrf_policy.buildHostnameAllowlistPolicyFromSuffixAllowlist)(allowHosts);
|
|
381
421
|
}
|
|
382
422
|
/**
|
|
383
423
|
* Returns true if the given IPv4 or IPv6 address is in a private, loopback,
|
|
@@ -387,13 +427,13 @@ function resolveMediaSsrfPolicy(allowHosts) {
|
|
|
387
427
|
* expanded notation, NAT64, 6to4, Teredo, octal IPv4, and fails closed on
|
|
388
428
|
* parse errors.
|
|
389
429
|
*/
|
|
390
|
-
const isPrivateOrReservedIP = isPrivateIpAddress;
|
|
430
|
+
const isPrivateOrReservedIP = openclaw_plugin_sdk_ssrf_policy.isPrivateIpAddress;
|
|
391
431
|
/**
|
|
392
432
|
* Resolve a hostname via DNS and reject private/reserved IPs.
|
|
393
433
|
* Throws if the resolved IP is private or resolution fails.
|
|
394
434
|
*/
|
|
395
435
|
async function resolveAndValidateIP(hostname, resolveFn) {
|
|
396
|
-
const resolve = resolveFn ?? lookup;
|
|
436
|
+
const resolve = resolveFn ?? node_dns_promises.lookup;
|
|
397
437
|
let resolved;
|
|
398
438
|
try {
|
|
399
439
|
resolved = await resolve(hostname);
|
|
@@ -414,14 +454,14 @@ const MAX_SAFE_REDIRECTS = 5;
|
|
|
414
454
|
* - DNS rebinding attacks when a lookup function is provided
|
|
415
455
|
*/
|
|
416
456
|
async function safeFetch(params) {
|
|
417
|
-
const resolveFn = params.resolveFn ?? lookup;
|
|
457
|
+
const resolveFn = params.resolveFn ?? node_dns_promises.lookup;
|
|
418
458
|
const hasDispatcher = Boolean(params.requestInit && typeof params.requestInit === "object" && "dispatcher" in params.requestInit);
|
|
419
459
|
const currentHeaders = new Headers(params.requestInit?.headers);
|
|
420
460
|
let currentUrl = params.url;
|
|
421
461
|
if (!isUrlAllowed(currentUrl, params.allowHosts)) throw new Error(`Initial download URL blocked: ${currentUrl}`);
|
|
422
462
|
if (currentHeaders.has("authorization") && params.authorizationAllowHosts && !isUrlAllowed(currentUrl, params.authorizationAllowHosts)) currentHeaders.delete("authorization");
|
|
423
463
|
if (!hasDispatcher) {
|
|
424
|
-
const guarded = await fetchWithSsrFGuard({
|
|
464
|
+
const guarded = await (0, openclaw_plugin_sdk_ssrf_runtime.fetchWithSsrFGuard)({
|
|
425
465
|
url: currentUrl,
|
|
426
466
|
fetchImpl: resolveGuardedFetchImpl({
|
|
427
467
|
fetchFn: params.fetchFn,
|
|
@@ -436,7 +476,8 @@ async function safeFetch(params) {
|
|
|
436
476
|
policy: resolveMediaSsrfPolicy(params.allowHosts),
|
|
437
477
|
lookupFn: resolveFn,
|
|
438
478
|
retainAuthorizationRedirectHostnameAllowlist: resolveRetainedAuthorizationRedirectHostnameAllowlist(params.authorizationAllowHosts),
|
|
439
|
-
auditContext: "msteams.attachment"
|
|
479
|
+
auditContext: "msteams.attachment",
|
|
480
|
+
timeoutMs: params.timeoutMs ?? 3e4
|
|
440
481
|
});
|
|
441
482
|
return responseWithRelease(guarded.response, guarded.release);
|
|
442
483
|
}
|
|
@@ -486,7 +527,8 @@ async function safeFetchWithPolicy(params) {
|
|
|
486
527
|
fetchFn: params.fetchFn,
|
|
487
528
|
fetchFnSupportsDispatcher: params.fetchFnSupportsDispatcher,
|
|
488
529
|
requestInit: params.requestInit,
|
|
489
|
-
resolveFn: params.resolveFn
|
|
530
|
+
resolveFn: params.resolveFn,
|
|
531
|
+
timeoutMs: params.timeoutMs
|
|
490
532
|
});
|
|
491
533
|
}
|
|
492
534
|
//#endregion
|
|
@@ -549,11 +591,11 @@ function validateMSTeamsProactiveServiceUrlBoundary(params) {
|
|
|
549
591
|
//#endregion
|
|
550
592
|
//#region extensions/msteams/src/http-error.ts
|
|
551
593
|
async function createMSTeamsHttpError(response, label, options) {
|
|
552
|
-
return await createProviderHttpError(response, label, options);
|
|
594
|
+
return await (0, openclaw_plugin_sdk_provider_http.createProviderHttpError)(response, label, options);
|
|
553
595
|
}
|
|
554
596
|
//#endregion
|
|
555
597
|
//#region extensions/msteams/src/bot-framework-service-url.ts
|
|
556
|
-
const BOT_FRAMEWORK_SERVICE_URL_HOST_ALLOWLIST = normalizeHostnameSuffixAllowlist([
|
|
598
|
+
const BOT_FRAMEWORK_SERVICE_URL_HOST_ALLOWLIST = (0, openclaw_plugin_sdk_ssrf_policy.normalizeHostnameSuffixAllowlist)([
|
|
557
599
|
"smba.trafficmanager.net",
|
|
558
600
|
"smba.infra.gcc.teams.microsoft.com",
|
|
559
601
|
"smba.infra.gov.teams.microsoft.us",
|
|
@@ -570,7 +612,7 @@ function describeBotFrameworkServiceUrlHost(serviceUrl) {
|
|
|
570
612
|
function isAllowedBotFrameworkServiceUrl(serviceUrl) {
|
|
571
613
|
if (typeof serviceUrl !== "string") return false;
|
|
572
614
|
const trimmed = serviceUrl.trim();
|
|
573
|
-
return Boolean(trimmed && isHttpsUrlAllowedByHostnameSuffixAllowlist(trimmed, BOT_FRAMEWORK_SERVICE_URL_HOST_ALLOWLIST));
|
|
615
|
+
return Boolean(trimmed && (0, openclaw_plugin_sdk_ssrf_policy.isHttpsUrlAllowedByHostnameSuffixAllowlist)(trimmed, BOT_FRAMEWORK_SERVICE_URL_HOST_ALLOWLIST));
|
|
574
616
|
}
|
|
575
617
|
function tryNormalizeBotFrameworkServiceUrl(serviceUrl) {
|
|
576
618
|
if (!isAllowedBotFrameworkServiceUrl(serviceUrl)) return;
|
|
@@ -586,18 +628,28 @@ function normalizeBotFrameworkServiceUrl(serviceUrl) {
|
|
|
586
628
|
let cachedUserAgent;
|
|
587
629
|
function resolveTeamsSdkVersion() {
|
|
588
630
|
try {
|
|
589
|
-
return createRequire(
|
|
631
|
+
return (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href)("@microsoft/teams.apps/package.json").version ?? "unknown";
|
|
590
632
|
} catch {
|
|
591
633
|
return "unknown";
|
|
592
634
|
}
|
|
593
635
|
}
|
|
594
636
|
function resolveOpenClawVersion() {
|
|
595
637
|
try {
|
|
596
|
-
return getMSTeamsRuntime().version;
|
|
638
|
+
return require_runtime.getMSTeamsRuntime().version;
|
|
597
639
|
} catch {
|
|
598
640
|
return "unknown";
|
|
599
641
|
}
|
|
600
642
|
}
|
|
643
|
+
/**
|
|
644
|
+
* Build a combined User-Agent string that preserves the Teams SDK identity
|
|
645
|
+
* and appends the OpenClaw version.
|
|
646
|
+
*
|
|
647
|
+
* Format: "teams.ts[apps]/<sdk-version> OpenClaw/<openclaw-version>"
|
|
648
|
+
* Example: "teams.ts[apps]/2.0.5 OpenClaw/2026.3.22"
|
|
649
|
+
*
|
|
650
|
+
* This lets the Teams backend track SDK usage while also identifying the
|
|
651
|
+
* host application.
|
|
652
|
+
*/
|
|
601
653
|
function buildUserAgent() {
|
|
602
654
|
if (cachedUserAgent) return cachedUserAgent;
|
|
603
655
|
cachedUserAgent = `teams.ts[apps]/${resolveTeamsSdkVersion()} OpenClaw/${resolveOpenClawVersion()}`;
|
|
@@ -622,8 +674,8 @@ function ensureUserAgentHeader(headers) {
|
|
|
622
674
|
//#endregion
|
|
623
675
|
//#region extensions/msteams/src/sdk.ts
|
|
624
676
|
const AZURE_IDENTITY_MODULE = "@azure/identity";
|
|
625
|
-
const loadAzureIdentity = createLazyRuntimeModule(() => import(AZURE_IDENTITY_MODULE));
|
|
626
|
-
const loadSdkModules = createLazyRuntimeModule(() => Promise.all([import("@microsoft/teams.apps"), import("@microsoft/teams.api")]).then(([apps, api]) => ({
|
|
677
|
+
const loadAzureIdentity = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeModule)(() => import(AZURE_IDENTITY_MODULE));
|
|
678
|
+
const loadSdkModules = (0, openclaw_plugin_sdk_lazy_runtime.createLazyRuntimeModule)(() => Promise.all([import("@microsoft/teams.apps"), import("@microsoft/teams.api")]).then(([apps, api]) => ({
|
|
627
679
|
App: apps.App,
|
|
628
680
|
ExpressAdapter: apps.ExpressAdapter,
|
|
629
681
|
cloudFromName: api.cloudFromName
|
|
@@ -652,7 +704,10 @@ async function createMSTeamsApp(creds, options) {
|
|
|
652
704
|
const cloud = options?.cloud ?? "Public";
|
|
653
705
|
const serviceUrl = options?.serviceUrl ? normalizeBotFrameworkServiceUrl(options.serviceUrl) : void 0;
|
|
654
706
|
const appOptions = {
|
|
655
|
-
client: options?.httpClient ?? {
|
|
707
|
+
client: options?.httpClient ?? {
|
|
708
|
+
headers: { "User-Agent": buildOpenClawUserAgentFragment() },
|
|
709
|
+
timeout: 3e4
|
|
710
|
+
},
|
|
656
711
|
...options?.httpServerAdapter ? { httpServerAdapter: options.httpServerAdapter } : {},
|
|
657
712
|
...options?.messagingEndpoint ? { messagingEndpoint: options.messagingEndpoint } : {},
|
|
658
713
|
cloud: cloudFromName(cloud),
|
|
@@ -677,7 +732,7 @@ function createFederatedApp(creds, App, appOptions) {
|
|
|
677
732
|
if (!creds.certificatePath) throw new Error("Federated credentials require either a certificate path or managed identity.");
|
|
678
733
|
let privateKey;
|
|
679
734
|
try {
|
|
680
|
-
privateKey =
|
|
735
|
+
privateKey = node_fs.readFileSync(creds.certificatePath, "utf-8");
|
|
681
736
|
} catch (err) {
|
|
682
737
|
const msg = err instanceof Error ? err.message : String(err);
|
|
683
738
|
throw new Error(`Failed to read certificate file at '${creds.certificatePath}': ${msg}`, { cause: err });
|
|
@@ -765,7 +820,7 @@ function createMSTeamsTokenBody(params) {
|
|
|
765
820
|
return body;
|
|
766
821
|
}
|
|
767
822
|
function resolveMSTeamsTokenExpiresAt(value) {
|
|
768
|
-
return resolveExpiresAtMsFromDurationSeconds(value, { bufferMs: EXPIRY_BUFFER_MS });
|
|
823
|
+
return (0, openclaw_plugin_sdk_number_runtime.resolveExpiresAtMsFromDurationSeconds)(value, { bufferMs: EXPIRY_BUFFER_MS });
|
|
769
824
|
}
|
|
770
825
|
function parseMSTeamsTokenResponse(data, failureLabel) {
|
|
771
826
|
const expiresAt = resolveMSTeamsTokenExpiresAt(data.expires_in);
|
|
@@ -778,10 +833,8 @@ function parseMSTeamsTokenResponse(data, failureLabel) {
|
|
|
778
833
|
};
|
|
779
834
|
}
|
|
780
835
|
async function fetchMSTeamsTokens(params) {
|
|
781
|
-
const
|
|
782
|
-
const { response, release } = await fetchWithSsrFGuard({
|
|
836
|
+
const { response, release } = await (0, openclaw_plugin_sdk_ssrf_runtime.fetchWithSsrFGuard)({
|
|
783
837
|
url: params.tokenUrl,
|
|
784
|
-
fetchImpl: async (input, guardedInit) => await currentFetch(input, guardedInit),
|
|
785
838
|
init: {
|
|
786
839
|
method: "POST",
|
|
787
840
|
headers: {
|
|
@@ -795,7 +848,7 @@ async function fetchMSTeamsTokens(params) {
|
|
|
795
848
|
});
|
|
796
849
|
try {
|
|
797
850
|
if (!response.ok) throw await createMSTeamsHttpError(response, `MSTeams ${params.failureLabel} failed`);
|
|
798
|
-
return parseMSTeamsTokenResponse(await readProviderJsonResponse(response, `MSTeams ${params.failureLabel} failed`), params.failureLabel);
|
|
851
|
+
return parseMSTeamsTokenResponse(await (0, openclaw_plugin_sdk_provider_http.readProviderJsonResponse)(response, `MSTeams ${params.failureLabel} failed`), params.failureLabel);
|
|
799
852
|
} finally {
|
|
800
853
|
await release();
|
|
801
854
|
}
|
|
@@ -859,10 +912,10 @@ async function refreshMSTeamsDelegatedTokens(params) {
|
|
|
859
912
|
//#region extensions/msteams/src/storage.ts
|
|
860
913
|
function resolveMSTeamsStorePath(params) {
|
|
861
914
|
if (params.storePath) return params.storePath;
|
|
862
|
-
if (params.stateDir) return
|
|
915
|
+
if (params.stateDir) return node_path.default.join(params.stateDir, params.filename);
|
|
863
916
|
const env = params.env ?? process.env;
|
|
864
|
-
const stateDir = params.homedir ? getMSTeamsRuntime().state.resolveStateDir(env, params.homedir) : getMSTeamsRuntime().state.resolveStateDir(env);
|
|
865
|
-
return
|
|
917
|
+
const stateDir = params.homedir ? require_runtime.getMSTeamsRuntime().state.resolveStateDir(env, params.homedir) : require_runtime.getMSTeamsRuntime().state.resolveStateDir(env);
|
|
918
|
+
return node_path.default.join(stateDir, params.filename);
|
|
866
919
|
}
|
|
867
920
|
//#endregion
|
|
868
921
|
//#region extensions/msteams/src/token.ts
|
|
@@ -874,19 +927,19 @@ function resolveAuthType(cfg) {
|
|
|
874
927
|
}
|
|
875
928
|
function hasConfiguredMSTeamsCredentials(cfg) {
|
|
876
929
|
const authType = resolveAuthType(cfg);
|
|
877
|
-
const hasAppId = Boolean(normalizeSecretInputString(cfg?.appId) || normalizeSecretInputString(process.env.MSTEAMS_APP_ID));
|
|
878
|
-
const hasTenantId = Boolean(normalizeSecretInputString(cfg?.tenantId) || normalizeSecretInputString(process.env.MSTEAMS_TENANT_ID));
|
|
930
|
+
const hasAppId = Boolean((0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.appId) || (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_APP_ID));
|
|
931
|
+
const hasTenantId = Boolean((0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.tenantId) || (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_TENANT_ID));
|
|
879
932
|
if (authType === "federated") {
|
|
880
933
|
const hasCert = Boolean(cfg?.certificatePath || process.env.MSTEAMS_CERTIFICATE_PATH);
|
|
881
934
|
const hasManagedIdentity = cfg?.useManagedIdentity ?? process.env.MSTEAMS_USE_MANAGED_IDENTITY === "true";
|
|
882
935
|
return hasAppId && hasTenantId && (hasCert || hasManagedIdentity);
|
|
883
936
|
}
|
|
884
|
-
return Boolean(normalizeSecretInputString(cfg?.appId) && hasConfiguredSecretInput(cfg?.appPassword) && normalizeSecretInputString(cfg?.tenantId));
|
|
937
|
+
return Boolean((0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.appId) && (0, openclaw_plugin_sdk_secret_input.hasConfiguredSecretInput)(cfg?.appPassword) && (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.tenantId));
|
|
885
938
|
}
|
|
886
939
|
function resolveMSTeamsCredentials(cfg) {
|
|
887
940
|
const authType = resolveAuthType(cfg);
|
|
888
|
-
const appId = normalizeSecretInputString(cfg?.appId) || normalizeSecretInputString(process.env.MSTEAMS_APP_ID);
|
|
889
|
-
const tenantId = normalizeSecretInputString(cfg?.tenantId) || normalizeSecretInputString(process.env.MSTEAMS_TENANT_ID);
|
|
941
|
+
const appId = (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.appId) || (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_APP_ID);
|
|
942
|
+
const tenantId = (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(cfg?.tenantId) || (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_TENANT_ID);
|
|
890
943
|
if (!appId || !tenantId) return;
|
|
891
944
|
if (authType === "federated") {
|
|
892
945
|
const certificatePath = cfg?.certificatePath || process.env.MSTEAMS_CERTIFICATE_PATH || void 0;
|
|
@@ -904,10 +957,10 @@ function resolveMSTeamsCredentials(cfg) {
|
|
|
904
957
|
managedIdentityClientId
|
|
905
958
|
};
|
|
906
959
|
}
|
|
907
|
-
const appPassword = normalizeResolvedSecretInputString({
|
|
960
|
+
const appPassword = (0, openclaw_plugin_sdk_secret_input.normalizeResolvedSecretInputString)({
|
|
908
961
|
value: cfg?.appPassword,
|
|
909
962
|
path: "channels.msteams.appPassword"
|
|
910
|
-
}) || normalizeSecretInputString(process.env.MSTEAMS_APP_PASSWORD);
|
|
963
|
+
}) || (0, openclaw_plugin_sdk_secret_input.normalizeSecretInputString)(process.env.MSTEAMS_APP_PASSWORD);
|
|
911
964
|
if (!appPassword) return;
|
|
912
965
|
return {
|
|
913
966
|
type: "secret",
|
|
@@ -922,7 +975,7 @@ function resolveDelegatedTokenPath() {
|
|
|
922
975
|
}
|
|
923
976
|
function loadDelegatedTokens() {
|
|
924
977
|
try {
|
|
925
|
-
const content = readFileSync(resolveDelegatedTokenPath(), "utf8");
|
|
978
|
+
const content = (0, node_fs.readFileSync)(resolveDelegatedTokenPath(), "utf8");
|
|
926
979
|
return JSON.parse(content);
|
|
927
980
|
} catch {
|
|
928
981
|
return;
|
|
@@ -930,12 +983,12 @@ function loadDelegatedTokens() {
|
|
|
930
983
|
}
|
|
931
984
|
function saveDelegatedTokens(tokens) {
|
|
932
985
|
const tokenPath = resolveDelegatedTokenPath();
|
|
933
|
-
privateFileStoreSync(dirname(tokenPath)).writeJson(basename(tokenPath), tokens);
|
|
986
|
+
(0, openclaw_plugin_sdk_security_runtime.privateFileStoreSync)((0, node_path.dirname)(tokenPath)).writeJson((0, node_path.basename)(tokenPath), tokens);
|
|
934
987
|
}
|
|
935
988
|
async function resolveDelegatedAccessToken(params) {
|
|
936
989
|
const tokens = loadDelegatedTokens();
|
|
937
990
|
if (!tokens) return;
|
|
938
|
-
if (isFutureDateTimestampMs(tokens.expiresAt)) return tokens.accessToken;
|
|
991
|
+
if ((0, openclaw_plugin_sdk_number_runtime.isFutureDateTimestampMs)(tokens.expiresAt)) return tokens.accessToken;
|
|
939
992
|
try {
|
|
940
993
|
const refreshed = await refreshMSTeamsDelegatedTokens({
|
|
941
994
|
tenantId: params.tenantId,
|
|
@@ -961,11 +1014,8 @@ function escapeOData(value) {
|
|
|
961
1014
|
}
|
|
962
1015
|
async function requestGraph(params) {
|
|
963
1016
|
const hasBody = params.body !== void 0;
|
|
964
|
-
const
|
|
965
|
-
|
|
966
|
-
const { response, release } = await fetchWithSsrFGuard$1({
|
|
967
|
-
url,
|
|
968
|
-
fetchImpl: async (input, guardedInit) => await currentFetch(input, guardedInit),
|
|
1017
|
+
const { response, release } = await (0, openclaw_plugin_sdk_ssrf_runtime.fetchWithSsrFGuard)({
|
|
1018
|
+
url: `${params.root ?? "https://graph.microsoft.com/v1.0"}${params.path}`,
|
|
969
1019
|
init: {
|
|
970
1020
|
method: params.method,
|
|
971
1021
|
headers: {
|
|
@@ -976,7 +1026,8 @@ async function requestGraph(params) {
|
|
|
976
1026
|
},
|
|
977
1027
|
body: hasBody ? JSON.stringify(params.body) : void 0
|
|
978
1028
|
},
|
|
979
|
-
auditContext: "msteams.graph"
|
|
1029
|
+
auditContext: "msteams.graph",
|
|
1030
|
+
timeoutMs: resolveMSTeamsRequestTimeoutMs(params.deadline)
|
|
980
1031
|
});
|
|
981
1032
|
let releaseInFinally = true;
|
|
982
1033
|
try {
|
|
@@ -989,7 +1040,7 @@ async function requestGraph(params) {
|
|
|
989
1040
|
}
|
|
990
1041
|
async function readOptionalGraphJson(res, label) {
|
|
991
1042
|
if (res.status === 204 || res.headers?.get?.("content-length") === "0") return;
|
|
992
|
-
return await readProviderJsonResponse(res, label);
|
|
1043
|
+
return await (0, openclaw_plugin_sdk_provider_http.readProviderJsonResponse)(res, label);
|
|
993
1044
|
}
|
|
994
1045
|
async function fetchGraphJson(params) {
|
|
995
1046
|
return await readOptionalGraphJson(await requestGraph({
|
|
@@ -997,7 +1048,8 @@ async function fetchGraphJson(params) {
|
|
|
997
1048
|
path: params.path,
|
|
998
1049
|
method: params.method,
|
|
999
1050
|
body: params.body,
|
|
1000
|
-
headers: params.headers
|
|
1051
|
+
headers: params.headers,
|
|
1052
|
+
deadline: params.deadline
|
|
1001
1053
|
}), `Graph ${params.path} failed`);
|
|
1002
1054
|
}
|
|
1003
1055
|
/**
|
|
@@ -1005,18 +1057,19 @@ async function fetchGraphJson(params) {
|
|
|
1005
1057
|
* pagination URLs) without prepending GRAPH_ROOT.
|
|
1006
1058
|
*/
|
|
1007
1059
|
async function fetchGraphAbsoluteUrl(params) {
|
|
1008
|
-
const { response, release } = await fetchWithSsrFGuard
|
|
1060
|
+
const { response, release } = await (0, openclaw_plugin_sdk_ssrf_runtime.fetchWithSsrFGuard)({
|
|
1009
1061
|
url: params.url,
|
|
1010
1062
|
init: { headers: {
|
|
1011
1063
|
"User-Agent": buildUserAgent(),
|
|
1012
1064
|
Authorization: `Bearer ${params.token}`,
|
|
1013
1065
|
...params.headers
|
|
1014
1066
|
} },
|
|
1015
|
-
auditContext: "msteams.graph.absolute"
|
|
1067
|
+
auditContext: "msteams.graph.absolute",
|
|
1068
|
+
timeoutMs: MSTEAMS_REQUEST_TIMEOUT_MS
|
|
1016
1069
|
});
|
|
1017
1070
|
try {
|
|
1018
1071
|
if (!response.ok) throw await createMSTeamsHttpError(response, `Graph ${params.url} failed`);
|
|
1019
|
-
return await readProviderJsonResponse(response, `Graph ${params.url} failed`);
|
|
1072
|
+
return await (0, openclaw_plugin_sdk_provider_http.readProviderJsonResponse)(response, `Graph ${params.url} failed`);
|
|
1020
1073
|
} finally {
|
|
1021
1074
|
await release();
|
|
1022
1075
|
}
|
|
@@ -1076,13 +1129,14 @@ async function resolveGraphToken(cfg, options) {
|
|
|
1076
1129
|
return accessToken;
|
|
1077
1130
|
}
|
|
1078
1131
|
async function listTeamsByName(token, query) {
|
|
1132
|
+
return (await listTeamsByNameWithPageInfo(token, query)).items;
|
|
1133
|
+
}
|
|
1134
|
+
async function listTeamsByNameWithPageInfo(token, query) {
|
|
1079
1135
|
const filter = `resourceProvisioningOptions/Any(x:x eq 'Team') and startsWith(displayName,'${escapeOData(query)}')`;
|
|
1080
|
-
|
|
1136
|
+
return await fetchAllGraphPages({
|
|
1081
1137
|
token,
|
|
1082
|
-
path: `/groups?$filter=${encodeURIComponent(filter)}&$select=id,displayName
|
|
1083
|
-
maxPages: 5
|
|
1138
|
+
path: `/groups?$filter=${encodeURIComponent(filter)}&$select=id,displayName`
|
|
1084
1139
|
});
|
|
1085
|
-
return items;
|
|
1086
1140
|
}
|
|
1087
1141
|
async function postGraphJson(params) {
|
|
1088
1142
|
return readOptionalGraphJson(await requestGraph({
|
|
@@ -1121,12 +1175,13 @@ async function patchGraphJson(params) {
|
|
|
1121
1175
|
}), `Graph PATCH ${params.path} failed`);
|
|
1122
1176
|
}
|
|
1123
1177
|
async function listChannelsForTeam(token, teamId) {
|
|
1124
|
-
|
|
1178
|
+
return (await listChannelsForTeamWithPageInfo(token, teamId)).items;
|
|
1179
|
+
}
|
|
1180
|
+
async function listChannelsForTeamWithPageInfo(token, teamId) {
|
|
1181
|
+
return await fetchAllGraphPages({
|
|
1125
1182
|
token,
|
|
1126
|
-
path: `/teams/${encodeURIComponent(teamId)}/channels?$select=id,displayName
|
|
1127
|
-
maxPages: 10
|
|
1183
|
+
path: `/teams/${encodeURIComponent(teamId)}/channels?$select=id,displayName`
|
|
1128
1184
|
});
|
|
1129
|
-
return items;
|
|
1130
1185
|
}
|
|
1131
1186
|
//#endregion
|
|
1132
1187
|
//#region extensions/msteams/src/graph-users.ts
|
|
@@ -1150,8 +1205,64 @@ async function searchGraphUsers(params) {
|
|
|
1150
1205
|
headers: { ConsistencyLevel: "eventual" }
|
|
1151
1206
|
})).value ?? [];
|
|
1152
1207
|
}
|
|
1208
|
+
async function findGraphUsersByExactIdentity(params) {
|
|
1209
|
+
const query = params.query.trim();
|
|
1210
|
+
if (!query) return {
|
|
1211
|
+
items: [],
|
|
1212
|
+
truncated: false
|
|
1213
|
+
};
|
|
1214
|
+
const escaped = escapeOData(query);
|
|
1215
|
+
const filter = `(displayName eq '${escaped}' or mail eq '${escaped}' or userPrincipalName eq '${escaped}')`;
|
|
1216
|
+
const path = `/users?$filter=${encodeURIComponent(filter)}&\$select=id,displayName,mail,userPrincipalName`;
|
|
1217
|
+
return await fetchAllGraphPages({
|
|
1218
|
+
token: params.token,
|
|
1219
|
+
path
|
|
1220
|
+
});
|
|
1221
|
+
}
|
|
1153
1222
|
//#endregion
|
|
1154
1223
|
//#region extensions/msteams/src/resolve-allowlist.ts
|
|
1224
|
+
function normalizeExactMatch(value) {
|
|
1225
|
+
return (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeLowercaseStringOrEmpty)(value ?? "");
|
|
1226
|
+
}
|
|
1227
|
+
function uniqueItemsById(items) {
|
|
1228
|
+
const byId = /* @__PURE__ */ new Map();
|
|
1229
|
+
for (const item of items) {
|
|
1230
|
+
const id = item.id?.trim();
|
|
1231
|
+
if (id && !byId.has(id)) byId.set(id, item);
|
|
1232
|
+
}
|
|
1233
|
+
return [...byId.values()];
|
|
1234
|
+
}
|
|
1235
|
+
function findExactTeams(items, query) {
|
|
1236
|
+
const normalized = normalizeExactMatch(query);
|
|
1237
|
+
return uniqueItemsById(items.filter((item) => normalizeExactMatch(item.displayName) === normalized));
|
|
1238
|
+
}
|
|
1239
|
+
function findExactChannels(items, query) {
|
|
1240
|
+
const normalized = normalizeExactMatch(query);
|
|
1241
|
+
return uniqueItemsById(items.filter((item) => normalizeExactMatch(item.displayName) === normalized));
|
|
1242
|
+
}
|
|
1243
|
+
function findExactUsers(items, query) {
|
|
1244
|
+
const normalized = normalizeExactMatch(query);
|
|
1245
|
+
return uniqueItemsById(items.filter((item) => [
|
|
1246
|
+
item.displayName,
|
|
1247
|
+
item.mail,
|
|
1248
|
+
item.userPrincipalName
|
|
1249
|
+
].some((value) => normalizeExactMatch(value) === normalized)));
|
|
1250
|
+
}
|
|
1251
|
+
function isStableMSTeamsUserId(raw) {
|
|
1252
|
+
return /^[0-9a-fA-F-]{16,}$/.test(normalizeMSTeamsUserInput(raw));
|
|
1253
|
+
}
|
|
1254
|
+
function normalizeStaticMSTeamsAllowEntry(raw) {
|
|
1255
|
+
const trimmed = raw.trim();
|
|
1256
|
+
if (!trimmed) return;
|
|
1257
|
+
if (trimmed === "*" || /^accessGroup:/i.test(trimmed)) return trimmed;
|
|
1258
|
+
const id = normalizeMSTeamsUserInput(trimmed);
|
|
1259
|
+
return isStableMSTeamsUserId(id) ? id : void 0;
|
|
1260
|
+
}
|
|
1261
|
+
function projectStableMSTeamsUserAllowlist(entries) {
|
|
1262
|
+
if (!entries) return;
|
|
1263
|
+
const projected = entries.map((entry) => normalizeStaticMSTeamsAllowEntry(entry)).filter((entry) => Boolean(entry));
|
|
1264
|
+
return [...new Map(projected.map((entry) => [normalizeExactMatch(entry), entry])).values()];
|
|
1265
|
+
}
|
|
1155
1266
|
function stripProviderPrefix(raw) {
|
|
1156
1267
|
return raw.replace(/^(msteams|teams):/i, "");
|
|
1157
1268
|
}
|
|
@@ -1178,37 +1289,39 @@ function parseMSTeamsConversationId(raw) {
|
|
|
1178
1289
|
return trimmed.slice(13).trim();
|
|
1179
1290
|
}
|
|
1180
1291
|
/**
|
|
1181
|
-
* Detect whether a raw target string
|
|
1182
|
-
*
|
|
1183
|
-
* forward verbatim to the channel adapter.
|
|
1292
|
+
* Detect whether a raw target string is a supported Microsoft Teams
|
|
1293
|
+
* conversation id.
|
|
1184
1294
|
*
|
|
1185
1295
|
* Accepts both prefixed and bare formats:
|
|
1186
1296
|
* - `conversation:<id>` — explicit conversation prefix
|
|
1187
|
-
* - `user:<aad-guid>` — user id (16+ hex chars, UUID-like)
|
|
1188
1297
|
* - `19:abc@thread.tacv2` / `19:abc@thread.skype` — channel / legacy group
|
|
1189
1298
|
* - `19:{userId}_{appId}@unq.gbl.spaces` — Graph 1:1 chat thread format
|
|
1190
1299
|
* - `a:1xxx` — Bot Framework personal (1:1) chat id
|
|
1191
1300
|
* - `8:orgid:xxx` — Bot Framework org-scoped personal chat id
|
|
1192
|
-
* - `29:xxx` — Bot Framework user id
|
|
1193
|
-
*
|
|
1194
|
-
* Display-name user targets such as `user:John Smith` intentionally return
|
|
1195
|
-
* false so that the Graph API directory lookup still runs for them.
|
|
1196
1301
|
*/
|
|
1197
|
-
function
|
|
1302
|
+
function looksLikeMSTeamsConversationId(raw) {
|
|
1198
1303
|
const trimmed = raw.trim();
|
|
1199
1304
|
if (!trimmed) return false;
|
|
1200
1305
|
if (/^conversation:/i.test(trimmed)) return true;
|
|
1201
|
-
if (/^user:/i.test(trimmed)) {
|
|
1202
|
-
const id = trimmed.slice(5).trim();
|
|
1203
|
-
return /^[0-9a-fA-F-]{16,}$/.test(id);
|
|
1204
|
-
}
|
|
1205
1306
|
if (/^19:.+@thread\.(tacv2|skype)$/i.test(trimmed)) return true;
|
|
1206
1307
|
if (/^19:.+@unq\.gbl\.spaces$/i.test(trimmed)) return true;
|
|
1207
1308
|
if (/^a:1[A-Za-z0-9_-]+$/i.test(trimmed)) return true;
|
|
1208
1309
|
if (/^8:orgid:[A-Za-z0-9-]+$/i.test(trimmed)) return true;
|
|
1209
|
-
if (/^29:[A-Za-z0-9_-]+$/i.test(trimmed)) return true;
|
|
1210
1310
|
return /@thread\b/i.test(trimmed);
|
|
1211
1311
|
}
|
|
1312
|
+
/**
|
|
1313
|
+
* Detect conversation ids plus stable user ids that explicit-target delivery
|
|
1314
|
+
* can forward verbatim to the channel adapter.
|
|
1315
|
+
*/
|
|
1316
|
+
function looksLikeMSTeamsTargetId(raw) {
|
|
1317
|
+
const trimmed = raw.trim();
|
|
1318
|
+
if (looksLikeMSTeamsConversationId(trimmed)) return true;
|
|
1319
|
+
if (/^user:/i.test(trimmed)) {
|
|
1320
|
+
const id = trimmed.slice(5).trim();
|
|
1321
|
+
return /^[0-9a-fA-F-]{16,}$/.test(id);
|
|
1322
|
+
}
|
|
1323
|
+
return /^29:[A-Za-z0-9_-]+$/i.test(trimmed);
|
|
1324
|
+
}
|
|
1212
1325
|
function normalizeMSTeamsTeamKey(raw) {
|
|
1213
1326
|
return stripProviderPrefix(raw).replace(/^team:/i, "").trim() || void 0;
|
|
1214
1327
|
}
|
|
@@ -1223,6 +1336,33 @@ function looksLikeMSTeamsThreadConversationId(raw) {
|
|
|
1223
1336
|
const normalized = normalizeMSTeamsConversationTargetId(raw);
|
|
1224
1337
|
return /^19:.+@thread\./i.test(normalized);
|
|
1225
1338
|
}
|
|
1339
|
+
function isStableMSTeamsTeamKey(raw) {
|
|
1340
|
+
return /^[0-9a-fA-F-]{16,}$/.test(raw.trim()) || looksLikeMSTeamsThreadConversationId(raw);
|
|
1341
|
+
}
|
|
1342
|
+
function projectStableMSTeamsChannels(channels) {
|
|
1343
|
+
const projected = {};
|
|
1344
|
+
for (const [channelKey, channelConfig] of Object.entries(channels ?? {})) {
|
|
1345
|
+
if (channelKey === "*") {
|
|
1346
|
+
projected[channelKey] = channelConfig;
|
|
1347
|
+
continue;
|
|
1348
|
+
}
|
|
1349
|
+
if (looksLikeMSTeamsThreadConversationId(channelKey)) projected[normalizeMSTeamsConversationTargetId(channelKey)] = channelConfig;
|
|
1350
|
+
}
|
|
1351
|
+
return projected;
|
|
1352
|
+
}
|
|
1353
|
+
function projectStableMSTeamsTeamsConfig(teams) {
|
|
1354
|
+
if (!teams) return;
|
|
1355
|
+
const projected = {};
|
|
1356
|
+
for (const [teamKey, teamConfig] of Object.entries(teams)) {
|
|
1357
|
+
if (teamKey !== "*" && !isStableMSTeamsTeamKey(teamKey)) continue;
|
|
1358
|
+
const stableKey = teamKey === "*" ? teamKey : normalizeMSTeamsConversationTargetId(teamKey);
|
|
1359
|
+
projected[stableKey] = {
|
|
1360
|
+
...teamConfig,
|
|
1361
|
+
channels: projectStableMSTeamsChannels(teamConfig.channels)
|
|
1362
|
+
};
|
|
1363
|
+
}
|
|
1364
|
+
return projected;
|
|
1365
|
+
}
|
|
1226
1366
|
function parseMSTeamsTeamChannelInput(raw) {
|
|
1227
1367
|
const trimmed = stripProviderPrefix(raw).trim();
|
|
1228
1368
|
if (!trimmed) return {};
|
|
@@ -1248,7 +1388,7 @@ async function resolveMSTeamsChannelAllowlist(params) {
|
|
|
1248
1388
|
tokenPromise ??= resolveGraphToken(params.cfg);
|
|
1249
1389
|
return tokenPromise;
|
|
1250
1390
|
};
|
|
1251
|
-
return await mapAllowlistResolutionInputs({
|
|
1391
|
+
return await (0, openclaw_plugin_sdk_allow_from.mapAllowlistResolutionInputs)({
|
|
1252
1392
|
inputs: params.entries,
|
|
1253
1393
|
mapInput: async (input) => {
|
|
1254
1394
|
const { team, channel } = parseMSTeamsTeamChannelInput(input);
|
|
@@ -1282,16 +1422,32 @@ async function resolveMSTeamsChannelAllowlist(params) {
|
|
|
1282
1422
|
};
|
|
1283
1423
|
}
|
|
1284
1424
|
const token = await getToken();
|
|
1285
|
-
|
|
1425
|
+
let teamMatch;
|
|
1426
|
+
if (/^[0-9a-fA-F-]{16,}$/.test(team)) teamMatch = {
|
|
1286
1427
|
id: team,
|
|
1287
1428
|
displayName: team
|
|
1288
|
-
}] : await listTeamsByName(token, team);
|
|
1289
|
-
if (teams.length === 0) return {
|
|
1290
|
-
input,
|
|
1291
|
-
resolved: false,
|
|
1292
|
-
note: "team not found"
|
|
1293
1429
|
};
|
|
1294
|
-
|
|
1430
|
+
else {
|
|
1431
|
+
const result = await listTeamsByNameWithPageInfo(token, team);
|
|
1432
|
+
if (result.truncated) return {
|
|
1433
|
+
input,
|
|
1434
|
+
resolved: false,
|
|
1435
|
+
note: "team lookup incomplete"
|
|
1436
|
+
};
|
|
1437
|
+
const exactTeams = findExactTeams(result.items, team);
|
|
1438
|
+
const [exactTeam] = exactTeams;
|
|
1439
|
+
if (!exactTeam) return {
|
|
1440
|
+
input,
|
|
1441
|
+
resolved: false,
|
|
1442
|
+
note: "team not found"
|
|
1443
|
+
};
|
|
1444
|
+
if (exactTeams.length > 1) return {
|
|
1445
|
+
input,
|
|
1446
|
+
resolved: false,
|
|
1447
|
+
note: "team name is ambiguous"
|
|
1448
|
+
};
|
|
1449
|
+
teamMatch = exactTeam;
|
|
1450
|
+
}
|
|
1295
1451
|
const graphTeamId = teamMatch.id?.trim();
|
|
1296
1452
|
const teamName = teamMatch.displayName?.trim() || team;
|
|
1297
1453
|
if (!graphTeamId) return {
|
|
@@ -1299,40 +1455,158 @@ async function resolveMSTeamsChannelAllowlist(params) {
|
|
|
1299
1455
|
resolved: false,
|
|
1300
1456
|
note: "team id missing"
|
|
1301
1457
|
};
|
|
1302
|
-
|
|
1458
|
+
if (!(params.teamIdMode !== "graph" || Boolean(channel))) return {
|
|
1459
|
+
input,
|
|
1460
|
+
resolved: true,
|
|
1461
|
+
teamId: graphTeamId,
|
|
1462
|
+
graphTeamId,
|
|
1463
|
+
teamName
|
|
1464
|
+
};
|
|
1465
|
+
let teamChannels;
|
|
1303
1466
|
try {
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1467
|
+
const result = await listChannelsForTeamWithPageInfo(token, graphTeamId);
|
|
1468
|
+
if (result.truncated) return {
|
|
1469
|
+
input,
|
|
1470
|
+
resolved: false,
|
|
1471
|
+
note: "channel lookup incomplete"
|
|
1472
|
+
};
|
|
1473
|
+
teamChannels = result.items;
|
|
1474
|
+
} catch {
|
|
1475
|
+
return {
|
|
1476
|
+
input,
|
|
1477
|
+
resolved: false,
|
|
1478
|
+
note: "channel lookup failed"
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
const generalChannels = findExactChannels(teamChannels, "general");
|
|
1482
|
+
if (params.teamIdMode !== "graph" && generalChannels.length !== 1) return {
|
|
1483
|
+
input,
|
|
1484
|
+
resolved: false,
|
|
1485
|
+
graphTeamId,
|
|
1486
|
+
teamName,
|
|
1487
|
+
note: generalChannels.length > 1 ? "General channel is ambiguous" : "General channel not found"
|
|
1488
|
+
};
|
|
1489
|
+
const teamId = generalChannels[0]?.id?.trim() || graphTeamId;
|
|
1307
1490
|
if (!channel) return {
|
|
1308
1491
|
input,
|
|
1309
1492
|
resolved: true,
|
|
1310
1493
|
teamId,
|
|
1311
|
-
|
|
1312
|
-
|
|
1494
|
+
graphTeamId,
|
|
1495
|
+
teamName
|
|
1313
1496
|
};
|
|
1314
|
-
const
|
|
1315
|
-
const
|
|
1316
|
-
if (
|
|
1497
|
+
const channelById = teamChannels.find((item) => item.id === channel);
|
|
1498
|
+
const exactChannels = channelById ? [channelById] : findExactChannels(teamChannels, channel);
|
|
1499
|
+
if (exactChannels.length === 0) return {
|
|
1317
1500
|
input,
|
|
1318
1501
|
resolved: false,
|
|
1319
1502
|
note: "channel not found"
|
|
1320
1503
|
};
|
|
1504
|
+
if (exactChannels.length > 1) return {
|
|
1505
|
+
input,
|
|
1506
|
+
resolved: false,
|
|
1507
|
+
note: "channel name is ambiguous"
|
|
1508
|
+
};
|
|
1509
|
+
const channelMatch = exactChannels[0];
|
|
1510
|
+
if (!channelMatch?.id) return {
|
|
1511
|
+
input,
|
|
1512
|
+
resolved: false,
|
|
1513
|
+
note: "channel id missing"
|
|
1514
|
+
};
|
|
1321
1515
|
return {
|
|
1322
1516
|
input,
|
|
1323
1517
|
resolved: true,
|
|
1324
1518
|
teamId,
|
|
1519
|
+
graphTeamId,
|
|
1325
1520
|
teamName,
|
|
1326
1521
|
channelId: channelMatch.id,
|
|
1327
|
-
channelName: channelMatch.displayName ?? channel
|
|
1328
|
-
|
|
1522
|
+
channelName: channelMatch.displayName ?? channel
|
|
1523
|
+
};
|
|
1524
|
+
}
|
|
1525
|
+
});
|
|
1526
|
+
}
|
|
1527
|
+
async function resolveMSTeamsTeamsConfig(params) {
|
|
1528
|
+
const entries = [];
|
|
1529
|
+
const unresolved = [];
|
|
1530
|
+
for (const [teamKey, teamCfg] of Object.entries(params.teams)) {
|
|
1531
|
+
if (teamKey === "*") {
|
|
1532
|
+
for (const channelKey of Object.keys(teamCfg?.channels ?? {})) if (channelKey !== "*" && !looksLikeMSTeamsThreadConversationId(channelKey)) unresolved.push(`${teamKey}/${channelKey}`);
|
|
1533
|
+
continue;
|
|
1534
|
+
}
|
|
1535
|
+
const channelKeys = Object.keys(teamCfg?.channels ?? {}).filter((key) => key !== "*");
|
|
1536
|
+
if (channelKeys.length === 0) {
|
|
1537
|
+
entries.push({
|
|
1538
|
+
input: teamKey,
|
|
1539
|
+
teamKey
|
|
1540
|
+
});
|
|
1541
|
+
continue;
|
|
1542
|
+
}
|
|
1543
|
+
for (const channelKey of channelKeys) entries.push({
|
|
1544
|
+
input: `${teamKey}/${channelKey}`,
|
|
1545
|
+
teamKey,
|
|
1546
|
+
channelKey
|
|
1547
|
+
});
|
|
1548
|
+
}
|
|
1549
|
+
if (entries.length === 0) return {
|
|
1550
|
+
teams: projectStableMSTeamsTeamsConfig(params.teams) ?? {},
|
|
1551
|
+
mapping: [],
|
|
1552
|
+
unresolved
|
|
1553
|
+
};
|
|
1554
|
+
const resolved = await resolveMSTeamsChannelAllowlist({
|
|
1555
|
+
cfg: params.cfg,
|
|
1556
|
+
entries: entries.map((entry) => entry.input),
|
|
1557
|
+
teamIdMode: params.teamIdMode
|
|
1558
|
+
});
|
|
1559
|
+
const mapping = [];
|
|
1560
|
+
const teams = projectStableMSTeamsTeamsConfig(params.teams) ?? {};
|
|
1561
|
+
resolved.forEach((entry, index) => {
|
|
1562
|
+
const source = entries[index];
|
|
1563
|
+
if (!source) return;
|
|
1564
|
+
const sourceTeam = params.teams[source.teamKey] ?? {};
|
|
1565
|
+
const resolvedTeamId = params.teamIdMode === "graph" ? entry.graphTeamId : entry.teamId;
|
|
1566
|
+
if (!entry.resolved || !resolvedTeamId) {
|
|
1567
|
+
unresolved.push(entry.input);
|
|
1568
|
+
return;
|
|
1569
|
+
}
|
|
1570
|
+
mapping.push(entry.channelId ? `${entry.input}→${resolvedTeamId}/${entry.channelId}` : `${entry.input}→${resolvedTeamId}`);
|
|
1571
|
+
const existing = teams[resolvedTeamId] ?? {};
|
|
1572
|
+
const { channels: _sourceChannels, ...sourceTeamPolicy } = sourceTeam;
|
|
1573
|
+
const mergedChannels = {
|
|
1574
|
+
...projectStableMSTeamsChannels(sourceTeam.channels),
|
|
1575
|
+
...existing.channels
|
|
1576
|
+
};
|
|
1577
|
+
const mergedTeam = {
|
|
1578
|
+
...sourceTeamPolicy,
|
|
1579
|
+
...existing,
|
|
1580
|
+
channels: mergedChannels
|
|
1581
|
+
};
|
|
1582
|
+
teams[resolvedTeamId] = mergedTeam;
|
|
1583
|
+
if (source.channelKey && entry.channelId) {
|
|
1584
|
+
const sourceChannel = sourceTeam.channels?.[source.channelKey];
|
|
1585
|
+
if (sourceChannel) teams[resolvedTeamId] = {
|
|
1586
|
+
...mergedTeam,
|
|
1587
|
+
channels: {
|
|
1588
|
+
...mergedChannels,
|
|
1589
|
+
[entry.channelId]: {
|
|
1590
|
+
...sourceChannel,
|
|
1591
|
+
...mergedChannels?.[entry.channelId]
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1329
1594
|
};
|
|
1330
1595
|
}
|
|
1331
1596
|
});
|
|
1597
|
+
return {
|
|
1598
|
+
teams,
|
|
1599
|
+
mapping,
|
|
1600
|
+
unresolved
|
|
1601
|
+
};
|
|
1332
1602
|
}
|
|
1333
1603
|
async function resolveMSTeamsUserAllowlist(params) {
|
|
1334
|
-
|
|
1335
|
-
|
|
1604
|
+
let tokenPromise;
|
|
1605
|
+
const getToken = () => {
|
|
1606
|
+
tokenPromise ??= resolveGraphToken(params.cfg);
|
|
1607
|
+
return tokenPromise;
|
|
1608
|
+
};
|
|
1609
|
+
return await (0, openclaw_plugin_sdk_allow_from.mapAllowlistResolutionInputs)({
|
|
1336
1610
|
inputs: params.entries,
|
|
1337
1611
|
mapInput: async (input) => {
|
|
1338
1612
|
const query = normalizeQuery(normalizeMSTeamsUserInput(input));
|
|
@@ -1345,25 +1619,460 @@ async function resolveMSTeamsUserAllowlist(params) {
|
|
|
1345
1619
|
resolved: true,
|
|
1346
1620
|
id: query
|
|
1347
1621
|
};
|
|
1348
|
-
const
|
|
1349
|
-
token,
|
|
1350
|
-
query
|
|
1351
|
-
top: 10
|
|
1622
|
+
const result = await findGraphUsersByExactIdentity({
|
|
1623
|
+
token: await getToken(),
|
|
1624
|
+
query
|
|
1352
1625
|
});
|
|
1353
|
-
|
|
1354
|
-
if (!match?.id) return {
|
|
1626
|
+
if (result.truncated) return {
|
|
1355
1627
|
input,
|
|
1356
|
-
resolved: false
|
|
1628
|
+
resolved: false,
|
|
1629
|
+
note: "user lookup incomplete"
|
|
1630
|
+
};
|
|
1631
|
+
const users = findExactUsers(result.items, query);
|
|
1632
|
+
const [match] = users;
|
|
1633
|
+
if (!match) return {
|
|
1634
|
+
input,
|
|
1635
|
+
resolved: false,
|
|
1636
|
+
note: "user not found"
|
|
1637
|
+
};
|
|
1638
|
+
if (users.length > 1) return {
|
|
1639
|
+
input,
|
|
1640
|
+
resolved: false,
|
|
1641
|
+
note: "user identity is ambiguous"
|
|
1357
1642
|
};
|
|
1358
1643
|
return {
|
|
1359
1644
|
input,
|
|
1360
1645
|
resolved: true,
|
|
1361
1646
|
id: match.id,
|
|
1362
|
-
name: match.displayName ?? void 0
|
|
1363
|
-
note: users.length > 1 ? "multiple matches; chose first" : void 0
|
|
1647
|
+
name: match.displayName ?? void 0
|
|
1364
1648
|
};
|
|
1365
1649
|
}
|
|
1366
1650
|
});
|
|
1367
1651
|
}
|
|
1368
1652
|
//#endregion
|
|
1369
|
-
|
|
1653
|
+
Object.defineProperty(exports, "ATTACHMENT_TAG_RE", {
|
|
1654
|
+
enumerable: true,
|
|
1655
|
+
get: function() {
|
|
1656
|
+
return ATTACHMENT_TAG_RE;
|
|
1657
|
+
}
|
|
1658
|
+
});
|
|
1659
|
+
Object.defineProperty(exports, "GRAPH_ROOT", {
|
|
1660
|
+
enumerable: true,
|
|
1661
|
+
get: function() {
|
|
1662
|
+
return GRAPH_ROOT;
|
|
1663
|
+
}
|
|
1664
|
+
});
|
|
1665
|
+
Object.defineProperty(exports, "IMG_SRC_RE", {
|
|
1666
|
+
enumerable: true,
|
|
1667
|
+
get: function() {
|
|
1668
|
+
return IMG_SRC_RE;
|
|
1669
|
+
}
|
|
1670
|
+
});
|
|
1671
|
+
Object.defineProperty(exports, "MSTEAMS_DEFAULT_DELEGATED_SCOPES", {
|
|
1672
|
+
enumerable: true,
|
|
1673
|
+
get: function() {
|
|
1674
|
+
return MSTEAMS_DEFAULT_DELEGATED_SCOPES;
|
|
1675
|
+
}
|
|
1676
|
+
});
|
|
1677
|
+
Object.defineProperty(exports, "MSTEAMS_OAUTH_CALLBACK_PATH", {
|
|
1678
|
+
enumerable: true,
|
|
1679
|
+
get: function() {
|
|
1680
|
+
return MSTEAMS_OAUTH_CALLBACK_PATH;
|
|
1681
|
+
}
|
|
1682
|
+
});
|
|
1683
|
+
Object.defineProperty(exports, "MSTEAMS_OAUTH_CALLBACK_PORT", {
|
|
1684
|
+
enumerable: true,
|
|
1685
|
+
get: function() {
|
|
1686
|
+
return MSTEAMS_OAUTH_CALLBACK_PORT;
|
|
1687
|
+
}
|
|
1688
|
+
});
|
|
1689
|
+
Object.defineProperty(exports, "MSTEAMS_OAUTH_REDIRECT_URI", {
|
|
1690
|
+
enumerable: true,
|
|
1691
|
+
get: function() {
|
|
1692
|
+
return MSTEAMS_OAUTH_REDIRECT_URI;
|
|
1693
|
+
}
|
|
1694
|
+
});
|
|
1695
|
+
Object.defineProperty(exports, "applyAuthorizationHeaderForUrl", {
|
|
1696
|
+
enumerable: true,
|
|
1697
|
+
get: function() {
|
|
1698
|
+
return applyAuthorizationHeaderForUrl;
|
|
1699
|
+
}
|
|
1700
|
+
});
|
|
1701
|
+
Object.defineProperty(exports, "buildMSTeamsAuthEndpoint", {
|
|
1702
|
+
enumerable: true,
|
|
1703
|
+
get: function() {
|
|
1704
|
+
return buildMSTeamsAuthEndpoint;
|
|
1705
|
+
}
|
|
1706
|
+
});
|
|
1707
|
+
Object.defineProperty(exports, "buildUserAgent", {
|
|
1708
|
+
enumerable: true,
|
|
1709
|
+
get: function() {
|
|
1710
|
+
return buildUserAgent;
|
|
1711
|
+
}
|
|
1712
|
+
});
|
|
1713
|
+
Object.defineProperty(exports, "createMSTeamsExpressAdapter", {
|
|
1714
|
+
enumerable: true,
|
|
1715
|
+
get: function() {
|
|
1716
|
+
return createMSTeamsExpressAdapter;
|
|
1717
|
+
}
|
|
1718
|
+
});
|
|
1719
|
+
Object.defineProperty(exports, "createMSTeamsHttpError", {
|
|
1720
|
+
enumerable: true,
|
|
1721
|
+
get: function() {
|
|
1722
|
+
return createMSTeamsHttpError;
|
|
1723
|
+
}
|
|
1724
|
+
});
|
|
1725
|
+
Object.defineProperty(exports, "createMSTeamsInboundDeadline", {
|
|
1726
|
+
enumerable: true,
|
|
1727
|
+
get: function() {
|
|
1728
|
+
return createMSTeamsInboundDeadline;
|
|
1729
|
+
}
|
|
1730
|
+
});
|
|
1731
|
+
Object.defineProperty(exports, "createMSTeamsTokenProvider", {
|
|
1732
|
+
enumerable: true,
|
|
1733
|
+
get: function() {
|
|
1734
|
+
return createMSTeamsTokenProvider;
|
|
1735
|
+
}
|
|
1736
|
+
});
|
|
1737
|
+
Object.defineProperty(exports, "deleteGraphRequest", {
|
|
1738
|
+
enumerable: true,
|
|
1739
|
+
get: function() {
|
|
1740
|
+
return deleteGraphRequest;
|
|
1741
|
+
}
|
|
1742
|
+
});
|
|
1743
|
+
Object.defineProperty(exports, "describeBotFrameworkServiceUrlHost", {
|
|
1744
|
+
enumerable: true,
|
|
1745
|
+
get: function() {
|
|
1746
|
+
return describeBotFrameworkServiceUrlHost;
|
|
1747
|
+
}
|
|
1748
|
+
});
|
|
1749
|
+
Object.defineProperty(exports, "encodeGraphShareId", {
|
|
1750
|
+
enumerable: true,
|
|
1751
|
+
get: function() {
|
|
1752
|
+
return encodeGraphShareId;
|
|
1753
|
+
}
|
|
1754
|
+
});
|
|
1755
|
+
Object.defineProperty(exports, "ensureUserAgentHeader", {
|
|
1756
|
+
enumerable: true,
|
|
1757
|
+
get: function() {
|
|
1758
|
+
return ensureUserAgentHeader;
|
|
1759
|
+
}
|
|
1760
|
+
});
|
|
1761
|
+
Object.defineProperty(exports, "escapeOData", {
|
|
1762
|
+
enumerable: true,
|
|
1763
|
+
get: function() {
|
|
1764
|
+
return escapeOData;
|
|
1765
|
+
}
|
|
1766
|
+
});
|
|
1767
|
+
Object.defineProperty(exports, "exchangeMSTeamsCodeForTokens", {
|
|
1768
|
+
enumerable: true,
|
|
1769
|
+
get: function() {
|
|
1770
|
+
return exchangeMSTeamsCodeForTokens;
|
|
1771
|
+
}
|
|
1772
|
+
});
|
|
1773
|
+
Object.defineProperty(exports, "extractHtmlFromAttachment", {
|
|
1774
|
+
enumerable: true,
|
|
1775
|
+
get: function() {
|
|
1776
|
+
return extractHtmlFromAttachment;
|
|
1777
|
+
}
|
|
1778
|
+
});
|
|
1779
|
+
Object.defineProperty(exports, "extractInlineImageCandidates", {
|
|
1780
|
+
enumerable: true,
|
|
1781
|
+
get: function() {
|
|
1782
|
+
return extractInlineImageCandidates;
|
|
1783
|
+
}
|
|
1784
|
+
});
|
|
1785
|
+
Object.defineProperty(exports, "fetchGraphAbsoluteUrl", {
|
|
1786
|
+
enumerable: true,
|
|
1787
|
+
get: function() {
|
|
1788
|
+
return fetchGraphAbsoluteUrl;
|
|
1789
|
+
}
|
|
1790
|
+
});
|
|
1791
|
+
Object.defineProperty(exports, "fetchGraphJson", {
|
|
1792
|
+
enumerable: true,
|
|
1793
|
+
get: function() {
|
|
1794
|
+
return fetchGraphJson;
|
|
1795
|
+
}
|
|
1796
|
+
});
|
|
1797
|
+
Object.defineProperty(exports, "hasConfiguredMSTeamsCredentials", {
|
|
1798
|
+
enumerable: true,
|
|
1799
|
+
get: function() {
|
|
1800
|
+
return hasConfiguredMSTeamsCredentials;
|
|
1801
|
+
}
|
|
1802
|
+
});
|
|
1803
|
+
Object.defineProperty(exports, "inferPlaceholder", {
|
|
1804
|
+
enumerable: true,
|
|
1805
|
+
get: function() {
|
|
1806
|
+
return inferPlaceholder;
|
|
1807
|
+
}
|
|
1808
|
+
});
|
|
1809
|
+
Object.defineProperty(exports, "isAllowedBotFrameworkServiceUrl", {
|
|
1810
|
+
enumerable: true,
|
|
1811
|
+
get: function() {
|
|
1812
|
+
return isAllowedBotFrameworkServiceUrl;
|
|
1813
|
+
}
|
|
1814
|
+
});
|
|
1815
|
+
Object.defineProperty(exports, "isDownloadableAttachment", {
|
|
1816
|
+
enumerable: true,
|
|
1817
|
+
get: function() {
|
|
1818
|
+
return isDownloadableAttachment;
|
|
1819
|
+
}
|
|
1820
|
+
});
|
|
1821
|
+
Object.defineProperty(exports, "isLikelyImageAttachment", {
|
|
1822
|
+
enumerable: true,
|
|
1823
|
+
get: function() {
|
|
1824
|
+
return isLikelyImageAttachment;
|
|
1825
|
+
}
|
|
1826
|
+
});
|
|
1827
|
+
Object.defineProperty(exports, "isUrlAllowed", {
|
|
1828
|
+
enumerable: true,
|
|
1829
|
+
get: function() {
|
|
1830
|
+
return isUrlAllowed;
|
|
1831
|
+
}
|
|
1832
|
+
});
|
|
1833
|
+
Object.defineProperty(exports, "listChannelsForTeam", {
|
|
1834
|
+
enumerable: true,
|
|
1835
|
+
get: function() {
|
|
1836
|
+
return listChannelsForTeam;
|
|
1837
|
+
}
|
|
1838
|
+
});
|
|
1839
|
+
Object.defineProperty(exports, "listChannelsForTeamWithPageInfo", {
|
|
1840
|
+
enumerable: true,
|
|
1841
|
+
get: function() {
|
|
1842
|
+
return listChannelsForTeamWithPageInfo;
|
|
1843
|
+
}
|
|
1844
|
+
});
|
|
1845
|
+
Object.defineProperty(exports, "listTeamsByName", {
|
|
1846
|
+
enumerable: true,
|
|
1847
|
+
get: function() {
|
|
1848
|
+
return listTeamsByName;
|
|
1849
|
+
}
|
|
1850
|
+
});
|
|
1851
|
+
Object.defineProperty(exports, "loadDelegatedTokens", {
|
|
1852
|
+
enumerable: true,
|
|
1853
|
+
get: function() {
|
|
1854
|
+
return loadDelegatedTokens;
|
|
1855
|
+
}
|
|
1856
|
+
});
|
|
1857
|
+
Object.defineProperty(exports, "loadMSTeamsSdkWithAuth", {
|
|
1858
|
+
enumerable: true,
|
|
1859
|
+
get: function() {
|
|
1860
|
+
return loadMSTeamsSdkWithAuth;
|
|
1861
|
+
}
|
|
1862
|
+
});
|
|
1863
|
+
Object.defineProperty(exports, "looksLikeMSTeamsConversationId", {
|
|
1864
|
+
enumerable: true,
|
|
1865
|
+
get: function() {
|
|
1866
|
+
return looksLikeMSTeamsConversationId;
|
|
1867
|
+
}
|
|
1868
|
+
});
|
|
1869
|
+
Object.defineProperty(exports, "looksLikeMSTeamsTargetId", {
|
|
1870
|
+
enumerable: true,
|
|
1871
|
+
get: function() {
|
|
1872
|
+
return looksLikeMSTeamsTargetId;
|
|
1873
|
+
}
|
|
1874
|
+
});
|
|
1875
|
+
Object.defineProperty(exports, "normalizeBotFrameworkServiceUrl", {
|
|
1876
|
+
enumerable: true,
|
|
1877
|
+
get: function() {
|
|
1878
|
+
return normalizeBotFrameworkServiceUrl;
|
|
1879
|
+
}
|
|
1880
|
+
});
|
|
1881
|
+
Object.defineProperty(exports, "normalizeContentType", {
|
|
1882
|
+
enumerable: true,
|
|
1883
|
+
get: function() {
|
|
1884
|
+
return normalizeContentType;
|
|
1885
|
+
}
|
|
1886
|
+
});
|
|
1887
|
+
Object.defineProperty(exports, "normalizeMSTeamsMessagingTarget", {
|
|
1888
|
+
enumerable: true,
|
|
1889
|
+
get: function() {
|
|
1890
|
+
return normalizeMSTeamsMessagingTarget;
|
|
1891
|
+
}
|
|
1892
|
+
});
|
|
1893
|
+
Object.defineProperty(exports, "normalizeMSTeamsUserInput", {
|
|
1894
|
+
enumerable: true,
|
|
1895
|
+
get: function() {
|
|
1896
|
+
return normalizeMSTeamsUserInput;
|
|
1897
|
+
}
|
|
1898
|
+
});
|
|
1899
|
+
Object.defineProperty(exports, "normalizeQuery", {
|
|
1900
|
+
enumerable: true,
|
|
1901
|
+
get: function() {
|
|
1902
|
+
return normalizeQuery;
|
|
1903
|
+
}
|
|
1904
|
+
});
|
|
1905
|
+
Object.defineProperty(exports, "parseMSTeamsConversationId", {
|
|
1906
|
+
enumerable: true,
|
|
1907
|
+
get: function() {
|
|
1908
|
+
return parseMSTeamsConversationId;
|
|
1909
|
+
}
|
|
1910
|
+
});
|
|
1911
|
+
Object.defineProperty(exports, "parseMSTeamsTeamChannelInput", {
|
|
1912
|
+
enumerable: true,
|
|
1913
|
+
get: function() {
|
|
1914
|
+
return parseMSTeamsTeamChannelInput;
|
|
1915
|
+
}
|
|
1916
|
+
});
|
|
1917
|
+
Object.defineProperty(exports, "parseMSTeamsTeamEntry", {
|
|
1918
|
+
enumerable: true,
|
|
1919
|
+
get: function() {
|
|
1920
|
+
return parseMSTeamsTeamEntry;
|
|
1921
|
+
}
|
|
1922
|
+
});
|
|
1923
|
+
Object.defineProperty(exports, "patchGraphJson", {
|
|
1924
|
+
enumerable: true,
|
|
1925
|
+
get: function() {
|
|
1926
|
+
return patchGraphJson;
|
|
1927
|
+
}
|
|
1928
|
+
});
|
|
1929
|
+
Object.defineProperty(exports, "postGraphBetaJson", {
|
|
1930
|
+
enumerable: true,
|
|
1931
|
+
get: function() {
|
|
1932
|
+
return postGraphBetaJson;
|
|
1933
|
+
}
|
|
1934
|
+
});
|
|
1935
|
+
Object.defineProperty(exports, "postGraphJson", {
|
|
1936
|
+
enumerable: true,
|
|
1937
|
+
get: function() {
|
|
1938
|
+
return postGraphJson;
|
|
1939
|
+
}
|
|
1940
|
+
});
|
|
1941
|
+
Object.defineProperty(exports, "projectStableMSTeamsTeamsConfig", {
|
|
1942
|
+
enumerable: true,
|
|
1943
|
+
get: function() {
|
|
1944
|
+
return projectStableMSTeamsTeamsConfig;
|
|
1945
|
+
}
|
|
1946
|
+
});
|
|
1947
|
+
Object.defineProperty(exports, "projectStableMSTeamsUserAllowlist", {
|
|
1948
|
+
enumerable: true,
|
|
1949
|
+
get: function() {
|
|
1950
|
+
return projectStableMSTeamsUserAllowlist;
|
|
1951
|
+
}
|
|
1952
|
+
});
|
|
1953
|
+
Object.defineProperty(exports, "readAccessToken", {
|
|
1954
|
+
enumerable: true,
|
|
1955
|
+
get: function() {
|
|
1956
|
+
return readAccessToken;
|
|
1957
|
+
}
|
|
1958
|
+
});
|
|
1959
|
+
Object.defineProperty(exports, "resolveAttachmentFetchPolicy", {
|
|
1960
|
+
enumerable: true,
|
|
1961
|
+
get: function() {
|
|
1962
|
+
return resolveAttachmentFetchPolicy;
|
|
1963
|
+
}
|
|
1964
|
+
});
|
|
1965
|
+
Object.defineProperty(exports, "resolveGraphToken", {
|
|
1966
|
+
enumerable: true,
|
|
1967
|
+
get: function() {
|
|
1968
|
+
return resolveGraphToken;
|
|
1969
|
+
}
|
|
1970
|
+
});
|
|
1971
|
+
Object.defineProperty(exports, "resolveMSTeamsChannelAllowlist", {
|
|
1972
|
+
enumerable: true,
|
|
1973
|
+
get: function() {
|
|
1974
|
+
return resolveMSTeamsChannelAllowlist;
|
|
1975
|
+
}
|
|
1976
|
+
});
|
|
1977
|
+
Object.defineProperty(exports, "resolveMSTeamsCredentials", {
|
|
1978
|
+
enumerable: true,
|
|
1979
|
+
get: function() {
|
|
1980
|
+
return resolveMSTeamsCredentials;
|
|
1981
|
+
}
|
|
1982
|
+
});
|
|
1983
|
+
Object.defineProperty(exports, "resolveMSTeamsRequestTimeoutMs", {
|
|
1984
|
+
enumerable: true,
|
|
1985
|
+
get: function() {
|
|
1986
|
+
return resolveMSTeamsRequestTimeoutMs;
|
|
1987
|
+
}
|
|
1988
|
+
});
|
|
1989
|
+
Object.defineProperty(exports, "resolveMSTeamsSdkCloudOptions", {
|
|
1990
|
+
enumerable: true,
|
|
1991
|
+
get: function() {
|
|
1992
|
+
return resolveMSTeamsSdkCloudOptions;
|
|
1993
|
+
}
|
|
1994
|
+
});
|
|
1995
|
+
Object.defineProperty(exports, "resolveMSTeamsSharePointUploadTimeoutMs", {
|
|
1996
|
+
enumerable: true,
|
|
1997
|
+
get: function() {
|
|
1998
|
+
return resolveMSTeamsSharePointUploadTimeoutMs;
|
|
1999
|
+
}
|
|
2000
|
+
});
|
|
2001
|
+
Object.defineProperty(exports, "resolveMSTeamsTeamsConfig", {
|
|
2002
|
+
enumerable: true,
|
|
2003
|
+
get: function() {
|
|
2004
|
+
return resolveMSTeamsTeamsConfig;
|
|
2005
|
+
}
|
|
2006
|
+
});
|
|
2007
|
+
Object.defineProperty(exports, "resolveMSTeamsUserAllowlist", {
|
|
2008
|
+
enumerable: true,
|
|
2009
|
+
get: function() {
|
|
2010
|
+
return resolveMSTeamsUserAllowlist;
|
|
2011
|
+
}
|
|
2012
|
+
});
|
|
2013
|
+
Object.defineProperty(exports, "resolveMediaSsrfPolicy", {
|
|
2014
|
+
enumerable: true,
|
|
2015
|
+
get: function() {
|
|
2016
|
+
return resolveMediaSsrfPolicy;
|
|
2017
|
+
}
|
|
2018
|
+
});
|
|
2019
|
+
Object.defineProperty(exports, "resolveRequestUrl", {
|
|
2020
|
+
enumerable: true,
|
|
2021
|
+
get: function() {
|
|
2022
|
+
return resolveRequestUrl;
|
|
2023
|
+
}
|
|
2024
|
+
});
|
|
2025
|
+
Object.defineProperty(exports, "safeFetchWithPolicy", {
|
|
2026
|
+
enumerable: true,
|
|
2027
|
+
get: function() {
|
|
2028
|
+
return safeFetchWithPolicy;
|
|
2029
|
+
}
|
|
2030
|
+
});
|
|
2031
|
+
Object.defineProperty(exports, "safeHostForUrl", {
|
|
2032
|
+
enumerable: true,
|
|
2033
|
+
get: function() {
|
|
2034
|
+
return safeHostForUrl;
|
|
2035
|
+
}
|
|
2036
|
+
});
|
|
2037
|
+
Object.defineProperty(exports, "saveDelegatedTokens", {
|
|
2038
|
+
enumerable: true,
|
|
2039
|
+
get: function() {
|
|
2040
|
+
return saveDelegatedTokens;
|
|
2041
|
+
}
|
|
2042
|
+
});
|
|
2043
|
+
Object.defineProperty(exports, "searchGraphUsers", {
|
|
2044
|
+
enumerable: true,
|
|
2045
|
+
get: function() {
|
|
2046
|
+
return searchGraphUsers;
|
|
2047
|
+
}
|
|
2048
|
+
});
|
|
2049
|
+
Object.defineProperty(exports, "tryBuildGraphSharesUrlForSharedLink", {
|
|
2050
|
+
enumerable: true,
|
|
2051
|
+
get: function() {
|
|
2052
|
+
return tryBuildGraphSharesUrlForSharedLink;
|
|
2053
|
+
}
|
|
2054
|
+
});
|
|
2055
|
+
Object.defineProperty(exports, "tryNormalizeBotFrameworkServiceUrl", {
|
|
2056
|
+
enumerable: true,
|
|
2057
|
+
get: function() {
|
|
2058
|
+
return tryNormalizeBotFrameworkServiceUrl;
|
|
2059
|
+
}
|
|
2060
|
+
});
|
|
2061
|
+
Object.defineProperty(exports, "validateMSTeamsProactiveServiceUrlBoundary", {
|
|
2062
|
+
enumerable: true,
|
|
2063
|
+
get: function() {
|
|
2064
|
+
return validateMSTeamsProactiveServiceUrlBoundary;
|
|
2065
|
+
}
|
|
2066
|
+
});
|
|
2067
|
+
Object.defineProperty(exports, "withMSTeamsAbortableRequestTimeout", {
|
|
2068
|
+
enumerable: true,
|
|
2069
|
+
get: function() {
|
|
2070
|
+
return withMSTeamsAbortableRequestTimeout;
|
|
2071
|
+
}
|
|
2072
|
+
});
|
|
2073
|
+
Object.defineProperty(exports, "withMSTeamsRequestDeadline", {
|
|
2074
|
+
enumerable: true,
|
|
2075
|
+
get: function() {
|
|
2076
|
+
return withMSTeamsRequestDeadline;
|
|
2077
|
+
}
|
|
2078
|
+
});
|