MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / getIntegration

Function getIntegration

apps/web/services/matrix/index.ts:4–24  ·  view source on GitHub ↗
(id: string, model: 'threads' | 'messages')

Source from the content-addressed store, hash-verified

2import axios from 'axios';
3
4async function getIntegration(id: string, model: 'threads' | 'messages') {
5 const query = {
6 where: { id },
7 select: {
8 channel: {
9 select: {
10 account: {
11 select: {
12 integrationMatrix: true,
13 },
14 },
15 },
16 },
17 },
18 };
19 const matrix =
20 model === 'threads'
21 ? await prisma.threads.findUnique(query)
22 : await prisma.messages.findUnique(query);
23 return matrix?.channel.account?.integrationMatrix.find((i) => i.enabled);
24}
25
26export async function matrixNewThread({
27 threadId,

Callers 2

matrixNewThreadFunction · 0.85
matrixNewMessageFunction · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected