From 1dc4ff2c62b4e0650396daa842e45785c041e342 Mon Sep 17 00:00:00 2001 From: waleed Date: Wed, 25 Feb 2026 15:09:00 -0800 Subject: [PATCH] lint --- apps/docs/components/ui/icon-mapping.ts | 12 +- apps/docs/content/docs/en/tools/meta.json | 2 +- .../api/tools/confluence/blogposts/route.ts | 6 +- .../app/api/tools/confluence/space/route.ts | 9 +- apps/sim/blocks/blocks/confluence.ts | 15 +- apps/sim/tools/confluence/get_task.ts | 184 +++++++++--------- apps/sim/tools/confluence/get_user.ts | 172 ++++++++-------- .../confluence/list_space_permissions.ts | 23 ++- apps/sim/tools/confluence/list_tasks.ts | 3 +- apps/sim/tools/registry.ts | 4 +- 10 files changed, 223 insertions(+), 207 deletions(-) diff --git a/apps/docs/components/ui/icon-mapping.ts b/apps/docs/components/ui/icon-mapping.ts index 8e274d3439..ba0e2bf32f 100644 --- a/apps/docs/components/ui/icon-mapping.ts +++ b/apps/docs/components/ui/icon-mapping.ts @@ -38,8 +38,8 @@ import { EyeIcon, FirecrawlIcon, FirefliesIcon, - GitLabIcon, GithubIcon, + GitLabIcon, GmailIcon, GongIcon, GoogleBooksIcon, @@ -73,9 +73,9 @@ import { LinearIcon, LinkedInIcon, LinkupIcon, - MailServerIcon, MailchimpIcon, MailgunIcon, + MailServerIcon, Mem0Icon, MicrosoftDataverseIcon, MicrosoftExcelIcon, @@ -108,8 +108,6 @@ import { ResendIcon, RevenueCatIcon, S3Icon, - SQSIcon, - STTIcon, SalesforceIcon, SearchIcon, SendgridIcon, @@ -121,17 +119,19 @@ import { SimilarwebIcon, SlackIcon, SmtpIcon, + SQSIcon, SshIcon, + STTIcon, StagehandIcon, StripeIcon, SupabaseIcon, - TTSIcon, TavilyIcon, TelegramIcon, TextractIcon, TinybirdIcon, TranslateIcon, TrelloIcon, + TTSIcon, TwilioIcon, TypeformIcon, UpstashIcon, @@ -142,11 +142,11 @@ import { WhatsAppIcon, WikipediaIcon, WordpressIcon, + xIcon, YouTubeIcon, ZendeskIcon, ZepIcon, ZoomIcon, - xIcon, } from '@/components/icons' type IconComponent = ComponentType> diff --git a/apps/docs/content/docs/en/tools/meta.json b/apps/docs/content/docs/en/tools/meta.json index 6f033e4df5..cd896c4457 100644 --- a/apps/docs/content/docs/en/tools/meta.json +++ b/apps/docs/content/docs/en/tools/meta.json @@ -147,4 +147,4 @@ "zep", "zoom" ] -} \ No newline at end of file +} diff --git a/apps/sim/app/api/tools/confluence/blogposts/route.ts b/apps/sim/app/api/tools/confluence/blogposts/route.ts index 27ccc9bac7..e17153f942 100644 --- a/apps/sim/app/api/tools/confluence/blogposts/route.ts +++ b/apps/sim/app/api/tools/confluence/blogposts/route.ts @@ -360,8 +360,7 @@ export async function PUT(request: NextRequest) { statusText: response.statusText, error: JSON.stringify(errorData, null, 2), }) - const errorMessage = - errorData?.message || `Failed to update blog post (${response.status})` + const errorMessage = errorData?.message || `Failed to update blog post (${response.status})` return NextResponse.json({ error: errorMessage }, { status: response.status }) } @@ -425,8 +424,7 @@ export async function DELETE(request: NextRequest) { statusText: response.statusText, error: JSON.stringify(errorData, null, 2), }) - const errorMessage = - errorData?.message || `Failed to delete blog post (${response.status})` + const errorMessage = errorData?.message || `Failed to delete blog post (${response.status})` return NextResponse.json({ error: errorMessage }, { status: response.status }) } diff --git a/apps/sim/app/api/tools/confluence/space/route.ts b/apps/sim/app/api/tools/confluence/space/route.ts index 5ab71dbc1a..874db2ba0d 100644 --- a/apps/sim/app/api/tools/confluence/space/route.ts +++ b/apps/sim/app/api/tools/confluence/space/route.ts @@ -142,8 +142,7 @@ export async function POST(request: NextRequest) { statusText: response.statusText, error: JSON.stringify(errorData, null, 2), }) - const errorMessage = - errorData?.message || `Failed to create space (${response.status})` + const errorMessage = errorData?.message || `Failed to create space (${response.status})` return NextResponse.json({ error: errorMessage }, { status: response.status }) } @@ -223,8 +222,7 @@ export async function PUT(request: NextRequest) { statusText: response.statusText, error: JSON.stringify(errorData, null, 2), }) - const errorMessage = - errorData?.message || `Failed to update space (${response.status})` + const errorMessage = errorData?.message || `Failed to update space (${response.status})` return NextResponse.json({ error: errorMessage }, { status: response.status }) } @@ -296,8 +294,7 @@ export async function DELETE(request: NextRequest) { statusText: response.statusText, error: JSON.stringify(errorData, null, 2), }) - const errorMessage = - errorData?.message || `Failed to delete space (${response.status})` + const errorMessage = errorData?.message || `Failed to delete space (${response.status})` return NextResponse.json({ error: errorMessage }, { status: response.status }) } diff --git a/apps/sim/blocks/blocks/confluence.ts b/apps/sim/blocks/blocks/confluence.ts index 1ef03831f3..8ebc3c459c 100644 --- a/apps/sim/blocks/blocks/confluence.ts +++ b/apps/sim/blocks/blocks/confluence.ts @@ -675,7 +675,10 @@ export const ConfluenceV2Block: BlockConfig = { type: 'short-input', placeholder: 'Enter blog post ID', required: true, - condition: { field: 'operation', value: ['get_blogpost', 'update_blogpost', 'delete_blogpost'] }, + condition: { + field: 'operation', + value: ['get_blogpost', 'update_blogpost', 'delete_blogpost'], + }, }, { id: 'versionNumber', @@ -794,14 +797,20 @@ export const ConfluenceV2Block: BlockConfig = { title: 'Title', type: 'short-input', placeholder: 'Enter title', - condition: { field: 'operation', value: ['create', 'update', 'create_blogpost', 'update_blogpost', 'update_space'] }, + condition: { + field: 'operation', + value: ['create', 'update', 'create_blogpost', 'update_blogpost', 'update_space'], + }, }, { id: 'content', title: 'Content', type: 'long-input', placeholder: 'Enter content', - condition: { field: 'operation', value: ['create', 'update', 'create_blogpost', 'update_blogpost'] }, + condition: { + field: 'operation', + value: ['create', 'update', 'create_blogpost', 'update_blogpost'], + }, }, { id: 'parentId', diff --git a/apps/sim/tools/confluence/get_task.ts b/apps/sim/tools/confluence/get_task.ts index fddfaa9012..a8b16e44bd 100644 --- a/apps/sim/tools/confluence/get_task.ts +++ b/apps/sim/tools/confluence/get_task.ts @@ -28,102 +28,100 @@ export interface ConfluenceGetTaskResponse { } } -export const confluenceGetTaskTool: ToolConfig< - ConfluenceGetTaskParams, - ConfluenceGetTaskResponse -> = { - id: 'confluence_get_task', - name: 'Confluence Get Task', - description: 'Get a specific Confluence inline task by ID.', - version: '1.0.0', +export const confluenceGetTaskTool: ToolConfig = + { + id: 'confluence_get_task', + name: 'Confluence Get Task', + description: 'Get a specific Confluence inline task by ID.', + version: '1.0.0', - oauth: { - required: true, - provider: 'confluence', - }, - - params: { - accessToken: { - type: 'string', + oauth: { required: true, - visibility: 'hidden', - description: 'OAuth access token for Confluence', + provider: 'confluence', }, - domain: { - type: 'string', - required: true, - visibility: 'user-only', - description: 'Your Confluence domain (e.g., yourcompany.atlassian.net)', - }, - taskId: { - type: 'string', - required: true, - visibility: 'user-or-llm', - description: 'The ID of the task to retrieve', - }, - cloudId: { - type: 'string', - required: false, - visibility: 'user-only', - description: - 'Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain.', - }, - }, - request: { - url: () => '/api/tools/confluence/tasks', - method: 'POST', - headers: (params: ConfluenceGetTaskParams) => ({ - Accept: 'application/json', - 'Content-Type': 'application/json', - Authorization: `Bearer ${params.accessToken}`, - }), - body: (params: ConfluenceGetTaskParams) => ({ - domain: params.domain, - accessToken: params.accessToken, - cloudId: params.cloudId, - taskId: params.taskId, - }), - }, - - transformResponse: async (response: Response) => { - const data = await response.json() - const task = data.task || data - return { - success: true, - output: { - ts: new Date().toISOString(), - id: task.id ?? '', - localId: task.localId ?? null, - spaceId: task.spaceId ?? null, - pageId: task.pageId ?? null, - blogPostId: task.blogPostId ?? null, - status: task.status ?? '', - createdBy: task.createdBy ?? null, - assignedTo: task.assignedTo ?? null, - completedBy: task.completedBy ?? null, - createdAt: task.createdAt ?? null, - updatedAt: task.updatedAt ?? null, - dueAt: task.dueAt ?? null, - completedAt: task.completedAt ?? null, + params: { + accessToken: { + type: 'string', + required: true, + visibility: 'hidden', + description: 'OAuth access token for Confluence', }, - } - }, + domain: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Your Confluence domain (e.g., yourcompany.atlassian.net)', + }, + taskId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The ID of the task to retrieve', + }, + cloudId: { + type: 'string', + required: false, + visibility: 'user-only', + description: + 'Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain.', + }, + }, - outputs: { - ts: TIMESTAMP_OUTPUT, - id: { type: 'string', description: 'Task ID' }, - localId: { type: 'string', description: 'Local task ID', optional: true }, - spaceId: { type: 'string', description: 'Space ID', optional: true }, - pageId: { type: 'string', description: 'Page ID', optional: true }, - blogPostId: { type: 'string', description: 'Blog post ID', optional: true }, - status: { type: 'string', description: 'Task status (complete or incomplete)' }, - createdBy: { type: 'string', description: 'Creator account ID', optional: true }, - assignedTo: { type: 'string', description: 'Assignee account ID', optional: true }, - completedBy: { type: 'string', description: 'Completer account ID', optional: true }, - createdAt: { type: 'string', description: 'Creation timestamp', optional: true }, - updatedAt: { type: 'string', description: 'Last update timestamp', optional: true }, - dueAt: { type: 'string', description: 'Due date', optional: true }, - completedAt: { type: 'string', description: 'Completion timestamp', optional: true }, - }, -} + request: { + url: () => '/api/tools/confluence/tasks', + method: 'POST', + headers: (params: ConfluenceGetTaskParams) => ({ + Accept: 'application/json', + 'Content-Type': 'application/json', + Authorization: `Bearer ${params.accessToken}`, + }), + body: (params: ConfluenceGetTaskParams) => ({ + domain: params.domain, + accessToken: params.accessToken, + cloudId: params.cloudId, + taskId: params.taskId, + }), + }, + + transformResponse: async (response: Response) => { + const data = await response.json() + const task = data.task || data + return { + success: true, + output: { + ts: new Date().toISOString(), + id: task.id ?? '', + localId: task.localId ?? null, + spaceId: task.spaceId ?? null, + pageId: task.pageId ?? null, + blogPostId: task.blogPostId ?? null, + status: task.status ?? '', + createdBy: task.createdBy ?? null, + assignedTo: task.assignedTo ?? null, + completedBy: task.completedBy ?? null, + createdAt: task.createdAt ?? null, + updatedAt: task.updatedAt ?? null, + dueAt: task.dueAt ?? null, + completedAt: task.completedAt ?? null, + }, + } + }, + + outputs: { + ts: TIMESTAMP_OUTPUT, + id: { type: 'string', description: 'Task ID' }, + localId: { type: 'string', description: 'Local task ID', optional: true }, + spaceId: { type: 'string', description: 'Space ID', optional: true }, + pageId: { type: 'string', description: 'Page ID', optional: true }, + blogPostId: { type: 'string', description: 'Blog post ID', optional: true }, + status: { type: 'string', description: 'Task status (complete or incomplete)' }, + createdBy: { type: 'string', description: 'Creator account ID', optional: true }, + assignedTo: { type: 'string', description: 'Assignee account ID', optional: true }, + completedBy: { type: 'string', description: 'Completer account ID', optional: true }, + createdAt: { type: 'string', description: 'Creation timestamp', optional: true }, + updatedAt: { type: 'string', description: 'Last update timestamp', optional: true }, + dueAt: { type: 'string', description: 'Due date', optional: true }, + completedAt: { type: 'string', description: 'Completion timestamp', optional: true }, + }, + } diff --git a/apps/sim/tools/confluence/get_user.ts b/apps/sim/tools/confluence/get_user.ts index 6935ac9a2d..15a6fdef3a 100644 --- a/apps/sim/tools/confluence/get_user.ts +++ b/apps/sim/tools/confluence/get_user.ts @@ -21,98 +21,96 @@ export interface ConfluenceGetUserResponse { } } -export const confluenceGetUserTool: ToolConfig< - ConfluenceGetUserParams, - ConfluenceGetUserResponse -> = { - id: 'confluence_get_user', - name: 'Confluence Get User', - description: 'Get a Confluence user\'s display name and profile info by their account ID.', - version: '1.0.0', +export const confluenceGetUserTool: ToolConfig = + { + id: 'confluence_get_user', + name: 'Confluence Get User', + description: "Get a Confluence user's display name and profile info by their account ID.", + version: '1.0.0', - oauth: { - required: true, - provider: 'confluence', - }, - - params: { - accessToken: { - type: 'string', + oauth: { required: true, - visibility: 'hidden', - description: 'OAuth access token for Confluence', + provider: 'confluence', }, - domain: { - type: 'string', - required: true, - visibility: 'user-only', - description: 'Your Confluence domain (e.g., yourcompany.atlassian.net)', - }, - accountId: { - type: 'string', - required: true, - visibility: 'user-or-llm', - description: 'The Atlassian account ID of the user to look up', - }, - cloudId: { - type: 'string', - required: false, - visibility: 'user-only', - description: - 'Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain.', - }, - }, - request: { - url: (params: ConfluenceGetUserParams) => { - const query = new URLSearchParams({ - domain: params.domain, - accessToken: params.accessToken, - accountId: params.accountId?.trim(), - }) - if (params.cloudId) { - query.set('cloudId', params.cloudId) - } - return `/api/tools/confluence/user?${query.toString()}` - }, - method: 'GET', - headers: (params: ConfluenceGetUserParams) => ({ - Accept: 'application/json', - Authorization: `Bearer ${params.accessToken}`, - }), - }, - - transformResponse: async (response: Response) => { - const data = await response.json() - return { - success: true, - output: { - ts: new Date().toISOString(), - accountId: data.accountId ?? '', - displayName: data.displayName ?? '', - email: data.email ?? null, - accountType: data.accountType ?? null, - profilePicture: data.profilePicture?.path ?? null, - publicName: data.publicName ?? null, + params: { + accessToken: { + type: 'string', + required: true, + visibility: 'hidden', + description: 'OAuth access token for Confluence', }, - } - }, + domain: { + type: 'string', + required: true, + visibility: 'user-only', + description: 'Your Confluence domain (e.g., yourcompany.atlassian.net)', + }, + accountId: { + type: 'string', + required: true, + visibility: 'user-or-llm', + description: 'The Atlassian account ID of the user to look up', + }, + cloudId: { + type: 'string', + required: false, + visibility: 'user-only', + description: + 'Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain.', + }, + }, - outputs: { - ts: TIMESTAMP_OUTPUT, - accountId: { type: 'string', description: 'Atlassian account ID of the user' }, - displayName: { type: 'string', description: 'Display name of the user' }, - email: { type: 'string', description: 'Email address of the user', optional: true }, - accountType: { - type: 'string', - description: 'Account type (e.g., atlassian, app, customer)', - optional: true, + request: { + url: (params: ConfluenceGetUserParams) => { + const query = new URLSearchParams({ + domain: params.domain, + accessToken: params.accessToken, + accountId: params.accountId?.trim(), + }) + if (params.cloudId) { + query.set('cloudId', params.cloudId) + } + return `/api/tools/confluence/user?${query.toString()}` + }, + method: 'GET', + headers: (params: ConfluenceGetUserParams) => ({ + Accept: 'application/json', + Authorization: `Bearer ${params.accessToken}`, + }), }, - profilePicture: { - type: 'string', - description: 'Path to the user profile picture', - optional: true, + + transformResponse: async (response: Response) => { + const data = await response.json() + return { + success: true, + output: { + ts: new Date().toISOString(), + accountId: data.accountId ?? '', + displayName: data.displayName ?? '', + email: data.email ?? null, + accountType: data.accountType ?? null, + profilePicture: data.profilePicture?.path ?? null, + publicName: data.publicName ?? null, + }, + } }, - publicName: { type: 'string', description: 'Public name of the user', optional: true }, - }, -} + + outputs: { + ts: TIMESTAMP_OUTPUT, + accountId: { type: 'string', description: 'Atlassian account ID of the user' }, + displayName: { type: 'string', description: 'Display name of the user' }, + email: { type: 'string', description: 'Email address of the user', optional: true }, + accountType: { + type: 'string', + description: 'Account type (e.g., atlassian, app, customer)', + optional: true, + }, + profilePicture: { + type: 'string', + description: 'Path to the user profile picture', + optional: true, + }, + publicName: { type: 'string', description: 'Public name of the user', optional: true }, + }, + } diff --git a/apps/sim/tools/confluence/list_space_permissions.ts b/apps/sim/tools/confluence/list_space_permissions.ts index f47c559dbd..3d8fe00f2b 100644 --- a/apps/sim/tools/confluence/list_space_permissions.ts +++ b/apps/sim/tools/confluence/list_space_permissions.ts @@ -122,12 +122,27 @@ export const confluenceListSpacePermissionsTool: ToolConfig< type: 'object', properties: { id: { type: 'string', description: 'Permission ID' }, - principalType: { type: 'string', description: 'Principal type (user, group, role)', optional: true }, + principalType: { + type: 'string', + description: 'Principal type (user, group, role)', + optional: true, + }, principalId: { type: 'string', description: 'Principal ID', optional: true }, - operationKey: { type: 'string', description: 'Operation key (read, create, delete, etc.)', optional: true }, - operationTargetType: { type: 'string', description: 'Target type (page, blogpost, space, etc.)', optional: true }, + operationKey: { + type: 'string', + description: 'Operation key (read, create, delete, etc.)', + optional: true, + }, + operationTargetType: { + type: 'string', + description: 'Target type (page, blogpost, space, etc.)', + optional: true, + }, anonymousAccess: { type: 'boolean', description: 'Whether anonymous access is allowed' }, - unlicensedAccess: { type: 'boolean', description: 'Whether unlicensed access is allowed' }, + unlicensedAccess: { + type: 'boolean', + description: 'Whether unlicensed access is allowed', + }, }, }, }, diff --git a/apps/sim/tools/confluence/list_tasks.ts b/apps/sim/tools/confluence/list_tasks.ts index 43edf00eb3..a6773de4b7 100644 --- a/apps/sim/tools/confluence/list_tasks.ts +++ b/apps/sim/tools/confluence/list_tasks.ts @@ -42,7 +42,8 @@ export const confluenceListTasksTool: ToolConfig< > = { id: 'confluence_list_tasks', name: 'Confluence List Tasks', - description: 'List inline tasks from Confluence. Optionally filter by page, space, assignee, or status.', + description: + 'List inline tasks from Confluence. Optionally filter by page, space, assignee, or status.', version: '1.0.0', oauth: { diff --git a/apps/sim/tools/registry.ts b/apps/sim/tools/registry.ts index 3fd3e29dad..64e49bfc63 100644 --- a/apps/sim/tools/registry.ts +++ b/apps/sim/tools/registry.ts @@ -190,16 +190,16 @@ import { confluenceCreateCommentTool, confluenceCreatePagePropertyTool, confluenceCreatePageTool, - confluenceCreateSpaceTool, confluenceCreateSpacePropertyTool, + confluenceCreateSpaceTool, confluenceDeleteAttachmentTool, confluenceDeleteBlogPostTool, confluenceDeleteCommentTool, confluenceDeleteLabelTool, confluenceDeletePagePropertyTool, confluenceDeletePageTool, - confluenceDeleteSpaceTool, confluenceDeleteSpacePropertyTool, + confluenceDeleteSpaceTool, confluenceGetBlogPostTool, confluenceGetPageAncestorsTool, confluenceGetPageChildrenTool,