mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-16 01:40:15 +08:00
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:
File diff suppressed because one or more lines are too long
@@ -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;
|
||||
|
||||
@@ -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' }
|
||||
|
||||
Reference in New Issue
Block a user