-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(web): AWEL flow 2.0 frontend codes (#1898)
Co-authored-by: Fangyin Cheng <[email protected]> Co-authored-by: 谨欣 <[email protected]> Co-authored-by: 严志勇 <[email protected]> Co-authored-by: yanzhiyong <[email protected]>
- Loading branch information
1 parent
9502251
commit 131bc7b
Showing
60 changed files
with
2,335 additions
and
2,244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,82 @@ | ||
import { IFlow, UpdateFLowAdminsParams } from '@/types/flow'; | ||
import { POST } from '../index'; | ||
|
||
/** | ||
* 更新管理员 | ||
*/ | ||
export const updateFlowAdmins = (data: UpdateFLowAdminsParams) => { | ||
return POST<UpdateFLowAdminsParams, IFlow>(`/api/v1/serve/awel/flow/admins`, data); | ||
import { | ||
IFlow, | ||
IFlowNode, | ||
IFlowResponse, | ||
IFlowUpdateParam, | ||
IFlowRefreshParams, | ||
IFlowExportParams, | ||
IFlowImportParams, | ||
IUploadFileRequestParams, | ||
IUploadFileResponse, | ||
} from '@/types/flow'; | ||
import { DELETE, GET, POST, PUT } from '../index'; | ||
|
||
/** AWEL Flow */ | ||
export const addFlow = (data: IFlowUpdateParam) => { | ||
return POST<IFlowUpdateParam, IFlow>('/api/v2/serve/awel/flows', data); | ||
}; | ||
|
||
export const getFlows = (page?: number, page_size?: number) => { | ||
return GET<any, IFlowResponse>('/api/v2/serve/awel/flows', { | ||
page, | ||
page_size, | ||
}); | ||
}; | ||
|
||
export const getFlowById = (id: string) => { | ||
return GET<null, IFlow>(`/api/v2/serve/awel/flows/${id}`); | ||
}; | ||
|
||
export const updateFlowById = (id: string, data: IFlowUpdateParam) => { | ||
return PUT<IFlowUpdateParam, IFlow>(`/api/v2/serve/awel/flows/${id}`, data); | ||
}; | ||
|
||
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 refreshFlowNodeById = (data: IFlowRefreshParams) => { | ||
return POST<IFlowRefreshParams, IFlowNode>( | ||
'/api/v2/serve/awel/nodes/refresh', | ||
data | ||
); | ||
}; | ||
|
||
export const debugFlow = (data: any) => { | ||
return POST<any, IFlowNode>('/api/v2/serve/awel/flow/debug', data); | ||
}; | ||
|
||
export const exportFlow = (data: IFlowExportParams) => { | ||
return GET<IFlowExportParams, any>( | ||
`/api/v2/serve/awel/flow/export/${data.uid}`, | ||
data | ||
); | ||
}; | ||
|
||
export const importFlow = (data: IFlowImportParams) => { | ||
return POST<IFlowImportParams, any>('/api/v2/serve/awel/flow/import', data); | ||
}; | ||
|
||
export const uploadFile = (data: IUploadFileRequestParams) => { | ||
return POST<IUploadFileRequestParams, Array<IUploadFileResponse>>( | ||
'/api/v2/serve/file/files/dbgpt', | ||
data | ||
); | ||
}; | ||
|
||
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}`); | ||
}; |
Oops, something went wrong.