@robinpath/teams
Advanced tools
| import type { ModuleAdapter } from "@robinpath/core"; | ||
| declare const TeamsModule: ModuleAdapter; | ||
| export default TeamsModule; | ||
| export { TeamsModule }; | ||
| export { TeamsFunctions, TeamsFunctionMetadata, TeamsModuleMetadata, TeamsCredentialTypes, } from "./teams.js"; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AASrD,QAAA,MAAM,WAAW,EAAE,aAQlB,CAAC;AAEF,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,YAAY,CAAC"} |
| import { TeamsFunctions, TeamsFunctionMetadata, TeamsModuleMetadata, TeamsCredentialTypes, configureTeams, } from "./teams.js"; | ||
| const TeamsModule = { | ||
| name: "teams", | ||
| functions: TeamsFunctions, | ||
| functionMetadata: TeamsFunctionMetadata, | ||
| moduleMetadata: TeamsModuleMetadata, | ||
| credentialTypes: TeamsCredentialTypes, | ||
| configure: configureTeams, | ||
| global: false, | ||
| }; | ||
| export default TeamsModule; | ||
| export { TeamsModule }; | ||
| export { TeamsFunctions, TeamsFunctionMetadata, TeamsModuleMetadata, TeamsCredentialTypes, } from "./teams.js"; | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,GAAkB;IACjC,IAAI,EAAE,OAAO;IACb,SAAS,EAAE,cAAc;IACzB,gBAAgB,EAAE,qBAAqB;IACvC,cAAc,EAAE,mBAAmB;IACnC,eAAe,EAAE,oBAAoB;IACrC,SAAS,EAAE,cAAc;IACzB,MAAM,EAAE,KAAK;CACd,CAAC;AAEF,eAAe,WAAW,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,YAAY,CAAC"} |
| /** | ||
| * RobinPath Microsoft Teams Module (Node port) | ||
| * | ||
| * Microsoft Teams integration via the Microsoft Graph API | ||
| * (https://graph.microsoft.com/v1.0/teams/ + /chats/ + /me/joinedTeams). | ||
| * Covers team + channel enumeration, channel messaging (send / reply / list), | ||
| * channel CRUD, 1:1 + group chat messaging, and incoming-webhook posts. | ||
| * | ||
| * Modeled on the outlook node module — same `microsoft_graph` credential | ||
| * contract (`access_token` or `client_credentials`) so users reuse a single | ||
| * credential across the MS suite. | ||
| * | ||
| * Authentication caveats for Teams: | ||
| * - Many chat and channel-messaging scopes are "protected APIs" that | ||
| * require Microsoft-gated admin consent (see | ||
| * https://learn.microsoft.com/en-us/graph/teams-protected-apis). If a | ||
| * call returns 403 `InvalidDelegatedRequest` / `AccessDenied`, request | ||
| * the appropriate permissions in the Azure portal. | ||
| * - `sendWebhook` bypasses Graph entirely — it POSTs to a public Incoming | ||
| * Webhook URL (or Teams Workflow HTTP webhook) and needs no credential. | ||
| * In that case the first argument is the URL, not a credential slug. | ||
| */ | ||
| import type { BuiltinHandler, CredentialTypeSchema, FunctionMetadata, ModuleHost, ModuleMetadata } from "@robinpath/core"; | ||
| export declare function configureTeams(h: ModuleHost): void; | ||
| export declare const TeamsFunctions: Record<string, BuiltinHandler>; | ||
| export declare const TeamsCredentialTypes: CredentialTypeSchema[]; | ||
| export declare const TeamsFunctionMetadata: Record<string, FunctionMetadata>; | ||
| export declare const TeamsModuleMetadata: ModuleMetadata; | ||
| //# sourceMappingURL=teams.d.ts.map |
| {"version":3,"file":"teams.d.ts","sourceRoot":"","sources":["../src/teams.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,cAAc,EAEf,MAAM,iBAAiB,CAAC;AAezB,wBAAgB,cAAc,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAElD;AAgsBD,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAUzD,CAAC;AAIF,eAAO,MAAM,oBAAoB,EAAE,oBAAoB,EA0EtD,CAAC;AA0FF,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CA+TlE,CAAC;AAIF,eAAO,MAAM,mBAAmB,EAAE,cAkCjC,CAAC"} |
+1030
| /** | ||
| * RobinPath Microsoft Teams Module (Node port) | ||
| * | ||
| * Microsoft Teams integration via the Microsoft Graph API | ||
| * (https://graph.microsoft.com/v1.0/teams/ + /chats/ + /me/joinedTeams). | ||
| * Covers team + channel enumeration, channel messaging (send / reply / list), | ||
| * channel CRUD, 1:1 + group chat messaging, and incoming-webhook posts. | ||
| * | ||
| * Modeled on the outlook node module — same `microsoft_graph` credential | ||
| * contract (`access_token` or `client_credentials`) so users reuse a single | ||
| * credential across the MS suite. | ||
| * | ||
| * Authentication caveats for Teams: | ||
| * - Many chat and channel-messaging scopes are "protected APIs" that | ||
| * require Microsoft-gated admin consent (see | ||
| * https://learn.microsoft.com/en-us/graph/teams-protected-apis). If a | ||
| * call returns 403 `InvalidDelegatedRequest` / `AccessDenied`, request | ||
| * the appropriate permissions in the Azure portal. | ||
| * - `sendWebhook` bypasses Graph entirely — it POSTs to a public Incoming | ||
| * Webhook URL (or Teams Workflow HTTP webhook) and needs no credential. | ||
| * In that case the first argument is the URL, not a credential slug. | ||
| */ | ||
| // ── Module-local state (populated by configure hook) ──────────────────── | ||
| const state = {}; | ||
| function host() { | ||
| if (!state.host) { | ||
| throw new Error("Teams module not initialized. Pass the adapter to rp.registerModule() via loadModule so its configure() hook runs first."); | ||
| } | ||
| return state.host; | ||
| } | ||
| export function configureTeams(h) { | ||
| state.host = h; | ||
| } | ||
| // ── Constants ────────────────────────────────────────────────────────── | ||
| const GRAPH_API = "https://graph.microsoft.com/v1.0"; | ||
| const DEFAULT_SCOPE = "https://graph.microsoft.com/.default"; | ||
| const CREDENTIAL_TYPE = "microsoft_graph"; | ||
| const TOKEN_TTL_MS = 50 * 60 * 1000; | ||
| const tokenCache = new Map(); | ||
| function cacheGet(key) { | ||
| const entry = tokenCache.get(key); | ||
| if (!entry) | ||
| return null; | ||
| if (entry.expiresAt <= Date.now()) { | ||
| tokenCache.delete(key); | ||
| return null; | ||
| } | ||
| return entry.token; | ||
| } | ||
| function cacheSet(key, token, ttlMs = TOKEN_TTL_MS) { | ||
| tokenCache.set(key, { token, expiresAt: Date.now() + ttlMs }); | ||
| } | ||
| function errorReturn(error, code, extra = {}) { | ||
| return { error, code, ...extra }; | ||
| } | ||
| function isErrorReturn(v) { | ||
| return !!v && typeof v === "object" && "error" in v && "code" in v; | ||
| } | ||
| async function resolveCredential(credentialSlug) { | ||
| if (!credentialSlug) { | ||
| return errorReturn("Credential slug is required.", "credential_not_found"); | ||
| } | ||
| let fields; | ||
| try { | ||
| fields = await host().credentials.get(credentialSlug); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "credential_not_found"); | ||
| } | ||
| if (!fields) { | ||
| return errorReturn(`Credential '${credentialSlug}' not found.`, "credential_not_found"); | ||
| } | ||
| const mode = String(fields.auth_mode ?? "access_token"); | ||
| if (mode === "client_credentials") { | ||
| return resolveClientCredentialsToken(credentialSlug, fields); | ||
| } | ||
| return resolveAccessToken(credentialSlug, fields); | ||
| } | ||
| async function resolveAccessToken(credentialSlug, fields) { | ||
| const token = String(fields.access_token ?? ""); | ||
| const refreshToken = String(fields.refresh_token ?? ""); | ||
| const clientId = String(fields.client_id ?? ""); | ||
| const clientSecret = String(fields.client_secret ?? ""); | ||
| const tenantId = String(fields.tenant_id ?? "common"); | ||
| if (refreshToken && clientId && clientSecret) { | ||
| const cacheKey = `refresh|${credentialSlug}|${refreshToken}`; | ||
| const cached = cacheGet(cacheKey); | ||
| if (cached) { | ||
| return { | ||
| token: cached, | ||
| user: "", | ||
| credentialSlug, | ||
| fields, | ||
| mode: "access_token", | ||
| }; | ||
| } | ||
| } | ||
| if (token) { | ||
| return { | ||
| token, | ||
| user: "", | ||
| credentialSlug, | ||
| fields, | ||
| mode: "access_token", | ||
| }; | ||
| } | ||
| if (!refreshToken || !clientId || !clientSecret) { | ||
| return errorReturn("Credential has no `access_token`, and not enough info to refresh (need refresh_token + client_id + client_secret + tenant_id).", "token_missing"); | ||
| } | ||
| const refreshed = await refreshAccessToken(credentialSlug, refreshToken, clientId, clientSecret, tenantId); | ||
| if (isErrorReturn(refreshed)) | ||
| return refreshed; | ||
| return { | ||
| token: refreshed.token, | ||
| user: "", | ||
| credentialSlug, | ||
| fields, | ||
| mode: "access_token", | ||
| }; | ||
| } | ||
| async function refreshAccessToken(credentialSlug, refreshToken, clientId, clientSecret, tenantId) { | ||
| const tenant = tenantId || "common"; | ||
| const url = `https://login.microsoftonline.com/${encodeURIComponent(tenant)}/oauth2/v2.0/token`; | ||
| const body = new URLSearchParams({ | ||
| grant_type: "refresh_token", | ||
| refresh_token: refreshToken, | ||
| client_id: clientId, | ||
| client_secret: clientSecret, | ||
| scope: "https://graph.microsoft.com/.default offline_access", | ||
| }).toString(); | ||
| let response; | ||
| try { | ||
| response = await fetch(url, { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/x-www-form-urlencoded" }, | ||
| body, | ||
| }); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const raw = await response.text(); | ||
| let decoded = {}; | ||
| try { | ||
| decoded = raw ? JSON.parse(raw) : {}; | ||
| } | ||
| catch { | ||
| decoded = {}; | ||
| } | ||
| const status = response.status; | ||
| const accessToken = String(decoded.access_token ?? ""); | ||
| if (status < 200 || status >= 300 || !accessToken) { | ||
| const msg = String(decoded.error_description ?? decoded.error ?? "Refresh failed."); | ||
| return errorReturn(msg, "token_exchange_failed", { status }); | ||
| } | ||
| const expiresIn = Number(decoded.expires_in ?? 0); | ||
| const ttlMs = expiresIn > 0 ? Math.max(60_000, (expiresIn - 300) * 1000) : TOKEN_TTL_MS; | ||
| cacheSet(`refresh|${credentialSlug}|${refreshToken}`, accessToken, ttlMs); | ||
| await writeBackAccessToken(credentialSlug, accessToken); | ||
| return { token: accessToken }; | ||
| } | ||
| async function writeBackAccessToken(slug, newToken) { | ||
| try { | ||
| const current = (await host().credentials.get(slug)) ?? {}; | ||
| await host().credentials.set(slug, CREDENTIAL_TYPE, { | ||
| ...current, | ||
| access_token: newToken, | ||
| }); | ||
| } | ||
| catch { | ||
| // Best-effort. | ||
| } | ||
| } | ||
| async function resolveClientCredentialsToken(credentialSlug, fields) { | ||
| const clientId = String(fields.client_id ?? ""); | ||
| const clientSecret = String(fields.client_secret ?? ""); | ||
| const tenantId = String(fields.tenant_id ?? ""); | ||
| const defaultUser = String(fields.default_user ?? ""); | ||
| if (!clientId || !clientSecret || !tenantId) { | ||
| return errorReturn("client_credentials mode requires `client_id`, `client_secret`, and `tenant_id`.", "token_missing"); | ||
| } | ||
| if (!defaultUser) { | ||
| return errorReturn("client_credentials mode requires `default_user` (no `/me` in app-only auth). Set it to a user UPN or object ID.", "token_missing"); | ||
| } | ||
| const cacheKey = `cc|${tenantId}|${clientId}|${clientSecret}`; | ||
| const cached = cacheGet(cacheKey); | ||
| if (cached) { | ||
| return { | ||
| token: cached, | ||
| user: defaultUser, | ||
| credentialSlug, | ||
| fields, | ||
| mode: "client_credentials", | ||
| }; | ||
| } | ||
| const url = `https://login.microsoftonline.com/${encodeURIComponent(tenantId)}/oauth2/v2.0/token`; | ||
| const body = new URLSearchParams({ | ||
| grant_type: "client_credentials", | ||
| client_id: clientId, | ||
| client_secret: clientSecret, | ||
| scope: DEFAULT_SCOPE, | ||
| }).toString(); | ||
| let response; | ||
| try { | ||
| response = await fetch(url, { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/x-www-form-urlencoded" }, | ||
| body, | ||
| }); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const raw = await response.text(); | ||
| let decoded = {}; | ||
| try { | ||
| decoded = raw ? JSON.parse(raw) : {}; | ||
| } | ||
| catch { | ||
| decoded = {}; | ||
| } | ||
| const status = response.status; | ||
| const accessToken = String(decoded.access_token ?? ""); | ||
| if (status < 200 || status >= 300 || !accessToken) { | ||
| const msg = String(decoded.error_description ?? decoded.error ?? "Token exchange failed."); | ||
| return errorReturn(msg, "token_exchange_failed", { status }); | ||
| } | ||
| const expiresIn = Number(decoded.expires_in ?? 0); | ||
| const ttlMs = expiresIn > 0 ? Math.max(60_000, (expiresIn - 300) * 1000) : TOKEN_TTL_MS; | ||
| cacheSet(cacheKey, accessToken, ttlMs); | ||
| return { | ||
| token: accessToken, | ||
| user: defaultUser, | ||
| credentialSlug, | ||
| fields, | ||
| mode: "client_credentials", | ||
| }; | ||
| } | ||
| // ── HTTP — Microsoft Graph ───────────────────────────────────────────── | ||
| async function call(cred, method, relativePath, body, extraHeaders = {}) { | ||
| const resolved = await resolveCredential(cred); | ||
| if (isErrorReturn(resolved)) | ||
| return resolved; | ||
| return callWithToken(resolved, method, relativePath, body, extraHeaders); | ||
| } | ||
| async function callWithToken(resolved, method, relativePath, body, extraHeaders) { | ||
| const url = `${GRAPH_API}/${relativePath.replace(/^\/+/, "")}`; | ||
| const headers = { | ||
| Authorization: `Bearer ${resolved.token}`, | ||
| "Content-Type": "application/json", | ||
| Accept: "application/json", | ||
| ...extraHeaders, | ||
| }; | ||
| const init = { method, headers }; | ||
| if (body !== null && body !== undefined) { | ||
| init.body = JSON.stringify(body); | ||
| } | ||
| let response; | ||
| try { | ||
| response = await fetch(url, init); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const status = response.status; | ||
| const rawBody = await response.text(); | ||
| let decoded; | ||
| try { | ||
| decoded = rawBody ? JSON.parse(rawBody) : null; | ||
| } | ||
| catch { | ||
| decoded = { raw: rawBody }; | ||
| } | ||
| if (status >= 200 && status < 300) { | ||
| if (rawBody === "" || decoded === null) | ||
| return { ok: true, status }; | ||
| if (decoded && typeof decoded === "object") | ||
| return decoded; | ||
| return { raw: rawBody }; | ||
| } | ||
| const err = decoded && typeof decoded === "object" && "error" in decoded | ||
| ? decoded.error | ||
| : null; | ||
| const graphCode = err && typeof err === "object" && "code" in err | ||
| ? String(err.code ?? "") | ||
| : ""; | ||
| let message = `Microsoft Graph returned HTTP ${status}.`; | ||
| if (err && typeof err === "object" && "message" in err) { | ||
| message = String(err.message); | ||
| } | ||
| else if (typeof err === "string") { | ||
| message = err; | ||
| } | ||
| let code = "graph_error"; | ||
| switch (status) { | ||
| case 401: | ||
| code = "token_missing"; | ||
| break; | ||
| case 403: | ||
| code = "permission_denied"; | ||
| break; | ||
| case 404: | ||
| code = "not_found"; | ||
| break; | ||
| case 400: | ||
| code = "validation_failed"; | ||
| break; | ||
| case 429: | ||
| code = "rate_limited"; | ||
| break; | ||
| } | ||
| if (graphCode === "InvalidAuthenticationToken") | ||
| code = "token_missing"; | ||
| if (graphCode === "Forbidden" || graphCode === "AccessDenied") | ||
| code = "permission_denied"; | ||
| const result = { | ||
| error: message, | ||
| code, | ||
| status, | ||
| graph_error: decoded && typeof decoded === "object" ? decoded : { raw: rawBody }, | ||
| }; | ||
| if (status === 429) { | ||
| const retryAfter = response.headers.get("retry-after"); | ||
| if (retryAfter) { | ||
| result.retry_after = /^\d+$/.test(retryAfter) | ||
| ? parseInt(retryAfter, 10) | ||
| : retryAfter; | ||
| } | ||
| } | ||
| return result; | ||
| } | ||
| // ── OData helper ─────────────────────────────────────────────────────── | ||
| function odataSuffix(opts) { | ||
| if (!opts || Object.keys(opts).length === 0) | ||
| return ""; | ||
| const parts = []; | ||
| for (const [k, rawV] of Object.entries(opts)) { | ||
| if (rawV === null || rawV === undefined || rawV === "") | ||
| continue; | ||
| if (k === "consistencyLevel") | ||
| continue; | ||
| let v; | ||
| if (typeof rawV === "boolean") | ||
| v = rawV ? "true" : "false"; | ||
| else if (typeof rawV === "object") | ||
| v = JSON.stringify(rawV); | ||
| else | ||
| v = String(rawV); | ||
| parts.push(encodeURIComponent(k) + "=" + encodeURIComponent(v)); | ||
| } | ||
| return parts.length ? "?" + parts.join("&") : ""; | ||
| } | ||
| // ── Message builder ──────────────────────────────────────────────────── | ||
| /** | ||
| * Build a Graph chatMessage body. Accepts either a shorthand string | ||
| * (plain text) or a full object. `contentType` defaults to "html" but the | ||
| * caller can flip to "text". | ||
| */ | ||
| function buildMessageBody(messageOrFields) { | ||
| if (typeof messageOrFields === "string") { | ||
| if (messageOrFields === "") { | ||
| return errorReturn("Message body is empty.", "validation_failed"); | ||
| } | ||
| return { body: { content: messageOrFields, contentType: "html" } }; | ||
| } | ||
| if (messageOrFields && | ||
| typeof messageOrFields === "object" && | ||
| !Array.isArray(messageOrFields)) { | ||
| const obj = messageOrFields; | ||
| if (obj.body && typeof obj.body === "object" && !Array.isArray(obj.body)) { | ||
| // Already shaped correctly. | ||
| return obj; | ||
| } | ||
| if (typeof obj.content === "string") { | ||
| const contentType = String(obj.contentType ?? "html"); | ||
| const out = { | ||
| body: { content: String(obj.content), contentType }, | ||
| }; | ||
| // Pass through extra top-level fields (subject, importance, mentions, attachments). | ||
| for (const k of ["subject", "importance", "mentions", "attachments", "summary"]) { | ||
| if (k in obj) | ||
| out[k] = obj[k]; | ||
| } | ||
| return out; | ||
| } | ||
| } | ||
| return errorReturn("Message must be a string or `{content, contentType?}` object.", "validation_failed"); | ||
| } | ||
| // ── Handlers — Teams ─────────────────────────────────────────────────── | ||
| const listTeams = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| // Delegated: /me/joinedTeams. App-only: /users/{default_user}/joinedTeams. | ||
| const resolved = await resolveCredential(cred); | ||
| if (isErrorReturn(resolved)) | ||
| return resolved; | ||
| const path = resolved.user === "" | ||
| ? "me/joinedTeams" | ||
| : `users/${encodeURIComponent(resolved.user)}/joinedTeams`; | ||
| return (await callWithToken(resolved, "GET", path, null, {})); | ||
| }; | ||
| // ── Handlers — Channels ──────────────────────────────────────────────── | ||
| const listChannels = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const teamId = String(args[1] ?? ""); | ||
| const opts = args[2] && typeof args[2] === "object" && !Array.isArray(args[2]) | ||
| ? args[2] | ||
| : {}; | ||
| if (!teamId) { | ||
| return errorReturn("teamId is required.", "validation_failed"); | ||
| } | ||
| const suffix = odataSuffix(opts); | ||
| return (await call(cred, "GET", `teams/${encodeURIComponent(teamId)}/channels${suffix}`, null)); | ||
| }; | ||
| const createChannel = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const teamId = String(args[1] ?? ""); | ||
| const displayName = String(args[2] ?? ""); | ||
| const opts = args[3] && typeof args[3] === "object" && !Array.isArray(args[3]) | ||
| ? args[3] | ||
| : {}; | ||
| if (!teamId || !displayName) { | ||
| return errorReturn("teamId and displayName are required.", "validation_failed"); | ||
| } | ||
| const body = { | ||
| displayName, | ||
| membershipType: String(opts.membershipType ?? "standard"), | ||
| }; | ||
| if (opts.description) | ||
| body.description = String(opts.description); | ||
| return (await call(cred, "POST", `teams/${encodeURIComponent(teamId)}/channels`, body)); | ||
| }; | ||
| // ── Handlers — Channel messages ──────────────────────────────────────── | ||
| const sendChannel = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const teamId = String(args[1] ?? ""); | ||
| const channelId = String(args[2] ?? ""); | ||
| const message = args[3]; | ||
| if (!teamId || !channelId) { | ||
| return errorReturn("teamId and channelId are required.", "validation_failed"); | ||
| } | ||
| const body = buildMessageBody(message); | ||
| if (isErrorReturn(body)) | ||
| return body; | ||
| return (await call(cred, "POST", `teams/${encodeURIComponent(teamId)}/channels/${encodeURIComponent(channelId)}/messages`, body)); | ||
| }; | ||
| const getMessages = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const teamId = String(args[1] ?? ""); | ||
| const channelId = String(args[2] ?? ""); | ||
| const opts = args[3] && typeof args[3] === "object" && !Array.isArray(args[3]) | ||
| ? args[3] | ||
| : {}; | ||
| if (!teamId || !channelId) { | ||
| return errorReturn("teamId and channelId are required.", "validation_failed"); | ||
| } | ||
| // Back-compat: the old module accepted `{top: N}` — translate to `$top`. | ||
| const qs = { ...opts }; | ||
| if (qs.top !== undefined && qs.$top === undefined) { | ||
| qs.$top = qs.top; | ||
| delete qs.top; | ||
| } | ||
| const suffix = odataSuffix(qs); | ||
| return (await call(cred, "GET", `teams/${encodeURIComponent(teamId)}/channels/${encodeURIComponent(channelId)}/messages${suffix}`, null)); | ||
| }; | ||
| const replyToMessage = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const teamId = String(args[1] ?? ""); | ||
| const channelId = String(args[2] ?? ""); | ||
| const messageId = String(args[3] ?? ""); | ||
| const reply = args[4]; | ||
| if (!teamId || !channelId || !messageId) { | ||
| return errorReturn("teamId, channelId, and messageId are required.", "validation_failed"); | ||
| } | ||
| const body = buildMessageBody(reply); | ||
| if (isErrorReturn(body)) | ||
| return body; | ||
| return (await call(cred, "POST", `teams/${encodeURIComponent(teamId)}/channels/${encodeURIComponent(channelId)}/messages/${encodeURIComponent(messageId)}/replies`, body)); | ||
| }; | ||
| // ── Handlers — Chats ─────────────────────────────────────────────────── | ||
| const listChats = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const opts = args[1] && typeof args[1] === "object" && !Array.isArray(args[1]) | ||
| ? args[1] | ||
| : {}; | ||
| const resolved = await resolveCredential(cred); | ||
| if (isErrorReturn(resolved)) | ||
| return resolved; | ||
| const path = resolved.user === "" | ||
| ? "me/chats" | ||
| : `users/${encodeURIComponent(resolved.user)}/chats`; | ||
| const suffix = odataSuffix(opts); | ||
| return (await callWithToken(resolved, "GET", path + suffix, null, {})); | ||
| }; | ||
| const sendChat = async (args) => { | ||
| const cred = String(args[0] ?? ""); | ||
| const chatId = String(args[1] ?? ""); | ||
| const message = args[2]; | ||
| if (!chatId) { | ||
| return errorReturn("chatId is required.", "validation_failed"); | ||
| } | ||
| const body = buildMessageBody(message); | ||
| if (isErrorReturn(body)) | ||
| return body; | ||
| return (await call(cred, "POST", `chats/${encodeURIComponent(chatId)}/messages`, body)); | ||
| }; | ||
| // ── Handlers — Webhook (no Graph) ────────────────────────────────────── | ||
| /** | ||
| * Post to an Incoming Webhook URL. This bypasses Graph and the credential | ||
| * vault — the URL itself is the auth. Accepts: | ||
| * - A plain string message (wrapped as Microsoft Teams MessageCard text) | ||
| * - An object payload passed through as-is (Adaptive Card / custom JSON) | ||
| */ | ||
| const sendWebhook = async (args) => { | ||
| const webhookUrl = String(args[0] ?? ""); | ||
| const message = args[1]; | ||
| const opts = args[2] && typeof args[2] === "object" && !Array.isArray(args[2]) | ||
| ? args[2] | ||
| : {}; | ||
| if (!webhookUrl) { | ||
| return errorReturn("webhookUrl is required.", "validation_failed"); | ||
| } | ||
| let payload; | ||
| if (message && typeof message === "object" && !Array.isArray(message)) { | ||
| payload = { ...message }; | ||
| } | ||
| else if (typeof message === "string") { | ||
| payload = { text: message }; | ||
| } | ||
| else { | ||
| return errorReturn("message is required (string or object).", "validation_failed"); | ||
| } | ||
| if (opts.title && payload.title === undefined) | ||
| payload.title = String(opts.title); | ||
| if (opts.themeColor && payload.themeColor === undefined) | ||
| payload.themeColor = String(opts.themeColor); | ||
| if (opts.sections && payload.sections === undefined) | ||
| payload.sections = opts.sections; | ||
| let response; | ||
| try { | ||
| response = await fetch(webhookUrl, { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify(payload), | ||
| }); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const status = response.status; | ||
| const text = await response.text(); | ||
| if (status < 200 || status >= 300) { | ||
| return errorReturn(`Webhook returned HTTP ${status}: ${text || "(empty body)"}`, "webhook_error", { status }); | ||
| } | ||
| return { ok: true, status, response: text || null }; | ||
| }; | ||
| // ── Exports: functions map ───────────────────────────────────────────── | ||
| export const TeamsFunctions = { | ||
| listTeams, | ||
| listChannels, | ||
| createChannel, | ||
| sendChannel, | ||
| getMessages, | ||
| replyToMessage, | ||
| listChats, | ||
| sendChat, | ||
| sendWebhook, | ||
| }; | ||
| // ── Credential types ─────────────────────────────────────────────────── | ||
| export const TeamsCredentialTypes = [ | ||
| { | ||
| slug: CREDENTIAL_TYPE, | ||
| title: "Microsoft Graph", | ||
| icon: "message-circle", | ||
| description: "Credentials for Microsoft Graph API (Teams, Outlook, OneDrive, etc.). Note that several Teams endpoints are 'protected APIs' requiring Microsoft-gated admin approval — see https://learn.microsoft.com/en-us/graph/teams-protected-apis.", | ||
| fields: [ | ||
| { | ||
| name: "auth_mode", | ||
| title: "Authentication mode", | ||
| type: "text", | ||
| required: true, | ||
| placeholder: "access_token", | ||
| description: "Choose how this credential authenticates:\n • access_token — Paste an OAuth2 access token obtained externally (delegated user auth).\n • client_credentials — Azure AD app-only auth. Provide client_id + client_secret + tenant_id + default_user.", | ||
| }, | ||
| { | ||
| name: "access_token", | ||
| title: "Access token", | ||
| type: "password", | ||
| required: false, | ||
| placeholder: "eyJ0eXAiOiJKV1QiLCJhbGciOi…", | ||
| description: "OAuth2 Bearer token for the signed-in Microsoft 365 user. Required when auth_mode = access_token. Tokens expire after ~1 hour — supply refresh_token + client_id + client_secret + tenant_id for automatic rotation.", | ||
| }, | ||
| { | ||
| name: "refresh_token", | ||
| title: "Refresh token", | ||
| type: "password", | ||
| required: false, | ||
| placeholder: "M.C508_BAY.0.U.-C…", | ||
| description: "Optional. When present alongside client_id + client_secret + tenant_id, the module will exchange it for a fresh access_token once the current one expires.", | ||
| }, | ||
| { | ||
| name: "client_id", | ||
| title: "Azure AD application (client) ID", | ||
| type: "text", | ||
| required: false, | ||
| placeholder: "12345678-1234-1234-1234-1234567890ab", | ||
| description: "Optional for access_token mode (needed for refresh). **Required** for client_credentials mode.", | ||
| }, | ||
| { | ||
| name: "client_secret", | ||
| title: "Client secret", | ||
| type: "password", | ||
| required: false, | ||
| placeholder: "abc~DEF.ghiJKL_mnoPQR…", | ||
| description: "Optional for access_token mode (needed for refresh). **Required** for client_credentials mode.", | ||
| }, | ||
| { | ||
| name: "tenant_id", | ||
| title: "Tenant ID", | ||
| type: "text", | ||
| required: false, | ||
| placeholder: "contoso.onmicrosoft.com OR 12345678-1234-1234-1234-1234567890ab", | ||
| description: "Azure AD tenant — GUID, verified domain, or one of `common` / `organizations` / `consumers`. Required for refresh-token flow and client_credentials mode.", | ||
| }, | ||
| { | ||
| name: "default_user", | ||
| title: "Default user (UPN or object ID)", | ||
| type: "text", | ||
| required: false, | ||
| placeholder: "user@company.onmicrosoft.com", | ||
| description: "Required for client_credentials mode. The user whose `/joinedTeams` and `/chats` are enumerated. Ignored in access_token mode.", | ||
| }, | ||
| ], | ||
| }, | ||
| ]; | ||
| // ── Metadata: parameters + errors ────────────────────────────────────── | ||
| const credentialParam = { | ||
| name: "credential", | ||
| title: "Credential", | ||
| description: "Slug of a saved `microsoft_graph` credential.", | ||
| dataType: "string", | ||
| formInputType: "resource", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "my_teams", | ||
| resource: { | ||
| type: "credential", | ||
| listFn: "credential.list", | ||
| modes: ["list", "expression"], | ||
| searchable: true, | ||
| filter: { type: CREDENTIAL_TYPE }, | ||
| }, | ||
| }; | ||
| const teamIdParam = { | ||
| name: "teamId", | ||
| title: "Team ID", | ||
| description: "Team's Graph ID (GUID). Returned by `listTeams` or visible in the Teams admin center URL.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "19:abc123…@thread.skype", | ||
| }; | ||
| const channelIdParam = { | ||
| name: "channelId", | ||
| title: "Channel ID", | ||
| description: "Channel ID inside a team. Returned by `listChannels`.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "19:channel-id@thread.tacv2", | ||
| }; | ||
| const chatIdParam = { | ||
| name: "chatId", | ||
| title: "Chat ID", | ||
| description: "1:1 or group chat ID. Returned by `listChats`.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "19:abc…@unq.gbl.spaces", | ||
| }; | ||
| const messageParam = { | ||
| name: "message", | ||
| title: "Message", | ||
| description: "Plain string (wrapped as HTML `body`) or a `{content, contentType?, subject?, importance?, mentions?, attachments?}` object.", | ||
| dataType: "object", | ||
| formInputType: "textarea", | ||
| required: true, | ||
| allowExpression: true, | ||
| rows: 4, | ||
| placeholder: "<b>Hello team!</b>", | ||
| }; | ||
| const commonErrors = { | ||
| credential_not_found: "No credential with that slug exists in the vault.", | ||
| token_missing: "Credential has no `access_token`, and not enough info to refresh or exchange for one.", | ||
| token_exchange_failed: "Microsoft identity platform rejected the token request.", | ||
| transport: "Network failure calling Microsoft Graph.", | ||
| graph_error: "Microsoft Graph returned an error — see `graph_error.error` for the `code` and `message`.", | ||
| permission_denied: "Access token lacks the required scope. Several Teams endpoints require gated admin approval (protected APIs).", | ||
| rate_limited: "Microsoft Graph rate-limit hit (HTTP 429) — retry after `retry_after` seconds.", | ||
| not_found: "Requested team / channel / chat / message does not exist.", | ||
| validation_failed: "Request body / query failed validation — see `graph_error` for details.", | ||
| webhook_error: "Incoming Webhook target returned a non-2xx response.", | ||
| }; | ||
| // ── Function metadata ────────────────────────────────────────────────── | ||
| export const TeamsFunctionMetadata = { | ||
| listTeams: { | ||
| title: "List joined teams", | ||
| summary: "List every team the authenticated user belongs to", | ||
| description: "Calls `GET /me/joinedTeams` (delegated) or `GET /users/{default_user}/joinedTeams` (app-only). Returns `{id, displayName, description, isArchived, webUrl}` for each team.", | ||
| group: "teams", | ||
| action: "query", | ||
| icon: "users", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["teams", "list"], | ||
| parameters: [credentialParam], | ||
| returnType: "object", | ||
| returnDescription: "{ value: [Team, …] }", | ||
| errors: commonErrors, | ||
| example: 'teams.listTeams "my_teams"', | ||
| }, | ||
| listChannels: { | ||
| title: "List channels in a team", | ||
| summary: "Enumerate a team's standard/private/shared channels", | ||
| description: "Calls `GET /teams/{teamId}/channels`. Returns channel metadata (id, displayName, membershipType, webUrl, filesFolderWebUrl).", | ||
| group: "teams", | ||
| action: "query", | ||
| icon: "list", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["teams", "channels", "list"], | ||
| parameters: [ | ||
| credentialParam, | ||
| teamIdParam, | ||
| { | ||
| name: "options", | ||
| title: "OData options", | ||
| description: "Recognized keys: `$filter`, `$select`, `$top`.", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: false, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 2, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "{ value: [Channel, …] }", | ||
| errors: commonErrors, | ||
| example: 'teams.listChannels "my_teams" "19:…@thread.skype"', | ||
| }, | ||
| createChannel: { | ||
| title: "Create channel", | ||
| summary: "Create a new channel in a team", | ||
| description: "Calls `POST /teams/{teamId}/channels`. `membershipType` is `standard` (default), `private`, or `shared`. Optionally supply a `description`.", | ||
| group: "teams", | ||
| action: "create", | ||
| icon: "plus-square", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: false, | ||
| since: "1.0.0", | ||
| tags: ["teams", "channel", "create"], | ||
| parameters: [ | ||
| credentialParam, | ||
| teamIdParam, | ||
| { | ||
| name: "displayName", | ||
| title: "Display name", | ||
| description: "Channel name (visible in Teams UI).", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| }, | ||
| { | ||
| name: "options", | ||
| title: "Options", | ||
| description: "Recognized keys:\n description : string\n membershipType : 'standard' (default) | 'private' | 'shared'", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: false, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 3, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "Created Channel resource.", | ||
| errors: commonErrors, | ||
| example: 'teams.createChannel "my_teams" "19:…@thread.skype" "Project Aurora" {membershipType:"private"}', | ||
| }, | ||
| sendChannel: { | ||
| title: "Send channel message", | ||
| summary: "Post a new message to a channel", | ||
| description: "Calls `POST /teams/{teamId}/channels/{channelId}/messages`. Supply the message as a string (wrapped as HTML body) or a `{content, contentType?, subject?, importance?, mentions?, attachments?}` object.", | ||
| group: "messages", | ||
| action: "write", | ||
| icon: "send", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call", "sends_notification"], | ||
| idempotent: false, | ||
| since: "1.0.0", | ||
| tags: ["teams", "channel", "message", "send"], | ||
| parameters: [credentialParam, teamIdParam, channelIdParam, messageParam], | ||
| returnType: "object", | ||
| returnDescription: "Created ChatMessage resource.", | ||
| errors: commonErrors, | ||
| examples: [ | ||
| { | ||
| title: "Simple HTML message", | ||
| code: 'teams.sendChannel "my_teams" "{{ team.id }}" "{{ channel.id }}" "<b>Build succeeded</b>"', | ||
| }, | ||
| { | ||
| title: "Message with subject + high importance", | ||
| code: 'teams.sendChannel "my_teams" "{{ team.id }}" "{{ channel.id }}" {content:"<p>Incident update</p>", subject:"P1 Incident", importance:"high"}', | ||
| }, | ||
| ], | ||
| example: 'teams.sendChannel "my_teams" "19:team…" "19:channel…" "Hello team!"', | ||
| }, | ||
| getMessages: { | ||
| title: "List channel messages", | ||
| summary: "Read messages from a channel (newest first)", | ||
| description: "Calls `GET /teams/{teamId}/channels/{channelId}/messages`. For back-compat the module accepts `{top: N}` as shorthand for `{$top: N}`.", | ||
| group: "messages", | ||
| action: "query", | ||
| icon: "message-square", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["teams", "channel", "messages", "read"], | ||
| parameters: [ | ||
| credentialParam, | ||
| teamIdParam, | ||
| channelIdParam, | ||
| { | ||
| name: "options", | ||
| title: "Options", | ||
| description: "Recognized keys:\n top / $top : number of messages to return\n $filter : OData filter\n $orderby : OData order", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: false, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 3, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "{ value: [ChatMessage, …] }", | ||
| errors: commonErrors, | ||
| example: 'teams.getMessages "my_teams" "19:team…" "19:channel…" {top:20}', | ||
| }, | ||
| replyToMessage: { | ||
| title: "Reply to channel message", | ||
| summary: "Post a reply inside an existing channel conversation", | ||
| description: "Calls `POST /teams/{teamId}/channels/{channelId}/messages/{messageId}/replies`. Same message shape as `sendChannel`.", | ||
| group: "messages", | ||
| action: "write", | ||
| icon: "reply", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call", "sends_notification"], | ||
| idempotent: false, | ||
| since: "1.0.0", | ||
| tags: ["teams", "channel", "reply"], | ||
| parameters: [ | ||
| credentialParam, | ||
| teamIdParam, | ||
| channelIdParam, | ||
| { | ||
| name: "messageId", | ||
| title: "Parent message ID", | ||
| description: "ID of the channel message to reply to.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| }, | ||
| messageParam, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "Created reply ChatMessage.", | ||
| errors: commonErrors, | ||
| example: 'teams.replyToMessage "my_teams" "19:team…" "19:channel…" "1700000000000" "Thanks!"', | ||
| }, | ||
| listChats: { | ||
| title: "List chats", | ||
| summary: "List 1:1 and group chats the user is in", | ||
| description: "Calls `GET /me/chats` (delegated) or `GET /users/{default_user}/chats` (app-only). Returns `{id, topic?, chatType, members?, webUrl}` for each chat.", | ||
| group: "chats", | ||
| action: "query", | ||
| icon: "messages-square", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["teams", "chats", "list"], | ||
| parameters: [ | ||
| credentialParam, | ||
| { | ||
| name: "options", | ||
| title: "OData options", | ||
| description: "Recognized keys: `$filter`, `$top`, `$expand`.", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: false, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 2, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "{ value: [Chat, …] }", | ||
| errors: commonErrors, | ||
| example: 'teams.listChats "my_teams"', | ||
| }, | ||
| sendChat: { | ||
| title: "Send chat message", | ||
| summary: "Post a message in a 1:1 or group chat", | ||
| description: "Calls `POST /chats/{chatId}/messages`. Same message shape as `sendChannel`.", | ||
| group: "chats", | ||
| action: "write", | ||
| icon: "send", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call", "sends_notification"], | ||
| idempotent: false, | ||
| since: "1.0.0", | ||
| tags: ["teams", "chat", "message", "send"], | ||
| parameters: [credentialParam, chatIdParam, messageParam], | ||
| returnType: "object", | ||
| returnDescription: "Created ChatMessage.", | ||
| errors: commonErrors, | ||
| example: 'teams.sendChat "my_teams" "19:…@unq.gbl.spaces" "Hey there!"', | ||
| }, | ||
| sendWebhook: { | ||
| title: "Send incoming-webhook message", | ||
| summary: "Post to a Teams Incoming Webhook URL (no credential required)", | ||
| description: "Posts a MessageCard / Adaptive Card payload to an Incoming Webhook (or Workflow HTTP webhook). The first argument is **the webhook URL**, not a credential slug — this endpoint authenticates via the URL itself. Accepts a plain string (wrapped as `{text}`) or a full payload object (passed through as-is).", | ||
| group: "chats", | ||
| action: "write", | ||
| icon: "webhook", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call", "sends_notification"], | ||
| idempotent: false, | ||
| since: "1.0.0", | ||
| tags: ["teams", "webhook", "notification"], | ||
| parameters: [ | ||
| { | ||
| name: "webhookUrl", | ||
| title: "Webhook URL", | ||
| description: "Full Incoming Webhook or Workflow HTTP webhook URL (stored by the caller).", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| placeholder: "https://outlook.office.com/webhook/GUID/IncomingWebhook/...", | ||
| }, | ||
| { | ||
| name: "message", | ||
| title: "Message", | ||
| description: "Plain string (wrapped as MessageCard text) or a full `{title?, text?, themeColor?, sections?, attachments?}` payload (passed through as-is).", | ||
| dataType: "object", | ||
| formInputType: "textarea", | ||
| required: true, | ||
| allowExpression: true, | ||
| rows: 4, | ||
| }, | ||
| { | ||
| name: "options", | ||
| title: "Options", | ||
| description: "Merged into the payload when not present:\n title : card title\n themeColor : hex (e.g. 'FF0000')\n sections : array of MessageCard sections", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: false, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 4, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "{ ok: true, status, response }", | ||
| errors: commonErrors, | ||
| example: 'teams.sendWebhook "https://outlook.office.com/webhook/…" "Build passed!" {title:"CI", themeColor:"00FF00"}', | ||
| }, | ||
| }; | ||
| // ── Module metadata ──────────────────────────────────────────────────── | ||
| export const TeamsModuleMetadata = { | ||
| slug: "teams", | ||
| title: "Microsoft Teams", | ||
| summary: "Send messages, list teams/channels/chats, create channels, and post via Incoming Webhooks", | ||
| description: 'Programmatic access to Microsoft Teams via **Microsoft Graph** (+ Incoming Webhooks bypass). One module covers:\n\n • **Teams / channels** — list joined teams, enumerate channels, create new channels (standard / private / shared).\n • **Channel messages** — post messages, reply in threads, list history.\n • **Chats** — list 1:1 and group chats, send DMs.\n • **Webhooks** — post to Incoming Webhook / Workflow HTTP webhook URLs without any credential.\n\n**Auth** — reuses the `microsoft_graph` credential (same as Outlook, OneDrive). Several Teams endpoints are "protected APIs" (channel messages, chats) that require Microsoft-gated admin approval in addition to the standard Azure AD permissions. See https://learn.microsoft.com/en-us/graph/teams-protected-apis.', | ||
| category: "messaging", | ||
| icon: "icon.svg", | ||
| color: "#464EB8", | ||
| version: "0.2.0", | ||
| docsUrl: "https://docs.robinpath.com/modules/teams", | ||
| status: "stable", | ||
| requires: [], | ||
| minNodeVersion: "18.0.0", | ||
| credentialsType: CREDENTIAL_TYPE, | ||
| operationGroups: { | ||
| teams: { | ||
| title: "Teams / Channels", | ||
| description: "List teams, enumerate channels, create channels.", | ||
| order: 1, | ||
| }, | ||
| messages: { | ||
| title: "Channel messages", | ||
| description: "Send, reply to, and list channel messages.", | ||
| order: 2, | ||
| }, | ||
| chats: { | ||
| title: "Chats / Webhooks", | ||
| description: "1:1 + group chats, and webhook notifications.", | ||
| order: 3, | ||
| }, | ||
| }, | ||
| methods: Object.keys(TeamsFunctions), | ||
| }; | ||
| //# sourceMappingURL=teams.js.map |
| {"version":3,"file":"teams.js","sourceRoot":"","sources":["../src/teams.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAWH,2EAA2E;AAE3E,MAAM,KAAK,GAA0B,EAAE,CAAC;AAExC,SAAS,IAAI;IACX,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACb,0HAA0H,CAC3H,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,CAAa;IAC1C,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC;AACjB,CAAC;AAED,0EAA0E;AAE1E,MAAM,SAAS,GAAG,kCAAkC,CAAC;AACrD,MAAM,aAAa,GAAG,sCAAsC,CAAC;AAC7D,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAC1C,MAAM,YAAY,GAAG,EAAE,GA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,EAAE,gCAAgC;QACnD,MAAM,EAAE,YAAY;QACpB,OAAO,EACL,4GAA4G;KAC/G;CACF,CAAC;AAEF,0EAA0E;AAE1E,MAAM,CAAC,MAAM,mBAAmB,GAAmB;IACjD,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,iBAAiB;IACxB,OAAO,EACL,2FAA2F;IAC7F,WAAW,EACT,qwBAAqwB;IACvwB,QAAQ,EAAE,WAAW;IACrB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,0CAA0C;IACnD,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,EAAE;IACZ,cAAc,EAAE,QAAQ;IACxB,eAAe,EAAE,eAAe;IAChC,eAAe,EAAE;QACf,KAAK,EAAE;YACL,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,kDAAkD;YAC/D,KAAK,EAAE,CAAC;SACT;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,4CAA4C;YACzD,KAAK,EAAE,CAAC;SACT;QACD,KAAK,EAAE;YACL,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,+CAA+C;YAC5D,KAAK,EAAE,CAAC;SACT;KACF;IACD,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC;CACrC,CAAC"} |
+25
-9
| { | ||
| "name": "@robinpath/teams", | ||
| "version": "0.1.1", | ||
| "version": "0.3.0", | ||
| "publishConfig": { | ||
@@ -23,12 +23,22 @@ "access": "public" | ||
| "peerDependencies": { | ||
| "@robinpath/core": ">=0.20.0" | ||
| "@robinpath/core": ">=0.40.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@robinpath/core": "^0.30.1", | ||
| "@robinpath/core": "^0.40.0", | ||
| "typescript": "^5.6.0" | ||
| }, | ||
| "description": "Teams module for RobinPath.", | ||
| "description": "Microsoft Teams integration via Microsoft Graph API — list joined teams, enumerate/create channels, send channel messages with replies, list and message 1:1/group chats, and post to Incoming Webhooks. Supports delegated OAuth2 access tokens (with refresh-token rotation) and Azure AD client-credentials.", | ||
| "keywords": [ | ||
| "teams", | ||
| "messaging" | ||
| "messaging", | ||
| "microsoft", | ||
| "microsoft-365", | ||
| "office365", | ||
| "graph", | ||
| "microsoft-graph", | ||
| "chat", | ||
| "webhook", | ||
| "oauth2", | ||
| "azure-ad", | ||
| "client-credentials" | ||
| ], | ||
@@ -38,7 +48,13 @@ "license": "MIT", | ||
| "category": "messaging", | ||
| "type": "integration", | ||
| "auth": "bearer-token", | ||
| "functionCount": 10, | ||
| "baseUrl": "https://graph.microsoft.com" | ||
| "type": "module", | ||
| "auth": "credential-vault", | ||
| "functionCount": 9, | ||
| "baseUrl": "https://graph.microsoft.com", | ||
| "language": "nodejs", | ||
| "platforms": [ | ||
| "cloud", | ||
| "cli", | ||
| "desktop" | ||
| ] | ||
| } | ||
| } |
+1
-1
@@ -22,3 +22,3 @@ # @robinpath/teams | ||
| ```bash | ||
| npm install @robinpath/teams | ||
| robinpath add @robinpath/teams | ||
| ``` | ||
@@ -25,0 +25,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Network access
Supply chain riskThis module accesses the network.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
80970
1993.87%10
400%1078
Infinity%2
100%5
150%