Skip to content

Commit e33543c

Browse files
committed
fix(integrations): audit fixes for wave-3
- pinecone: read camelCase vectorType/deletionProtection (with snake_case fallback) so list_indexes/describe_index populate them; make describe_index_stats casing defensive - google-drive: URL-encode fileId in the export route - remove extraneous inline/section-divider comments across new blocks/tools; convert type docs to TSDoc
1 parent be79ea0 commit e33543c

12 files changed

Lines changed: 14 additions & 58 deletions

File tree

apps/sim/app/api/tools/google_drive/export/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
6464

6565
logger.info(`[${requestId}] Getting file metadata from Google Drive`, { fileId })
6666

67-
const metadataUrl = `https://www.googleapis.com/drive/v3/files/${fileId}?fields=${ALL_FILE_FIELDS}&supportsAllDrives=true`
67+
const metadataUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}?fields=${ALL_FILE_FIELDS}&supportsAllDrives=true`
6868
const metadataUrlValidation = await validateUrlWithDNS(metadataUrl, 'metadataUrl')
6969
if (!metadataUrlValidation.isValid) {
7070
return NextResponse.json(
@@ -123,7 +123,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
123123
exportFormat: exportMimeType,
124124
})
125125

126-
const exportUrl = `https://www.googleapis.com/drive/v3/files/${fileId}/export?mimeType=${encodeURIComponent(exportMimeType)}&supportsAllDrives=true`
126+
const exportUrl = `https://www.googleapis.com/drive/v3/files/${encodeURIComponent(fileId)}/export?mimeType=${encodeURIComponent(exportMimeType)}&supportsAllDrives=true`
127127
const exportUrlValidation = await validateUrlWithDNS(exportUrl, 'exportUrl')
128128
if (!exportUrlValidation.isValid) {
129129
return NextResponse.json(

apps/sim/blocks/blocks/firecrawl.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,11 +733,9 @@ Example 2 - Product Data:
733733
links: { type: 'json', description: 'Discovered URLs array' },
734734
// Extract output
735735
sources: { type: 'json', description: 'Data sources array' },
736-
// Status / job output
737736
jobId: { type: 'string', description: 'Job ID for the started operation' },
738737
status: { type: 'string', description: 'Job status' },
739738
expiresAt: { type: 'string', description: 'Result expiration timestamp' },
740-
// Credit usage output
741739
remainingCredits: { type: 'number', description: 'Credits remaining for the team' },
742740
planCredits: { type: 'number', description: 'Credits allocated in the current plan' },
743741
billingPeriodStart: { type: 'string', description: 'Start of the current billing period' },

apps/sim/blocks/blocks/google_drive.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,6 @@ Return ONLY the query string - no explanations, no quotes around the whole thing
923923
condition: { field: 'operation', value: 'untrash' },
924924
required: true,
925925
},
926-
// Export File Fields
927926
{
928927
id: 'exportFileSelector',
929928
title: 'Select File to Export',
@@ -983,7 +982,6 @@ Return ONLY the query string - no explanations, no quotes around the whole thing
983982
placeholder: 'Optional: Override the exported filename',
984983
condition: { field: 'operation', value: 'export' },
985984
},
986-
// List Revisions Fields
987985
{
988986
id: 'listRevisionsFileSelector',
989987
title: 'Select File',
@@ -1016,7 +1014,6 @@ Return ONLY the query string - no explanations, no quotes around the whole thing
10161014
mode: 'advanced',
10171015
condition: { field: 'operation', value: 'list_revisions' },
10181016
},
1019-
// Get Revision Fields
10201017
{
10211018
id: 'getRevisionFileSelector',
10221019
title: 'Select File',
@@ -1049,7 +1046,6 @@ Return ONLY the query string - no explanations, no quotes around the whole thing
10491046
condition: { field: 'operation', value: 'get_revision' },
10501047
required: true,
10511048
},
1052-
// List Comments Fields
10531049
{
10541050
id: 'listCommentsFileSelector',
10551051
title: 'Select File',
@@ -1094,7 +1090,6 @@ Return ONLY the query string - no explanations, no quotes around the whole thing
10941090
mode: 'advanced',
10951091
condition: { field: 'operation', value: 'list_comments' },
10961092
},
1097-
// Create Comment Fields
10981093
{
10991094
id: 'createCommentFileSelector',
11001095
title: 'Select File',
@@ -1143,7 +1138,6 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.`
11431138
mode: 'advanced',
11441139
condition: { field: 'operation', value: 'create_comment' },
11451140
},
1146-
// Delete Comment Fields
11471141
{
11481142
id: 'deleteCommentFileSelector',
11491143
title: 'Select File',
@@ -1281,7 +1275,6 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.`
12811275
shareFileId,
12821276
unshareFileId,
12831277
listPermissionsFileId,
1284-
// File canonical params for revisions/comments/export operations
12851278
exportFileId,
12861279
listRevisionsFileId,
12871280
getRevisionFileId,
@@ -1408,7 +1401,6 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.`
14081401
const includeRevisionsValue =
14091402
includeRevisions === 'true' ? true : includeRevisions === 'false' ? false : undefined
14101403

1411-
// Convert includeDeleted dropdown to boolean
14121404
const includeDeletedValue =
14131405
includeDeleted === 'true' ? true : includeDeleted === 'false' ? false : undefined
14141406

@@ -1470,7 +1462,6 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.`
14701462
shareFileId: { type: 'string', description: 'File to share' },
14711463
unshareFileId: { type: 'string', description: 'File to unshare' },
14721464
listPermissionsFileId: { type: 'string', description: 'File to list permissions for' },
1473-
// Revisions / comments / export canonical file params (per-operation)
14741465
exportFileId: { type: 'string', description: 'File to export' },
14751466
listRevisionsFileId: { type: 'string', description: 'File to list revisions for' },
14761467
getRevisionFileId: { type: 'string', description: 'File the revision belongs to' },
@@ -1509,12 +1500,9 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.`
15091500
emailMessage: { type: 'string', description: 'Custom notification message' },
15101501
// Unshare operation inputs
15111502
permissionId: { type: 'string', description: 'Permission ID to remove' },
1512-
// Export operation inputs
15131503
exportMimeType: { type: 'string', description: 'Target MIME type to export to' },
1514-
// Revision operation inputs
15151504
revisionId: { type: 'string', description: 'Revision ID to retrieve' },
15161505
revisionsPageSize: { type: 'string', description: 'Results per page for revisions' },
1517-
// Comment operation inputs
15181506
commentId: { type: 'string', description: 'Comment ID to delete' },
15191507
anchor: { type: 'string', description: 'Anchor region for a new comment' },
15201508
includeDeleted: { type: 'string', description: 'Include deleted comments when listing' },

apps/sim/blocks/blocks/pinecone.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ export const PineconeBlock: BlockConfig<PineconeResponse> = {
261261
],
262262
condition: { field: 'operation', value: 'search_vector' },
263263
},
264-
// Update vector fields
265264
{
266265
id: 'indexHost',
267266
title: 'Index Host',
@@ -328,7 +327,6 @@ export const PineconeBlock: BlockConfig<PineconeResponse> = {
328327
generationType: 'json-object',
329328
},
330329
},
331-
// Delete vectors fields
332330
{
333331
id: 'indexHost',
334332
title: 'Index Host',
@@ -383,7 +381,6 @@ export const PineconeBlock: BlockConfig<PineconeResponse> = {
383381
generationType: 'json-object',
384382
},
385383
},
386-
// List vector IDs fields
387384
{
388385
id: 'indexHost',
389386
title: 'Index Host',
@@ -424,7 +421,6 @@ export const PineconeBlock: BlockConfig<PineconeResponse> = {
424421
condition: { field: 'operation', value: 'list_vector_ids' },
425422
mode: 'advanced',
426423
},
427-
// Describe index stats fields
428424
{
429425
id: 'indexHost',
430426
title: 'Index Host',
@@ -448,7 +444,6 @@ export const PineconeBlock: BlockConfig<PineconeResponse> = {
448444
generationType: 'json-object',
449445
},
450446
},
451-
// Describe index fields
452447
{
453448
id: 'indexName',
454449
title: 'Index Name',
@@ -546,18 +541,14 @@ export const PineconeBlock: BlockConfig<PineconeResponse> = {
546541
vector: { type: 'json', description: 'Query vector' },
547542
includeValues: { type: 'boolean', description: 'Include vector values' },
548543
includeMetadata: { type: 'boolean', description: 'Include metadata' },
549-
// Update vector inputs
550544
id: { type: 'string', description: 'Vector identifier to update' },
551545
values: { type: 'json', description: 'New dense vector values' },
552546
sparseValues: { type: 'json', description: 'New sparse vector values' },
553547
setMetadata: { type: 'json', description: 'Metadata to set on the vector' },
554-
// Delete vectors inputs
555548
deleteAll: { type: 'boolean', description: 'Delete all vectors in the namespace' },
556-
// List vector IDs inputs
557549
prefix: { type: 'string', description: 'Vector ID prefix filter' },
558550
limit: { type: 'number', description: 'Maximum number of IDs to return' },
559551
paginationToken: { type: 'string', description: 'Pagination token for the next page' },
560-
// Describe index inputs
561552
indexName: { type: 'string', description: 'Index name' },
562553
},
563554

apps/sim/blocks/blocks/s3.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ function parseObjectKeys(value: unknown): string[] {
2222
if (Array.isArray(parsed)) {
2323
return parsed.map((key) => String(key).trim()).filter(Boolean)
2424
}
25-
} catch {
26-
// Fall through to delimiter-based parsing
27-
}
25+
} catch {}
2826
}
2927
return trimmed
3028
.split(/[\n,]/)
@@ -228,7 +226,6 @@ export const S3Block: BlockConfig<S3Response> = {
228226
mode: 'advanced',
229227
},
230228

231-
// ===== DELETE / HEAD / PRESIGNED OBJECT KEY =====
232229
{
233230
id: 'objectKey',
234231
title: 'Object Key/Path',
@@ -289,7 +286,6 @@ export const S3Block: BlockConfig<S3Response> = {
289286
mode: 'advanced',
290287
},
291288

292-
// ===== HEAD OBJECT FIELDS =====
293289
{
294290
id: 'headVersionId',
295291
title: 'Version ID',
@@ -299,7 +295,6 @@ export const S3Block: BlockConfig<S3Response> = {
299295
mode: 'advanced',
300296
},
301297

302-
// ===== DELETE OBJECTS (BATCH) FIELDS =====
303298
{
304299
id: 'objectKeys',
305300
title: 'Object Keys',
@@ -316,7 +311,6 @@ export const S3Block: BlockConfig<S3Response> = {
316311
mode: 'advanced',
317312
},
318313

319-
// ===== PRESIGNED URL FIELDS =====
320314
{
321315
id: 'presignedMethod',
322316
title: 'URL Type',
@@ -345,7 +339,6 @@ export const S3Block: BlockConfig<S3Response> = {
345339
mode: 'advanced',
346340
},
347341

348-
// ===== LIST BUCKETS FIELDS =====
349342
{
350343
id: 'bucketPrefix',
351344
title: 'Bucket Prefix',
@@ -370,7 +363,6 @@ export const S3Block: BlockConfig<S3Response> = {
370363
mode: 'advanced',
371364
},
372365

373-
// ===== CREATE BUCKET FIELDS =====
374366
{
375367
id: 'createBucketAcl',
376368
title: 'Access Control',
@@ -686,20 +678,15 @@ export const S3Block: BlockConfig<S3Response> = {
686678
destinationBucket: { type: 'string', description: 'Destination bucket name' },
687679
destinationKey: { type: 'string', description: 'Destination object key' },
688680
copyAcl: { type: 'string', description: 'ACL for copied object' },
689-
// Head object inputs
690681
headVersionId: { type: 'string', description: 'Object version ID for metadata lookup' },
691-
// Batch delete inputs
692682
objectKeys: { type: 'string', description: 'Object keys to delete (batch)' },
693683
quiet: { type: 'boolean', description: 'Return only deletion errors' },
694-
// Presigned URL inputs
695684
presignedMethod: { type: 'string', description: 'Presigned URL type (get or put)' },
696685
expiresIn: { type: 'number', description: 'Presigned URL validity in seconds' },
697686
presignedContentType: { type: 'string', description: 'Content-Type for presigned upload' },
698-
// List buckets inputs
699687
bucketPrefix: { type: 'string', description: 'Bucket name prefix filter' },
700688
maxBuckets: { type: 'number', description: 'Maximum number of buckets to return' },
701689
bucketsContinuationToken: { type: 'string', description: 'Pagination token for buckets' },
702-
// Create bucket inputs
703690
createBucketAcl: { type: 'string', description: 'ACL for the new bucket' },
704691
},
705692
outputs: {

apps/sim/tools/firecrawl/batch-scrape.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ function normalizeUrls(value: unknown): string[] {
3030
if (Array.isArray(parsed)) {
3131
return parsed.map((entry) => String(entry).trim()).filter((entry) => entry.length > 0)
3232
}
33-
} catch {
34-
// Fall through to newline-separated parsing
35-
}
33+
} catch {}
3634
return trimmed
3735
.split(/\r?\n/)
3836
.map((entry) => entry.trim())

apps/sim/tools/google_drive/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ export interface GoogleDriveRevision {
184184
kind?: string
185185
}
186186

187-
// A threaded reply attached to a comment
187+
/** A threaded reply attached to a comment. */
188188
export interface GoogleDriveCommentReply {
189189
id?: string
190190
kind?: string
@@ -197,7 +197,7 @@ export interface GoogleDriveCommentReply {
197197
action?: string // 'resolve' | 'reopen'
198198
}
199199

200-
// A comment on a file
200+
/** A comment on a Google Drive file. */
201201
export interface GoogleDriveComment {
202202
id?: string
203203
kind?: string

apps/sim/tools/google_drive/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export const ALL_REVISION_FIELDS = [
9797
'kind',
9898
].join(',')
9999

100-
// All reply fields from Google Drive API v3
100+
/** All reply fields requested from the Google Drive API v3. */
101101
const ALL_REPLY_FIELDS = [
102102
'id',
103103
'kind',
@@ -110,7 +110,7 @@ const ALL_REPLY_FIELDS = [
110110
'action',
111111
].join(',')
112112

113-
// All comment fields from Google Drive API v3
113+
/** All comment fields requested from the Google Drive API v3. */
114114
export const ALL_COMMENT_FIELDS = [
115115
'id',
116116
'kind',

apps/sim/tools/pinecone/describe_index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ export const describeIndexTool: ToolConfig<PineconeDescribeIndexParams, Pinecone
4444
dimension: data.dimension ?? null,
4545
metric: data.metric ?? null,
4646
host: data.host ?? null,
47-
vectorType: data.vector_type ?? null,
48-
deletionProtection: data.deletion_protection ?? null,
47+
vectorType: data.vectorType ?? data.vector_type ?? null,
48+
deletionProtection: data.deletionProtection ?? data.deletion_protection ?? null,
4949
tags: data.tags ?? null,
5050
spec: data.spec ?? null,
5151
status: data.status ?? null,

apps/sim/tools/pinecone/describe_index_stats.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export const describeIndexStatsTool: ToolConfig<
5656
output: {
5757
namespaces: data.namespaces ?? {},
5858
dimension: data.dimension ?? null,
59-
indexFullness: data.indexFullness ?? null,
60-
totalVectorCount: data.totalVectorCount ?? null,
59+
indexFullness: data.indexFullness ?? data.index_fullness ?? null,
60+
totalVectorCount: data.totalVectorCount ?? data.total_vector_count ?? null,
6161
},
6262
}
6363
},

0 commit comments

Comments
 (0)