MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / patchFileDownload

Function patchFileDownload

packages/server/src/openapi/transforms.ts:111–132  ·  view source on GitHub ↗
(paths: Record<string, unknown>)

Source from the content-addressed store, hash-verified

109}
110
111function patchFileDownload(paths: Record<string, unknown>): void {
112 const operation = getOperation(paths, '/api/v1/files/{file_id}', 'get');
113 if (operation === undefined) return;
114
115 setResponse(operation, '200', {
116 description: 'Binary file download',
117 headers: {
118 'content-disposition': headerString(),
119 'content-length': headerInteger(),
120 etag: headerString(),
121 },
122 content: {
123 'application/octet-stream': {
124 schema: binarySchema,
125 },
126 },
127 });
128 setResponse(operation, '404', {
129 description: 'File not found',
130 content: jsonContent(errorEnvelopeSchema),
131 });
132}
133
134function patchSessionActions(paths: Record<string, unknown>): void {
135 const internalPath = '/api/v1/sessions/{tail}';

Callers 1

transformOpenApiDocumentFunction · 0.85

Calls 5

getOperationFunction · 0.85
setResponseFunction · 0.85
headerIntegerFunction · 0.85
jsonContentFunction · 0.85
headerStringFunction · 0.70

Tested by

no test coverage detected