@budibase/frontend-core 3.25.4 → 3.26.0
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/frontend-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.26.0",
|
|
4
4
|
"description": "Budibase frontend core libraries used in builder and client",
|
|
5
5
|
"author": "Budibase",
|
|
6
6
|
"license": "MPL-2.0",
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"shortid": "2.2.15",
|
|
20
20
|
"socket.io-client": "^4.7.5"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "94f6d3fcbeb2043d8144dc3be0cf560b71dd35dc"
|
|
23
23
|
}
|
package/src/api/chatApps.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
ChatConversationRequest,
|
|
5
5
|
CreateChatConversationRequest,
|
|
6
6
|
ChatApp,
|
|
7
|
+
ChatAppAgent,
|
|
7
8
|
FetchAgentHistoryResponse,
|
|
8
9
|
UpdateChatAppRequest,
|
|
9
10
|
AgentMessageMetadata,
|
|
@@ -28,7 +29,7 @@ export interface ChatAppEndpoints {
|
|
|
28
29
|
) => Promise<ChatConversation>
|
|
29
30
|
fetchChatHistory: (chatAppId: string) => Promise<FetchAgentHistoryResponse>
|
|
30
31
|
fetchChatApp: (workspaceId?: string) => Promise<ChatApp | null>
|
|
31
|
-
setChatAppAgent: (chatAppId: string, agentId: string) => Promise<
|
|
32
|
+
setChatAppAgent: (chatAppId: string, agentId: string) => Promise<ChatAppAgent>
|
|
32
33
|
createChatConversation: (
|
|
33
34
|
chat: CreateChatConversationRequest,
|
|
34
35
|
workspaceId?: string
|
package/src/api/index.ts
CHANGED
|
@@ -56,7 +56,6 @@ import { buildDeploymentEndpoints } from "./deploy"
|
|
|
56
56
|
import { buildWorkspaceFavouriteEndpoints } from "./workspaceFavourites"
|
|
57
57
|
import { buildRecaptchaEndpoints } from "./recaptcha"
|
|
58
58
|
import { buildAIConfigEndpoints } from "./aiConfig"
|
|
59
|
-
import { buildRagConfigEndpoints } from "./ragConfigs"
|
|
60
59
|
import { buildVectorDbEndpoints } from "./vectorDbs"
|
|
61
60
|
|
|
62
61
|
export type { APIClient } from "./types"
|
|
@@ -328,7 +327,6 @@ export const createAPIClient = (config: APIClientConfig = {}): APIClient => {
|
|
|
328
327
|
resource: buildResourceEndpoints(API),
|
|
329
328
|
recaptcha: buildRecaptchaEndpoints(API),
|
|
330
329
|
aiConfig: buildAIConfigEndpoints(API),
|
|
331
|
-
ragConfig: buildRagConfigEndpoints(API),
|
|
332
330
|
vectorDb: buildVectorDbEndpoints(API),
|
|
333
331
|
}
|
|
334
332
|
}
|
package/src/api/types.ts
CHANGED
|
@@ -43,7 +43,6 @@ import { DeploymentEndpoints } from "./deploy"
|
|
|
43
43
|
import { WorkspaceFavouriteEndpoints } from "./workspaceFavourites"
|
|
44
44
|
import { RecaptchaEndpoints } from "./recaptcha"
|
|
45
45
|
import { AIConfigEndpoints } from "./aiConfig"
|
|
46
|
-
import { RagConfigEndpoints } from "./ragConfigs"
|
|
47
46
|
import { VectorDbEndpoints } from "./vectorDbs"
|
|
48
47
|
|
|
49
48
|
export enum HTTPMethod {
|
|
@@ -159,6 +158,5 @@ export type APIClient = BaseAPIClient &
|
|
|
159
158
|
deployment: DeploymentEndpoints
|
|
160
159
|
recaptcha: RecaptchaEndpoints
|
|
161
160
|
aiConfig: AIConfigEndpoints
|
|
162
|
-
ragConfig: RagConfigEndpoints
|
|
163
161
|
vectorDb: VectorDbEndpoints
|
|
164
162
|
}
|
|
@@ -153,7 +153,9 @@
|
|
|
153
153
|
chatAppId: "",
|
|
154
154
|
agentId: "",
|
|
155
155
|
}
|
|
156
|
-
const fallbackAgentId =
|
|
156
|
+
const fallbackAgentId =
|
|
157
|
+
chatApp.agents?.find(agent => agent.isEnabled && agent.isDefault)
|
|
158
|
+
?.agentId || chatApp.agents?.find(agent => agent.isEnabled)?.agentId
|
|
157
159
|
chat = {
|
|
158
160
|
...baseChat,
|
|
159
161
|
chatAppId: chatApp._id,
|
package/src/fetch/UserFetch.ts
CHANGED
|
@@ -11,6 +11,7 @@ import BaseDataFetch, { DataFetchParams } from "./DataFetch"
|
|
|
11
11
|
|
|
12
12
|
interface UserFetchQuery {
|
|
13
13
|
appId?: string
|
|
14
|
+
workspaceId?: string
|
|
14
15
|
paginated?: boolean
|
|
15
16
|
string?: {
|
|
16
17
|
email: string
|
|
@@ -57,7 +58,7 @@ export default class UserFetch extends BaseDataFetch<
|
|
|
57
58
|
const { cursor, query } = get(this.store)
|
|
58
59
|
|
|
59
60
|
// Convert old format to new one - we now allow use of the lucene format
|
|
60
|
-
const { appId, paginated, ...rest } = query
|
|
61
|
+
const { appId, paginated, workspaceId, ...rest } = query
|
|
61
62
|
|
|
62
63
|
const finalQuery: SearchFilters = utils.isSupportedUserSearch(rest)
|
|
63
64
|
? rest
|
|
@@ -68,6 +69,7 @@ export default class UserFetch extends BaseDataFetch<
|
|
|
68
69
|
bookmark: cursor ?? undefined,
|
|
69
70
|
query: finalQuery ?? undefined,
|
|
70
71
|
appId: appId,
|
|
72
|
+
workspaceId,
|
|
71
73
|
paginate: paginated || paginate,
|
|
72
74
|
limit,
|
|
73
75
|
}
|
package/src/api/ragConfigs.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CreateRagConfigRequest,
|
|
3
|
-
RagConfig,
|
|
4
|
-
RagConfigListResponse,
|
|
5
|
-
UpdateRagConfigRequest,
|
|
6
|
-
} from "@budibase/types"
|
|
7
|
-
import { BaseAPIClient } from "./types"
|
|
8
|
-
|
|
9
|
-
export interface RagConfigEndpoints {
|
|
10
|
-
fetch: () => Promise<RagConfigListResponse>
|
|
11
|
-
create: (config: CreateRagConfigRequest) => Promise<RagConfig>
|
|
12
|
-
update: (config: UpdateRagConfigRequest) => Promise<RagConfig>
|
|
13
|
-
delete: (id: string) => Promise<{ deleted: true }>
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const buildRagConfigEndpoints = (
|
|
17
|
-
API: BaseAPIClient
|
|
18
|
-
): RagConfigEndpoints => ({
|
|
19
|
-
fetch: async () => {
|
|
20
|
-
return await API.get({
|
|
21
|
-
url: "/api/ragconfig",
|
|
22
|
-
})
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
create: async config => {
|
|
26
|
-
return await API.post({
|
|
27
|
-
url: "/api/ragconfig",
|
|
28
|
-
body: config,
|
|
29
|
-
})
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
update: async config => {
|
|
33
|
-
return await API.put({
|
|
34
|
-
url: "/api/ragconfig",
|
|
35
|
-
body: config,
|
|
36
|
-
})
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
delete: async id => {
|
|
40
|
-
return await API.delete({
|
|
41
|
-
url: `/api/ragconfig/${id}`,
|
|
42
|
-
})
|
|
43
|
-
},
|
|
44
|
-
})
|