Skip to content

Commit 4aa17bf

Browse files
committed
improvement(clickup): final per-tool audit polish — checklist item children, tolerant comment date
- Checklist items surface the documented children array of nested item IDs - create_comment tolerates a string-typed date in the response
1 parent 75c275e commit 4aa17bf

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

apps/sim/tools/clickup/create_comment.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,20 @@ export const clickupCreateCommentTool: ToolConfig<
8888
const record = isRecordLike(data) ? data : {}
8989
const id = record.id
9090
const histId = record.hist_id
91-
const date = record.date
91+
const rawDate = record.date
92+
const date =
93+
typeof rawDate === 'number'
94+
? rawDate
95+
: typeof rawDate === 'string' && Number.isFinite(Number(rawDate))
96+
? Number(rawDate)
97+
: undefined
9298

9399
return {
94100
success: true,
95101
output: {
96102
id: id === undefined || id === null ? undefined : String(id),
97103
histId: histId === undefined || histId === null ? undefined : String(histId),
98-
date: typeof date === 'number' ? date : undefined,
104+
date,
99105
},
100106
}
101107
},

apps/sim/tools/clickup/shared.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,9 @@ function mapClickUpChecklistItem(value: unknown): ClickUpChecklistItem {
510510
resolved: getOptionalBoolean(value.resolved),
511511
parent: getOptionalString(value.parent),
512512
dateCreated: getOptionalString(value.date_created),
513+
children: Array.isArray(value.children)
514+
? value.children.filter((child): child is string => typeof child === 'string')
515+
: [],
513516
}
514517
}
515518

@@ -589,6 +592,11 @@ const CLICKUP_CHECKLIST_ITEM_OUTPUT_PROPERTIES: Record<string, OutputProperty> =
589592
resolved: { type: 'boolean', description: 'Whether the item is resolved', nullable: true },
590593
parent: { type: 'string', description: 'Parent checklist item ID', nullable: true },
591594
dateCreated: { type: 'string', description: 'Creation timestamp (Unix ms)', nullable: true },
595+
children: {
596+
type: 'array',
597+
description: 'IDs of nested child items',
598+
items: { type: 'string', description: 'A checklist item ID' },
599+
},
592600
}
593601

594602
export const CLICKUP_CHECKLIST_OUTPUT_PROPERTIES: Record<string, OutputProperty> = {

apps/sim/tools/clickup/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ export interface ClickUpChecklistItem {
135135
resolved: boolean | null
136136
parent: string | null
137137
dateCreated: string | null
138+
children: string[]
138139
}
139140

140141
export interface ClickUpChecklist {

0 commit comments

Comments
 (0)