Spaces:
Runtime error
Runtime error
Download integrations/slack/src/utils.ts from BTankut/Context-Store-LLM: direct link, hf CLI and curl.
- Browser
- Download file 866 Bytes
-
https://huggingface.co/spaces/BTankut/Context-Store-LLM/resolve/main/integrations/slack/src/utils.ts
- Command line
-
hf download hf://spaces/BTankut/Context-Store-LLM/integrations/slack/src/utils.ts
-
curl -L -o utils.ts https://huggingface.co/spaces/BTankut/Context-Store-LLM/resolve/main/integrations/slack/src/utils.ts
866 Bytes
| import axios from 'axios'; | |
| export interface ActivityCreate { | |
| url: string; | |
| text: string; | |
| sourceId: string; | |
| sourceURL: string; | |
| integrationAccountId: string; | |
| } | |
| export async function getSlackTeamInfo(slackTeamId: string, accessToken: string) { | |
| const response = await axios.get(`https://slack.com/api/team.info?team=${slackTeamId}`, { | |
| headers: { | |
| 'Content-Type': 'application/json; charset=utf-8', | |
| Authorization: `Bearer ${accessToken}`, | |
| }, | |
| }); | |
| return response.data; | |
| } | |
| export async function getUserDetails(userIds: string[], accessToken: string) { | |
| return await Promise.all( | |
| userIds.map(async (userId) => { | |
| const userResponse = await axios.get(`https://slack.com/api/users.info?user=${userId}`, { | |
| headers: { Authorization: `Bearer ${accessToken}` }, | |
| }); | |
| return userResponse.data.user; | |
| }), | |
| ); | |
| } | |