Skip to content

Commit 3e3cb9a

Browse files
committed
fix(onedrive): escape single quotes in search query, document embed link type
- encodeURIComponent doesn't escape single quotes, breaking the OData string literal for filenames containing an apostrophe - clarify create_share_link's linkType description to include 'embed', which the block UI already exposes as a valid option
1 parent ba6627f commit 3e3cb9a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

apps/sim/tools/onedrive/create_share_link.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const createShareLinkTool: ToolConfig<OneDriveToolParams, OneDriveShareLi
2929
type: 'string',
3030
required: false,
3131
visibility: 'user-or-llm',
32-
description: 'Type of link to create: "view" (read-only) or "edit" (read-write)',
32+
description: 'Type of link to create: "view" (read-only), "edit" (read-write), or "embed"',
3333
},
3434
linkScope: {
3535
type: 'string',

apps/sim/tools/onedrive/search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const searchTool: ToolConfig<OneDriveToolParams, OneDriveSearchResponse>
4646
}
4747

4848
const url = new URL(
49-
`https://graph.microsoft.com/v1.0/me/drive/root/search(q='${encodeURIComponent(query)}')`
49+
`https://graph.microsoft.com/v1.0/me/drive/root/search(q='${encodeURIComponent(query).replace(/'/g, '%27')}')`
5050
)
5151
url.searchParams.append(
5252
'$select',

0 commit comments

Comments
 (0)