mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-04 10:34:30 +00:00
feat(web): Add DAG variables to web flow (#1981)
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com> Co-authored-by: 谨欣 <echo.cmy@antgroup.com> Co-authored-by: yanzhiyong <932374019@qq.com> Co-authored-by: 严志勇 <yanzhiyong@tiansuixiansheng.com>
This commit is contained in:
@@ -6,6 +6,10 @@ import {
|
||||
IFlowRefreshParams,
|
||||
IFlowResponse,
|
||||
IFlowUpdateParam,
|
||||
IGetKeysRequestParams,
|
||||
IGetKeysResponseData,
|
||||
IGetVariablesByKeyRequestParams,
|
||||
IGetVariablesByKeyResponseData,
|
||||
IUploadFileRequestParams,
|
||||
IUploadFileResponse,
|
||||
} from '@/types/flow';
|
||||
@@ -35,8 +39,8 @@ export const deleteFlowById = (id: string) => {
|
||||
return DELETE<null, null>(`/api/v2/serve/awel/flows/${id}`);
|
||||
};
|
||||
|
||||
export const getFlowNodes = () => {
|
||||
return GET<null, Array<IFlowNode>>(`/api/v2/serve/awel/nodes`);
|
||||
export const getFlowNodes = (tags?: string) => {
|
||||
return GET<{ tags?: string }, Array<IFlowNode>>(`/api/v2/serve/awel/nodes`, { tags });
|
||||
};
|
||||
|
||||
export const refreshFlowNodeById = (data: IFlowRefreshParams) => {
|
||||
@@ -63,11 +67,22 @@ export const downloadFile = (fileId: string) => {
|
||||
return GET<null, any>(`/api/v2/serve/file/files/dbgpt/${fileId}`);
|
||||
};
|
||||
|
||||
// TODO:wait for interface update
|
||||
export const getFlowTemplateList = () => {
|
||||
return GET<null, Array<any>>('/api/v2/serve/awel/flow/templates');
|
||||
};
|
||||
|
||||
export const getFlowTemplateById = (id: string) => {
|
||||
return GET<null, any>(`/api/v2/serve/awel/flow/templates/${id}`);
|
||||
};
|
||||
|
||||
export const getFlowTemplates = () => {
|
||||
return GET<null, any>(`/api/v2/serve/awel/flow/templates`);
|
||||
};
|
||||
|
||||
export const getKeys = (data?: IGetKeysRequestParams) => {
|
||||
return GET<IGetKeysRequestParams, Array<IGetKeysResponseData>>('/api/v2/serve/awel/variables/keys', data);
|
||||
};
|
||||
|
||||
export const getVariablesByKey = (data: IGetVariablesByKeyRequestParams) => {
|
||||
return GET<IGetVariablesByKeyRequestParams, IGetVariablesByKeyResponseData>('/api/v2/serve/awel/variables', data);
|
||||
};
|
||||
|
||||
export const metadataBatch = (data: IUploadFileRequestParams) => {
|
||||
return POST<IUploadFileRequestParams, Array<IUploadFileResponse>>('/api/v2/serve/file/files/metadata/batch', data);
|
||||
};
|
||||
|
Reference in New Issue
Block a user