* Transforms an update comment API response into typed output.
(data: any, params: JiraUpdateCommentParams)
| 7 | * Transforms an update comment API response into typed output. |
| 8 | */ |
| 9 | function transformUpdateCommentResponse(data: any, params: JiraUpdateCommentParams) { |
| 10 | return { |
| 11 | ts: new Date().toISOString(), |
| 12 | issueKey: params.issueKey ?? 'unknown', |
| 13 | commentId: data?.id ?? params.commentId ?? 'unknown', |
| 14 | body: data?.body ? (extractAdfText(data.body) ?? params.body ?? '') : (params.body ?? ''), |
| 15 | author: transformUser(data?.author) ?? { accountId: '', displayName: '' }, |
| 16 | created: data?.created ?? '', |
| 17 | updated: data?.updated ?? '', |
| 18 | success: true, |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | export const jiraUpdateCommentTool: ToolConfig<JiraUpdateCommentParams, JiraUpdateCommentResponse> = |
| 23 | { |
no test coverage detected