mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-10 22:32:16 +02:00
feat(rename): complete searchSpace to workspace transition across frontend and backend
- Introduced a comprehensive specification for renaming `searchSpace` to `workspace` in `surfsense_web` and `surfsense_desktop`, ensuring all TypeScript identifiers, React props, and local data structures are updated. - Implemented migration shims for persisted local state to prevent data loss during the transition. - Updated observability metrics and IPC channels to reflect the new naming convention. - Removed legacy `active-search-space` module and replaced it with `active-workspace` to maintain consistency. - Ensured no behavioral changes or data loss for users during the renaming process.
This commit is contained in:
parent
2a020629c5
commit
a8c1fb660d
259 changed files with 5480 additions and 2285 deletions
|
|
@ -61,7 +61,7 @@ export const inputs = z.object({
|
|||
export type Inputs = z.infer<typeof inputs>;
|
||||
|
||||
// Captured model snapshot (server-managed). Set at create time and preserved
|
||||
// across edits so runs are insulated from later chat/search-space model changes.
|
||||
// across edits so runs are insulated from later chat/workspace model changes.
|
||||
export const automationModels = z.object({
|
||||
chat_model_id: z.number().int().default(0),
|
||||
image_gen_model_id: z.number().int().default(0),
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ export const publicChatSnapshotDetail = z.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* List public chat snapshots for search space
|
||||
* List public chat snapshots for workspace
|
||||
*/
|
||||
export const publicChatSnapshotsBySpaceRequest = z.object({
|
||||
workspace_id: z.number(),
|
||||
|
|
|
|||
|
|
@ -54,11 +54,11 @@ export const deleteMembershipResponse = z.object({
|
|||
/**
|
||||
* Leave workspace
|
||||
*/
|
||||
export const leaveSearchSpaceRequest = z.object({
|
||||
export const leaveWorkspaceRequest = z.object({
|
||||
workspace_id: z.number(),
|
||||
});
|
||||
|
||||
export const leaveSearchSpaceResponse = z.object({
|
||||
export const leaveWorkspaceResponse = z.object({
|
||||
message: z.string(),
|
||||
});
|
||||
|
||||
|
|
@ -84,7 +84,7 @@ export type UpdateMembershipRequest = z.infer<typeof updateMembershipRequest>;
|
|||
export type UpdateMembershipResponse = z.infer<typeof updateMembershipResponse>;
|
||||
export type DeleteMembershipRequest = z.infer<typeof deleteMembershipRequest>;
|
||||
export type DeleteMembershipResponse = z.infer<typeof deleteMembershipResponse>;
|
||||
export type LeaveSearchSpaceRequest = z.infer<typeof leaveSearchSpaceRequest>;
|
||||
export type LeaveSearchSpaceResponse = z.infer<typeof leaveSearchSpaceResponse>;
|
||||
export type LeaveWorkspaceRequest = z.infer<typeof leaveWorkspaceRequest>;
|
||||
export type LeaveWorkspaceResponse = z.infer<typeof leaveWorkspaceResponse>;
|
||||
export type GetMyAccessRequest = z.infer<typeof getMyAccessRequest>;
|
||||
export type GetMyAccessResponse = z.infer<typeof getMyAccessResponse>;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { z } from "zod";
|
||||
import { paginationQueryParams } from ".";
|
||||
|
||||
export const searchSpace = z.object({
|
||||
export const workspace = z.object({
|
||||
id: z.number(),
|
||||
name: z.string(),
|
||||
description: z.string().nullable(),
|
||||
|
|
@ -16,9 +16,9 @@ export const searchSpace = z.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* Get search spaces
|
||||
* Get workspaces
|
||||
*/
|
||||
export const getSearchSpacesRequest = z.object({
|
||||
export const getWorkspacesRequest = z.object({
|
||||
queryParams: paginationQueryParams
|
||||
.extend({
|
||||
owned_only: z.boolean().optional(),
|
||||
|
|
@ -26,31 +26,31 @@ export const getSearchSpacesRequest = z.object({
|
|||
.nullish(),
|
||||
});
|
||||
|
||||
export const getSearchSpacesResponse = z.array(searchSpace);
|
||||
export const getWorkspacesResponse = z.array(workspace);
|
||||
|
||||
/**
|
||||
* Create search space
|
||||
* Create workspace
|
||||
*/
|
||||
export const createSearchSpaceRequest = searchSpace.pick({ name: true, description: true }).extend({
|
||||
export const createWorkspaceRequest = workspace.pick({ name: true, description: true }).extend({
|
||||
citations_enabled: z.boolean().prefault(true).optional(),
|
||||
qna_custom_instructions: z.string().nullable().optional(),
|
||||
});
|
||||
|
||||
export const createSearchSpaceResponse = searchSpace.omit({ member_count: true, is_owner: true });
|
||||
export const createWorkspaceResponse = workspace.omit({ member_count: true, is_owner: true });
|
||||
|
||||
/**
|
||||
* Get search space
|
||||
* Get workspace
|
||||
*/
|
||||
export const getSearchSpaceRequest = searchSpace.pick({ id: true });
|
||||
export const getWorkspaceRequest = workspace.pick({ id: true });
|
||||
|
||||
export const getSearchSpaceResponse = searchSpace.omit({ member_count: true, is_owner: true });
|
||||
export const getWorkspaceResponse = workspace.omit({ member_count: true, is_owner: true });
|
||||
|
||||
/**
|
||||
* Update search space
|
||||
* Update workspace
|
||||
*/
|
||||
export const updateSearchSpaceRequest = z.object({
|
||||
export const updateWorkspaceRequest = z.object({
|
||||
id: z.number(),
|
||||
data: searchSpace
|
||||
data: workspace
|
||||
.pick({
|
||||
name: true,
|
||||
description: true,
|
||||
|
|
@ -61,45 +61,45 @@ export const updateSearchSpaceRequest = z.object({
|
|||
.partial(),
|
||||
});
|
||||
|
||||
export const updateSearchSpaceResponse = searchSpace.omit({ member_count: true, is_owner: true });
|
||||
export const updateWorkspaceResponse = workspace.omit({ member_count: true, is_owner: true });
|
||||
|
||||
export const updateSearchSpaceApiAccessRequest = z.object({
|
||||
export const updateWorkspaceApiAccessRequest = z.object({
|
||||
id: z.number(),
|
||||
api_access_enabled: z.boolean(),
|
||||
});
|
||||
|
||||
export const updateSearchSpaceApiAccessResponse = searchSpace.omit({
|
||||
export const updateWorkspaceApiAccessResponse = workspace.omit({
|
||||
member_count: true,
|
||||
is_owner: true,
|
||||
});
|
||||
|
||||
/**
|
||||
* Delete search space
|
||||
* Delete workspace
|
||||
*/
|
||||
export const deleteSearchSpaceRequest = searchSpace.pick({ id: true });
|
||||
export const deleteWorkspaceRequest = workspace.pick({ id: true });
|
||||
|
||||
export const deleteSearchSpaceResponse = z.object({
|
||||
export const deleteWorkspaceResponse = z.object({
|
||||
message: z.literal("Workspace deleted successfully"),
|
||||
});
|
||||
|
||||
/**
|
||||
* Leave search space (for non-owners)
|
||||
* Leave workspace (for non-owners)
|
||||
*/
|
||||
export const leaveSearchSpaceResponse = z.object({
|
||||
export const leaveWorkspaceResponse = z.object({
|
||||
message: z.literal("Successfully left the workspace"),
|
||||
});
|
||||
|
||||
// Inferred types
|
||||
export type SearchSpace = z.infer<typeof searchSpace>;
|
||||
export type GetSearchSpacesRequest = z.infer<typeof getSearchSpacesRequest>;
|
||||
export type GetSearchSpacesResponse = z.infer<typeof getSearchSpacesResponse>;
|
||||
export type CreateSearchSpaceRequest = z.infer<typeof createSearchSpaceRequest>;
|
||||
export type CreateSearchSpaceResponse = z.infer<typeof createSearchSpaceResponse>;
|
||||
export type GetSearchSpaceRequest = z.infer<typeof getSearchSpaceRequest>;
|
||||
export type GetSearchSpaceResponse = z.infer<typeof getSearchSpaceResponse>;
|
||||
export type UpdateSearchSpaceRequest = z.infer<typeof updateSearchSpaceRequest>;
|
||||
export type UpdateSearchSpaceResponse = z.infer<typeof updateSearchSpaceResponse>;
|
||||
export type UpdateSearchSpaceApiAccessRequest = z.infer<typeof updateSearchSpaceApiAccessRequest>;
|
||||
export type UpdateSearchSpaceApiAccessResponse = z.infer<typeof updateSearchSpaceApiAccessResponse>;
|
||||
export type DeleteSearchSpaceRequest = z.infer<typeof deleteSearchSpaceRequest>;
|
||||
export type DeleteSearchSpaceResponse = z.infer<typeof deleteSearchSpaceResponse>;
|
||||
export type Workspace = z.infer<typeof workspace>;
|
||||
export type GetWorkspacesRequest = z.infer<typeof getWorkspacesRequest>;
|
||||
export type GetWorkspacesResponse = z.infer<typeof getWorkspacesResponse>;
|
||||
export type CreateWorkspaceRequest = z.infer<typeof createWorkspaceRequest>;
|
||||
export type CreateWorkspaceResponse = z.infer<typeof createWorkspaceResponse>;
|
||||
export type GetWorkspaceRequest = z.infer<typeof getWorkspaceRequest>;
|
||||
export type GetWorkspaceResponse = z.infer<typeof getWorkspaceResponse>;
|
||||
export type UpdateWorkspaceRequest = z.infer<typeof updateWorkspaceRequest>;
|
||||
export type UpdateWorkspaceResponse = z.infer<typeof updateWorkspaceResponse>;
|
||||
export type UpdateWorkspaceApiAccessRequest = z.infer<typeof updateWorkspaceApiAccessRequest>;
|
||||
export type UpdateWorkspaceApiAccessResponse = z.infer<typeof updateWorkspaceApiAccessResponse>;
|
||||
export type DeleteWorkspaceRequest = z.infer<typeof deleteWorkspaceRequest>;
|
||||
export type DeleteWorkspaceResponse = z.infer<typeof deleteWorkspaceResponse>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue