mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-08-19 20:00:11 +02:00
* Autodocument Swagger API with JSDocs on /v1/ endpoints for API access implement single-player API keys WIP Admin API Keys * Create new api keys as both single and multi-user * Add boot and telem * Complete Admin API * Complete endpoints dark mode swagger * update docs * undo debug * update docs and readme
37 lines
907 B
JavaScript
37 lines
907 B
JavaScript
const swaggerAutogen = require('swagger-autogen')({ openapi: '3.0.0' });
|
|
|
|
const doc = {
|
|
info: {
|
|
version: '1.0.0',
|
|
title: 'AnythingLLM Developer API',
|
|
description: 'API endpoints that enable programmatic reading, writing, and updating of your AnythingLLM instance. UI supplied by Swagger.io.',
|
|
},
|
|
host: '/api',
|
|
schemes: ['http'],
|
|
securityDefinitions: {
|
|
BearerAuth: {
|
|
type: 'http',
|
|
scheme: 'bearer',
|
|
bearerFormat: 'JWT'
|
|
}
|
|
},
|
|
security: [
|
|
{ BearerAuth: [] }
|
|
],
|
|
definitions: {
|
|
InvalidAPIKey: {
|
|
message: 'Invalid API Key',
|
|
},
|
|
}
|
|
};
|
|
|
|
const outputFile = './openapi.json';
|
|
const endpointsFiles = [
|
|
'../endpoints/api/auth/index.js',
|
|
'../endpoints/api/admin/index.js',
|
|
'../endpoints/api/document/index.js',
|
|
'../endpoints/api/workspace/index.js',
|
|
'../endpoints/api/system/index.js',
|
|
];
|
|
|
|
swaggerAutogen(outputFile, endpointsFiles, doc) |