Skip to content

Commit 85b36be

Browse files
committed
correctness
1 parent 3af7dec commit 85b36be

11 files changed

Lines changed: 133 additions & 16 deletions

File tree

apps/docs/content/docs/en/tools/ashby.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ Retrieves full details about a single job posting by its ID.
480480
|`minValue` | number | Minimum value |
481481
|`maxValue` | number | Maximum value |
482482
|`shouldDisplayCompensationOnJobBoard` | boolean | Whether compensation is shown on the job board |
483+
| `applicationLimitCalloutHtml` | string | HTML callout shown when the application limit is reached |
483484
| `updatedAt` | string | ISO 8601 last update timestamp |
484485
| `job` | object | The expanded job object, only present when the request was made with expandJob=true |
485486

apps/docs/content/docs/en/tools/confluence.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,8 @@ Delete a Confluence space.
10901090
| `ts` | string | ISO 8601 timestamp of the operation |
10911091
| `spaceId` | string | Deleted space ID |
10921092
| `deleted` | boolean | Deletion status |
1093+
| `longTaskId` | string | ID of the long-running deletion task; poll Confluence long-task API to track completion |
1094+
| `longTaskStatusLink` | string | Relative link to the long-task status endpoint |
10931095

10941096
### `confluence_list_spaces`
10951097

apps/docs/content/docs/en/tools/firecrawl.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ Parse uploaded documents (PDF, DOCX, HTML, etc.) into clean markdown using Firec
254254
| `proxy` | string | No | Proxy mode: "basic" or "auto" |
255255
| `zeroDataRetention` | boolean | No | Enable zero data retention. Defaults to false. |
256256
| `apiKey` | string | Yes | Firecrawl API key |
257+
| `pricing` | custom | No | No description |
258+
| `metadata` | string | No | No description |
257259
| `rateLimit` | string | No | No description |
258260

259261
#### Output

