import type { Viewport } from 'reactflow' import type { Edge, Node } from '@/app/components/workflow/types' import type { DataSetListResponse } from '@/models/datasets' import type { SiteInfo, } from '@/models/share' import type { AppModeEnum, ModelConfig } from '@/types/app' import qs from 'qs' import { get, } from './base' export type TryAppInfo = { name: string description: string mode: AppModeEnum site: SiteInfo model_config: ModelConfig deleted_tools: any[] } export const fetchTryAppInfo = async (appId: string) => { return get(`/trial-apps/${appId}`) as Promise } export const fetchTryAppDatasets = (appId: string, ids: string[]) => { const urlParams = qs.stringify({ ids }, { indices: false }) return get(`/trial-apps/${appId}/datasets?${urlParams}`) } type TryAppFlowPreview = { graph: { nodes: Node[] edges: Edge[] viewport: Viewport } } export const fetchTryAppFlowPreview = (appId: string) => { return get(`/trial-apps/${appId}/workflows`) }