@joshuanode/n8n-nodes-teamsbot 0.0.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/README.md ADDED
@@ -0,0 +1,90 @@
1
+ # n8n-nodes-teamsbot
2
+
3
+ This community node package adds Microsoft Teams Bot Framework support to n8n with a focus on modern single-tenant bot setups.
4
+
5
+ It includes:
6
+
7
+ - `Microsoft Teams Bot Trigger`: receives incoming Bot Framework activities from Teams
8
+ - `Microsoft Teams Bot`: sends/replies/updates/deletes activities and works with conversation APIs
9
+
10
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
11
+
12
+ ## Installation
13
+
14
+ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
15
+
16
+ ## Operations
17
+
18
+ ### Microsoft Teams Bot Trigger
19
+
20
+ - Trigger on activity types:
21
+ - `message`
22
+ - `conversationUpdate`
23
+ - `messageReaction`
24
+ - `messageUpdate`
25
+ - `messageDelete`
26
+ - `event`
27
+ - `installationUpdate`
28
+ - Optional behaviors:
29
+ - Ignore bot-originated activities
30
+ - Deduplicate activity deliveries
31
+ - Verify JWT signatures from Bot Framework OpenID/JWKS endpoints
32
+ - Validate channel endorsements
33
+ - Include raw activity in output
34
+
35
+ ### Microsoft Teams Bot
36
+
37
+ - `Send Activity`
38
+ - `Reply To Activity`
39
+ - `Update Activity`
40
+ - `Delete Activity`
41
+ - `Send Typing Indicator`
42
+ - `Get Conversation Members`
43
+ - `Create Conversation`
44
+
45
+ ## Credentials
46
+
47
+ Create a `Microsoft Teams Bot API` credential with:
48
+
49
+ - `Microsoft App ID`
50
+ - `Microsoft App Secret`
51
+ - `Tenant ID` (required for single-tenant token acquisition)
52
+
53
+ This package requests tokens from:
54
+
55
+ `https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token`
56
+
57
+ with scope:
58
+
59
+ `https://api.botframework.com/.default`
60
+
61
+ ## Usage
62
+
63
+ ### Minimal inbound -> outbound workflow
64
+
65
+ 1. Add `Microsoft Teams Bot Trigger`.
66
+ 2. Configure your Bot Framework messaging endpoint to the trigger webhook URL.
67
+ 3. Add a `Microsoft Teams Bot` node after the trigger.
68
+ 4. Use operation `Reply To Activity` or `Send Activity`.
69
+ 5. Map:
70
+ - `Service URL` -> `{{$json.botContext.serviceUrl}}`
71
+ - `Conversation ID` -> `{{$json.botContext.conversationId}}`
72
+ - `Activity ID` (if replying/updating/deleting) -> `{{$json.botContext.activityId}}`
73
+
74
+ ### Endpoint reminder
75
+
76
+ The trigger webhook path is:
77
+
78
+ `<your-n8n-webhook-base>/<workflow-webhook-path>/webhook`
79
+
80
+ Use the exact production URL when configuring the bot messaging endpoint in Azure.
81
+
82
+ ## Resources
83
+
84
+ * [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
85
+ * [Bot Framework authentication troubleshooting](https://learn.microsoft.com/azure/bot-service/bot-service-troubleshoot-authentication-problems)
86
+ * [Microsoft identity platform OAuth 2.0 client credentials flow](https://learn.microsoft.com/entra/identity-platform/v2-oauth2-client-creds-grant-flow)
87
+
88
+ ## Version history
89
+
90
+ - `0.0.1`: Initial release with trigger + action nodes and single-tenant auth model.
@@ -0,0 +1,18 @@
1
+ import type { ICredentialType, Icon, INodeProperties } from 'n8n-workflow';
2
+ export declare class TeamsBotApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ icon: Icon;
6
+ documentationUrl: string;
7
+ properties: INodeProperties[];
8
+ test: {
9
+ request: {
10
+ method: "POST";
11
+ url: string;
12
+ headers: {
13
+ 'Content-Type': string;
14
+ };
15
+ body: string;
16
+ };
17
+ };
18
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TeamsBotApi = void 0;
4
+ class TeamsBotApi {
5
+ constructor() {
6
+ this.name = 'teamsBotApi';
7
+ this.displayName = 'Microsoft Teams Bot API';
8
+ this.icon = 'file:teamsbot.svg';
9
+ this.documentationUrl = 'https://learn.microsoft.com/azure/bot-service/bot-service-troubleshoot-authentication-problems';
10
+ this.properties = [
11
+ {
12
+ displayName: 'Microsoft App ID',
13
+ name: 'appId',
14
+ type: 'string',
15
+ default: '',
16
+ required: true,
17
+ description: 'Application (client) ID for your Bot registration',
18
+ },
19
+ {
20
+ displayName: 'Microsoft App Secret',
21
+ name: 'appSecret',
22
+ type: 'string',
23
+ typeOptions: {
24
+ password: true,
25
+ },
26
+ default: '',
27
+ required: true,
28
+ description: 'Client secret for your Bot registration',
29
+ },
30
+ {
31
+ displayName: 'Tenant ID',
32
+ name: 'tenantId',
33
+ type: 'string',
34
+ default: '',
35
+ required: true,
36
+ description: 'Directory (tenant) ID. Required for single-tenant token acquisition.',
37
+ },
38
+ ];
39
+ this.test = {
40
+ request: {
41
+ method: 'POST',
42
+ url: '={{"https://login.microsoftonline.com/" + $credentials.tenantId + "/oauth2/v2.0/token"}}',
43
+ headers: {
44
+ 'Content-Type': 'application/x-www-form-urlencoded',
45
+ },
46
+ body: '={{"grant_type=client_credentials&client_id=" + encodeURIComponent($credentials.appId) + "&client_secret=" + encodeURIComponent($credentials.appSecret) + "&scope=" + encodeURIComponent("https://api.botframework.com/.default")}}',
47
+ },
48
+ };
49
+ }
50
+ }
51
+ exports.TeamsBotApi = TeamsBotApi;
52
+ //# sourceMappingURL=TeamsBotApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TeamsBotApi.credentials.js","sourceRoot":"","sources":["../../credentials/TeamsBotApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,WAAW;IAAxB;QACC,SAAI,GAAG,aAAa,CAAC;QAErB,gBAAW,GAAG,yBAAyB,CAAC;QAExC,SAAI,GAAS,mBAAmB,CAAC;QAEjC,qBAAgB,GAAG,gGAAgG,CAAC;QAEpH,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,mDAAmD;aAChE;YACD;gBACC,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,yCAAyC;aACtD;YACD;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,sEAAsE;aACnF;SACD,CAAC;QAEF,SAAI,GAAG;YACN,OAAO,EAAE;gBACR,MAAM,EAAE,MAAe;gBACvB,GAAG,EAAE,0FAA0F;gBAC/F,OAAO,EAAE;oBACR,cAAc,EAAE,mCAAmC;iBACnD;gBACD,IAAI,EAAE,qOAAqO;aAC3O;SACD,CAAC;IACH,CAAC;CAAA;AAjDD,kCAiDC"}
@@ -0,0 +1,30 @@
1
+ <svg width="128" height="128" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg">
2
+ <defs>
3
+ <linearGradient id="g1d" x1="18" y1="42" x2="96" y2="114" gradientUnits="userSpaceOnUse">
4
+ <stop stop-color="#96C2F2"/>
5
+ <stop offset="1" stop-color="#8B8BFF"/>
6
+ </linearGradient>
7
+ <linearGradient id="g2d" x1="68" y1="56" x2="120" y2="120" gradientUnits="userSpaceOnUse">
8
+ <stop stop-color="#6A5BE0"/>
9
+ <stop offset="1" stop-color="#9488FF"/>
10
+ </linearGradient>
11
+ <linearGradient id="g3d" x1="16" y1="64" x2="66" y2="118" gradientUnits="userSpaceOnUse">
12
+ <stop stop-color="#889EFF"/>
13
+ <stop offset="1" stop-color="#4A3EDA"/>
14
+ </linearGradient>
15
+ <linearGradient id="g4d" x1="38" y1="8" x2="72" y2="44" gradientUnits="userSpaceOnUse">
16
+ <stop stop-color="#A1C8F7"/>
17
+ <stop offset="1" stop-color="#8580FF"/>
18
+ </linearGradient>
19
+ <linearGradient id="g5d" x1="88" y1="22" x2="112" y2="56" gradientUnits="userSpaceOnUse">
20
+ <stop stop-color="#B0AFFF"/>
21
+ <stop offset="1" stop-color="#7A72F3"/>
22
+ </linearGradient>
23
+ </defs>
24
+ <circle cx="52" cy="26" r="24" fill="url(#g4d)"/>
25
+ <circle cx="102" cy="38" r="18" fill="url(#g5d)"/>
26
+ <rect x="14" y="48" width="76" height="72" rx="34" fill="url(#g1d)"/>
27
+ <rect x="64" y="56" width="58" height="64" rx="26" fill="url(#g2d)"/>
28
+ <rect x="0" y="66" width="58" height="56" rx="14" fill="url(#g3d)"/>
29
+ <path d="M14 80h30v6H32v28h-6V86H14z" fill="#101325"/>
30
+ </svg>
@@ -0,0 +1,30 @@
1
+ <svg width="128" height="128" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg">
2
+ <defs>
3
+ <linearGradient id="g1" x1="18" y1="42" x2="96" y2="114" gradientUnits="userSpaceOnUse">
4
+ <stop stop-color="#7CB0EB"/>
5
+ <stop offset="1" stop-color="#6F6EF8"/>
6
+ </linearGradient>
7
+ <linearGradient id="g2" x1="68" y1="56" x2="120" y2="120" gradientUnits="userSpaceOnUse">
8
+ <stop stop-color="#4C3BC0"/>
9
+ <stop offset="1" stop-color="#7466EF"/>
10
+ </linearGradient>
11
+ <linearGradient id="g3" x1="16" y1="64" x2="66" y2="118" gradientUnits="userSpaceOnUse">
12
+ <stop stop-color="#6D84EE"/>
13
+ <stop offset="1" stop-color="#2F27A8"/>
14
+ </linearGradient>
15
+ <linearGradient id="g4" x1="38" y1="8" x2="72" y2="44" gradientUnits="userSpaceOnUse">
16
+ <stop stop-color="#84B0E8"/>
17
+ <stop offset="1" stop-color="#6B63E8"/>
18
+ </linearGradient>
19
+ <linearGradient id="g5" x1="88" y1="22" x2="112" y2="56" gradientUnits="userSpaceOnUse">
20
+ <stop stop-color="#8A88F3"/>
21
+ <stop offset="1" stop-color="#5D55E0"/>
22
+ </linearGradient>
23
+ </defs>
24
+ <circle cx="52" cy="26" r="24" fill="url(#g4)"/>
25
+ <circle cx="102" cy="38" r="18" fill="url(#g5)"/>
26
+ <rect x="14" y="48" width="76" height="72" rx="34" fill="url(#g1)"/>
27
+ <rect x="64" y="56" width="58" height="64" rx="26" fill="url(#g2)"/>
28
+ <rect x="0" y="66" width="58" height="56" rx="14" fill="url(#g3)"/>
29
+ <path d="M14 80h30v6H32v28h-6V86H14z" fill="#ECECEC"/>
30
+ </svg>
@@ -0,0 +1,44 @@
1
+ import type { IDataObject, IExecuteFunctions, IHttpRequestMethods, IWebhookFunctions } from 'n8n-workflow';
2
+ type TeamsNodeFunctions = IExecuteFunctions | IWebhookFunctions;
3
+ type JwtPayload = IDataObject & {
4
+ iss?: string;
5
+ aud?: string | string[];
6
+ exp?: number;
7
+ nbf?: number;
8
+ serviceurl?: string;
9
+ serviceUrl?: string;
10
+ };
11
+ type ValidationResult = {
12
+ valid: boolean;
13
+ reason?: string;
14
+ claims?: JwtPayload;
15
+ };
16
+ type ValidationOptions = {
17
+ allowUnsignedRequests: boolean;
18
+ validateKeyEndorsements: boolean;
19
+ };
20
+ export type TeamsBotCredentials = IDataObject & {
21
+ appId: string;
22
+ appSecret: string;
23
+ tenantId: string;
24
+ };
25
+ export type BotFrameworkActivity = IDataObject & {
26
+ id?: string;
27
+ type?: string;
28
+ text?: string;
29
+ timestamp?: string;
30
+ channelId?: string;
31
+ serviceUrl?: string;
32
+ locale?: string;
33
+ from?: IDataObject;
34
+ recipient?: IDataObject;
35
+ conversation?: IDataObject;
36
+ channelData?: IDataObject;
37
+ };
38
+ export declare function getBotAccessToken(this: TeamsNodeFunctions, credentials: TeamsBotCredentials): Promise<string>;
39
+ export declare function botFrameworkRequest(this: TeamsNodeFunctions, credentials: TeamsBotCredentials, method: IHttpRequestMethods, serviceUrl: string, path: string, body?: IDataObject): Promise<IDataObject>;
40
+ export declare function validateIncomingRequest(this: IWebhookFunctions, credentials: TeamsBotCredentials, activity: BotFrameworkActivity, options: ValidationOptions): Promise<ValidationResult>;
41
+ export declare function normalizeString(value: unknown): string | undefined;
42
+ export declare function trimTrailingSlashes(value: string): string;
43
+ export declare function parseJsonField(value: string, label: string): IDataObject | IDataObject[] | undefined;
44
+ export {};
@@ -0,0 +1,315 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBotAccessToken = getBotAccessToken;
4
+ exports.botFrameworkRequest = botFrameworkRequest;
5
+ exports.validateIncomingRequest = validateIncomingRequest;
6
+ exports.normalizeString = normalizeString;
7
+ exports.trimTrailingSlashes = trimTrailingSlashes;
8
+ exports.parseJsonField = parseJsonField;
9
+ const crypto_1 = require("crypto");
10
+ const n8n_workflow_1 = require("n8n-workflow");
11
+ const TOKEN_SCOPE = 'https://api.botframework.com/.default';
12
+ const OPEN_ID_CONFIGURATION_URL = 'https://login.botframework.com/v1/.well-known/openidconfiguration';
13
+ const OPEN_ID_CACHE_TTL_MS = 60 * 60 * 1000;
14
+ const JWKS_CACHE_TTL_MS = 15 * 60 * 1000;
15
+ const TOKEN_CACHE_SKEW_MS = 2 * 60 * 1000;
16
+ const CLAIM_TOLERANCE_SECONDS = 300;
17
+ const tokenCache = new Map();
18
+ let openIdCache = null;
19
+ const jwksCache = new Map();
20
+ async function getBotAccessToken(credentials) {
21
+ const appId = normalizeString(credentials.appId);
22
+ const appSecret = normalizeString(credentials.appSecret);
23
+ const tenantId = normalizeString(credentials.tenantId);
24
+ if (!appId || !appSecret || !tenantId) {
25
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Microsoft App ID, App Secret, and Tenant ID are required credentials.');
26
+ }
27
+ const cacheKey = `${tenantId}:${appId}`;
28
+ const cachedToken = tokenCache.get(cacheKey);
29
+ if (cachedToken && cachedToken.expiresAt > Date.now() + TOKEN_CACHE_SKEW_MS) {
30
+ return cachedToken.accessToken;
31
+ }
32
+ const tokenEndpoint = `https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token`;
33
+ const body = new URLSearchParams({
34
+ grant_type: 'client_credentials',
35
+ client_id: appId,
36
+ client_secret: appSecret,
37
+ scope: TOKEN_SCOPE,
38
+ });
39
+ try {
40
+ const tokenResponse = (await this.helpers.httpRequest({
41
+ method: 'POST',
42
+ url: tokenEndpoint,
43
+ headers: {
44
+ 'Content-Type': 'application/x-www-form-urlencoded',
45
+ },
46
+ body: body.toString(),
47
+ json: true,
48
+ }));
49
+ const accessToken = normalizeString(tokenResponse.access_token);
50
+ const expiresIn = toNumber(tokenResponse.expires_in);
51
+ if (!accessToken || !expiresIn) {
52
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Token endpoint returned an invalid response.');
53
+ }
54
+ tokenCache.set(cacheKey, {
55
+ accessToken,
56
+ expiresAt: Date.now() + expiresIn * 1000,
57
+ });
58
+ return accessToken;
59
+ }
60
+ catch (error) {
61
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error, {
62
+ message: 'Failed to acquire a Bot Framework access token.',
63
+ description: `Token endpoint: ${tokenEndpoint}`,
64
+ });
65
+ }
66
+ }
67
+ async function botFrameworkRequest(credentials, method, serviceUrl, path, body) {
68
+ const normalizedServiceUrl = trimTrailingSlashes(serviceUrl);
69
+ if (!normalizedServiceUrl) {
70
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Service URL is required.');
71
+ }
72
+ const normalizedPath = path.startsWith('/') ? path : `/${path}`;
73
+ const url = `${normalizedServiceUrl}${normalizedPath}`;
74
+ const accessToken = await getBotAccessToken.call(this, credentials);
75
+ try {
76
+ const requestOptions = {
77
+ method,
78
+ url,
79
+ headers: {
80
+ Authorization: `Bearer ${accessToken}`,
81
+ 'Content-Type': 'application/json',
82
+ },
83
+ json: true,
84
+ };
85
+ if (body && method !== 'GET' && method !== 'DELETE') {
86
+ requestOptions.body = body;
87
+ }
88
+ const response = await this.helpers.httpRequest(requestOptions);
89
+ if (response === undefined || response === null) {
90
+ return {};
91
+ }
92
+ if (typeof response === 'object') {
93
+ return response;
94
+ }
95
+ return { value: response };
96
+ }
97
+ catch (error) {
98
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error, {
99
+ message: `Bot Framework request failed (${method} ${url}).`,
100
+ });
101
+ }
102
+ }
103
+ async function validateIncomingRequest(credentials, activity, options) {
104
+ var _a, _b;
105
+ const authorizationHeader = getAuthorizationHeader(this.getHeaderData());
106
+ if (!authorizationHeader) {
107
+ return options.allowUnsignedRequests
108
+ ? { valid: true }
109
+ : { valid: false, reason: 'Missing Authorization header.' };
110
+ }
111
+ const tokenMatch = authorizationHeader.match(/^Bearer\s+(.+)$/i);
112
+ if (!tokenMatch) {
113
+ return { valid: false, reason: 'Authorization header must use Bearer token format.' };
114
+ }
115
+ const token = tokenMatch[1];
116
+ const decoded = decodeJwtToken(token);
117
+ if (!decoded) {
118
+ return { valid: false, reason: 'Unable to decode JWT token.' };
119
+ }
120
+ const openId = await getOpenIdConfiguration.call(this);
121
+ const jwks = await getJwks.call(this, openId.jwks_uri);
122
+ const signingKey = jwks.keys.find((key) => key.kid === decoded.header.kid);
123
+ if (!signingKey) {
124
+ return { valid: false, reason: `Signing key not found for kid "${decoded.header.kid}".` };
125
+ }
126
+ if (options.validateKeyEndorsements) {
127
+ const channelId = normalizeString(activity.channelId);
128
+ const endorsements = Array.isArray(signingKey.endorsements) ? signingKey.endorsements : [];
129
+ if (channelId && endorsements.length > 0 && !endorsements.includes(channelId)) {
130
+ return {
131
+ valid: false,
132
+ reason: `Signing key endorsements do not allow channel "${channelId}".`,
133
+ };
134
+ }
135
+ }
136
+ if (decoded.header.alg !== 'RS256') {
137
+ return { valid: false, reason: `Unsupported JWT algorithm "${(_a = decoded.header.alg) !== null && _a !== void 0 ? _a : 'unknown'}".` };
138
+ }
139
+ if (!verifyJwtSignature(decoded.signedContent, decoded.signature, signingKey)) {
140
+ return { valid: false, reason: 'JWT signature verification failed.' };
141
+ }
142
+ const nowSeconds = Math.floor(Date.now() / 1000);
143
+ if (typeof decoded.payload.exp === 'number' &&
144
+ nowSeconds > decoded.payload.exp + CLAIM_TOLERANCE_SECONDS) {
145
+ return { valid: false, reason: 'JWT token has expired.' };
146
+ }
147
+ if (typeof decoded.payload.nbf === 'number' &&
148
+ nowSeconds + CLAIM_TOLERANCE_SECONDS < decoded.payload.nbf) {
149
+ return { valid: false, reason: 'JWT token is not valid yet (nbf check failed).' };
150
+ }
151
+ const appId = normalizeString(credentials.appId);
152
+ if (!appId) {
153
+ return { valid: false, reason: 'Credential is missing Microsoft App ID.' };
154
+ }
155
+ if (!isAudienceValid(decoded.payload.aud, appId)) {
156
+ return { valid: false, reason: 'JWT audience does not match Microsoft App ID.' };
157
+ }
158
+ if (!isIssuerValid(decoded.payload.iss, openId.issuer)) {
159
+ return { valid: false, reason: 'JWT issuer is not valid for Bot Framework.' };
160
+ }
161
+ const tokenServiceUrl = (_b = normalizeString(decoded.payload.serviceurl)) !== null && _b !== void 0 ? _b : normalizeString(decoded.payload.serviceUrl);
162
+ const requestServiceUrl = normalizeString(activity.serviceUrl);
163
+ if (tokenServiceUrl &&
164
+ requestServiceUrl &&
165
+ trimTrailingSlashes(tokenServiceUrl) !== trimTrailingSlashes(requestServiceUrl)) {
166
+ return { valid: false, reason: 'Token service URL does not match activity service URL.' };
167
+ }
168
+ return { valid: true, claims: decoded.payload };
169
+ }
170
+ function normalizeString(value) {
171
+ if (typeof value !== 'string') {
172
+ return undefined;
173
+ }
174
+ const trimmed = value.trim();
175
+ return trimmed.length > 0 ? trimmed : undefined;
176
+ }
177
+ function trimTrailingSlashes(value) {
178
+ return value.replace(/\/+$/g, '');
179
+ }
180
+ function parseJsonField(value, label) {
181
+ const trimmed = value.trim();
182
+ if (!trimmed) {
183
+ return undefined;
184
+ }
185
+ try {
186
+ return JSON.parse(trimmed);
187
+ }
188
+ catch (error) {
189
+ throw new Error(`Invalid JSON in "${label}": ${error.message}`);
190
+ }
191
+ }
192
+ function getAuthorizationHeader(headers) {
193
+ var _a, _b;
194
+ return ((_b = (_a = normalizeString(headers.authorization)) !== null && _a !== void 0 ? _a : normalizeString(headers.Authorization)) !== null && _b !== void 0 ? _b : normalizeString(headers.AUTHORIZATION));
195
+ }
196
+ function decodeJwtToken(token) {
197
+ const segments = token.split('.');
198
+ if (segments.length !== 3) {
199
+ return undefined;
200
+ }
201
+ try {
202
+ const headerJson = base64UrlToBuffer(segments[0]).toString('utf8');
203
+ const payloadJson = base64UrlToBuffer(segments[1]).toString('utf8');
204
+ const header = JSON.parse(headerJson);
205
+ const payload = JSON.parse(payloadJson);
206
+ const signature = base64UrlToBuffer(segments[2]);
207
+ if (!header.kid) {
208
+ return undefined;
209
+ }
210
+ return {
211
+ header,
212
+ payload,
213
+ signedContent: `${segments[0]}.${segments[1]}`,
214
+ signature,
215
+ };
216
+ }
217
+ catch {
218
+ return undefined;
219
+ }
220
+ }
221
+ function verifyJwtSignature(signedContent, signature, signingKey) {
222
+ const firstCertificate = Array.isArray(signingKey.x5c) ? signingKey.x5c[0] : undefined;
223
+ if (!firstCertificate) {
224
+ return false;
225
+ }
226
+ const certificatePem = buildCertificatePem(firstCertificate);
227
+ const publicKey = (0, crypto_1.createPublicKey)(certificatePem);
228
+ const verifier = (0, crypto_1.createVerify)('RSA-SHA256');
229
+ verifier.update(signedContent);
230
+ verifier.end();
231
+ return verifier.verify(publicKey, signature);
232
+ }
233
+ function buildCertificatePem(rawCertificate) {
234
+ var _a, _b;
235
+ const body = (_b = (_a = rawCertificate.match(/.{1,64}/g)) === null || _a === void 0 ? void 0 : _a.join('\n')) !== null && _b !== void 0 ? _b : rawCertificate;
236
+ return `-----BEGIN CERTIFICATE-----\n${body}\n-----END CERTIFICATE-----`;
237
+ }
238
+ function base64UrlToBuffer(input) {
239
+ let base64 = input.replace(/-/g, '+').replace(/_/g, '/');
240
+ const paddingNeeded = base64.length % 4;
241
+ if (paddingNeeded !== 0) {
242
+ base64 += '='.repeat(4 - paddingNeeded);
243
+ }
244
+ return Buffer.from(base64, 'base64');
245
+ }
246
+ function isAudienceValid(audClaim, appId) {
247
+ if (typeof audClaim === 'string') {
248
+ return audClaim === appId;
249
+ }
250
+ if (Array.isArray(audClaim)) {
251
+ return audClaim.includes(appId);
252
+ }
253
+ return false;
254
+ }
255
+ function isIssuerValid(issuerClaim, openIdIssuer) {
256
+ const issuer = normalizeString(issuerClaim);
257
+ if (!issuer) {
258
+ return false;
259
+ }
260
+ const allowedIssuers = new Set([
261
+ trimTrailingSlashes(openIdIssuer),
262
+ 'https://api.botframework.com',
263
+ ]);
264
+ return allowedIssuers.has(trimTrailingSlashes(issuer));
265
+ }
266
+ function toNumber(value) {
267
+ if (typeof value === 'number' && Number.isFinite(value)) {
268
+ return value;
269
+ }
270
+ if (typeof value === 'string' && value.trim()) {
271
+ const parsed = Number.parseInt(value, 10);
272
+ if (Number.isFinite(parsed)) {
273
+ return parsed;
274
+ }
275
+ }
276
+ return undefined;
277
+ }
278
+ async function getOpenIdConfiguration() {
279
+ if (openIdCache && openIdCache.expiresAt > Date.now()) {
280
+ return openIdCache.value;
281
+ }
282
+ const openIdResponse = (await this.helpers.httpRequest({
283
+ method: 'GET',
284
+ url: OPEN_ID_CONFIGURATION_URL,
285
+ json: true,
286
+ }));
287
+ if (!openIdResponse.issuer || !openIdResponse.jwks_uri) {
288
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Bot Framework OpenID configuration is invalid.');
289
+ }
290
+ openIdCache = {
291
+ value: openIdResponse,
292
+ expiresAt: Date.now() + OPEN_ID_CACHE_TTL_MS,
293
+ };
294
+ return openIdResponse;
295
+ }
296
+ async function getJwks(jwksUri) {
297
+ const cached = jwksCache.get(jwksUri);
298
+ if (cached && cached.expiresAt > Date.now()) {
299
+ return { keys: cached.keys };
300
+ }
301
+ const jwksResponse = (await this.helpers.httpRequest({
302
+ method: 'GET',
303
+ url: jwksUri,
304
+ json: true,
305
+ }));
306
+ if (!jwksResponse.keys || !Array.isArray(jwksResponse.keys)) {
307
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Bot Framework JWKS response is invalid.');
308
+ }
309
+ jwksCache.set(jwksUri, {
310
+ keys: jwksResponse.keys,
311
+ expiresAt: Date.now() + JWKS_CACHE_TTL_MS,
312
+ });
313
+ return jwksResponse;
314
+ }
315
+ //# sourceMappingURL=GenericFunctions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/TeamsBot/GenericFunctions.ts"],"names":[],"mappings":";;AAqGA,8CA2DC;AAED,kDAyDC;AAED,0DA4FC;AAED,0CAOC;AAED,kDAEC;AAED,wCAcC;AAtVD,mCAAuD;AASvD,+CAAgE;AAEhE,MAAM,WAAW,GAAG,uCAAuC,CAAC;AAC5D,MAAM,yBAAyB,GAC9B,mEAAmE,CAAC;AACrE,MAAM,oBAAoB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5C,MAAM,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACzC,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAC1C,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAgFpC,MAAM,UAAU,GAAG,IAAI,GAAG,EAA2B,CAAC;AACtD,IAAI,WAAW,GAAqC,IAAI,CAAC;AACzD,MAAM,SAAS,GAAG,IAAI,GAAG,EAA0D,CAAC;AAE7E,KAAK,UAAU,iBAAiB,CAEtC,WAAgC;IAEhC,MAAM,KAAK,GAAG,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,QAAQ,GAAG,eAAe,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAEvD,IAAI,CAAC,KA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AE,EAAE,yCAAyC,CAAC,CAAC;IACzF,CAAC;IAED,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE;QACtB,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,iBAAiB;KACzC,CAAC,CAAC;IAEH,OAAO,YAAY,CAAC;AACrB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class TeamsBot implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }