fix: restore OpenAPI file uploads

Expose /api/v1/file in OpenAPI, enable file-scoped API keys, and regenerate docs/client artifacts.
This commit is contained in:
Weilong Liao
2026-06-18 12:37:38 +08:00
committed by GitHub
parent 2c8f38c886
commit 264e7eaaa3
12 changed files with 411 additions and 29 deletions

File diff suppressed because one or more lines are too long

View File

@@ -191,7 +191,7 @@ export type ConversationRef = {
export type CreateApiKeyRequest = {
name: string;
scopes?: Array<('bot' | 'provider' | 'persona' | 'im' | 'config' | 'chat' | 'plugin' | 'mcp' | 'skill')>;
scopes?: Array<('bot' | 'provider' | 'persona' | 'im' | 'config' | 'chat' | 'file' | 'plugin' | 'mcp' | 'skill')>;
expires_at?: string;
expires_in_days?: number;
};
@@ -340,6 +340,8 @@ export type NeoReleaseActionRequest = {
export type ParameterAttachmentId = string;
export type ParameterAttachmentIdQuery = string;
export type ParameterBotId = string;
export type ParameterChunkId = string;
@@ -1496,6 +1498,24 @@ export type UploadFileResponse = (SuccessEnvelope);
export type UploadFileError = unknown;
export type UploadOpenApiFileData = {
body: FileUploadRequest;
};
export type UploadOpenApiFileResponse = (SuccessEnvelope);
export type UploadOpenApiFileError = unknown;
export type DownloadOpenApiFileData = {
query: {
attachment_id: string;
};
};
export type DownloadOpenApiFileResponse = ((Blob | File));
export type DownloadOpenApiFileError = unknown;
export type GetFileByNameData = {
query: {
filename: string;

View File

@@ -482,7 +482,7 @@ const apiKeys = ref([]);
const apiKeyCreating = ref(false);
const newApiKeyName = ref('');
const newApiKeyExpiresInDays = ref(30);
const newApiKeyScopes = ref(['bot', 'provider', 'im', 'config', 'chat']);
const newApiKeyScopes = ref(['bot', 'provider', 'im', 'config', 'chat', 'file']);
const createdApiKeyPlaintext = ref('');
const systemConfigData = ref({});
const systemConfigMetadata = ref({});
@@ -513,6 +513,7 @@ const availableScopes = [
{ value: 'im', label: 'im' },
{ value: 'config', label: 'config' },
{ value: 'chat', label: 'chat' },
{ value: 'file', label: 'file' },
{ value: 'plugin', label: 'plugin' },
{ value: 'mcp', label: 'mcp' },
{ value: 'skill', label: 'skill' }