mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-03 13:38:00 +00:00
4.7 doc update (#1068)
* fix: plugin update * feat: get current time plugin * fix: ts * perf: select app ux * fix: ts * perf: max w * move code * perf: inform tip * fix: inform * doc * fix: tool handle * perf: tmp file store * doc * fix: message file selector * feat: doc * perf: switch trigger * doc * fix: openapi import * rount the number * parse openapi schema * fix empty line after variables (#64) * doc image * image size * doc * doc * catch error --------- Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
@@ -4,7 +4,6 @@ import { connectToDatabase } from '@/service/mongo';
|
||||
import type { CreateOnePluginParams } from '@fastgpt/global/core/plugin/controller';
|
||||
import { authUserNotVisitor } from '@fastgpt/service/support/permission/auth/user';
|
||||
import { MongoPlugin } from '@fastgpt/service/core/plugin/schema';
|
||||
import { checkTeamPluginLimit } from '@fastgpt/service/support/permission/teamLimit';
|
||||
import { mongoSessionRun } from '@fastgpt/service/common/mongo/sessionRun';
|
||||
import { httpApiSchema2Plugins } from '@fastgpt/global/core/plugin/httpPlugin/utils';
|
||||
|
||||
@@ -31,7 +30,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
|
||||
{ session }
|
||||
);
|
||||
|
||||
const childrenPlugins = httpApiSchema2Plugins({
|
||||
const childrenPlugins = await httpApiSchema2Plugins({
|
||||
parentId,
|
||||
apiSchemaStr: body.metadata?.apiSchemaStr,
|
||||
customHeader: body.metadata?.customHeaders
|
||||
|
@@ -1,15 +1,13 @@
|
||||
import type { NextApiRequest, NextApiResponse } from 'next';
|
||||
import { jsonRes } from '@fastgpt/service/common/response';
|
||||
import SwaggerParser from '@apidevtools/swagger-parser';
|
||||
import { loadOpenAPISchemaFromUrl } from '@fastgpt/global/common/string/swagger';
|
||||
|
||||
export default async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
||||
try {
|
||||
const apiURL = req.body.url as string;
|
||||
|
||||
const api = await SwaggerParser.validate(apiURL);
|
||||
|
||||
return jsonRes(res, {
|
||||
data: api
|
||||
data: await loadOpenAPISchemaFromUrl(apiURL)
|
||||
});
|
||||
} catch (err) {
|
||||
jsonRes(res, {
|
||||
|
@@ -75,7 +75,7 @@ const updateHttpChildrenPlugin = async ({
|
||||
'_id metadata'
|
||||
);
|
||||
|
||||
const schemaPlugins = httpApiSchema2Plugins({
|
||||
const schemaPlugins = await httpApiSchema2Plugins({
|
||||
parentId: parent.id,
|
||||
apiSchemaStr: parent.metadata?.apiSchemaStr,
|
||||
customHeader: parent.metadata?.customHeaders
|
||||
|
Reference in New Issue
Block a user