Skip to content

Commit 6f3cc42

Browse files
authored
Add files via upload
1 parent 331eab5 commit 6f3cc42

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+3449
-0
lines changed

ui/WorkOrder/src/api/apikey.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import client from './client'
2+
3+
const getAllAPIKeys = () => client.get('/apikey')
4+
5+
const createNewAPI = (body) => client.post(`/apikey`, body)
6+
7+
const updateAPI = (id, body) => client.put(`/apikey/${id}`, body)
8+
9+
const deleteAPI = (id) => client.delete(`/apikey/${id}`)
10+
11+
export default {
12+
getAllAPIKeys,
13+
createNewAPI,
14+
updateAPI,
15+
deleteAPI
16+
}

ui/WorkOrder/src/api/assistants.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import client from './client'
2+
3+
const getAllAssistants = () => client.get('/assistants')
4+
5+
const getSpecificAssistant = (id) => client.get(`/assistants/${id}`)
6+
7+
const getAssistantObj = (id, credential) => client.get(`/openai-assistants/${id}?credential=${credential}`)
8+
9+
const getAllAvailableAssistants = (credential) => client.get(`/openai-assistants?credential=${credential}`)
10+
11+
const createNewAssistant = (body) => client.post(`/assistants`, body)
12+
13+
const updateAssistant = (id, body) => client.put(`/assistants/${id}`, body)
14+
15+
const deleteAssistant = (id, isDeleteBoth) =>
16+
isDeleteBoth ? client.delete(`/assistants/${id}?isDeleteBoth=true`) : client.delete(`/assistants/${id}`)
17+
18+
export default {
19+
getAllAssistants,
20+
getSpecificAssistant,
21+
getAssistantObj,
22+
getAllAvailableAssistants,
23+
createNewAssistant,
24+
updateAssistant,
25+
deleteAssistant
26+
}

ui/WorkOrder/src/api/chatflows.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import client from './client'
2+
3+
const getAllChatflows = () => client.get('/chatflows')
4+
5+
const getSpecificChatflow = (id) => client.get(`/chatflows/${id}`)
6+
7+
const getSpecificChatflowFromPublicEndpoint = (id) => client.get(`/public-chatflows/${id}`)
8+
9+
const createNewChatflow = (body) => client.post(`/chatflows`, body)
10+
11+
const updateChatflow = (id, body) => client.put(`/chatflows/${id}`, body)
12+
13+
const deleteChatflow = (id) => client.delete(`/chatflows/${id}`)
14+
15+
const getIsChatflowStreaming = (id) => client.get(`/chatflows-streaming/${id}`)
16+
17+
export default {
18+
getAllChatflows,
19+
getSpecificChatflow,
20+
getSpecificChatflowFromPublicEndpoint,
21+
createNewChatflow,
22+
updateChatflow,
23+
deleteChatflow,
24+
getIsChatflowStreaming
25+
}

ui/WorkOrder/src/api/chatmessage.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import client from './client'
2+
3+
const getInternalChatmessageFromChatflow = (id) => client.get(`/internal-chatmessage/${id}`)
4+
const getAllChatmessageFromChatflow = (id, params = {}) => client.get(`/chatmessage/${id}`, { params: { order: 'DESC', ...params } })
5+
const getChatmessageFromPK = (id, params = {}) => client.get(`/chatmessage/${id}`, { params: { order: 'ASC', ...params } })
6+
const deleteChatmessage = (id, params = {}) => client.delete(`/chatmessage/${id}`, { params: { ...params } })
7+
8+
export default {
9+
getInternalChatmessageFromChatflow,
10+
getAllChatmessageFromChatflow,
11+
getChatmessageFromPK,
12+
deleteChatmessage
13+
}

ui/WorkOrder/src/api/client.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import axios from 'axios'
2+
import { baseURL } from '@/store/constant'
3+
4+
const apiClient = axios.create({
5+
baseURL: `${baseURL}/api/v1`,
6+
headers: {
7+
'Content-type': 'application/json'
8+
}
9+
})
10+
11+
apiClient.interceptors.request.use(function (config) {
12+
const username = localStorage.getItem('username')
13+
const password = localStorage.getItem('password')
14+
15+
if (username && password) {
16+
config.auth = {
17+
username,
18+
password
19+
}
20+
}
21+
22+
return config
23+
})
24+
25+
export default apiClient

ui/WorkOrder/src/api/config.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import client from './client'
2+
3+
const getConfig = (id) => client.get(`/flow-config/${id}`)
4+
const getNodeConfig = (body) => client.post(`/node-config`, body)
5+
6+
export default {
7+
getConfig,
8+
getNodeConfig
9+
}

ui/WorkOrder/src/api/credentials.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import client from './client'
2+
3+
const getAllCredentials = () => client.get('/credentials')
4+
5+
const getCredentialsByName = (componentCredentialName) => client.get(`/credentials?credentialName=${componentCredentialName}`)
6+
7+
const getAllComponentsCredentials = () => client.get('/components-credentials')
8+
9+
const getSpecificCredential = (id) => client.get(`/credentials/${id}`)
10+
11+
const getSpecificComponentCredential = (name) => client.get(`/components-credentials/${name}`)
12+
13+
const createCredential = (body) => client.post(`/credentials`, body)
14+
15+
const updateCredential = (id, body) => client.put(`/credentials/${id}`, body)
16+
17+
const deleteCredential = (id) => client.delete(`/credentials/${id}`)
18+
19+
export default {
20+
getAllCredentials,
21+
getCredentialsByName,
22+
getAllComponentsCredentials,
23+
getSpecificCredential,
24+
getSpecificComponentCredential,
25+
createCredential,
26+
updateCredential,
27+
deleteCredential
28+
}

ui/WorkOrder/src/api/nodes.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import client from './client'
2+
3+
const getAllNodes = () => client.get('/nodes')
4+
5+
const getSpecificNode = (name) => client.get(`/nodes/${name}`)
6+
7+
export default {
8+
getAllNodes,
9+
getSpecificNode
10+
}

ui/WorkOrder/src/api/prediction.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import client from './client'
2+
3+
const sendMessageAndGetPrediction = (id, input) => client.post(`/internal-prediction/${id}`, input)
4+
5+
export default {
6+
sendMessageAndGetPrediction
7+
}

ui/WorkOrder/src/api/prompt.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import client from './client'
2+
3+
const getAvailablePrompts = (body) => client.post(`/prompts-list`, body)
4+
const getPrompt = (body) => client.post(`/load-prompt`, body)
5+
6+
export default {
7+
getAvailablePrompts,
8+
getPrompt
9+
}

ui/WorkOrder/src/api/tools.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import client from './client'
2+
3+
const getAllTools = () => client.get('/tools')
4+
5+
const getSpecificTool = (id) => client.get(`/tools/${id}`)
6+
7+
const createNewTool = (body) => client.post(`/tools`, body)
8+
9+
const updateTool = (id, body) => client.put(`/tools/${id}`, body)
10+
11+
const deleteTool = (id) => client.delete(`/tools/${id}`)
12+
13+
export default {
14+
getAllTools,
15+
getSpecificTool,
16+
createNewTool,
17+
updateTool,
18+
deleteTool
19+
}

ui/WorkOrder/src/api/vectorstore.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import client from './client'
2+
3+
const upsertVectorStore = (id, input) => client.post(`/vector/internal-upsert/${id}`, input)
4+
5+
export default {
6+
upsertVectorStore
7+
}
19.7 KB
Loading
Loading
+1
Loading
11.8 KB
Loading

0 commit comments

Comments
 (0)