mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-09 22:25:33 -05:00
updated types
This commit is contained in:
@@ -227,6 +227,7 @@ Retrieve detailed information about a specific Jira issue
|
||||
| ↳ `timeZone` | string | User timezone |
|
||||
| ↳ `created` | string | ISO 8601 timestamp when the attachment was created |
|
||||
| `issueKey` | string | Issue key \(e.g., PROJ-123\) |
|
||||
| `issue` | json | Complete raw Jira issue object from the API |
|
||||
|
||||
### `jira_update`
|
||||
|
||||
@@ -296,6 +297,7 @@ Create a new Jira issue
|
||||
| `self` | string | REST API URL for the created issue |
|
||||
| `summary` | string | Issue summary |
|
||||
| `url` | string | URL to the created issue in Jira |
|
||||
| `assigneeId` | string | Account ID of the assigned user \(null if no assignee was set\) |
|
||||
|
||||
### `jira_bulk_read`
|
||||
|
||||
@@ -685,6 +687,11 @@ Add attachments to a Jira issue
|
||||
| ↳ `mimeType` | string | MIME type |
|
||||
| ↳ `size` | number | File size in bytes |
|
||||
| ↳ `content` | string | URL to download the attachment |
|
||||
| `attachmentIds` | array | Array of attachment IDs |
|
||||
| `files` | array | Uploaded file metadata |
|
||||
| ↳ `name` | string | File name |
|
||||
| ↳ `mimeType` | string | MIME type |
|
||||
| ↳ `size` | number | File size in bytes |
|
||||
|
||||
### `jira_delete_attachment`
|
||||
|
||||
|
||||
@@ -90,16 +90,24 @@ export async function POST(request: NextRequest) {
|
||||
)
|
||||
}
|
||||
|
||||
const attachments = await response.json()
|
||||
const attachmentIds = Array.isArray(attachments)
|
||||
? attachments.map((attachment) => attachment.id).filter(Boolean)
|
||||
: []
|
||||
const jiraAttachments = await response.json()
|
||||
const attachmentsList = Array.isArray(jiraAttachments) ? jiraAttachments : []
|
||||
|
||||
const attachmentIds = attachmentsList.map((att: any) => att.id).filter(Boolean)
|
||||
const attachments = attachmentsList.map((att: any) => ({
|
||||
id: att.id ?? '',
|
||||
filename: att.filename ?? '',
|
||||
mimeType: att.mimeType ?? '',
|
||||
size: att.size ?? 0,
|
||||
content: att.content ?? '',
|
||||
}))
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
output: {
|
||||
ts: new Date().toISOString(),
|
||||
issueKey: validatedData.issueKey,
|
||||
attachments,
|
||||
attachmentIds,
|
||||
files: filesOutput,
|
||||
},
|
||||
|
||||
@@ -92,5 +92,24 @@ export const jiraAddAttachmentTool: ToolConfig<JiraAddAttachmentParams, JiraAddA
|
||||
},
|
||||
},
|
||||
},
|
||||
attachmentIds: {
|
||||
type: 'array',
|
||||
description: 'Array of attachment IDs',
|
||||
items: { type: 'string' },
|
||||
optional: true,
|
||||
},
|
||||
files: {
|
||||
type: 'array',
|
||||
description: 'Uploaded file metadata',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
name: { type: 'string', description: 'File name' },
|
||||
mimeType: { type: 'string', description: 'MIME type' },
|
||||
size: { type: 'number', description: 'File size in bytes' },
|
||||
},
|
||||
},
|
||||
optional: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -321,6 +321,7 @@ export const jiraRetrieveTool: ToolConfig<JiraRetrieveParams, JiraRetrieveRespon
|
||||
output: {
|
||||
ts: new Date().toISOString(),
|
||||
...transformIssueData(data),
|
||||
issue: data,
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -328,5 +329,10 @@ export const jiraRetrieveTool: ToolConfig<JiraRetrieveParams, JiraRetrieveRespon
|
||||
outputs: {
|
||||
ts: TIMESTAMP_OUTPUT,
|
||||
...ISSUE_ITEM_PROPERTIES,
|
||||
issue: {
|
||||
type: 'json',
|
||||
description: 'Complete raw Jira issue object from the API',
|
||||
optional: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -748,6 +748,7 @@ export interface JiraRetrieveResponse extends ToolResponse {
|
||||
output: {
|
||||
ts: string
|
||||
id: string
|
||||
issueKey: string
|
||||
key: string
|
||||
self: string
|
||||
summary: string
|
||||
@@ -861,6 +862,7 @@ export interface JiraRetrieveResponse extends ToolResponse {
|
||||
author: { accountId: string; displayName: string } | null
|
||||
created: string
|
||||
}>
|
||||
issue: Record<string, unknown>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -952,6 +954,7 @@ export interface JiraWriteResponse extends ToolResponse {
|
||||
summary: string
|
||||
success: boolean
|
||||
url: string
|
||||
assigneeId: string | null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1224,6 +1227,12 @@ export interface JiraAddAttachmentResponse extends ToolResponse {
|
||||
size: number
|
||||
content: string
|
||||
}>
|
||||
attachmentIds: string[]
|
||||
files: Array<{
|
||||
name: string
|
||||
mimeType: string
|
||||
size: number
|
||||
}>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -169,6 +169,7 @@ export const jiraWriteTool: ToolConfig<JiraWriteParams, JiraWriteResponse> = {
|
||||
summary: 'Issue created successfully',
|
||||
success: true,
|
||||
url: '',
|
||||
assigneeId: null,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -186,6 +187,7 @@ export const jiraWriteTool: ToolConfig<JiraWriteParams, JiraWriteResponse> = {
|
||||
summary: data.output.summary ?? '',
|
||||
success: data.output.success ?? true,
|
||||
url: data.output.url ?? '',
|
||||
assigneeId: data.output.assigneeId ?? null,
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -200,6 +202,7 @@ export const jiraWriteTool: ToolConfig<JiraWriteParams, JiraWriteResponse> = {
|
||||
summary: data.output?.summary ?? 'Issue created',
|
||||
success: false,
|
||||
url: data.output?.url ?? '',
|
||||
assigneeId: data.output?.assigneeId ?? null,
|
||||
},
|
||||
error: data.error,
|
||||
}
|
||||
@@ -212,5 +215,10 @@ export const jiraWriteTool: ToolConfig<JiraWriteParams, JiraWriteResponse> = {
|
||||
self: { type: 'string', description: 'REST API URL for the created issue' },
|
||||
summary: { type: 'string', description: 'Issue summary' },
|
||||
url: { type: 'string', description: 'URL to the created issue in Jira' },
|
||||
assigneeId: {
|
||||
type: 'string',
|
||||
description: 'Account ID of the assigned user (null if no assignee was set)',
|
||||
optional: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user