feat(workspace): refactor search space handling to workspace

This commit is contained in:
Anish Sarkar 2026-07-06 10:04:17 +05:30
parent e92b7a34ed
commit c379ab1155
53 changed files with 268 additions and 169 deletions

View file

@ -29,7 +29,7 @@ export const chatThreadFixtures = {
headers: authHeaders(apiToken),
data: {
title: "e2e-drive-journey",
search_space_id: searchSpace.id,
workspace_id: searchSpace.id,
visibility: "PRIVATE",
},
});

View file

@ -24,7 +24,7 @@ export async function streamChatToCompletion(
headers: authHeaders(token),
data: {
chat_id: args.threadId,
search_space_id: args.searchSpaceId,
workspace_id: args.searchSpaceId,
user_query: args.query,
},
});

View file

@ -16,7 +16,7 @@ export async function listConnectors(
searchSpaceId: number
): Promise<ConnectorRow[]> {
const response = await request.get(
`${BACKEND_URL}/api/v1/search-source-connectors?search_space_id=${searchSpaceId}`,
`${BACKEND_URL}/api/v1/search-source-connectors?workspace_id=${searchSpaceId}`,
{ headers: authHeaders(token) }
);
if (!response.ok()) {
@ -115,7 +115,7 @@ export async function triggerIndex(
body: IndexBody
): Promise<{ ok: true }> {
const response = await request.post(
`${BACKEND_URL}/api/v1/search-source-connectors/${connectorId}/index?search_space_id=${searchSpaceId}`,
`${BACKEND_URL}/api/v1/search-source-connectors/${connectorId}/index?workspace_id=${searchSpaceId}`,
{ headers: authHeaders(token), data: body }
);
if (!response.ok()) {
@ -134,7 +134,7 @@ export async function triggerIndexExpectDisabled(
body: IndexBody = {}
): Promise<{ indexing_started: false; message?: string }> {
const response = await request.post(
`${BACKEND_URL}/api/v1/search-source-connectors/${connectorId}/index?search_space_id=${searchSpaceId}`,
`${BACKEND_URL}/api/v1/search-source-connectors/${connectorId}/index?workspace_id=${searchSpaceId}`,
{ headers: authHeaders(token), data: body }
);
if (!response.ok()) {

View file

@ -21,7 +21,7 @@ export async function listDocuments(
limit = 100
): Promise<DocumentRow[]> {
const response = await request.get(
`${BACKEND_URL}/api/v1/documents?search_space_id=${searchSpaceId}&limit=${limit}`,
`${BACKEND_URL}/api/v1/documents?workspace_id=${searchSpaceId}&limit=${limit}`,
{ headers: authHeaders(token) }
);
if (!response.ok()) {

View file

@ -13,7 +13,7 @@ export async function createSearchSpace(
name: string,
description = "E2E test search space"
): Promise<SearchSpaceRow> {
const response = await request.post(`${BACKEND_URL}/api/v1/searchspaces`, {
const response = await request.post(`${BACKEND_URL}/api/v1/workspaces`, {
headers: authHeaders(token),
data: { name, description },
});
@ -28,7 +28,7 @@ export async function deleteSearchSpace(
token: string,
id: number
): Promise<void> {
const response = await request.delete(`${BACKEND_URL}/api/v1/searchspaces/${id}`, {
const response = await request.delete(`${BACKEND_URL}/api/v1/workspaces/${id}`, {
headers: authHeaders(token),
});
if (!response.ok() && response.status() !== 404) {

View file

@ -12,7 +12,7 @@ test.describe("Smoke", () => {
headers: authHeaders(apiToken),
data: {
title: "e2e-chat-stream-smoke",
search_space_id: searchSpace.id,
workspace_id: searchSpace.id,
visibility: "PRIVATE",
},
});