@budibase/frontend-core 3.35.1 → 3.35.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/api/index.ts +0 -4
- package/src/api/types.ts +0 -4
- package/src/api/knowledgeBases.ts +0 -79
- package/src/api/vectorDbs.ts +0 -44
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/frontend-core",
|
|
3
|
-
"version": "3.35.
|
|
3
|
+
"version": "3.35.3",
|
|
4
4
|
"description": "Budibase frontend core libraries used in builder and client",
|
|
5
5
|
"author": "Budibase",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"@budibase/types": "*",
|
|
18
18
|
"ai": "^6.0.116",
|
|
19
19
|
"dayjs": "^1.10.8",
|
|
20
|
-
"lodash": "4.
|
|
20
|
+
"lodash": "4.18.1",
|
|
21
21
|
"socket.io-client": "^4.7.5"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"vitest": "^3.2.4"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "d5b05b266b9b7726bdcd7a9e7affb3330129805c"
|
|
27
27
|
}
|
package/src/api/index.ts
CHANGED
|
@@ -58,8 +58,6 @@ import { buildWorkspaceFavouriteEndpoints } from "./workspaceFavourites"
|
|
|
58
58
|
import { buildWorkspaceHomeEndpoints } from "./workspaceHome"
|
|
59
59
|
import { buildRecaptchaEndpoints } from "./recaptcha"
|
|
60
60
|
import { buildAIConfigEndpoints } from "./aiConfig"
|
|
61
|
-
import { buildVectorDbEndpoints } from "./vectorDbs"
|
|
62
|
-
import { buildKnowledgeBaseEndpoints } from "./knowledgeBases"
|
|
63
61
|
|
|
64
62
|
export type { APIClient } from "./types"
|
|
65
63
|
|
|
@@ -333,7 +331,5 @@ export const createAPIClient = (config: APIClientConfig = {}): APIClient => {
|
|
|
333
331
|
resource: buildResourceEndpoints(API),
|
|
334
332
|
recaptcha: buildRecaptchaEndpoints(API),
|
|
335
333
|
aiConfig: buildAIConfigEndpoints(API),
|
|
336
|
-
vectorDb: buildVectorDbEndpoints(API),
|
|
337
|
-
knowledgeBase: buildKnowledgeBaseEndpoints(API),
|
|
338
334
|
}
|
|
339
335
|
}
|
package/src/api/types.ts
CHANGED
|
@@ -45,8 +45,6 @@ import { WorkspaceFavouriteEndpoints } from "./workspaceFavourites"
|
|
|
45
45
|
import { WorkspaceHomeEndpoints } from "./workspaceHome"
|
|
46
46
|
import { RecaptchaEndpoints } from "./recaptcha"
|
|
47
47
|
import { AIConfigEndpoints } from "./aiConfig"
|
|
48
|
-
import { VectorDbEndpoints } from "./vectorDbs"
|
|
49
|
-
import { KnowledgeBaseEndpoints } from "./knowledgeBases"
|
|
50
48
|
|
|
51
49
|
export enum HTTPMethod {
|
|
52
50
|
POST = "POST",
|
|
@@ -166,6 +164,4 @@ export type APIClient = BaseAPIClient &
|
|
|
166
164
|
deployment: DeploymentEndpoints
|
|
167
165
|
recaptcha: RecaptchaEndpoints
|
|
168
166
|
aiConfig: AIConfigEndpoints
|
|
169
|
-
vectorDb: VectorDbEndpoints
|
|
170
|
-
knowledgeBase: KnowledgeBaseEndpoints
|
|
171
167
|
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CreateKnowledgeBaseRequest,
|
|
3
|
-
FetchKnowledgeBaseFilesResponse,
|
|
4
|
-
KnowledgeBase,
|
|
5
|
-
KnowledgeBaseFileUploadResponse,
|
|
6
|
-
KnowledgeBaseListResponse,
|
|
7
|
-
UpdateKnowledgeBaseRequest,
|
|
8
|
-
} from "@budibase/types"
|
|
9
|
-
import { BaseAPIClient } from "./types"
|
|
10
|
-
|
|
11
|
-
export interface KnowledgeBaseEndpoints {
|
|
12
|
-
fetch: () => Promise<KnowledgeBaseListResponse>
|
|
13
|
-
create: (config: CreateKnowledgeBaseRequest) => Promise<KnowledgeBase>
|
|
14
|
-
update: (config: UpdateKnowledgeBaseRequest) => Promise<KnowledgeBase>
|
|
15
|
-
delete: (id: string) => Promise<{ deleted: true }>
|
|
16
|
-
fetchFiles: (
|
|
17
|
-
knowledgeBaseId: string
|
|
18
|
-
) => Promise<FetchKnowledgeBaseFilesResponse>
|
|
19
|
-
uploadFile: (
|
|
20
|
-
knowledgeBaseId: string,
|
|
21
|
-
file: File
|
|
22
|
-
) => Promise<KnowledgeBaseFileUploadResponse>
|
|
23
|
-
deleteFile: (
|
|
24
|
-
knowledgeBaseId: string,
|
|
25
|
-
fileId: string
|
|
26
|
-
) => Promise<{ deleted: true }>
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export const buildKnowledgeBaseEndpoints = (
|
|
30
|
-
API: BaseAPIClient
|
|
31
|
-
): KnowledgeBaseEndpoints => ({
|
|
32
|
-
fetch: async () => {
|
|
33
|
-
return await API.get({
|
|
34
|
-
url: "/api/knowledge-base",
|
|
35
|
-
})
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
create: async config => {
|
|
39
|
-
return await API.post({
|
|
40
|
-
url: "/api/knowledge-base",
|
|
41
|
-
body: config,
|
|
42
|
-
})
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
update: async config => {
|
|
46
|
-
return await API.put({
|
|
47
|
-
url: "/api/knowledge-base",
|
|
48
|
-
body: config,
|
|
49
|
-
})
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
delete: async id => {
|
|
53
|
-
return await API.delete({
|
|
54
|
-
url: `/api/knowledge-base/${id}`,
|
|
55
|
-
})
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
fetchFiles: async knowledgeBaseId => {
|
|
59
|
-
return await API.get({
|
|
60
|
-
url: `/api/knowledge-base/${knowledgeBaseId}/files`,
|
|
61
|
-
})
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
uploadFile: async (knowledgeBaseId, file) => {
|
|
65
|
-
const formData = new FormData()
|
|
66
|
-
formData.append("file", file)
|
|
67
|
-
return await API.post<FormData, KnowledgeBaseFileUploadResponse>({
|
|
68
|
-
url: `/api/knowledge-base/${knowledgeBaseId}/files`,
|
|
69
|
-
body: formData,
|
|
70
|
-
json: false,
|
|
71
|
-
})
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
deleteFile: async (knowledgeBaseId, fileId) => {
|
|
75
|
-
return await API.delete({
|
|
76
|
-
url: `/api/knowledge-base/${knowledgeBaseId}/files/${fileId}`,
|
|
77
|
-
})
|
|
78
|
-
},
|
|
79
|
-
})
|
package/src/api/vectorDbs.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CreateVectorDbRequest,
|
|
3
|
-
UpdateVectorDbRequest,
|
|
4
|
-
VectorDb,
|
|
5
|
-
VectorDbListResponse,
|
|
6
|
-
} from "@budibase/types"
|
|
7
|
-
import { BaseAPIClient } from "./types"
|
|
8
|
-
|
|
9
|
-
export interface VectorDbEndpoints {
|
|
10
|
-
fetch: () => Promise<VectorDbListResponse>
|
|
11
|
-
create: (config: CreateVectorDbRequest) => Promise<VectorDb>
|
|
12
|
-
update: (config: UpdateVectorDbRequest) => Promise<VectorDb>
|
|
13
|
-
delete: (id: string) => Promise<{ deleted: true }>
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const buildVectorDbEndpoints = (
|
|
17
|
-
API: BaseAPIClient
|
|
18
|
-
): VectorDbEndpoints => ({
|
|
19
|
-
fetch: async () => {
|
|
20
|
-
return await API.get({
|
|
21
|
-
url: "/api/vectordb",
|
|
22
|
-
})
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
create: async config => {
|
|
26
|
-
return await API.post({
|
|
27
|
-
url: "/api/vectordb",
|
|
28
|
-
body: config,
|
|
29
|
-
})
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
update: async config => {
|
|
33
|
-
return await API.put({
|
|
34
|
-
url: "/api/vectordb",
|
|
35
|
-
body: config,
|
|
36
|
-
})
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
delete: async id => {
|
|
40
|
-
return await API.delete({
|
|
41
|
-
url: `/api/vectordb/${id}`,
|
|
42
|
-
})
|
|
43
|
-
},
|
|
44
|
-
})
|