mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-12 07:48:26 +00:00
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 },
|
|
});
|
|
}
|