apps/sim/app/api/tools/confluence/comment/route.ts

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,26 @@ export const PUT = withRouteHandler(async (request: NextRequest) => {
7373
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
7474
}
7575

76-
// Get current comment version
77-
const getUrl = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/footer-comments/${commentId}`
78-
const getResponse = await fetch(getUrl, {
76+
// Detect comment type — try footer-comments first, fall back to inline-comments
77+
const apiBase = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2`
78+
let commentEndpoint = 'footer-comments'
79+
let getResponse = await fetch(`${apiBase}/footer-comments/${commentId}`, {
7980
headers: {
8081
Accept: 'application/json',
8182
Authorization: `Bearer ${accessToken}`,
8283
},
8384
})
8485

86+
if (getResponse.status === 404) {
87+
commentEndpoint = 'inline-comments'
88+
getResponse = await fetch(`${apiBase}/inline-comments/${commentId}`, {
89+
headers: {
90+
Accept: 'application/json',
91+
Authorization: `Bearer ${accessToken}`,
92+
},
93+
})
94+
}
95+
8596
if (!getResponse.ok) {
8697
const errorText = await getResponse.text()
8798
throw new Error(
@@ -92,7 +103,7 @@ export const PUT = withRouteHandler(async (request: NextRequest) => {
92103
const currentComment = await getResponse.json()
93104
const currentVersion = currentComment.version?.number || 1
94105

95-
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/footer-comments/${commentId}`
106+
const url = `${apiBase}/${commentEndpoint}/${commentId}`
96107

97108
const updateBody = {
98109
body: {
@@ -164,16 +175,26 @@ export const DELETE = withRouteHandler(async (request: NextRequest) => {
164175
return NextResponse.json({ error: cloudIdValidation.error }, { status: 400 })
165176
}
166177

167-
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/footer-comments/${commentId}`
178+
const apiBase = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2`
168179

169-
const response = await fetch(url, {
180+
let response = await fetch(`${apiBase}/footer-comments/${commentId}`, {
170181
method: 'DELETE',
171182
headers: {
172183
Accept: 'application/json',
173184
Authorization: `Bearer ${accessToken}`,
174185
},
175186
})
176187

188+
if (response.status === 404) {
189+
response = await fetch(`${apiBase}/inline-comments/${commentId}`, {
190+
method: 'DELETE',
191+
headers: {
192+
Accept: 'application/json',
193+
Authorization: `Bearer ${accessToken}`,
194+
},
195+
})
196+
}
197+
177198
if (!response.ok) {
178199
const errorText = await response.text()
179200
logger.error('Confluence API error response:', {

apps/sim/app/api/tools/confluence/page-properties/route.ts

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const updatePropertySchema = z.object({
2828
propertyId: z.string().min(1, 'Property ID is required'),
2929
key: z.string().min(1, 'Property key is required'),
3030
value: z.any(),
31-
versionNumber: z.number().min(1, 'Version number is required'),
31+
versionNumber: z.number().min(1).optional(),
3232
})
3333

3434
const deletePropertySchema = z.object({
@@ -256,6 +256,39 @@ export const PUT = withRouteHandler(async (request: NextRequest) => {
256256

257257
const url = `https://api.atlassian.com/ex/confluence/${cloudId}/wiki/api/v2/pages/${pageId}/properties/${propertyId}`
258258

259+
let nextVersion = versionNumber
260+
if (nextVersion === undefined) {
261+
const lookupResponse = await fetch(url, {
262+
method: 'GET',
263+
headers: {
264+
Accept: 'application/json',
265+
Authorization: `Bearer ${accessToken}`,
266+
},
267+
})
268+
if (!lookupResponse.ok) {
269+
const errorText = await lookupResponse.text()
270+
return NextResponse.json(
271+
{
272+
error: parseAtlassianErrorMessage(
273+
lookupResponse.status,
274+
lookupResponse.statusText,
275+
errorText
276+
),
277+
},
278+
{ status: lookupResponse.status }
279+
)
280+
}
281+
const current = await lookupResponse.json()
282+
const currentNumber = current?.version?.number
283+
if (typeof currentNumber !== 'number') {
284+
return NextResponse.json(
285+
{ error: 'Could not determine current property version' },
286+
{ status: 500 }
287+
)
288+
}
289+
nextVersion = currentNumber + 1
290+
}
291+
259292
const response = await fetch(url, {
260293
method: 'PUT',
261294
headers: {
@@ -266,7 +299,7 @@ export const PUT = withRouteHandler(async (request: NextRequest) => {
266299
body: JSON.stringify({
267300
key,
268301
value,
269-
version: { number: versionNumber },
302+
version: { number: nextVersion },
270303
}),
271304
})
272305

apps/sim/app/api/tools/confluence/space/route.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,26 @@ export const DELETE = withRouteHandler(async (request: NextRequest) => {
360360
)
361361
}
362362

363-
return NextResponse.json({ spaceId, deleted: true })
363+
let longTask: { id?: string; statusLink?: string } = {}
364+
try {
365+
const text = await response.text()
366+
if (text) {
367+
const data = JSON.parse(text)
368+
longTask = {
369+
id: data?.id,
370+
statusLink: data?.links?.status,
371+
}
372+
}
373+
} catch {
374+
// 204 No Content or non-JSON body — ignore
375+
}
376+
377+
return NextResponse.json({
378+
spaceId,
379+
deleted: true,
380+
longTaskId: longTask.id,
381+
longTaskStatusLink: longTask.statusLink,
382+
})
364383
} catch (error) {
365384
logger.error('Error deleting Confluence space:', error)
366385
return NextResponse.json(

apps/sim/blocks/blocks/jira.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ Return ONLY the description text - no explanations.`,
271271
placeholder: 'Parent issue key for subtasks (e.g., PROJ-123)',
272272
dependsOn: ['projectId'],
273273
condition: { field: 'operation', value: 'write' },
274+
mode: 'advanced',
274275
},
275276
// Write/Update Issue additional fields
276277
{
@@ -321,41 +322,47 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
321322
placeholder: 'Reporter account ID',
322323
dependsOn: ['projectId'],
323324
condition: { field: 'operation', value: 'write' },
325+
mode: 'advanced',
324326
},
325327
{
326328
id: 'environment',
327329
title: 'Environment',
328330
type: 'long-input',
329331
placeholder: 'Environment information (e.g., Production, Staging)',
330332
condition: { field: 'operation', value: ['write', 'update'] },
333+
mode: 'advanced',
331334
},
332335
{
333336
id: 'customFieldId',
334337
title: 'Custom Field ID',
335338
type: 'short-input',
336339
placeholder: 'e.g., customfield_10001 or 10001',
337340
condition: { field: 'operation', value: ['write', 'update'] },
341+
mode: 'advanced',
338342
},
339343
{
340344
id: 'customFieldValue',
341345
title: 'Custom Field Value',
342346
type: 'short-input',
343347
placeholder: 'Value for the custom field',
344348
condition: { field: 'operation', value: ['write', 'update'] },
349+
mode: 'advanced',
345350
},
346351
{
347352
id: 'components',
348353
title: 'Components',
349354
type: 'short-input',
350355
placeholder: 'Comma-separated component names',
351356
condition: { field: 'operation', value: ['write', 'update'] },
357+
mode: 'advanced',
352358
},
353359
{
354360
id: 'fixVersions',
355361
title: 'Fix Versions',
356362
type: 'short-input',
357363
placeholder: 'Comma-separated fix version names',
358364
condition: { field: 'operation', value: ['write', 'update'] },
365+
mode: 'advanced',
359366
},
360367
{
361368
id: 'notifyUsers',
@@ -367,6 +374,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
367374
],
368375
value: () => 'true',
369376
condition: { field: 'operation', value: 'update' },
377+
mode: 'advanced',
370378
},
371379
// Delete Issue fields
372380
{
@@ -379,6 +387,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
379387
],
380388
value: () => 'false',
381389
condition: { field: 'operation', value: 'delete' },
390+
mode: 'advanced',
382391
},
383392
// Assign Issue fields
384393
{
@@ -422,6 +431,7 @@ Return ONLY the comment text - no explanations.`,
422431
type: 'short-input',
423432
placeholder: 'Resolution name (e.g., "Fixed", "Won\'t Fix")',
424433
condition: { field: 'operation', value: 'transition' },
434+
mode: 'advanced',
425435
},
426436
// Search Issues fields
427437
{
@@ -454,27 +464,31 @@ Return ONLY the JQL query - no explanations or markdown formatting.`,
454464
type: 'short-input',
455465
placeholder: 'Cursor token for next page (omit for first page)',
456466
condition: { field: 'operation', value: 'search' },
467+
mode: 'advanced',
457468
},
458469
{
459470
id: 'startAt',
460471
title: 'Start At',
461472
type: 'short-input',
462473
placeholder: 'Pagination start index (default: 0)',
463474
condition: { field: 'operation', value: ['get_comments', 'get_worklogs'] },
475+
mode: 'advanced',
464476
},
465477
{
466478
id: 'maxResults',
467479
title: 'Max Results',
468480
type: 'short-input',
469481
placeholder: 'Maximum results to return (default: 50)',
470482
condition: { field: 'operation', value: ['search', 'get_comments', 'get_worklogs'] },
483+
mode: 'advanced',
471484
},
472485
{
473486
id: 'fields',
474487
title: 'Fields',
475488
type: 'short-input',
476489
placeholder: 'Comma-separated fields to return (e.g., key,summary,status)',
477490
condition: { field: 'operation', value: 'search' },
491+
mode: 'advanced',
478492
},
479493
// Comment fields
480494
{
@@ -630,6 +644,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
630644
type: 'long-input',
631645
placeholder: 'Add optional comment for the link',
632646
condition: { field: 'operation', value: 'create_link' },
647+
mode: 'advanced',
633648
wandConfig: {
634649
enabled: true,
635650
prompt: `Generate a comment for a Jira issue link based on the user's description.
@@ -658,20 +673,23 @@ Return ONLY the comment text - no explanations.`,
658673
type: 'short-input',
659674
placeholder: 'Enter account ID for specific user',
660675
condition: { field: 'operation', value: 'get_users' },
676+
mode: 'advanced',
661677
},
662678
{
663679
id: 'usersStartAt',
664680
title: 'Start At',
665681
type: 'short-input',
666682
placeholder: 'Pagination start index (default: 0)',
667683
condition: { field: 'operation', value: 'get_users' },
684+
mode: 'advanced',
668685
},
669686
{
670687
id: 'usersMaxResults',
671688
title: 'Max Results',
672689
type: 'short-input',
673690
placeholder: 'Maximum users to return (default: 50)',
674691
condition: { field: 'operation', value: 'get_users' },
692+
mode: 'advanced',
675693
},
676694
// Search Users fields
677695
{

apps/sim/blocks/blocks/jira_service_management.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,8 @@ Return ONLY the comment text - no explanations.`,
12371237
status: { type: 'string', description: 'Form status (open, submitted, locked)' },
12381238
answers: {
12391239
type: 'json',
1240-
description: 'Form answers as key-value pairs (question ID to answer)',
1240+
description:
1241+
'Array of simplified form answers, each with label, answer, fieldKey, and choice',
12411242
},
12421243
deleted: { type: 'boolean', description: 'Whether the form was successfully deleted' },
12431244
visibility: {

apps/sim/tools/confluence/delete_space.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ export interface ConfluenceDeleteSpaceResponse {
1414
ts: string
1515
spaceId: string
1616
deleted: boolean
17+
longTaskId?: string
18+
longTaskStatusLink?: string
1719
}
1820
}
1921

@@ -83,6 +85,8 @@ export const confluenceDeleteSpaceTool: ToolConfig<
8385
ts: new Date().toISOString(),
8486
spaceId: data.spaceId ?? '',
8587
deleted: true,
88+
longTaskId: data.longTaskId,
89+
longTaskStatusLink: data.longTaskStatusLink,
8690
},
8791
}
8892
},
@@ -91,5 +95,14 @@ export const confluenceDeleteSpaceTool: ToolConfig<
9195
ts: TIMESTAMP_OUTPUT,
9296
spaceId: { type: 'string', description: 'Deleted space ID' },
9397
deleted: { type: 'boolean', description: 'Deletion status' },
98+
longTaskId: {
99+
type: 'string',
100+
description:
101+
'ID of the long-running deletion task; poll Confluence long-task API to track completion',
102+
},
103+
longTaskStatusLink: {
104+
type: 'string',
105+
description: 'Relative link to the long-task status endpoint',
106+
},
94107
},
95108
}

apps/sim/tools/jira/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ export function extractAdfText(content: any): string | null {
7272
export function transformUser(user: any): {
7373
accountId: string
7474
displayName: string
75-
active?: boolean
76-
emailAddress?: string
77-
avatarUrl?: string
78-
accountType?: string
79-
timeZone?: string
75+
active: boolean | null
76+
emailAddress: string | null
77+
avatarUrl: string | null
78+
accountType: string | null
79+
timeZone: string | null
8080
} | null {
8181
if (!user) return null
8282
return {

0 commit comments

Comments
 (0)