mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-19 20:50:09 +01:00
665553af5a
* developer api access for embedded chat widgets and embed chats * lint * uncheck files * sanitize embed api inputs --------- Co-authored-by: Timothy Carambat <rambat1010@gmail.com>
30 lines
1.1 KiB
JavaScript
30 lines
1.1 KiB
JavaScript
const { useSwagger } = require("../../swagger/utils");
|
|
const { apiAdminEndpoints } = require("./admin");
|
|
const { apiAuthEndpoints } = require("./auth");
|
|
const { apiDocumentEndpoints } = require("./document");
|
|
const { apiSystemEndpoints } = require("./system");
|
|
const { apiWorkspaceEndpoints } = require("./workspace");
|
|
const { apiWorkspaceThreadEndpoints } = require("./workspaceThread");
|
|
const { apiUserManagementEndpoints } = require("./userManagement");
|
|
const { apiOpenAICompatibleEndpoints } = require("./openai");
|
|
const { apiEmbedEndpoints } = require("./embed");
|
|
|
|
// All endpoints must be documented and pass through the validApiKey Middleware.
|
|
// How to JSDoc an endpoint
|
|
// https://www.npmjs.com/package/swagger-autogen#openapi-3x
|
|
function developerEndpoints(app, router) {
|
|
if (!router) return;
|
|
useSwagger(app);
|
|
apiAuthEndpoints(router);
|
|
apiAdminEndpoints(router);
|
|
apiSystemEndpoints(router);
|
|
apiWorkspaceEndpoints(router);
|
|
apiDocumentEndpoints(router);
|
|
apiWorkspaceThreadEndpoints(router);
|
|
apiUserManagementEndpoints(router);
|
|
apiOpenAICompatibleEndpoints(router);
|
|
apiEmbedEndpoints(router);
|
|
}
|
|
|
|
module.exports = { developerEndpoints };
|