mirror of
https://github.com/langgenius/dify.git
synced 2026-02-13 07:01:23 -05:00
- 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.
31 lines
718 B
TypeScript
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>())
|