Files
dify/web/contract/console/sandbox-file.ts
Harry bb4dd85ae3 feat(sandbox): refactor sandbox file handling to include app_id
- Updated API routes to use app_id instead of sandbox_id for file operations, aligning with user-specific sandbox workspaces.
- Enhanced SandboxFileService and related classes to accommodate app_id in file listing and download functionalities.
- Refactored storage key generation for sandbox archives to include app_id, ensuring proper file organization.
- Adjusted frontend contracts and services to reflect the new app_id parameter in API calls.
2026-01-30 22:45:28 +08:00

31 lines
718 B
TypeScript

import type {
SandboxFileDownloadRequest,
SandboxFileDownloadTicket,
SandboxFileListQuery,
SandboxFileNode,
} from '@/types/sandbox-file'
import { type } from '@orpc/contract'
import { base } from '../base'
export const listFilesContract = base
.route({
path: '/apps/{appId}/sandbox/files',
method: 'GET',
})
.input(type<{
params: { appId: string }
query?: SandboxFileListQuery
}>())
.output(type<SandboxFileNode[]>())
export const downloadFileContract = base
.route({
path: '/apps/{appId}/sandbox/files/download',
method: 'POST',
})
.input(type<{
params: { appId: string }
body: SandboxFileDownloadRequest
}>())
.output(type<SandboxFileDownloadTicket>())