mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-10 08:48:29 +00:00
* Feat: v2 * feat: add chat functionality * First cut: integrations * Feat: add conversation API * Enhance conversation handling and memory management * Feat: added conversation --------- Co-authored-by: Manoj K <saimanoj58@gmail.com>
25 lines
646 B
TypeScript
25 lines
646 B
TypeScript
import { prisma } from "~/db.server";
|
|
|
|
/**
|
|
* Get all integration definitions available to a workspace.
|
|
* Returns both global (workspaceId: null) and workspace-specific definitions.
|
|
*/
|
|
export async function getIntegrationDefinitions(workspaceId: string) {
|
|
return prisma.integrationDefinitionV2.findMany({
|
|
where: {
|
|
OR: [{ workspaceId: null }, { workspaceId }],
|
|
},
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Get a single integration definition by its ID.
|
|
*/
|
|
export async function getIntegrationDefinitionWithId(
|
|
integrationDefinitionId: string,
|
|
) {
|
|
return prisma.integrationDefinitionV2.findUnique({
|
|
where: { id: integrationDefinitionId },
|
|
});
|
|
}
|