MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / processThreadUpdate

Function processThreadUpdate

packages/integration-linear/src/outbound.ts:122–149  ·  view source on GitHub ↗
({
  threadId,
  integration,
  event,
}: {
  threadId: string;
  integration: channelsIntegration;
  event: TwoWaySyncThreadEvent;
})

Source from the content-addressed store, hash-verified

120}
121
122async function processThreadUpdate({
123 threadId,
124 integration,
125 event,
126}: {
127 threadId: string;
128 integration: channelsIntegration;
129 event: TwoWaySyncThreadEvent;
130}) {
131 const thread = await linenSdk.getThread({
132 channelId: integration.channelId,
133 threadId,
134 });
135
136 if (!thread) {
137 return 'ThreadNotFound';
138 }
139
140 if (!thread.messages.length) {
141 return 'ThreadNotFound';
142 }
143
144 if (!thread.externalThreadId) {
145 return 'missing thread external id';
146 }
147
148 return await threadHandleMap[event](thread, integration);
149}
150
151const integrationMap = {
152 threadUpdated: processThreadUpdate,

Callers

nothing calls this directly

Calls 1

getThreadMethod · 0.80

Tested by

no test coverage detected