Swadhin Biswas feat(api): add runner, analytics, packages, and security services · 3/6/2026
28f7954
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
/**
* Issue Tracking Integrations Library
* Jira, Linear, Trello, ClickUp integrations
*/
import { pgTable, text, timestamp, boolean } from "drizzle-orm/pg-core";
import { getDatabase, schema } from "@/db";
import { eq, and } from "drizzle-orm";
import { logger } from "./logger";
import { repositories } from "@/db/schema/repositories";
import { issues } from "@/db/schema/issues";
import { assertOnlineFeature } from "./air-gapped";
// ============================================================================
// SCHEMA
// ============================================================================
export const issueTrackerConfigs = pgTable("issue_tracker_configs", {
id: text("id").primaryKey(),
repositoryId: text("repository_id")
.notNull()
.references(() => repositories.id, { onDelete: "cascade" }),
provider: text("provider").notNull(), // jira, linear, trello, clickup
name: text("name").notNull(),
apiUrl: text("api_url"),
apiToken: text("api_token"), // Encrypted
projectKey: text("project_key"), // Jira project, Linear team, Trello board, ClickUp list
webhookSecret: text("webhook_secret"),
isEnabled: boolean("is_enabled").default(true),
syncToExternal: boolean("sync_to_external").default(true),
syncFromExternal: boolean("sync_from_external").default(true),
createdAt: timestamp("created_at").notNull().defaultNow(),
updatedAt: timestamp("updated_at").notNull().defaultNow(),
});
export const issueTrackerLinks = pgTable("issue_tracker_links", {
id: text("id").primaryKey(),
configId: text("config_id")
.notNull()
.references(() => issueTrackerConfigs.id, { onDelete: "cascade" }),
localIssueId: text("local_issue_id")
.references(() => issues.id, { onDelete: "cascade" }),
externalId: text("external_id").notNull(),
externalKey: text("external_key"), // e.g., PROJ-123
externalUrl: text("external_url"),
lastSyncAt: timestamp("last_sync_at"),
createdAt: timestamp("created_at").notNull().defaultNow(),
});
export type IssueTrackerConfig = typeof issueTrackerConfigs.$inferSelect;
export type IssueTrackerLink = typeof issueTrackerLinks.$inferSelect;
// ============================================================================
// PROVIDER DEFINITIONS
// ============================================================================
export const ISSUE_PROVIDERS = {
jira: {
name: "Jira",
icon: "jira",
apiBase: "https://{domain}.atlassian.net/rest/api/3",
authType: "basic", // email:api-token
},
linear: {
name: "Linear",
icon: "linear",
apiBase: "https://api.linear.app/graphql",
authType: "bearer",
},
trello: {
name: "Trello",
icon: "trello",
apiBase: "https://api.trello.com/1",
authType: "query", // key + token in query
},
clickup: {
name: "ClickUp",
icon: "clickup",
apiBase: "https://api.clickup.com/api/v2",
authType: "bearer",
},
} as const;
function withBearer(token: string | null | undefined): string {
const value = (token || "").trim();
if (!value) return "";
return value.toLowerCase().startsWith("bearer ") ? value : `Bearer ${value}`;
}
// ============================================================================
// CONFIGURATION
// ============================================================================
export async function configureIssueTracker(options: {
repositoryId: string;
provider: keyof typeof ISSUE_PROVIDERS;
name: string;
apiUrl?: string;
apiToken: string;
projectKey: string;
}): Promise<IssueTrackerConfig> {
const db = getDatabase();
const config = {
id: crypto.randomUUID(),
repositoryId: options.repositoryId,
provider: options.provider,
name: options.name,
apiUrl: options.apiUrl || null,
apiToken: options.apiToken,
projectKey: options.projectKey,
webhookSecret: crypto.randomUUID(),
isEnabled: true,
syncToExternal: true,
syncFromExternal: true,
createdAt: new Date(),
updatedAt: new Date(),
};
// @ts-expect-error - Drizzle multi-db union type issue
await db.insert(schema.issueTrackerConfigs).values(config);
logger.info({ repoId: options.repositoryId, provider: options.provider }, "Issue tracker configured");
return config as IssueTrackerConfig;
}
export async function getIssueTrackerConfigs(repositoryId: string): Promise<IssueTrackerConfig[]> {
const db = getDatabase();
try {
return await db.query.issueTrackerConfigs?.findMany({
where: eq(schema.issueTrackerConfigs.repositoryId, repositoryId),
}) || [];
} catch {
return [];
}
}
// ============================================================================
// JIRA INTEGRATION
// ============================================================================
export async function jiraCreateIssue(options: {
config: IssueTrackerConfig;
summary: string;
description?: string;
issueType?: string;
priority?: string;
labels?: string[];
}): Promise<{ id: string; key: string; url: string } | null> {
assertOnlineFeature("Jira integration");
const apiUrl = options.config.apiUrl || `https://your-domain.atlassian.net/rest/api/3`;
try {
const response = await fetch(`${apiUrl}/issue`, {
method: "POST",
headers: {
Authorization: `Basic ${Buffer.from(options.config.apiToken || "").toString("base64")}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
fields: {
project: { key: options.config.projectKey },
summary: options.summary,
description: {
type: "doc",
version: 1,
content: [{
type: "paragraph",
content: [{ type: "text", text: options.description || "" }],
}],
},
issuetype: { name: options.issueType || "Task" },
...(options.priority && { priority: { name: options.priority } }),
...(options.labels && { labels: options.labels }),
},
}),
});
if (!response.ok) return null;
const data = await response.json();
return {
id: data.id,
key: data.key,
url: `${apiUrl.replace("/rest/api/3", "")}/browse/${data.key}`,
};
} catch (error) {
logger.error({ error }, "Jira create issue failed");
return null;
}
}
export async function jiraGetIssue(config: IssueTrackerConfig, issueKey: string): Promise<{
id: string;
key: string;
summary: string;
status: string;
assignee?: string;
} | null> {
assertOnlineFeature("Jira integration");
const apiUrl = config.apiUrl || `https://your-domain.atlassian.net/rest/api/3`;
try {
const response = await fetch(`${apiUrl}/issue/${issueKey}`, {
headers: {
Authorization: `Basic ${Buffer.from(config.apiToken || "").toString("base64")}`,
},
});
if (!response.ok) return null;
const data = await response.json();
return {
id: data.id,
key: data.key,
summary: data.fields.summary,
status: data.fields.status.name,
assignee: data.fields.assignee?.displayName,
};
} catch {
return null;
}
}
export async function jiraTransition(config: IssueTrackerConfig, issueKey: string, transitionName: string): Promise<boolean> {
assertOnlineFeature("Jira integration");
const apiUrl = config.apiUrl || `https://your-domain.atlassian.net/rest/api/3`;
try {
// Get available transitions
const transResponse = await fetch(`${apiUrl}/issue/${issueKey}/transitions`, {
headers: {
Authorization: `Basic ${Buffer.from(config.apiToken || "").toString("base64")}`,
},
});
const transData = await transResponse.json();
const transition = transData.transitions?.find((t: any) =>
t.name.toLowerCase() === transitionName.toLowerCase()
);
if (!transition) return false;
// Execute transition
const response = await fetch(`${apiUrl}/issue/${issueKey}/transitions`, {
method: "POST",
headers: {
Authorization: `Basic ${Buffer.from(config.apiToken || "").toString("base64")}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ transition: { id: transition.id } }),
});
return response.ok;
} catch {
return false;
}
}
// ============================================================================
// LINEAR INTEGRATION
// ============================================================================
export async function linearCreateIssue(options: {
config: IssueTrackerConfig;
title: string;
description?: string;
priority?: number; // 0-4
labels?: string[];
}): Promise<{ id: string; identifier: string; url: string } | null> {
assertOnlineFeature("Linear integration");
try {
const response = await fetch("https://api.linear.app/graphql", {
method: "POST",
headers: {
Authorization: withBearer(options.config.apiToken),
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `
mutation CreateIssue($input: IssueCreateInput!) {
issueCreate(input: $input) {
success
issue {
id
identifier
url
}
}
}
`,
variables: {
input: {
teamId: options.config.projectKey,
title: options.title,
description: options.description,
priority: options.priority,
labelIds: options.labels,
},
},
}),
});
const data = await response.json();
const issue = data.data?.issueCreate?.issue;
if (!issue) return null;
return {
id: issue.id,
identifier: issue.identifier,
url: issue.url,
};
} catch (error) {
logger.error({ error }, "Linear create issue failed");
return null;
}
}
export async function linearGetIssue(config: IssueTrackerConfig, issueId: string): Promise<{
id: string;
identifier: string;
title: string;
state: string;
assignee?: string;
} | null> {
assertOnlineFeature("Linear integration");
try {
const response = await fetch("https://api.linear.app/graphql", {
method: "POST",
headers: {
Authorization: withBearer(config.apiToken),
"Content-Type": "application/json",
},
body: JSON.stringify({
query: `
query Issue($id: String!) {
issue(id: $id) {
id
identifier
title
state { name }
assignee { name }
}
}
`,
variables: { id: issueId },
}),
});
const data = await response.json();
const issue = data.data?.issue;
if (!issue) return null;
return {
id: issue.id,
identifier: issue.identifier,
title: issue.title,
state: issue.state?.name,
assignee: issue.assignee?.name,
};
} catch {
return null;
}
}
// ============================================================================
// TRELLO INTEGRATION
// ============================================================================
export async function trelloCreateCard(options: {
config: IssueTrackerConfig;
name: string;
desc?: string;
listId: string;
labels?: string[];
}): Promise<{ id: string; shortLink: string; url: string } | null> {
assertOnlineFeature("Trello integration");
try {
// Token format: "key:token"
const [key, token] = (options.config.apiToken || "").split(":");
const params = new URLSearchParams({
key,
token,
idList: options.listId,
name: options.name,
desc: options.desc || "",
});
if (options.labels) {
params.append("idLabels", options.labels.join(","));
}
const response = await fetch(`https://api.trello.com/1/cards?${params}`, {
method: "POST",
});
if (!response.ok) return null;
const data = await response.json();
return {
id: data.id,
shortLink: data.shortLink,
url: data.shortUrl,
};
} catch (error) {
logger.error({ error }, "Trello create card failed");
return null;
}
}
export async function trelloGetCard(config: IssueTrackerConfig, cardId: string): Promise<{
id: string;
name: string;
list: string;
members: string[];
} | null> {
assertOnlineFeature("Trello integration");
try {
const [key, token] = (config.apiToken || "").split(":");
const response = await fetch(
`https://api.trello.com/1/cards/${cardId}?key=${key}&token=${token}&fields=id,name,idList&members=true`
);
if (!response.ok) return null;
const data = await response.json();
return {
id: data.id,
name: data.name,
list: data.idList,
members: data.members?.map((m: any) => m.fullName) || [],
};
} catch {
return null;
}
}
export async function trelloMoveCard(config: IssueTrackerConfig, cardId: string, listId: string): Promise<boolean> {
assertOnlineFeature("Trello integration");
try {
const [key, token] = (config.apiToken || "").split(":");
const response = await fetch(
`https://api.trello.com/1/cards/${cardId}?key=${key}&token=${token}&idList=${listId}`,
{ method: "PUT" }
);
return response.ok;
} catch {
return false;
}
}
// ============================================================================
// CLICKUP INTEGRATION
// ============================================================================
export async function clickupCreateTask(options: {
config: IssueTrackerConfig;
name: string;
description?: string;
priority?: number; // 1-4
tags?: string[];
dueDate?: Date;
}): Promise<{ id: string; url: string } | null> {
assertOnlineFeature("ClickUp integration");
try {
const response = await fetch(
`https://api.clickup.com/api/v2/list/${options.config.projectKey}/task`,
{
method: "POST",
headers: {
Authorization: options.config.apiToken || "",
"Content-Type": "application/json",
},
body: JSON.stringify({
name: options.name,
description: options.description,
priority: options.priority,
tags: options.tags,
due_date: options.dueDate?.getTime(),
}),
}
);
if (!response.ok) return null;
const data = await response.json();
return {
id: data.id,
url: data.url,
};
} catch (error) {
logger.error({ error }, "ClickUp create task failed");
return null;
}
}
export async function clickupGetTask(config: IssueTrackerConfig, taskId: string): Promise<{
id: string;
name: string;
status: string;
assignees: string[];
} | null> {
assertOnlineFeature("ClickUp integration");
try {
const response = await fetch(
`https://api.clickup.com/api/v2/task/${taskId}`,
{
headers: { Authorization: config.apiToken || "" },
}
);
if (!response.ok) return null;
const data = await response.json();
return {
id: data.id,
name: data.name,
status: data.status?.status,
assignees: data.assignees?.map((a: any) => a.username) || [],
};
} catch {
return null;
}
}
export async function clickupUpdateStatus(config: IssueTrackerConfig, taskId: string, status: string): Promise<boolean> {
assertOnlineFeature("ClickUp integration");
try {
const response = await fetch(
`https://api.clickup.com/api/v2/task/${taskId}`,
{
method: "PUT",
headers: {
Authorization: config.apiToken || "",
"Content-Type": "application/json",
},
body: JSON.stringify({ status }),
}
);
return response.ok;
} catch {
return false;
}
}
// ============================================================================
// SYNC FUNCTIONS
// ============================================================================
export async function syncIssueToExternal(localIssueId: string): Promise<IssueTrackerLink[]> {
assertOnlineFeature("Issue tracker synchronization");
const db = getDatabase();
const links: IssueTrackerLink[] = [];
const issue = await db.query.issues.findFirst({
where: eq(schema.issues.id, localIssueId),
});
if (!issue) return links;
const configs = await getIssueTrackerConfigs(issue.repositoryId);
for (const config of configs) {
if (!config.isEnabled || !config.syncToExternal) continue;
let externalId: string | null = null;
let externalKey: string | null = null;
let externalUrl: string | null = null;
switch (config.provider) {
case "jira": {
const result = await jiraCreateIssue({
config,
summary: issue.title,
description: issue.body || undefined,
});
if (result) {
externalId = result.id;
externalKey = result.key;
externalUrl = result.url;
}
break;
}
case "linear": {
const result = await linearCreateIssue({
config,
title: issue.title,
description: issue.body || undefined,
});
if (result) {
externalId = result.id;
externalKey = result.identifier;
externalUrl = result.url;
}
break;
}
case "trello": {
const result = await trelloCreateCard({
config,
listId: config.projectKey || "",
name: issue.title,
desc: issue.body || undefined,
});
if (result) {
externalId = result.id;
externalKey = result.shortLink;
externalUrl = result.url;
}
break;
}
case "clickup": {
const result = await clickupCreateTask({
config,
name: issue.title,
description: issue.body || undefined,
});
if (result) {
externalId = result.id;
externalUrl = result.url;
}
break;
}
}
if (externalId) {
const link = {
id: crypto.randomUUID(),
configId: config.id,
localIssueId,
externalId,
externalKey,
externalUrl,
lastSyncAt: new Date(),
createdAt: new Date(),
};
// @ts-expect-error - Drizzle multi-db union type issue
await db.insert(schema.issueTrackerLinks).values(link);
links.push(link as IssueTrackerLink);
}
}
return links;
}
export async function getLinkedExternalIssues(localIssueId: string): Promise<{
link: IssueTrackerLink;
config: IssueTrackerConfig;
}[]> {
const db = getDatabase();
try {
const links = await db.query.issueTrackerLinks?.findMany({
where: eq(schema.issueTrackerLinks.localIssueId, localIssueId),
}) || [];
const results = [];
for (const link of links) {
const config = await db.query.issueTrackerConfigs?.findFirst({
where: eq(schema.issueTrackerConfigs.id, link.configId),
});
if (config) {
results.push({ link, config });
}
}
return results;
} catch {
return [];
}
}
// ============================================================================
// WEBHOOK HANDLERS
// ============================================================================
export async function handleIssueTrackerWebhook(
provider: string,
webhookSecret: string,
payload: Record<string, unknown>
): Promise<boolean> {
assertOnlineFeature("Issue tracker webhooks");
const db = getDatabase();
const config = await db.query.issueTrackerConfigs?.findFirst({
where: and(
eq(schema.issueTrackerConfigs.provider, provider),
eq(schema.issueTrackerConfigs.webhookSecret, webhookSecret)
),
});
if (!config || !config.syncFromExternal) {
return false;
}
// Handle webhook based on provider
switch (provider) {
case "jira":
return handleJiraWebhook(config, payload);
case "linear":
return handleLinearWebhook(config, payload);
case "trello":
return handleTrelloWebhook(config, payload);
case "clickup":
return handleClickUpWebhook(config, payload);
default:
return false;
}
}
async function handleJiraWebhook(config: IssueTrackerConfig, payload: Record<string, unknown>): Promise<boolean> {
const db = getDatabase();
const event = payload.webhookEvent as string;
const issue = payload.issue as Record<string, unknown>;
if (!issue) return false;
const link = await db.query.issueTrackerLinks?.findFirst({
where: and(
eq(schema.issueTrackerLinks.configId, config.id),
eq(schema.issueTrackerLinks.externalId, String(issue.id))
),
});
if (!link?.localIssueId) return false;
if (event === "jira:issue_updated") {
const fields = issue.fields as Record<string, unknown>;
const status = (fields.status as Record<string, unknown>)?.name as string;
// Update local issue state
const newState = status?.toLowerCase().includes("done") ? "closed" : "open";
// @ts-expect-error - Drizzle multi-db union type issue
await db.update(schema.issues)
.set({ state: newState, updatedAt: new Date() })
.where(eq(schema.issues.id, link.localIssueId));
}
return true;
}
async function handleLinearWebhook(config: IssueTrackerConfig, payload: Record<string, unknown>): Promise<boolean> {
const db = getDatabase();
const action = String(payload.action || "");
const issue = payload.data as Record<string, unknown> | undefined;
const issueId = issue?.id ? String(issue.id) : null;
if (!issueId) return false;
const link = await db.query.issueTrackerLinks?.findFirst({
where: and(
eq(schema.issueTrackerLinks.configId, config.id),
eq(schema.issueTrackerLinks.externalId, issueId)
),
});
if (!link?.localIssueId) return false;
if (action === "update") {
const issueState = issue?.state;
const stateName =
typeof issueState === "object" && issueState !== null
? String((issueState as Record<string, unknown>).name || "")
: String(issueState || "");
const state = stateName.toLowerCase();
const newState = state.includes("done") || state.includes("closed") ? "closed" : "open";
// @ts-expect-error - Drizzle multi-db union type issue
await db.update(schema.issues)
.set({ state: newState, updatedAt: new Date() })
.where(eq(schema.issues.id, link.localIssueId));
}
logger.info({ config: config.id, action }, "Linear webhook processed");
return true;
}
async function handleTrelloWebhook(config: IssueTrackerConfig, payload: Record<string, unknown>): Promise<boolean> {
const db = getDatabase();
const action = payload.action as Record<string, unknown> | undefined;
const cardId = action?.data && typeof action.data === "object"
? String((action.data as any)?.card?.id || "")
: "";
if (!cardId) return false;
const link = await db.query.issueTrackerLinks?.findFirst({
where: and(
eq(schema.issueTrackerLinks.configId, config.id),
eq(schema.issueTrackerLinks.externalId, cardId)
),
});
if (!link?.localIssueId) return false;
const listAfterId = (action?.data as any)?.listAfter?.id as string | undefined;
const listBeforeId = (action?.data as any)?.listBefore?.id as string | undefined;
if (listAfterId && listBeforeId && listAfterId !== listBeforeId) {
const isDone = listAfterId.toLowerCase().includes("done") || listAfterId.toLowerCase().includes("complete");
// @ts-expect-error - Drizzle multi-db union type issue
await db.update(schema.issues)
.set({ state: isDone ? "closed" : "open", updatedAt: new Date() })
.where(eq(schema.issues.id, link.localIssueId));
}
logger.info({ config: config.id, cardId }, "Trello webhook processed");
return true;
}
async function handleClickUpWebhook(config: IssueTrackerConfig, payload: Record<string, unknown>): Promise<boolean> {
const db = getDatabase();
const taskId = payload.task_id ? String(payload.task_id) : "";
if (!taskId) return false;
const link = await db.query.issueTrackerLinks?.findFirst({
where: and(
eq(schema.issueTrackerLinks.configId, config.id),
eq(schema.issueTrackerLinks.externalId, taskId)
),
});
if (!link?.localIssueId) return false;
const status = String((payload.history_items as any[])?.[0]?.after || payload.status || "").toLowerCase();
if (status) {
const isDone = status.includes("done") || status.includes("closed") || status.includes("complete");
// @ts-expect-error - Drizzle multi-db union type issue
await db.update(schema.issues)
.set({ state: isDone ? "closed" : "open", updatedAt: new Date() })
.where(eq(schema.issues.id, link.localIssueId));
}
logger.info({ config: config.id, taskId }, "ClickUp webhook processed");
return true;
}