@@ -350,7 +350,7 @@ export async function getChildAppPreviewNode({
350350 systemToolSet : {
351351 toolId : app . id ,
352352 toolList : children
353- . filter ( ( item ) => item . isActive !== false )
353+ . filter ( ( item ) => item . status === 1 || item . status === undefined )
354354 . map ( ( item ) => ( {
355355 toolId : item . id ,
356356 name : parseI18nString ( item . name , lang ) ,
@@ -407,7 +407,7 @@ export async function getChildAppPreviewNode({
407407 return {
408408 id : getNanoid ( ) ,
409409 pluginId : app . id ,
410- templateType : app . templateType ,
410+ templateType : app . templateType ?? FlowNodeTemplateTypeEnum . tools ,
411411 flowNodeType,
412412 avatar : app . avatar ,
413413 name : parseI18nString ( app . name , lang ) ,
@@ -507,21 +507,13 @@ export async function getChildAppRuntimeById({
507507}
508508
509509const dbPluginFormat = ( item : SystemPluginConfigSchemaType ) : SystemPluginTemplateItemType => {
510- const {
511- name,
512- avatar,
513- intro,
514- toolDescription,
515- version,
516- weight,
517- templateType,
518- associatedPluginId,
519- userGuide
520- } = item . customConfig ! ;
510+ const { name, avatar, intro, toolDescription, version, weight, associatedPluginId, userGuide } =
511+ item . customConfig ! ;
521512
522513 return {
523514 id : item . pluginId ,
524- isActive : item . isActive ,
515+ status : item . status ?? 1 ,
516+ defaultInstalled : item . defaultInstalled ?? true ,
525517 isFolder : false ,
526518 parentId : null ,
527519 author : item . customConfig ?. author || '' ,
@@ -531,7 +523,7 @@ const dbPluginFormat = (item: SystemPluginConfigSchemaType): SystemPluginTemplat
531523 intro,
532524 toolDescription,
533525 weight,
534- templateType,
526+ templateType : FlowNodeTemplateTypeEnum . tools ,
535527 originCost : item . originCost ,
536528 currentCost : item . currentCost ,
537529 hasTokenFee : item . hasTokenFee ,
@@ -573,14 +565,17 @@ export const refreshSystemTools = async (): Promise<SystemPluginTemplateItemType
573565 instructions : dbPluginConfig ?. customConfig ?. userGuide ,
574566 weight : item . weight ,
575567 toolSource : item . toolSource || 'built-in' ,
568+ // temporarily fixed
569+ pluginTags : ( item as any ) . pluginTags ,
576570 workflow : {
577571 nodes : [ ] ,
578572 edges : [ ]
579573 } ,
580574 versionList,
581- templateType : item . templateType ,
575+ templateType : item . templateType ?? FlowNodeTemplateTypeEnum . tools ,
582576 showStatus : true ,
583- isActive : dbPluginConfig ?. isActive ?? item . isActive ?? true ,
577+ status : dbPluginConfig ?. status ?? 1 ,
578+ defaultInstalled : dbPluginConfig ?. defaultInstalled ?? true ,
584579 inputList : item ?. secretInputConfig ,
585580 hasSystemSecret : ! ! dbPluginConfig ?. inputListVal ,
586581
@@ -599,11 +594,6 @@ export const refreshSystemTools = async (): Promise<SystemPluginTemplateItemType
599594 const concatTools = [ ...formatTools , ...dbPlugins ] ;
600595 concatTools . sort ( ( a , b ) => ( a . pluginOrder ?? 999 ) - ( b . pluginOrder ?? 999 ) ) ;
601596
602- global . systemToolsTypeCache = { } ;
603- concatTools . forEach ( ( item ) => {
604- global . systemToolsTypeCache [ item . templateType ] = 1 ;
605- } ) ;
606-
607597 return concatTools ;
608598} ;
609599
@@ -622,7 +612,3 @@ export const getSystemToolById = async (id: string): Promise<SystemPluginTemplat
622612 if ( ! dbPlugin ) return Promise . reject ( PluginErrEnum . unExist ) ;
623613 return dbPluginFormat ( dbPlugin ) ;
624614} ;
625-
626- declare global {
627- var systemToolsTypeCache : Record < string , 1 > ;
628- }
0 commit comments