Function
createIntegrationAccount
({
integrationDefinitionId,
userId,
accountId,
config,
settings,
workspaceId,
}: {
integrationDefinitionId: string;
userId: string;
accountId: string;
workspaceId: string;
config?: Record<string, any>;
settings?: Record<string, any>;
})
Source from the content-addressed store, hash-verified
| 6 | import { enqueueCase } from "~/lib/queue-adapter.server"; |
| 7 | |
| 8 | export const createIntegrationAccount = async ({ |
| 9 | integrationDefinitionId, |
| 10 | userId, |
| 11 | accountId, |
| 12 | config, |
| 13 | settings, |
| 14 | workspaceId, |
| 15 | }: { |
| 16 | integrationDefinitionId: string; |
| 17 | userId: string; |
| 18 | accountId: string; |
| 19 | workspaceId: string; |
| 20 | config?: Record<string, any>; |
| 21 | settings?: Record<string, any>; |
| 22 | }) => { |
| 23 | return prisma.integrationAccount.upsert({ |
| 24 | where: { |
| 25 | accountId_integrationDefinitionId_workspaceId: { |
| 26 | accountId, |
| 27 | integrationDefinitionId, |
| 28 | workspaceId, |
| 29 | }, |
| 30 | }, |
| 31 | update: { |
| 32 | integrationConfiguration: config || {}, |
| 33 | settings: settings || {}, |
| 34 | isActive: true, |
| 35 | deleted: null, |
| 36 | }, |
| 37 | create: { |
| 38 | accountId, |
| 39 | integrationDefinitionId, |
| 40 | integratedById: userId, |
| 41 | integrationConfiguration: config || {}, |
| 42 | settings: settings || {}, |
| 43 | isActive: true, |
| 44 | workspaceId, |
| 45 | }, |
| 46 | }); |
| 47 | }; |
| 48 | |
| 49 | export const saveMCPConfig = async ({ |
| 50 | integrationAccountId, |
Callers
nothing calls this directly
Tested by
no test coverage detected