@openclaw/msteams 2026.7.1 → 2026.7.2-beta.1
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-BSyPdpGN.cjs} +641 -227
- package/dist/channel-config-api.cjs +3 -0
- package/dist/channel-plugin-api.cjs +3 -0
- package/dist/channel.runtime-DQTOzzet.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-DtS9gqkV.cjs} +369 -861
- package/dist/{oauth-BifWxWzq.js → oauth-C5E5powI.cjs} +21 -21
- package/dist/{polls-B_hs4aKm.js → polls-BhoI4VaN.cjs} +188 -38
- package/dist/{resolve-allowlist-Dnw4aNOu.js → resolve-allowlist-CyQ57MfH.cjs} +817 -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-BDTPN3dX.cjs} +123 -49
- package/dist/{src-DZFs5XtZ.js → src-CUMz2B6f.cjs} +672 -740
- 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,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const require_resolve_allowlist = require("./resolve-allowlist-CyQ57MfH.cjs");
|
|
2
|
+
let openclaw_plugin_sdk_provider_auth = require("openclaw/plugin-sdk/provider-auth");
|
|
3
|
+
let openclaw_plugin_sdk_provider_auth_runtime = require("openclaw/plugin-sdk/provider-auth-runtime");
|
|
4
|
+
let openclaw_plugin_sdk_runtime_env = require("openclaw/plugin-sdk/runtime-env");
|
|
5
5
|
//#region extensions/msteams/src/oauth.flow.ts
|
|
6
6
|
function shouldUseManualOAuthFlow(isRemote) {
|
|
7
|
-
return isRemote || isWSL2Sync();
|
|
7
|
+
return isRemote || (0, openclaw_plugin_sdk_runtime_env.isWSL2Sync)();
|
|
8
8
|
}
|
|
9
9
|
function generatePkce() {
|
|
10
|
-
return generateHexPkceVerifierChallenge();
|
|
10
|
+
return (0, openclaw_plugin_sdk_provider_auth.generateHexPkceVerifierChallenge)();
|
|
11
11
|
}
|
|
12
12
|
function buildMSTeamsAuthUrl(params) {
|
|
13
|
-
const scopes = params.scopes ?? MSTEAMS_DEFAULT_DELEGATED_SCOPES;
|
|
14
|
-
return `${buildMSTeamsAuthEndpoint(params.tenantId)}?${new URLSearchParams({
|
|
13
|
+
const scopes = params.scopes ?? require_resolve_allowlist.MSTEAMS_DEFAULT_DELEGATED_SCOPES;
|
|
14
|
+
return `${require_resolve_allowlist.buildMSTeamsAuthEndpoint(params.tenantId)}?${new URLSearchParams({
|
|
15
15
|
client_id: params.clientId,
|
|
16
16
|
response_type: "code",
|
|
17
|
-
redirect_uri: MSTEAMS_OAUTH_REDIRECT_URI,
|
|
17
|
+
redirect_uri: require_resolve_allowlist.MSTEAMS_OAUTH_REDIRECT_URI,
|
|
18
18
|
scope: scopes.join(" "),
|
|
19
19
|
code_challenge: params.challenge,
|
|
20
20
|
code_challenge_method: "S256",
|
|
@@ -23,27 +23,27 @@ function buildMSTeamsAuthUrl(params) {
|
|
|
23
23
|
}).toString()}`;
|
|
24
24
|
}
|
|
25
25
|
function parseCallbackInput(input, _expectedState) {
|
|
26
|
-
return parseOAuthCallbackInput(input, {
|
|
26
|
+
return (0, openclaw_plugin_sdk_provider_auth_runtime.parseOAuthCallbackInput)(input, {
|
|
27
27
|
missingState: "Missing 'state' parameter in URL. Paste the full redirect URL.",
|
|
28
28
|
invalidInput: "Paste the full redirect URL (including code and state parameters), not just the authorization code."
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
async function waitForLocalCallback(params) {
|
|
32
|
-
return await waitForLocalOAuthCallback({
|
|
32
|
+
return await (0, openclaw_plugin_sdk_provider_auth_runtime.waitForLocalOAuthCallback)({
|
|
33
33
|
expectedState: params.expectedState,
|
|
34
34
|
timeoutMs: params.timeoutMs,
|
|
35
|
-
port: MSTEAMS_OAUTH_CALLBACK_PORT,
|
|
36
|
-
callbackPath: MSTEAMS_OAUTH_CALLBACK_PATH,
|
|
37
|
-
redirectUri: MSTEAMS_OAUTH_REDIRECT_URI,
|
|
35
|
+
port: require_resolve_allowlist.MSTEAMS_OAUTH_CALLBACK_PORT,
|
|
36
|
+
callbackPath: require_resolve_allowlist.MSTEAMS_OAUTH_CALLBACK_PATH,
|
|
37
|
+
redirectUri: require_resolve_allowlist.MSTEAMS_OAUTH_REDIRECT_URI,
|
|
38
38
|
successTitle: "MSTeams Delegated OAuth complete",
|
|
39
|
-
progressMessage: `Waiting for OAuth callback on ${MSTEAMS_OAUTH_REDIRECT_URI}...`,
|
|
39
|
+
progressMessage: `Waiting for OAuth callback on ${require_resolve_allowlist.MSTEAMS_OAUTH_REDIRECT_URI}...`,
|
|
40
40
|
onProgress: params.onProgress
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region extensions/msteams/src/oauth.ts
|
|
45
45
|
async function loginMSTeamsDelegated(ctx, params) {
|
|
46
|
-
const scopes = params.scopes ?? MSTEAMS_DEFAULT_DELEGATED_SCOPES;
|
|
46
|
+
const scopes = params.scopes ?? require_resolve_allowlist.MSTEAMS_DEFAULT_DELEGATED_SCOPES;
|
|
47
47
|
const needsManual = shouldUseManualOAuthFlow(ctx.isRemote);
|
|
48
48
|
await ctx.note(needsManual ? [
|
|
49
49
|
"You are running in a remote/VPS environment.",
|
|
@@ -52,10 +52,10 @@ async function loginMSTeamsDelegated(ctx, params) {
|
|
|
52
52
|
].join("\n") : [
|
|
53
53
|
"Browser will open for Microsoft authentication.",
|
|
54
54
|
`Sign in to grant delegated permissions for MSTeams.`,
|
|
55
|
-
`The callback will be captured automatically on localhost:${MSTEAMS_OAUTH_CALLBACK_PORT}.`
|
|
55
|
+
`The callback will be captured automatically on localhost:${require_resolve_allowlist.MSTEAMS_OAUTH_CALLBACK_PORT}.`
|
|
56
56
|
].join("\n"), "MSTeams Delegated OAuth");
|
|
57
57
|
const { verifier, challenge } = generatePkce();
|
|
58
|
-
const state = generateOAuthState();
|
|
58
|
+
const state = (0, openclaw_plugin_sdk_provider_auth_runtime.generateOAuthState)();
|
|
59
59
|
const authUrl = buildMSTeamsAuthUrl({
|
|
60
60
|
tenantId: params.tenantId,
|
|
61
61
|
clientId: params.clientId,
|
|
@@ -77,7 +77,7 @@ async function loginMSTeamsDelegated(ctx, params) {
|
|
|
77
77
|
onProgress: (msg) => ctx.progress.update(msg)
|
|
78
78
|
});
|
|
79
79
|
ctx.progress.update("Exchanging authorization code for tokens...");
|
|
80
|
-
return await exchangeMSTeamsCodeForTokens({
|
|
80
|
+
return await require_resolve_allowlist.exchangeMSTeamsCodeForTokens({
|
|
81
81
|
tenantId: params.tenantId,
|
|
82
82
|
clientId: params.clientId,
|
|
83
83
|
clientSecret: params.clientSecret,
|
|
@@ -101,7 +101,7 @@ async function manualFlow(ctx, authUrl, state, verifier, params, cause) {
|
|
|
101
101
|
if ("error" in parsed) throw new Error(parsed.error, cause ? { cause } : void 0);
|
|
102
102
|
if (parsed.state !== state) throw new Error("OAuth state mismatch - please try again", cause ? { cause } : void 0);
|
|
103
103
|
ctx.progress.update("Exchanging authorization code for tokens...");
|
|
104
|
-
return exchangeMSTeamsCodeForTokens({
|
|
104
|
+
return require_resolve_allowlist.exchangeMSTeamsCodeForTokens({
|
|
105
105
|
tenantId: params.tenantId,
|
|
106
106
|
clientId: params.clientId,
|
|
107
107
|
clientSecret: params.clientSecret,
|
|
@@ -111,4 +111,4 @@ async function manualFlow(ctx, authUrl, state, verifier, params, cause) {
|
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
//#endregion
|
|
114
|
-
|
|
114
|
+
exports.loginMSTeamsDelegated = loginMSTeamsDelegated;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime-D6vf50IK.cjs");
|
|
2
|
+
const require_runtime = require("./runtime-gZTAuFux.cjs");
|
|
3
|
+
let openclaw_plugin_sdk_string_coerce_runtime = require("openclaw/plugin-sdk/string-coerce-runtime");
|
|
4
|
+
let openclaw_plugin_sdk_file_lock = require("openclaw/plugin-sdk/file-lock");
|
|
5
|
+
let openclaw_plugin_sdk_number_runtime = require("openclaw/plugin-sdk/number-runtime");
|
|
6
|
+
let node_path = require("node:path");
|
|
7
|
+
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
8
|
+
let openclaw_plugin_sdk_security_runtime = require("openclaw/plugin-sdk/security-runtime");
|
|
9
|
+
let node_crypto = require("node:crypto");
|
|
10
|
+
node_crypto = require_rolldown_runtime.__toESM(node_crypto, 1);
|
|
11
|
+
let openclaw_plugin_sdk_keyed_async_queue = require("openclaw/plugin-sdk/keyed-async-queue");
|
|
12
|
+
let openclaw_plugin_sdk_json_store = require("openclaw/plugin-sdk/json-store");
|
|
10
13
|
//#region extensions/msteams/src/conversation-store-helpers.ts
|
|
11
14
|
function normalizeStoredConversationId(raw) {
|
|
12
15
|
return raw.split(";")[0] ?? raw;
|
|
@@ -26,7 +29,6 @@ function toConversationStoreEntries(entries) {
|
|
|
26
29
|
function mergeStoredConversationReference(existing, incoming, nowIso) {
|
|
27
30
|
return {
|
|
28
31
|
...existing?.timezone && !incoming.timezone ? { timezone: existing.timezone } : {},
|
|
29
|
-
...existing?.graphChatId && !incoming.graphChatId ? { graphChatId: existing.graphChatId } : {},
|
|
30
32
|
...existing?.tenantId && !incoming.tenantId ? { tenantId: existing.tenantId } : {},
|
|
31
33
|
...existing?.aadObjectId && !incoming.aadObjectId ? { aadObjectId: existing.aadObjectId } : {},
|
|
32
34
|
...incoming,
|
|
@@ -40,7 +42,7 @@ function findPreferredDmConversationByUserId(entries, id) {
|
|
|
40
42
|
const unknownTypeMatches = [];
|
|
41
43
|
for (const entry of entries) {
|
|
42
44
|
if (entry.reference.user?.aadObjectId !== target && entry.reference.user?.id !== target) continue;
|
|
43
|
-
const convType = normalizeLowercaseStringOrEmpty(entry.reference.conversation?.conversationType ?? "");
|
|
45
|
+
const convType = (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeLowercaseStringOrEmpty)(entry.reference.conversation?.conversationType ?? "");
|
|
44
46
|
if (convType === "personal") personalMatches.push(entry);
|
|
45
47
|
else if (convType === "channel" || convType === "groupchat") {} else unknownTypeMatches.push(entry);
|
|
46
48
|
}
|
|
@@ -62,14 +64,14 @@ const STORE_LOCK_OPTIONS = {
|
|
|
62
64
|
stale: 3e4
|
|
63
65
|
};
|
|
64
66
|
async function writeJsonFile(filePath, value) {
|
|
65
|
-
await writeJsonFileAtomically(filePath, value);
|
|
67
|
+
await (0, openclaw_plugin_sdk_json_store.writeJsonFileAtomically)(filePath, value);
|
|
66
68
|
}
|
|
67
69
|
async function ensureJsonFile(filePath, fallback) {
|
|
68
|
-
if (!await pathExists(filePath)) await writeJsonFile(filePath, fallback);
|
|
70
|
+
if (!await (0, openclaw_plugin_sdk_security_runtime.pathExists)(filePath)) await writeJsonFile(filePath, fallback);
|
|
69
71
|
}
|
|
70
|
-
async function withFileLock
|
|
72
|
+
async function withFileLock(filePath, fallback, fn) {
|
|
71
73
|
await ensureJsonFile(filePath, fallback);
|
|
72
|
-
return await withFileLock(filePath, STORE_LOCK_OPTIONS, async () => {
|
|
74
|
+
return await (0, openclaw_plugin_sdk_file_lock.withFileLock)(filePath, STORE_LOCK_OPTIONS, async () => {
|
|
73
75
|
return await fn();
|
|
74
76
|
});
|
|
75
77
|
}
|
|
@@ -78,8 +80,8 @@ async function withFileLock$1(filePath, fallback, fn) {
|
|
|
78
80
|
function resolveStateDirOverride(options) {
|
|
79
81
|
if (!options) return;
|
|
80
82
|
if (options.stateDir) return options.stateDir;
|
|
81
|
-
if (options.storePath) return
|
|
82
|
-
if (options.homedir) return getMSTeamsRuntime().state.resolveStateDir(options.env ?? process.env, options.homedir);
|
|
83
|
+
if (options.storePath) return node_path.default.dirname(options.storePath);
|
|
84
|
+
if (options.homedir) return require_runtime.getMSTeamsRuntime().state.resolveStateDir(options.env ?? process.env, options.homedir);
|
|
83
85
|
return options.env?.OPENCLAW_STATE_DIR?.trim() || void 0;
|
|
84
86
|
}
|
|
85
87
|
function resolveMSTeamsSqliteStateEnv(options) {
|
|
@@ -95,16 +97,16 @@ function toPluginJsonValue(value) {
|
|
|
95
97
|
return JSON.parse(serialized);
|
|
96
98
|
}
|
|
97
99
|
function resolveMSTeamsSqliteStateDir(options) {
|
|
98
|
-
return resolveStateDirOverride(options) ?? getMSTeamsRuntime().state.resolveStateDir(options?.env ?? process.env, options?.homedir);
|
|
100
|
+
return resolveStateDirOverride(options) ?? require_runtime.getMSTeamsRuntime().state.resolveStateDir(options?.env ?? process.env, options?.homedir);
|
|
99
101
|
}
|
|
100
|
-
const sqliteMutationLocks = new KeyedAsyncQueue();
|
|
102
|
+
const sqliteMutationLocks = new openclaw_plugin_sdk_keyed_async_queue.KeyedAsyncQueue();
|
|
101
103
|
async function withProcessMutationLock(lockPath, fn) {
|
|
102
104
|
return await sqliteMutationLocks.enqueue(lockPath, fn);
|
|
103
105
|
}
|
|
104
106
|
async function withMSTeamsSqliteMutationLock(options, lockFilename, fn) {
|
|
105
|
-
const lockPath =
|
|
107
|
+
const lockPath = node_path.default.join(resolveMSTeamsSqliteStateDir(options), lockFilename);
|
|
106
108
|
return await withProcessMutationLock(lockPath, async () => {
|
|
107
|
-
return await withFileLock
|
|
109
|
+
return await withFileLock(lockPath, { version: 1 }, fn);
|
|
108
110
|
});
|
|
109
111
|
}
|
|
110
112
|
//#endregion
|
|
@@ -116,7 +118,7 @@ const MSTEAMS_SQLITE_MAX_CONVERSATION_ROWS = 2e3;
|
|
|
116
118
|
const MSTEAMS_CONVERSATION_TTL_MS = 365 * 24 * 60 * 60 * 1e3;
|
|
117
119
|
const CONVERSATION_LOCK_FILENAME = "msteams-conversations.sqlite.lock";
|
|
118
120
|
function createConversationStateStore(params) {
|
|
119
|
-
return getMSTeamsRuntime().state.openKeyedStore({
|
|
121
|
+
return require_runtime.getMSTeamsRuntime().state.openKeyedStore({
|
|
120
122
|
namespace: MSTEAMS_CONVERSATIONS_NAMESPACE,
|
|
121
123
|
maxEntries: MSTEAMS_SQLITE_MAX_CONVERSATION_ROWS,
|
|
122
124
|
env: resolveMSTeamsSqliteStateEnv(params)
|
|
@@ -130,7 +132,7 @@ function normalizeMSTeamsLegacyConversationStore(value) {
|
|
|
130
132
|
return value;
|
|
131
133
|
}
|
|
132
134
|
function buildMSTeamsConversationStateKey(conversationId) {
|
|
133
|
-
return
|
|
135
|
+
return node_crypto.default.createHash("sha256").update(conversationId).digest("hex");
|
|
134
136
|
}
|
|
135
137
|
function prepareMSTeamsConversationReferenceForStorage(conversationId, reference) {
|
|
136
138
|
return {
|
|
@@ -231,8 +233,7 @@ function createMSTeamsConversationStoreState(params) {
|
|
|
231
233
|
get,
|
|
232
234
|
list,
|
|
233
235
|
remove,
|
|
234
|
-
findPreferredDmByUserId
|
|
235
|
-
findByUserId: findPreferredDmByUserId
|
|
236
|
+
findPreferredDmByUserId
|
|
236
237
|
};
|
|
237
238
|
}
|
|
238
239
|
//#endregion
|
|
@@ -258,23 +259,23 @@ function extractSelections(value) {
|
|
|
258
259
|
if (Array.isArray(value)) return value.map(normalizeChoiceValue).filter((entry) => Boolean(entry));
|
|
259
260
|
const normalized = normalizeChoiceValue(value);
|
|
260
261
|
if (!normalized) return [];
|
|
261
|
-
if (normalized.includes(",")) return normalizeStringEntries(normalized.split(","));
|
|
262
|
+
if (normalized.includes(",")) return (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeStringEntries)(normalized.split(","));
|
|
262
263
|
return [normalized];
|
|
263
264
|
}
|
|
264
265
|
function readNestedValue(value, keys) {
|
|
265
266
|
let current = value;
|
|
266
267
|
for (const key of keys) {
|
|
267
|
-
if (!isRecord(current)) return;
|
|
268
|
+
if (!(0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(current)) return;
|
|
268
269
|
current = current[key];
|
|
269
270
|
}
|
|
270
271
|
return current;
|
|
271
272
|
}
|
|
272
273
|
function readNestedString(value, keys) {
|
|
273
|
-
return normalizeOptionalString(readNestedValue(value, keys));
|
|
274
|
+
return (0, openclaw_plugin_sdk_string_coerce_runtime.normalizeOptionalString)(readNestedValue(value, keys));
|
|
274
275
|
}
|
|
275
276
|
function extractMSTeamsPollVote(activity) {
|
|
276
277
|
const value = activity?.value;
|
|
277
|
-
if (!value || !isRecord(value)) return null;
|
|
278
|
+
if (!value || !(0, openclaw_plugin_sdk_string_coerce_runtime.isRecord)(value)) return null;
|
|
278
279
|
const pollId = readNestedString(value, ["openclawPollId"]) ?? readNestedString(value, ["pollId"]) ?? readNestedString(value, ["openclaw", "pollId"]) ?? readNestedString(value, [
|
|
279
280
|
"openclaw",
|
|
280
281
|
"poll",
|
|
@@ -309,7 +310,7 @@ function extractMSTeamsPollVote(activity) {
|
|
|
309
310
|
};
|
|
310
311
|
}
|
|
311
312
|
function buildMSTeamsPollCard(params) {
|
|
312
|
-
const pollId = params.pollId ??
|
|
313
|
+
const pollId = params.pollId ?? node_crypto.default.randomUUID();
|
|
313
314
|
const maxSelections = typeof params.maxSelections === "number" && params.maxSelections > 1 ? Math.floor(params.maxSelections) : 1;
|
|
314
315
|
const cappedMaxSelections = Math.min(Math.max(1, maxSelections), params.options.length);
|
|
315
316
|
const choices = params.options.map((option, index) => ({
|
|
@@ -364,14 +365,14 @@ function buildMSTeamsPollCard(params) {
|
|
|
364
365
|
};
|
|
365
366
|
}
|
|
366
367
|
function createPollStateStore(params) {
|
|
367
|
-
return getMSTeamsRuntime().state.openKeyedStore({
|
|
368
|
+
return require_runtime.getMSTeamsRuntime().state.openKeyedStore({
|
|
368
369
|
namespace: MSTEAMS_POLLS_NAMESPACE,
|
|
369
370
|
maxEntries: MSTEAMS_SQLITE_MAX_POLL_ROWS,
|
|
370
371
|
env: resolveMSTeamsSqliteStateEnv(params)
|
|
371
372
|
});
|
|
372
373
|
}
|
|
373
374
|
function createPollVoteBucketStateStore(params) {
|
|
374
|
-
return getMSTeamsRuntime().state.openKeyedStore({
|
|
375
|
+
return require_runtime.getMSTeamsRuntime().state.openKeyedStore({
|
|
375
376
|
namespace: MSTEAMS_POLL_VOTE_BUCKETS_NAMESPACE,
|
|
376
377
|
maxEntries: MSTEAMS_MAX_POLL_VOTE_BUCKET_ROWS,
|
|
377
378
|
env: resolveMSTeamsSqliteStateEnv(params)
|
|
@@ -399,8 +400,8 @@ function selectRetainedMSTeamsPolls(polls) {
|
|
|
399
400
|
}
|
|
400
401
|
function normalizeMSTeamsPollSelections(poll, selections) {
|
|
401
402
|
const maxSelections = Math.max(1, poll.maxSelections);
|
|
402
|
-
const mapped = selections.map((entry) => parseStrictNonNegativeInteger(entry)).filter((value) => value !== void 0).filter((value) => value >= 0 && value < poll.options.length).map((value) => String(value));
|
|
403
|
-
return uniqueStrings(maxSelections > 1 ? mapped.slice(0, maxSelections) : mapped.slice(0, 1));
|
|
403
|
+
const mapped = selections.map((entry) => (0, openclaw_plugin_sdk_number_runtime.parseStrictNonNegativeInteger)(entry)).filter((value) => value !== void 0).filter((value) => value >= 0 && value < poll.options.length).map((value) => String(value));
|
|
404
|
+
return (0, openclaw_plugin_sdk_string_coerce_runtime.uniqueStrings)(maxSelections > 1 ? mapped.slice(0, maxSelections) : mapped.slice(0, 1));
|
|
404
405
|
}
|
|
405
406
|
function splitMSTeamsPoll(poll) {
|
|
406
407
|
const { votes, ...metadata } = poll;
|
|
@@ -410,17 +411,17 @@ function splitMSTeamsPoll(poll) {
|
|
|
410
411
|
};
|
|
411
412
|
}
|
|
412
413
|
function hashMSTeamsPollVote(pollId, voterId) {
|
|
413
|
-
return
|
|
414
|
+
return node_crypto.default.createHash("sha256").update(pollId).update("\0").update(voterId).digest("hex");
|
|
414
415
|
}
|
|
415
416
|
function buildMSTeamsPollStateKey(pollId) {
|
|
416
|
-
return
|
|
417
|
+
return node_crypto.default.createHash("sha256").update(pollId).digest("hex");
|
|
417
418
|
}
|
|
418
419
|
function selectMSTeamsPollVoteBucket(pollId, voterId) {
|
|
419
420
|
const bucket = Number.parseInt(hashMSTeamsPollVote(pollId, voterId).slice(0, 8), 16);
|
|
420
421
|
return String(bucket % MSTEAMS_POLL_VOTE_BUCKET_COUNT).padStart(4, "0");
|
|
421
422
|
}
|
|
422
423
|
function buildMSTeamsPollVoteBucketKey(pollId, bucket) {
|
|
423
|
-
return `${
|
|
424
|
+
return `${node_crypto.default.createHash("sha256").update(pollId).digest("hex")}:${bucket}`;
|
|
424
425
|
}
|
|
425
426
|
function createMSTeamsPollStoreState(params) {
|
|
426
427
|
const pollStore = createPollStateStore(params);
|
|
@@ -535,4 +536,153 @@ function createMSTeamsPollStoreState(params) {
|
|
|
535
536
|
};
|
|
536
537
|
}
|
|
537
538
|
//#endregion
|
|
538
|
-
|
|
539
|
+
Object.defineProperty(exports, "MSTEAMS_CONVERSATIONS_LEGACY_FILENAME", {
|
|
540
|
+
enumerable: true,
|
|
541
|
+
get: function() {
|
|
542
|
+
return MSTEAMS_CONVERSATIONS_LEGACY_FILENAME;
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
Object.defineProperty(exports, "MSTEAMS_CONVERSATIONS_NAMESPACE", {
|
|
546
|
+
enumerable: true,
|
|
547
|
+
get: function() {
|
|
548
|
+
return MSTEAMS_CONVERSATIONS_NAMESPACE;
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
Object.defineProperty(exports, "MSTEAMS_MAX_POLL_VOTE_BUCKET_ROWS", {
|
|
552
|
+
enumerable: true,
|
|
553
|
+
get: function() {
|
|
554
|
+
return MSTEAMS_MAX_POLL_VOTE_BUCKET_ROWS;
|
|
555
|
+
}
|
|
556
|
+
});
|
|
557
|
+
Object.defineProperty(exports, "MSTEAMS_POLLS_LEGACY_FILENAME", {
|
|
558
|
+
enumerable: true,
|
|
559
|
+
get: function() {
|
|
560
|
+
return MSTEAMS_POLLS_LEGACY_FILENAME;
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
Object.defineProperty(exports, "MSTEAMS_POLLS_NAMESPACE", {
|
|
564
|
+
enumerable: true,
|
|
565
|
+
get: function() {
|
|
566
|
+
return MSTEAMS_POLLS_NAMESPACE;
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
Object.defineProperty(exports, "MSTEAMS_POLL_VOTE_BUCKETS_NAMESPACE", {
|
|
570
|
+
enumerable: true,
|
|
571
|
+
get: function() {
|
|
572
|
+
return MSTEAMS_POLL_VOTE_BUCKETS_NAMESPACE;
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
Object.defineProperty(exports, "MSTEAMS_SQLITE_MAX_CONVERSATION_ROWS", {
|
|
576
|
+
enumerable: true,
|
|
577
|
+
get: function() {
|
|
578
|
+
return MSTEAMS_SQLITE_MAX_CONVERSATION_ROWS;
|
|
579
|
+
}
|
|
580
|
+
});
|
|
581
|
+
Object.defineProperty(exports, "MSTEAMS_SQLITE_MAX_POLL_ROWS", {
|
|
582
|
+
enumerable: true,
|
|
583
|
+
get: function() {
|
|
584
|
+
return MSTEAMS_SQLITE_MAX_POLL_ROWS;
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
Object.defineProperty(exports, "buildMSTeamsConversationStateKey", {
|
|
588
|
+
enumerable: true,
|
|
589
|
+
get: function() {
|
|
590
|
+
return buildMSTeamsConversationStateKey;
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
Object.defineProperty(exports, "buildMSTeamsPollCard", {
|
|
594
|
+
enumerable: true,
|
|
595
|
+
get: function() {
|
|
596
|
+
return buildMSTeamsPollCard;
|
|
597
|
+
}
|
|
598
|
+
});
|
|
599
|
+
Object.defineProperty(exports, "buildMSTeamsPollStateKey", {
|
|
600
|
+
enumerable: true,
|
|
601
|
+
get: function() {
|
|
602
|
+
return buildMSTeamsPollStateKey;
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
Object.defineProperty(exports, "buildMSTeamsPollVoteBucketKey", {
|
|
606
|
+
enumerable: true,
|
|
607
|
+
get: function() {
|
|
608
|
+
return buildMSTeamsPollVoteBucketKey;
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
Object.defineProperty(exports, "createMSTeamsConversationStoreState", {
|
|
612
|
+
enumerable: true,
|
|
613
|
+
get: function() {
|
|
614
|
+
return createMSTeamsConversationStoreState;
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
Object.defineProperty(exports, "createMSTeamsPollStoreState", {
|
|
618
|
+
enumerable: true,
|
|
619
|
+
get: function() {
|
|
620
|
+
return createMSTeamsPollStoreState;
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
Object.defineProperty(exports, "extractMSTeamsPollVote", {
|
|
624
|
+
enumerable: true,
|
|
625
|
+
get: function() {
|
|
626
|
+
return extractMSTeamsPollVote;
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
Object.defineProperty(exports, "normalizeMSTeamsLegacyConversationStore", {
|
|
630
|
+
enumerable: true,
|
|
631
|
+
get: function() {
|
|
632
|
+
return normalizeMSTeamsLegacyConversationStore;
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
Object.defineProperty(exports, "normalizeStoredConversationId", {
|
|
636
|
+
enumerable: true,
|
|
637
|
+
get: function() {
|
|
638
|
+
return normalizeStoredConversationId;
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
Object.defineProperty(exports, "prepareMSTeamsConversationReferenceForStorage", {
|
|
642
|
+
enumerable: true,
|
|
643
|
+
get: function() {
|
|
644
|
+
return prepareMSTeamsConversationReferenceForStorage;
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
Object.defineProperty(exports, "resolveMSTeamsSqliteStateEnv", {
|
|
648
|
+
enumerable: true,
|
|
649
|
+
get: function() {
|
|
650
|
+
return resolveMSTeamsSqliteStateEnv;
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
Object.defineProperty(exports, "selectMSTeamsPollVoteBucket", {
|
|
654
|
+
enumerable: true,
|
|
655
|
+
get: function() {
|
|
656
|
+
return selectMSTeamsPollVoteBucket;
|
|
657
|
+
}
|
|
658
|
+
});
|
|
659
|
+
Object.defineProperty(exports, "selectRetainedMSTeamsConversations", {
|
|
660
|
+
enumerable: true,
|
|
661
|
+
get: function() {
|
|
662
|
+
return selectRetainedMSTeamsConversations;
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
Object.defineProperty(exports, "selectRetainedMSTeamsPolls", {
|
|
666
|
+
enumerable: true,
|
|
667
|
+
get: function() {
|
|
668
|
+
return selectRetainedMSTeamsPolls;
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
Object.defineProperty(exports, "splitMSTeamsPoll", {
|
|
672
|
+
enumerable: true,
|
|
673
|
+
get: function() {
|
|
674
|
+
return splitMSTeamsPoll;
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
Object.defineProperty(exports, "toPluginJsonValue", {
|
|
678
|
+
enumerable: true,
|
|
679
|
+
get: function() {
|
|
680
|
+
return toPluginJsonValue;
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
Object.defineProperty(exports, "withMSTeamsSqliteMutationLock", {
|
|
684
|
+
enumerable: true,
|
|
685
|
+
get: function() {
|
|
686
|
+
return withMSTeamsSqliteMutationLock;
|
|
687
|
+
}
|
|
688
|
+
});
|