Skip to content

Commit e9e8839

Browse files
fix(file): complete Manage Sharing rename in tools barrel
Prior commit's lint-staged dropped the barrel re-export update, leaving index.ts importing the deleted set-sharing module and breaking the block registry check. Point the barrel at manage-sharing.
1 parent e175b6d commit e9e8839

8 files changed

Lines changed: 47 additions & 47 deletions

File tree

apps/sim/app/api/tools/file/manage/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ export const POST = withRouteHandler(async (request: NextRequest) => {
576576
})
577577
}
578578

579-
case 'set_sharing': {
579+
case 'manage_sharing': {
580580
const { fileId, isActive, authType, password, allowedEmails } = body
581581

582582
// Check permission before probing file existence so a read-only caller

apps/sim/blocks/blocks.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ describe.concurrent('Blocks Module', () => {
174174
'file_append',
175175
'file_compress',
176176
'file_decompress',
177-
'file_set_sharing',
177+
'file_manage_sharing',
178178
])
179179
expect(block?.tools.config?.tool({ operation: 'file_compress' })).toBe('file_compress')
180180
expect(block?.tools.config?.tool({ operation: 'file_decompress' })).toBe('file_decompress')

apps/sim/blocks/blocks/file.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ describe('FileV5Block', () => {
118118
)
119119
})
120120

121-
it('maps set sharing to public access for a canonical file ID', () => {
121+
it('maps manage sharing to public access for a canonical file ID', () => {
122122
expect(
123123
buildParams({
124-
operation: 'file_set_sharing',
124+
operation: 'file_manage_sharing',
125125
shareInput: 'file-1',
126126
shareVisibility: 'public',
127127
_context: { workspaceId: 'workspace-1' },
@@ -139,7 +139,7 @@ describe('FileV5Block', () => {
139139
it('maps private visibility to a disabled share with no authType', () => {
140140
expect(
141141
buildParams({
142-
operation: 'file_set_sharing',
142+
operation: 'file_manage_sharing',
143143
shareInput: 'file-1',
144144
shareVisibility: 'private',
145145
_context: { workspaceId: 'workspace-1' },
@@ -154,7 +154,7 @@ describe('FileV5Block', () => {
154154
it('passes the password through for password visibility', () => {
155155
expect(
156156
buildParams({
157-
operation: 'file_set_sharing',
157+
operation: 'file_manage_sharing',
158158
shareInput: 'file-1',
159159
shareVisibility: 'password',
160160
sharePassword: 'hunter2',
@@ -171,7 +171,7 @@ describe('FileV5Block', () => {
171171
it('splits allowed emails for email visibility', () => {
172172
expect(
173173
buildParams({
174-
operation: 'file_set_sharing',
174+
operation: 'file_manage_sharing',
175175
shareInput: 'file-1',
176176
shareVisibility: 'email',
177177
shareAllowedEmails: 'a@example.com, b@example.com\n@acme.com',
@@ -185,10 +185,10 @@ describe('FileV5Block', () => {
185185
})
186186
})
187187

188-
it('resolves the file ID from a selected workspace file object for set sharing', () => {
188+
it('resolves the file ID from a selected workspace file object for manage sharing', () => {
189189
expect(
190190
buildParams({
191-
operation: 'file_set_sharing',
191+
operation: 'file_manage_sharing',
192192
shareInput: [{ id: 'file-9', name: 'report.pdf' }],
193193
shareVisibility: 'public',
194194
_context: { workspaceId: 'workspace-1' },
@@ -200,9 +200,9 @@ describe('FileV5Block', () => {
200200
})
201201
})
202202

203-
it('throws when no file is provided for set sharing', () => {
204-
expect(() => buildParams({ operation: 'file_set_sharing' })).toThrow(
205-
'File is required for set sharing'
203+
it('throws when no file is provided for manage sharing', () => {
204+
expect(() => buildParams({ operation: 'file_manage_sharing' })).toThrow(
205+
'File is required to manage sharing'
206206
)
207207
})
208208
})

apps/sim/blocks/blocks/file.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -823,9 +823,9 @@ export const FileV5Block: BlockConfig<FileParserV3Output> = {
823823
type: 'file_v5',
824824
name: 'File',
825825
description:
826-
'Read, get content, fetch, write, append, compress, decompress, and set sharing for files',
826+
'Read, get content, fetch, write, append, compress, decompress, and manage sharing for files',
827827
longDescription:
828-
'Read workspace file objects, extract the text content of files, fetch and parse files from URLs with optional headers, write new workspace files, append content to existing files, compress files into a .zip archive, extract a .zip archive into the workspace, or set the public share link for a file.',
828+
'Read workspace file objects, extract the text content of files, fetch and parse files from URLs with optional headers, write new workspace files, append content to existing files, compress files into a .zip archive, extract a .zip archive into the workspace, or manage the public share link for a file.',
829829
hideFromToolbar: false,
830830
bestPractices: `
831831
- Read returns workspace file objects in the "files" output and does NOT include their text. Use it to pick files or pass file references downstream (e.g. as attachments).
@@ -850,7 +850,7 @@ export const FileV5Block: BlockConfig<FileParserV3Output> = {
850850
{ label: 'Append', id: 'file_append' },
851851
{ label: 'Compress', id: 'file_compress' },
852852
{ label: 'Decompress', id: 'file_decompress' },
853-
{ label: 'Set File Sharing', id: 'file_set_sharing' },
853+
{ label: 'Manage Sharing', id: 'file_manage_sharing' },
854854
],
855855
value: () => 'file_read',
856856
},
@@ -1026,8 +1026,8 @@ export const FileV5Block: BlockConfig<FileParserV3Output> = {
10261026
acceptedTypes: '*',
10271027
placeholder: 'Select a workspace file',
10281028
mode: 'basic',
1029-
condition: { field: 'operation', value: 'file_set_sharing' },
1030-
required: { field: 'operation', value: 'file_set_sharing' },
1029+
condition: { field: 'operation', value: 'file_manage_sharing' },
1030+
required: { field: 'operation', value: 'file_manage_sharing' },
10311031
},
10321032
{
10331033
id: 'shareFileId',
@@ -1036,8 +1036,8 @@ export const FileV5Block: BlockConfig<FileParserV3Output> = {
10361036
canonicalParamId: 'shareInput',
10371037
placeholder: 'Workspace file ID',
10381038
mode: 'advanced',
1039-
condition: { field: 'operation', value: 'file_set_sharing' },
1040-
required: { field: 'operation', value: 'file_set_sharing' },
1039+
condition: { field: 'operation', value: 'file_manage_sharing' },
1040+
required: { field: 'operation', value: 'file_manage_sharing' },
10411041
},
10421042
{
10431043
id: 'shareVisibility',
@@ -1051,7 +1051,7 @@ export const FileV5Block: BlockConfig<FileParserV3Output> = {
10511051
{ label: 'SSO', id: 'sso' },
10521052
],
10531053
value: () => 'public',
1054-
condition: { field: 'operation', value: 'file_set_sharing' },
1054+
condition: { field: 'operation', value: 'file_manage_sharing' },
10551055
},
10561056
{
10571057
id: 'sharePassword',
@@ -1061,12 +1061,12 @@ export const FileV5Block: BlockConfig<FileParserV3Output> = {
10611061
placeholder: 'Password for the public link',
10621062
condition: {
10631063
field: 'operation',
1064-
value: 'file_set_sharing',
1064+
value: 'file_manage_sharing',
10651065
and: { field: 'shareVisibility', value: 'password' },
10661066
},
10671067
required: {
10681068
field: 'operation',
1069-
value: 'file_set_sharing',
1069+
value: 'file_manage_sharing',
10701070
and: { field: 'shareVisibility', value: 'password' },
10711071
},
10721072
},
@@ -1077,12 +1077,12 @@ export const FileV5Block: BlockConfig<FileParserV3Output> = {
10771077
placeholder: 'Comma- or newline-separated emails or @domain patterns',
10781078
condition: {
10791079
field: 'operation',
1080-
value: 'file_set_sharing',
1080+
value: 'file_manage_sharing',
10811081
and: { field: 'shareVisibility', value: ['email', 'sso'] },
10821082
},
10831083
required: {
10841084
field: 'operation',
1085-
value: 'file_set_sharing',
1085+
value: 'file_manage_sharing',
10861086
and: { field: 'shareVisibility', value: ['email', 'sso'] },
10871087
},
10881088
},
@@ -1096,7 +1096,7 @@ export const FileV5Block: BlockConfig<FileParserV3Output> = {
10961096
'file_append',
10971097
'file_compress',
10981098
'file_decompress',
1099-
'file_set_sharing',
1099+
'file_manage_sharing',
11001100
],
11011101
config: {
11021102
tool: (params) => params.operation || 'file_read',
@@ -1202,10 +1202,10 @@ export const FileV5Block: BlockConfig<FileParserV3Output> = {
12021202
}
12031203
}
12041204

1205-
if (operation === 'file_set_sharing') {
1205+
if (operation === 'file_manage_sharing') {
12061206
const shareInput = params.shareInput
12071207
if (!shareInput) {
1208-
throw new Error('File is required for set sharing')
1208+
throw new Error('File is required to manage sharing')
12091209
}
12101210

12111211
let fileId: string
@@ -1338,7 +1338,7 @@ export const FileV5Block: BlockConfig<FileParserV3Output> = {
13381338
},
13391339
shareInput: {
13401340
type: 'json',
1341-
description: 'Selected workspace file or canonical file ID to set sharing for',
1341+
description: 'Selected workspace file or canonical file ID to manage sharing for',
13421342
},
13431343
shareVisibility: {
13441344
type: 'string',
@@ -1379,23 +1379,23 @@ export const FileV5Block: BlockConfig<FileParserV3Output> = {
13791379
url: {
13801380
type: 'string',
13811381
description:
1382-
'URL to access the file (write and append), or the public share link when shared; empty when set to private (set sharing)',
1382+
'URL to access the file (write and append), or the public share link when shared; empty when set to private (manage sharing)',
13831383
},
13841384
isActive: {
13851385
type: 'boolean',
1386-
description: 'Whether the public link is enabled (set sharing)',
1386+
description: 'Whether the public link is enabled (manage sharing)',
13871387
},
13881388
authType: {
13891389
type: 'string',
1390-
description: 'Public link access mode: public, password, email, or sso (set sharing)',
1390+
description: 'Public link access mode: public, password, email, or sso (manage sharing)',
13911391
},
13921392
hasPassword: {
13931393
type: 'boolean',
1394-
description: 'Whether the public link is password-protected (set sharing)',
1394+
description: 'Whether the public link is password-protected (manage sharing)',
13951395
},
13961396
allowedEmails: {
13971397
type: 'array',
1398-
description: 'Allowed emails/domains for email or SSO access (set sharing)',
1398+
description: 'Allowed emails/domains for email or SSO access (manage sharing)',
13991399
},
14001400
},
14011401
}

apps/sim/lib/api/contracts/tools/file.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ export const fileManageMoveBodySchema = z.object({
4343

4444
export type FileManageMoveBody = z.input<typeof fileManageMoveBodySchema>
4545

46-
export const fileManageSetSharingBodySchema = z.object({
47-
operation: z.literal('set_sharing'),
46+
export const fileManageSharingBodySchema = z.object({
47+
operation: z.literal('manage_sharing'),
4848
workspaceId: z.string().min(1).optional(),
49-
fileId: z.string().min(1, 'fileId is required for set_sharing operation'),
50-
isActive: z.boolean({ error: 'isActive is required for set_sharing operation' }),
49+
fileId: z.string().min(1, 'fileId is required for manage_sharing operation'),
50+
isActive: z.boolean({ error: 'isActive is required for manage_sharing operation' }),
5151
authType: shareAuthTypeSchema.optional(),
5252
password: z.string().min(1).max(1024).optional(),
5353
allowedEmails: z.array(z.string().min(1)).max(200).optional(),
5454
})
5555

56-
export type FileManageSetSharingBody = z.input<typeof fileManageSetSharingBodySchema>
56+
export type FileManageSharingBody = z.input<typeof fileManageSharingBodySchema>
5757

5858
export const fileManageReadBodySchema = z
5959
.object({
@@ -105,7 +105,7 @@ export const fileManageBodySchema = z.union([
105105
fileManageAppendBodySchema,
106106
fileManageGetBodySchema,
107107
fileManageMoveBodySchema,
108-
fileManageSetSharingBodySchema,
108+
fileManageSharingBodySchema,
109109
fileManageReadBodySchema,
110110
fileManageContentBodySchema,
111111
fileManageCompressBodySchema,

apps/sim/tools/file/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
export { fileAppendTool } from '@/tools/file/append'
99
export { fileCompressTool, fileDecompressTool } from '@/tools/file/compress'
1010
export { fileGetContentTool, fileGetTool, fileReadTool } from '@/tools/file/get'
11-
export { fileSetSharingTool } from '@/tools/file/set-sharing'
11+
export { fileManageSharingTool } from '@/tools/file/manage-sharing'
1212
export { fileWriteTool } from '@/tools/file/write'
1313

1414
export const fileParseTool = fileParserTool

apps/sim/tools/file/manage-sharing.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ShareAuthType } from '@/lib/api/contracts/public-shares'
22
import type { ToolConfig, ToolResponse, WorkflowToolExecutionContext } from '@/tools/types'
33

4-
interface FileSetSharingParams {
4+
interface FileManageSharingParams {
55
fileId: string
66
isActive?: boolean
77
authType?: ShareAuthType
@@ -11,9 +11,9 @@ interface FileSetSharingParams {
1111
_context?: WorkflowToolExecutionContext
1212
}
1313

14-
export const fileSetSharingTool: ToolConfig<FileSetSharingParams, ToolResponse> = {
15-
id: 'file_set_sharing',
16-
name: 'Set File Sharing',
14+
export const fileManageSharingTool: ToolConfig<FileManageSharingParams, ToolResponse> = {
15+
id: 'file_manage_sharing',
16+
name: 'Manage Sharing',
1717
description:
1818
'Enable or disable the public share link for a workspace file, and set its access mode (public, password, email, or SSO). Idempotent: the public link stays stable across changes.',
1919
version: '1.0.0',
@@ -58,7 +58,7 @@ export const fileSetSharingTool: ToolConfig<FileSetSharingParams, ToolResponse>
5858
method: 'POST',
5959
headers: () => ({ 'Content-Type': 'application/json' }),
6060
body: (params) => ({
61-
operation: 'set_sharing',
61+
operation: 'manage_sharing',
6262
fileId: params.fileId,
6363
isActive: params.isActive,
6464
authType: params.authType,

apps/sim/tools/registry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,11 +864,11 @@ import {
864864
fileFetchTool,
865865
fileGetContentTool,
866866
fileGetTool,
867+
fileManageSharingTool,
867868
fileParserV2Tool,
868869
fileParserV3Tool,
869870
fileParseTool,
870871
fileReadTool,
871-
fileSetSharingTool,
872872
fileWriteTool,
873873
} from '@/tools/file'
874874
import {
@@ -4220,7 +4220,7 @@ export const tools: Record<string, ToolConfig> = {
42204220
file_get: fileGetTool,
42214221
file_get_content: fileGetContentTool,
42224222
file_read: fileReadTool,
4223-
file_set_sharing: fileSetSharingTool,
4223+
file_manage_sharing: fileManageSharingTool,
42244224
file_write: fileWriteTool,
42254225
firecrawl_scrape: firecrawlScrapeTool,
42264226
firecrawl_search: firecrawlSearchTool,

0 commit comments

Comments
 (0)