Spaces:
Runtime error
Runtime error
Download integrations/github/src/account-create.ts from BTankut/Context-Store-LLM: direct link, hf CLI and curl.
- Browser
- Download file 890 Bytes
-
https://huggingface.co/spaces/BTankut/Context-Store-LLM/resolve/main/integrations/github/src/account-create.ts
- Command line
-
hf download hf://spaces/BTankut/Context-Store-LLM/integrations/github/src/account-create.ts
-
curl -L -o account-create.ts https://huggingface.co/spaces/BTankut/Context-Store-LLM/resolve/main/integrations/github/src/account-create.ts
890 Bytes
| import { getGithubData } from './utils'; | |
| export async function integrationCreate( | |
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | |
| data: any, | |
| ) { | |
| const { oauthResponse } = data; | |
| const integrationConfiguration = { | |
| refresh_token: oauthResponse.refresh_token, | |
| access_token: oauthResponse.access_token, | |
| }; | |
| const user = await getGithubData( | |
| 'https://api.github.com/user', | |
| integrationConfiguration.access_token, | |
| ); | |
| return [ | |
| { | |
| type: 'account', | |
| data: { | |
| settings: { | |
| login: user.login, | |
| username: user.login, | |
| schedule: { | |
| frequency: '*/15 * * * *', | |
| }, | |
| }, | |
| accountId: user.id.toString(), | |
| config: { | |
| ...integrationConfiguration, | |
| mcp: { tokens: { access_token: integrationConfiguration.access_token } }, | |
| }, | |
| }, | |
| }, | |
| ]; | |
| } | |