Skip to content

Commit a153a20

Browse files
author
waleed
committed
added number validation, tested all stripe tools
1 parent 3de37fe commit a153a20

File tree

169 files changed

+444
-406
lines changed

Some content is hidden

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

169 files changed

+444
-406
lines changed

apps/sim/blocks/blocks/stripe.ts

Lines changed: 71 additions & 58 deletions
Large diffs are not rendered by default.

apps/sim/tools/airtable/list_records.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const airtableListRecordsTool: ToolConfig<AirtableListParams, AirtableLis
4949
url: (params) => {
5050
const url = `https://api.airtable.com/v0/${params.baseId}/${params.tableId}`
5151
const queryParams = new URLSearchParams()
52-
if (params.maxRecords) queryParams.append('maxRecords', params.maxRecords.toString())
52+
if (params.maxRecords) queryParams.append('maxRecords', Number(params.maxRecords).toString())
5353
if (params.filterFormula) {
5454
// Airtable formulas often contain characters needing encoding,
5555
// but standard encodeURIComponent might over-encode.

apps/sim/tools/arxiv/get_author_papers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const getAuthorPapersTool: ToolConfig<
3434
searchParams.append('search_query', `au:"${params.authorName}"`)
3535
searchParams.append(
3636
'max_results',
37-
(params.maxResults ? Math.min(params.maxResults, 2000) : 10).toString()
37+
(params.maxResults ? Math.min(Number(params.maxResults), 2000) : 10).toString()
3838
)
3939
searchParams.append('sortBy', 'submittedDate')
4040
searchParams.append('sortOrder', 'descending')

apps/sim/tools/arxiv/search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const searchTool: ToolConfig<ArxivSearchParams, ArxivSearchResponse> = {
5656

5757
// Add optional parameters
5858
if (params.maxResults) {
59-
searchParams.append('max_results', Math.min(params.maxResults, 2000).toString())
59+
searchParams.append('max_results', Math.min(Number(params.maxResults), 2000).toString())
6060
} else {
6161
searchParams.append('max_results', '10')
6262
}

apps/sim/tools/confluence/list_attachments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const confluenceListAttachmentsTool: ToolConfig<
8585
accessToken: params.accessToken,
8686
cloudId: params.cloudId,
8787
pageId: params.pageId,
88-
limit: params.limit || 25,
88+
limit: params.limit ? Number(params.limit) : 25,
8989
}
9090
},
9191
},

apps/sim/tools/confluence/list_comments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const confluenceListCommentsTool: ToolConfig<
8484
accessToken: params.accessToken,
8585
cloudId: params.cloudId,
8686
pageId: params.pageId,
87-
limit: params.limit || 25,
87+
limit: params.limit ? Number(params.limit) : 25,
8888
}
8989
},
9090
},

apps/sim/tools/confluence/list_spaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const confluenceListSpacesTool: ToolConfig<
7777
domain: params.domain,
7878
accessToken: params.accessToken,
7979
cloudId: params.cloudId,
80-
limit: params.limit || 25,
80+
limit: params.limit ? Number(params.limit) : 25,
8181
}
8282
},
8383
},

apps/sim/tools/confluence/search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export const confluenceSearchTool: ToolConfig<ConfluenceSearchParams, Confluence
8383
accessToken: params.accessToken,
8484
cloudId: params.cloudId,
8585
query: params.query,
86-
limit: params.limit || 25,
86+
limit: params.limit ? Number(params.limit) : 25,
8787
}
8888
},
8989
},

apps/sim/tools/discord/ban_member.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const discordBanMemberTool: ToolConfig<DiscordBanMemberParams, DiscordBan
5858
body: (params: DiscordBanMemberParams) => {
5959
const body: any = {}
6060
if (params.deleteMessageDays !== undefined) {
61-
body.delete_message_days = params.deleteMessageDays
61+
body.delete_message_days = Number(params.deleteMessageDays)
6262
}
6363
return body
6464
},

apps/sim/tools/discord/create_channel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const discordCreateChannelTool: ToolConfig<
6565
const body: any = {
6666
name: params.name,
6767
}
68-
if (params.type !== undefined) body.type = params.type
68+
if (params.type !== undefined) body.type = Number(params.type)
6969
if (params.topic) body.topic = params.topic
7070
if (params.parentId) body.parent_id = params.parentId
7171
return body

0 commit comments

Comments
 (0)