| ...configsMap, | ...configsMap, | ||||
| }) | }) | ||||
| const { | const { | ||||
| hasNodeInspectVars, | |||||
| hasSetInspectVar, | |||||
| fetchInspectVarValue, | |||||
| editInspectVarValue, | |||||
| renameInspectVarName, | |||||
| appendNodeInspectVars, | |||||
| deleteInspectVar, | |||||
| deleteNodeInspectorVars, | |||||
| deleteAllInspectorVars, | |||||
| isInspectVarEdited, | |||||
| resetToLastRunVar, | |||||
| invalidateSysVarValues, | |||||
| resetConversationVar, | |||||
| invalidateConversationVarValues, | |||||
| } = useInspectVarsCrud() | |||||
| hasNodeInspectVars, | |||||
| hasSetInspectVar, | |||||
| fetchInspectVarValue, | |||||
| editInspectVarValue, | |||||
| renameInspectVarName, | |||||
| appendNodeInspectVars, | |||||
| deleteInspectVar, | |||||
| deleteNodeInspectorVars, | |||||
| deleteAllInspectorVars, | |||||
| isInspectVarEdited, | |||||
| resetToLastRunVar, | |||||
| invalidateSysVarValues, | |||||
| resetConversationVar, | |||||
| invalidateConversationVarValues, | |||||
| } = useInspectVarsCrud() | |||||
| const hooksStore = useMemo(() => { | const hooksStore = useMemo(() => { | ||||
| return { | return { |
| const appDetail = useAppStore(s => s.appDetail) | const appDetail = useAppStore(s => s.appDetail) | ||||
| const handleExportDSL = useCallback(async (include = false) => { | |||||
| const handleExportDSL = useCallback(async (include = false, workflowId?: string) => { | |||||
| if (!appDetail) | if (!appDetail) | ||||
| return | return | ||||
| const { data } = await exportAppConfig({ | const { data } = await exportAppConfig({ | ||||
| appID: appDetail.id, | appID: appDetail.id, | ||||
| include, | include, | ||||
| workflowID: workflowId, | |||||
| }) | }) | ||||
| const a = document.createElement('a') | const a = document.createElement('a') | ||||
| const file = new Blob([data], { type: 'application/yaml' }) | const file = new Blob([data], { type: 'application/yaml' }) |
| availableNodesMetaData?: AvailableNodesMetaData | availableNodesMetaData?: AvailableNodesMetaData | ||||
| getWorkflowRunAndTraceUrl: (runId?: string) => { runUrl: string; traceUrl: string } | getWorkflowRunAndTraceUrl: (runId?: string) => { runUrl: string; traceUrl: string } | ||||
| exportCheck?: () => Promise<void> | exportCheck?: () => Promise<void> | ||||
| handleExportDSL?: (include?: boolean) => Promise<void> | |||||
| handleExportDSL?: (include?: boolean, flowId?: string) => Promise<void> | |||||
| fetchInspectVars: (params: { passInVars?: boolean, vars?: VarInInspect[], passedInAllPluginInfoList?: Record<string, ToolWithProvider[]>, passedInSchemaTypeDefinitions?: SchemaTypeDefinition[] }) => Promise<void> | fetchInspectVars: (params: { passInVars?: boolean, vars?: VarInInspect[], passedInAllPluginInfoList?: Record<string, ToolWithProvider[]>, passedInSchemaTypeDefinitions?: SchemaTypeDefinition[] }) => Promise<void> | ||||
| hasNodeInspectVars: (nodeId: string) => boolean | hasNodeInspectVars: (nodeId: string) => boolean | ||||
| hasSetInspectVar: (nodeId: string, name: string, sysVars: VarInInspect[], conversationVars: VarInInspect[]) => boolean | hasSetInspectVar: (nodeId: string, name: string, sysVars: VarInInspect[], conversationVars: VarInInspect[]) => boolean |
| }) | }) | ||||
| break | break | ||||
| case VersionHistoryContextMenuOptions.exportDSL: | case VersionHistoryContextMenuOptions.exportDSL: | ||||
| handleExportDSL(false, item.id) | |||||
| handleExportDSL?.(false, item.id) | |||||
| break | break | ||||
| } | } | ||||
| }, [t, handleExportDSL]) | }, [t, handleExportDSL]) |