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

Function transformOpenApiDocument

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

Source from the content-addressed store, hash-verified

79} as const;
80
81export function transformOpenApiDocument(
82 document: Record<string, unknown>,
83): Record<string, unknown> {
84 const paths = asRecord(document['paths']);
85 if (paths === undefined) return document;
86
87 patchFileUpload(paths);
88 patchFileDownload(paths);
89 patchSessionActions(paths);
90 patchFsAction(paths);
91 patchFsDownload(paths);
92 patchQuestionResolveOrDismiss(paths);
93
94 return document;
95}
96
97function patchFileUpload(paths: Record<string, unknown>): void {
98 const operation = getOperation(paths, '/api/v1/files', 'post');

Callers 1

registerOpenApiFunction · 0.90

Calls 7

patchFileUploadFunction · 0.85
patchFileDownloadFunction · 0.85
patchSessionActionsFunction · 0.85
patchFsActionFunction · 0.85
patchFsDownloadFunction · 0.85
asRecordFunction · 0.70

Tested by

no test coverage detected