mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-11 09:38:27 +00:00
* Feat: added integration connect and mcp oAuth * Feat: add mcp support to chat * Fix: UI for integrations and logs * Fix: ui * Fix: proxy server * Feat: enhance MCP tool integration and loading functionality * Fix: added header * Fix: Linear integration sync --------- Co-authored-by: Manoj K <saimanoj58@gmail.com>
45 lines
952 B
TypeScript
45 lines
952 B
TypeScript
import { prisma } from "~/db.server";
|
|
|
|
export const getIntegrationAccount = async (
|
|
integrationDefinitionId: string,
|
|
userId: string,
|
|
) => {
|
|
return await prisma.integrationAccount.findFirst({
|
|
where: {
|
|
integrationDefinitionId: integrationDefinitionId,
|
|
integratedById: userId,
|
|
isActive: true,
|
|
},
|
|
});
|
|
};
|
|
|
|
export const getIntegrationAccountForId = async (id: string) => {
|
|
return await prisma.integrationAccount.findUnique({
|
|
where: {
|
|
id,
|
|
},
|
|
});
|
|
};
|
|
|
|
export const getIntegrationAccounts = async (userId: string) => {
|
|
return prisma.integrationAccount.findMany({
|
|
where: {
|
|
integratedById: userId,
|
|
isActive: true,
|
|
},
|
|
include: {
|
|
integrationDefinition: true,
|
|
},
|
|
});
|
|
};
|
|
|
|
export const getIntegrationAccountForSlug = async (slug: string) => {
|
|
return await prisma.integrationAccount.findFirst({
|
|
where: {
|
|
integrationDefinition: {
|
|
slug,
|
|
},
|
|
},
|
|
});
|
|
};
|