({
channelId,
messageId,
threadId,
event,
integration,
id,
}: TwoWaySyncType & {
integration: channelsIntegration;
})
| 32 | }; |
| 33 | |
| 34 | export async function processGithubIntegration({ |
| 35 | channelId, |
| 36 | messageId, |
| 37 | threadId, |
| 38 | event, |
| 39 | integration, |
| 40 | id, |
| 41 | }: TwoWaySyncType & { |
| 42 | integration: channelsIntegration; |
| 43 | }) { |
| 44 | if (event === 'newThread') { |
| 45 | return await processNewThread({ threadId, integration }); |
| 46 | } |
| 47 | if (event === 'threadClosed') { |
| 48 | return await processThreadUpdate({ |
| 49 | threadId, |
| 50 | integration, |
| 51 | event, |
| 52 | }); |
| 53 | } |
| 54 | if (event === 'threadReopened') { |
| 55 | return await processThreadUpdate({ |
| 56 | threadId, |
| 57 | integration, |
| 58 | event, |
| 59 | }); |
| 60 | } |
| 61 | if (event === 'newMessage') { |
| 62 | return await processNewMessage({ |
| 63 | messageId, |
| 64 | integration, |
| 65 | }); |
| 66 | } |
| 67 | if (event === 'threadUpdated') { |
| 68 | return await processThreadUpdate({ |
| 69 | threadId, |
| 70 | integration, |
| 71 | event, |
| 72 | }); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | async function processNewMessage({ |
| 77 | messageId, |
no test coverage detected