mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-12 13:38:30 +00:00
* Feat: clustering fact statements * Feat: cluster drift * Feat: add recall count and model to search * Feat: Github integration * Fix: clustering UI * Improve graph * Bump: new version --------- Co-authored-by: Manoj K <saimanoj58@gmail.com>
38 lines
890 B
TypeScript
38 lines
890 B
TypeScript
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 } },
|
|
},
|
|
},
|
|
},
|
|
];
|
|
}
|