Skip to content

Commit afd043e

Browse files
committed
rename enum
1 parent 13242e8 commit afd043e

File tree

40 files changed

+92
-73
lines changed

40 files changed

+92
-73
lines changed

packages/global/core/app/constants.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ export enum AppTypeEnum {
1212
simple = 'simple',
1313
agent = 'agent',
1414
workflow = 'advanced',
15-
plugin = 'plugin',
16-
toolSet = 'toolSet', // 'mcp'
15+
workflowTool = 'plugin',
16+
mcpToolSet = 'toolSet', // 'mcp'
1717
httpToolSet = 'httpToolSet',
18-
tool = 'tool',
1918
hidden = 'hidden',
2019

2120
// deprecated
21+
tool = 'tool',
2222
httpPlugin = 'httpPlugin'
2323
}
2424

packages/global/core/app/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export const getAppType = (config?: WorkflowTemplateBasicType | AppSimpleEditFor
185185
return AppTypeEnum.workflow;
186186
}
187187
if (config.nodes.some((node) => node.flowNodeType === 'pluginInput')) {
188-
return AppTypeEnum.plugin;
188+
return AppTypeEnum.workflowTool;
189189
}
190190
return '';
191191
};

packages/global/core/workflow/type/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export type WorkflowTemplateType = {
5050
// template market
5151
export type TemplateMarketItemType = WorkflowTemplateType & {
5252
tags: string[];
53-
type: AppTypeEnum.simple | AppTypeEnum.workflow | AppTypeEnum.plugin;
53+
type: AppTypeEnum.simple | AppTypeEnum.workflow | AppTypeEnum.workflowTool;
5454
};
5555
// template market list
5656
export type TemplateMarketListItemType = {
@@ -59,6 +59,6 @@ export type TemplateMarketListItemType = {
5959
intro?: string;
6060
author?: string;
6161
tags: string[];
62-
type: AppTypeEnum.simple | AppTypeEnum.workflow | AppTypeEnum.plugin;
62+
type: AppTypeEnum.simple | AppTypeEnum.workflow | AppTypeEnum.workflowTool;
6363
avatar: string;
6464
};

packages/service/core/app/tool/controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export async function getChildAppPreviewNode({
238238
})
239239
: true;
240240

241-
if (item.type === AppTypeEnum.toolSet) {
241+
if (item.type === AppTypeEnum.mcpToolSet) {
242242
const children = await getMCPChildren(item);
243243
version.nodes[0].toolConfig = {
244244
mcpToolSet: {

packages/service/support/permission/teamLimit.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export const checkTeamAppLimit = async (teamId: string, amount = 1) => {
4949
$in: [
5050
AppTypeEnum.simple,
5151
AppTypeEnum.workflow,
52-
AppTypeEnum.plugin,
53-
AppTypeEnum.toolSet,
52+
AppTypeEnum.workflowTool,
53+
AppTypeEnum.mcpToolSet,
5454
AppTypeEnum.httpToolSet
5555
]
5656
}
@@ -65,7 +65,12 @@ export const checkTeamAppLimit = async (teamId: string, amount = 1) => {
6565
if (global?.licenseData?.maxApps && typeof global?.licenseData?.maxApps === 'number') {
6666
const totalApps = await MongoApp.countDocuments({
6767
type: {
68-
$in: [AppTypeEnum.simple, AppTypeEnum.workflow, AppTypeEnum.plugin, AppTypeEnum.toolSet]
68+
$in: [
69+
AppTypeEnum.simple,
70+
AppTypeEnum.workflow,
71+
AppTypeEnum.workflowTool,
72+
AppTypeEnum.mcpToolSet
73+
]
6974
}
7075
});
7176
if (totalApps >= global.licenseData.maxApps) {

packages/service/support/user/audit/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ export function getI18nAppType(type: AppTypeEnum): string {
1414
if (type === AppTypeEnum.folder) return i18nT('account_team:type.Folder');
1515
if (type === AppTypeEnum.simple) return i18nT('app:type.Chat_Agent');
1616
if (type === AppTypeEnum.workflow) return i18nT('account_team:type.Workflow bot');
17-
if (type === AppTypeEnum.plugin) return i18nT('app:toolType_workflow');
17+
if (type === AppTypeEnum.workflowTool) return i18nT('app:toolType_workflow');
1818
if (type === AppTypeEnum.httpPlugin) return i18nT('account_team:type.Http plugin');
1919
if (type === AppTypeEnum.httpToolSet) return i18nT('app:toolType_http');
20-
if (type === AppTypeEnum.toolSet) return i18nT('app:toolType_mcp');
20+
if (type === AppTypeEnum.mcpToolSet) return i18nT('app:toolType_mcp');
2121
if (type === AppTypeEnum.tool) return i18nT('app:toolType_mcp');
2222
return i18nT('common:UnKnow');
2323
}

projects/app/src/pageComponents/app/constants.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@ export const createAppTypeMap = {
1818
description: i18nT('app:type_workflow_description'),
1919
imgUrl: '/imgs/app/workflowPreview.svg'
2020
},
21-
[AppTypeEnum.plugin]: {
22-
type: AppTypeEnum.plugin,
21+
[AppTypeEnum.workflowTool]: {
22+
type: AppTypeEnum.workflowTool,
2323
icon: 'core/app/type/pluginFill',
2424
title: i18nT('app:toolType_workflow'),
2525
intro: i18nT('app:type_plugin_intro'),
2626
description: i18nT('app:type_plugin_description'),
2727
imgUrl: '/imgs/app/pluginPreview.svg'
2828
},
29-
[AppTypeEnum.toolSet]: {
30-
type: AppTypeEnum.toolSet,
29+
[AppTypeEnum.mcpToolSet]: {
30+
type: AppTypeEnum.mcpToolSet,
3131
icon: 'core/app/type/mcpToolsFill',
3232
title: i18nT('app:toolType_mcp'),
3333
intro: i18nT('app:type_mcp_intro'),

projects/app/src/pageComponents/app/detail/Logs/DetailLogsModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const DetailLogsModal = ({ appId, chatId, onClose }: Props) => {
6969

7070
const title = chat?.title;
7171
const chatModels = chat?.app?.chatModels;
72-
const isPlugin = chat?.app.type === AppTypeEnum.plugin;
72+
const isPlugin = chat?.app.type === AppTypeEnum.workflowTool;
7373

7474
return (
7575
<>

projects/app/src/pageComponents/app/detail/RouteTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const RouteTab = () => {
2929
? [
3030
{
3131
label:
32-
appDetail.type === AppTypeEnum.plugin
32+
appDetail.type === AppTypeEnum.workflowTool
3333
? t('app:setting_plugin')
3434
: t('app:setting_app'),
3535
id: TabEnum.appEdit

projects/app/src/pageComponents/app/detail/SimpleApp/components/ToolSelectModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ const ToolSelectModal = ({ onClose, ...props }: Props & { onClose: () => void })
9292
searchKey: searchVal,
9393
type: [
9494
AppTypeEnum.toolFolder,
95-
AppTypeEnum.plugin,
96-
AppTypeEnum.toolSet,
95+
AppTypeEnum.workflowTool,
96+
AppTypeEnum.mcpToolSet,
9797
AppTypeEnum.httpToolSet
9898
]
9999
}).then((res) => res.filter((app) => app.id !== appDetail._id));

0 commit comments

Comments
 (0)