Skip to content

Commit 3f002b1

Browse files
committed
refactor: trim msteams helper exports
1 parent 579acc3 commit 3f002b1

35 files changed

Lines changed: 91 additions & 96 deletions

extensions/msteams/src/attachments/shared.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ type InlineImageLimitOptions = {
3434
maxInlineTotalBytes?: number;
3535
};
3636

37-
export const IMAGE_EXT_RE = /\.(avif|bmp|gif|heic|heif|jpe?g|png|tiff?|webp)$/i;
37+
const IMAGE_EXT_RE = /\.(avif|bmp|gif|heic|heif|jpe?g|png|tiff?|webp)$/i;
3838

3939
export const IMG_SRC_RE = /<img[^>]+src=["']([^"']+)["'][^>]*>/gi;
4040
export const ATTACHMENT_TAG_RE = /<attachment[^>]+id=["']([^"']+)["'][^>]*>/gi;
4141

42-
export const DEFAULT_MEDIA_HOST_ALLOWLIST = [
42+
const DEFAULT_MEDIA_HOST_ALLOWLIST = [
4343
"graph.microsoft.com",
4444
"graph.microsoft.us",
4545
"graph.microsoft.de",
@@ -67,7 +67,7 @@ export const DEFAULT_MEDIA_HOST_ALLOWLIST = [
6767
"microsoft.com",
6868
] as const;
6969

70-
export const DEFAULT_MEDIA_AUTH_HOST_ALLOWLIST = [
70+
const DEFAULT_MEDIA_AUTH_HOST_ALLOWLIST = [
7171
"api.botframework.com",
7272
"botframework.com",
7373
// Bot Framework Service URL (smba.trafficmanager.net) used for outbound

extensions/msteams/src/errors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ function extractRetryAfterMs(err: unknown): number | null {
149149
return null;
150150
}
151151

152-
export type MSTeamsSendErrorKind = "auth" | "throttled" | "transient" | "permanent" | "unknown";
152+
type MSTeamsSendErrorKind = "auth" | "throttled" | "transient" | "permanent" | "unknown";
153153

154-
export type MSTeamsSendErrorClassification = {
154+
type MSTeamsSendErrorClassification = {
155155
kind: MSTeamsSendErrorKind;
156156
statusCode?: number;
157157
retryAfterMs?: number;

extensions/msteams/src/feedback-reflection-prompt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/text-runti
33
/** Max chars of the thumbed-down response to include in the reflection prompt. */
44
const MAX_RESPONSE_CHARS = 500;
55

6-
export type ParsedReflectionResponse = {
6+
type ParsedReflectionResponse = {
77
learning: string;
88
followUp: boolean;
99
userMessage?: string;

extensions/msteams/src/feedback-reflection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { buildConversationReference } from "./messenger.js";
3131
import type { MSTeamsMonitorLogger } from "./monitor-types.js";
3232
import { getMSTeamsRuntime } from "./runtime.js";
3333

34-
export type FeedbackEvent = {
34+
type FeedbackEvent = {
3535
type: "custom";
3636
event: "feedback";
3737
ts: number;
@@ -65,7 +65,7 @@ export function buildFeedbackEvent(params: {
6565
};
6666
}
6767

68-
export type RunFeedbackReflectionParams = {
68+
type RunFeedbackReflectionParams = {
6969
cfg: OpenClawConfig;
7070
adapter: MSTeamsAdapter;
7171
appId: string;

extensions/msteams/src/file-consent-helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import { buildFileConsentCard } from "./file-consent.js";
1414
import { storePendingUploadFs } from "./pending-uploads-fs.js";
1515
import { storePendingUpload } from "./pending-uploads.js";
1616

17-
export type FileConsentMedia = {
17+
type FileConsentMedia = {
1818
buffer: Buffer;
1919
filename: string;
2020
contentType?: string;
2121
};
2222

23-
export type FileConsentActivityResult = {
23+
type FileConsentActivityResult = {
2424
activity: Record<string, unknown>;
2525
uploadId: string;
2626
};

extensions/msteams/src/file-consent-invoke.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import type { MSTeamsTurnContext } from "./sdk-types.js";
1010
/**
1111
* Handle fileConsent/invoke activities for large file uploads.
1212
*/
13-
export async function handleMSTeamsFileConsentInvoke(
13+
async function handleMSTeamsFileConsentInvoke(
1414
context: MSTeamsTurnContext,
1515
log: MSTeamsMonitorLogger,
1616
): Promise<boolean> {

extensions/msteams/src/file-consent.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,15 @@ export async function validateConsentUploadUrl(
159159
}
160160
}
161161

162-
export interface FileConsentCardParams {
162+
interface FileConsentCardParams {
163163
filename: string;
164164
description?: string;
165165
sizeInBytes: number;
166166
/** Custom context data to include in the card (passed back in the invoke) */
167167
context?: Record<string, unknown>;
168168
}
169169

170-
export interface FileInfoCardParams {
170+
interface FileInfoCardParams {
171171
filename: string;
172172
contentUrl: string;
173173
uniqueId: string;
@@ -207,15 +207,15 @@ export function buildFileInfoCard(params: FileInfoCardParams) {
207207
};
208208
}
209209

210-
export interface FileConsentUploadInfo {
210+
interface FileConsentUploadInfo {
211211
name: string;
212212
uploadUrl: string;
213213
contentUrl: string;
214214
uniqueId: string;
215215
fileType: string;
216216
}
217217

218-
export interface FileConsentResponse {
218+
interface FileConsentResponse {
219219
action: "accept" | "decline";
220220
uploadInfo?: FileConsentUploadInfo;
221221
context?: Record<string, unknown>;

extensions/msteams/src/graph-group-management.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ import {
1313
// Add Participant
1414
// ---------------------------------------------------------------------------
1515

16-
export type AddParticipantMSTeamsParams = {
16+
type AddParticipantMSTeamsParams = {
1717
cfg: OpenClawConfig;
1818
to: string;
1919
userId: string;
2020
role?: string;
2121
};
2222

23-
export type AddParticipantMSTeamsResult = {
23+
type AddParticipantMSTeamsResult = {
2424
added: { userId: string; chatId: string };
2525
};
2626

@@ -66,13 +66,13 @@ export async function addParticipantMSTeams(
6666
// Remove Participant
6767
// ---------------------------------------------------------------------------
6868

69-
export type RemoveParticipantMSTeamsParams = {
69+
type RemoveParticipantMSTeamsParams = {
7070
cfg: OpenClawConfig;
7171
to: string;
7272
userId: string;
7373
};
7474

75-
export type RemoveParticipantMSTeamsResult = {
75+
type RemoveParticipantMSTeamsResult = {
7676
removed: { userId: string; chatId: string };
7777
};
7878

@@ -136,13 +136,13 @@ export async function removeParticipantMSTeams(
136136
// Rename Group
137137
// ---------------------------------------------------------------------------
138138

139-
export type RenameGroupMSTeamsParams = {
139+
type RenameGroupMSTeamsParams = {
140140
cfg: OpenClawConfig;
141141
to: string;
142142
name: string;
143143
};
144144

145-
export type RenameGroupMSTeamsResult = {
145+
type RenameGroupMSTeamsResult = {
146146
renamed: { chatId: string; newName: string };
147147
};
148148

extensions/msteams/src/graph-members.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ type GraphUserProfile = {
1010
officeLocation?: string;
1111
};
1212

13-
export type GetMemberInfoMSTeamsParams = {
13+
type GetMemberInfoMSTeamsParams = {
1414
cfg: OpenClawConfig;
1515
userId: string;
1616
};
1717

18-
export type GetMemberInfoMSTeamsResult = {
18+
type GetMemberInfoMSTeamsResult = {
1919
user: {
2020
id: string | undefined;
2121
displayName: string | undefined;

extensions/msteams/src/graph-teams.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { type GraphResponse, fetchGraphJson, resolveGraphToken } from "./graph.j
55
// Types
66
// ---------------------------------------------------------------------------
77

8-
export type GraphTeamsChannel = {
8+
type GraphTeamsChannel = {
99
id?: string;
1010
displayName?: string;
1111
description?: string;
@@ -14,12 +14,12 @@ export type GraphTeamsChannel = {
1414
createdDateTime?: string;
1515
};
1616

17-
export type ListChannelsMSTeamsParams = {
17+
type ListChannelsMSTeamsParams = {
1818
cfg: OpenClawConfig;
1919
teamId: string;
2020
};
2121

22-
export type ListChannelsMSTeamsResult = {
22+
type ListChannelsMSTeamsResult = {
2323
channels: Array<{
2424
id: string | undefined;
2525
displayName: string | undefined;
@@ -29,13 +29,13 @@ export type ListChannelsMSTeamsResult = {
2929
truncated?: boolean;
3030
};
3131

32-
export type GetChannelInfoMSTeamsParams = {
32+
type GetChannelInfoMSTeamsParams = {
3333
cfg: OpenClawConfig;
3434
teamId: string;
3535
channelId: string;
3636
};
3737

38-
export type GetChannelInfoMSTeamsResult = {
38+
type GetChannelInfoMSTeamsResult = {
3939
channel: {
4040
id: string | undefined;
4141
displayName: string | undefined;

0 commit comments

Comments
 (0)