Skip to content

Commit 030ae5c

Browse files
authored
fix(tools): fixed tool outputs (#2325)
* fix for asana and apify * fixed onedrive * fixed confluence error throwing and added upload file * fixed google vault tag dropdown and output * fix google group tag dropdown, var reference * fixed hubspot output * fixed pipedrive output * removed comments * removed more comments * consolidated file utils * fixed hubspot json schema * fix hubspot search tools * minor change
1 parent 855e2c4 commit 030ae5c

File tree

85 files changed

+1183
-957
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1183
-957
lines changed

apps/docs/content/docs/de/tools/apify.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ Führe einen APIFY-Aktor synchron aus und erhalte Ergebnisse (maximal 5 Minuten)
5454
| `success` | boolean | Ob die Aktor-Ausführung erfolgreich war |
5555
| `runId` | string | APIFY-Ausführungs-ID |
5656
| `status` | string | Ausführungsstatus \(SUCCEEDED, FAILED, usw.\) |
57-
| `datasetId` | string | Dataset-ID mit Ergebnissen |
5857
| `items` | array | Dataset-Elemente \(falls abgeschlossen\) |
5958

6059
### `apify_run_actor_async`

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ Run an APIFY actor synchronously and get results (max 5 minutes)
5757
| `success` | boolean | Whether the actor run succeeded |
5858
| `runId` | string | APIFY run ID |
5959
| `status` | string | Run status \(SUCCEEDED, FAILED, etc.\) |
60-
| `datasetId` | string | Dataset ID containing results |
6160
| `items` | array | Dataset items \(if completed\) |
6261

6362
### `apify_run_actor_async`

apps/docs/content/docs/es/tools/apify.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ Ejecuta un actor de APIFY de forma sincrónica y obtén resultados (máximo 5 mi
5454
| `success` | boolean | Si la ejecución del actor tuvo éxito |
5555
| `runId` | string | ID de ejecución de APIFY |
5656
| `status` | string | Estado de la ejecución \(SUCCEEDED, FAILED, etc.\) |
57-
| `datasetId` | string | ID del conjunto de datos que contiene los resultados |
5857
| `items` | array | Elementos del conjunto de datos \(si se completó\) |
5958

6059
### `apify_run_actor_async`

apps/docs/content/docs/fr/tools/apify.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ Exécuter un acteur APIFY de manière synchrone et obtenir les résultats (maxim
5454
| `success` | booléen | Indique si l'exécution de l'acteur a réussi |
5555
| `runId` | chaîne | ID d'exécution APIFY |
5656
| `status` | chaîne | Statut d'exécution \(SUCCEEDED, FAILED, etc.\) |
57-
| `datasetId` | chaîne | ID du jeu de données contenant les résultats |
5857
| `items` | tableau | Éléments du jeu de données \(si terminé\) |
5958

6059
### `apify_run_actor_async`

apps/docs/content/docs/ja/tools/apify.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ APIPYアクターを同期的に実行して結果を取得(最大5分)
5454
| `success` | boolean | アクター実行が成功したかどうか |
5555
| `runId` | string | APIFY実行ID |
5656
| `status` | string | 実行ステータス(SUCCEEDED、FAILEDなど) |
57-
| `datasetId` | string | 結果を含むデータセットID |
5857
| `items` | array | データセット項目(完了した場合) |
5958

6059
### `apify_run_actor_async`

apps/docs/content/docs/zh/tools/apify.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
5454
| `success` | boolean | actor 运行是否成功 |
5555
| `runId` | string | APIFY 运行 ID |
5656
| `status` | string | 运行状态 \(SUCCEEDED, FAILED 等\) |
57-
| `datasetId` | string | 包含结果的数据集 ID |
5857
| `items` | array | 数据集条目 \(如果已完成\) |
5958

6059
### `apify_run_actor_async`

apps/sim/app/api/files/parse/route.ts

Lines changed: 7 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
extractCleanFilename,
1616
extractStorageKey,
1717
extractWorkspaceIdFromExecutionKey,
18+
getMimeTypeFromExtension,
1819
getViewerUrl,
1920
inferContextFromKey,
2021
} from '@/lib/uploads/utils/file-utils'
@@ -44,36 +45,6 @@ interface ParseResult {
4445
}
4546
}
4647

47-
const fileTypeMap: Record<string, string> = {
48-
// Text formats
49-
txt: 'text/plain',
50-
csv: 'text/csv',
51-
json: 'application/json',
52-
xml: 'application/xml',
53-
md: 'text/markdown',
54-
html: 'text/html',
55-
css: 'text/css',
56-
js: 'application/javascript',
57-
ts: 'application/typescript',
58-
// Document formats
59-
pdf: 'application/pdf',
60-
doc: 'application/msword',
61-
docx: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
62-
// Spreadsheet formats
63-
xls: 'application/vnd.ms-excel',
64-
xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
65-
// Presentation formats
66-
ppt: 'application/vnd.ms-powerpoint',
67-
pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
68-
// Image formats
69-
png: 'image/png',
70-
jpg: 'image/jpeg',
71-
jpeg: 'image/jpeg',
72-
gif: 'image/gif',
73-
// Archive formats
74-
zip: 'application/zip',
75-
}
76-
7748
/**
7849
* Main API route handler
7950
*/
@@ -382,7 +353,8 @@ async function handleExternalUrl(
382353
})
383354
} else {
384355
const { uploadWorkspaceFile } = await import('@/lib/uploads/contexts/workspace')
385-
const mimeType = response.headers.get('content-type') || getMimeType(extension)
356+
const mimeType =
357+
response.headers.get('content-type') || getMimeTypeFromExtension(extension)
386358
await uploadWorkspaceFile(workspaceId, userId, buffer, filename, mimeType)
387359
logger.info(`Saved URL file to workspace storage: ${filename}`)
388360
}
@@ -574,7 +546,7 @@ async function handleLocalFile(
574546
content: result.content,
575547
filePath,
576548
metadata: {
577-
fileType: fileType || getMimeType(extension),
549+
fileType: fileType || getMimeTypeFromExtension(extension),
578550
size: stats.size,
579551
hash,
580552
processingTime: 0,
@@ -709,7 +681,7 @@ async function handleGenericTextBuffer(
709681
content: result.content,
710682
filePath: originalPath || filename,
711683
metadata: {
712-
fileType: fileType || getMimeType(extension),
684+
fileType: fileType || getMimeTypeFromExtension(extension),
713685
size: fileBuffer.length,
714686
hash: createHash('md5').update(fileBuffer).digest('hex'),
715687
processingTime: 0,
@@ -727,7 +699,7 @@ async function handleGenericTextBuffer(
727699
content,
728700
filePath: originalPath || filename,
729701
metadata: {
730-
fileType: fileType || getMimeType(extension),
702+
fileType: fileType || getMimeTypeFromExtension(extension),
731703
size: fileBuffer.length,
732704
hash: createHash('md5').update(fileBuffer).digest('hex'),
733705
processingTime: 0,
@@ -768,7 +740,7 @@ function handleGenericBuffer(
768740
content,
769741
filePath: filename,
770742
metadata: {
771-
fileType: fileType || getMimeType(extension),
743+
fileType: fileType || getMimeTypeFromExtension(extension),
772744
size: fileBuffer.length,
773745
hash: createHash('md5').update(fileBuffer).digest('hex'),
774746
processingTime: 0,
@@ -791,13 +763,6 @@ async function parseBufferAsPdf(buffer: Buffer) {
791763
}
792764
}
793765

794-
/**
795-
* Get MIME type from file extension
796-
*/
797-
function getMimeType(extension: string): string {
798-
return fileTypeMap[extension] || 'application/octet-stream'
799-
}
800-
801766
/**
802767
* Format bytes to human readable size
803768
*/

apps/sim/app/api/tools/asana/add-comment/route.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,16 @@ export async function POST(request: Request) {
8686

8787
return NextResponse.json({
8888
success: true,
89-
output: {
90-
ts: new Date().toISOString(),
91-
gid: story.gid,
92-
text: story.text || '',
93-
created_at: story.created_at,
94-
created_by: story.created_by
95-
? {
96-
gid: story.created_by.gid,
97-
name: story.created_by.name,
98-
}
99-
: undefined,
100-
},
89+
ts: new Date().toISOString(),
90+
gid: story.gid,
91+
text: story.text || '',
92+
created_at: story.created_at,
93+
created_by: story.created_by
94+
? {
95+
gid: story.created_by.gid,
96+
name: story.created_by.name,
97+
}
98+
: undefined,
10199
})
102100
} catch (error) {
103101
logger.error('Error processing request:', error)

apps/sim/app/api/tools/asana/create-task/route.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,13 @@ export async function POST(request: Request) {
9999

100100
return NextResponse.json({
101101
success: true,
102-
output: {
103-
ts: new Date().toISOString(),
104-
gid: task.gid,
105-
name: task.name,
106-
notes: task.notes || '',
107-
completed: task.completed || false,
108-
created_at: task.created_at,
109-
permalink_url: task.permalink_url,
110-
},
102+
ts: new Date().toISOString(),
103+
gid: task.gid,
104+
name: task.name,
105+
notes: task.notes || '',
106+
completed: task.completed || false,
107+
created_at: task.created_at,
108+
permalink_url: task.permalink_url,
111109
})
112110
} catch (error: any) {
113111
logger.error('Error creating Asana task:', {

apps/sim/app/api/tools/asana/get-projects/route.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,12 @@ export async function POST(request: Request) {
7373

7474
return NextResponse.json({
7575
success: true,
76-
output: {
77-
ts: new Date().toISOString(),
78-
projects: projects.map((project: any) => ({
79-
gid: project.gid,
80-
name: project.name,
81-
resource_type: project.resource_type,
82-
})),
83-
},
76+
ts: new Date().toISOString(),
77+
projects: projects.map((project: any) => ({
78+
gid: project.gid,
79+
name: project.name,
80+
resource_type: project.resource_type,
81+
})),
8482
})
8583
} catch (error) {
8684
logger.error('Error processing request:', error)

0 commit comments

Comments
 (0)