Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle breaking changes to workspace config #349

Merged
merged 5 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/api/generated/@tanstack/react-query.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
v1CreateWorkspace,
v1ListActiveWorkspaces,
v1ActivateWorkspace,
v1UpdateWorkspace,
v1DeleteWorkspace,
v1ListArchivedWorkspaces,
v1RecoverWorkspace,
Expand Down Expand Up @@ -55,6 +56,9 @@ import type {
V1ActivateWorkspaceData,
V1ActivateWorkspaceError,
V1ActivateWorkspaceResponse,
V1UpdateWorkspaceData,
V1UpdateWorkspaceError,
V1UpdateWorkspaceResponse,
V1DeleteWorkspaceData,
V1DeleteWorkspaceError,
V1DeleteWorkspaceResponse,
Expand Down Expand Up @@ -441,6 +445,26 @@ export const v1ActivateWorkspaceMutation = (
return mutationOptions
}

export const v1UpdateWorkspaceMutation = (
options?: Partial<OptionsLegacyParser<V1UpdateWorkspaceData>>
) => {
const mutationOptions: UseMutationOptions<
V1UpdateWorkspaceResponse,
V1UpdateWorkspaceError,
OptionsLegacyParser<V1UpdateWorkspaceData>
> = {
mutationFn: async (localOptions) => {
const { data } = await v1UpdateWorkspace({
...options,
...localOptions,
throwOnError: true,
})
return data
},
}
return mutationOptions
}

export const v1DeleteWorkspaceMutation = (
options?: Partial<OptionsLegacyParser<V1DeleteWorkspaceData>>
) => {
Expand Down
20 changes: 20 additions & 0 deletions src/api/generated/sdk.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ import type {
V1ActivateWorkspaceData,
V1ActivateWorkspaceError,
V1ActivateWorkspaceResponse,
V1UpdateWorkspaceData,
V1UpdateWorkspaceError,
V1UpdateWorkspaceResponse,
V1DeleteWorkspaceData,
V1DeleteWorkspaceError,
V1DeleteWorkspaceResponse,
Expand Down Expand Up @@ -312,6 +315,23 @@ export const v1ActivateWorkspace = <ThrowOnError extends boolean = false>(
})
}

/**
* Update Workspace
* Update a workspace.
*/
export const v1UpdateWorkspace = <ThrowOnError extends boolean = false>(
options: OptionsLegacyParser<V1UpdateWorkspaceData, ThrowOnError>
) => {
return (options?.client ?? client).put<
V1UpdateWorkspaceResponse,
V1UpdateWorkspaceError,
ThrowOnError
>({
...options,
url: '/api/v1/workspaces/{workspace_name}',
})
}

/**
* Delete Workspace
* Delete a workspace by name.
Expand Down
38 changes: 29 additions & 9 deletions src/api/generated/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,18 @@ export type Conversation = {
alerts?: Array<Alert>
}

export type CreateOrRenameWorkspaceRequest = {
export type CustomInstructions = {
prompt: string
}

export type FullWorkspace_Input = {
name: string
config?: WorkspaceConfig | null
rename_to?: string | null
config?: WorkspaceConfig_Input | null
}

export type CustomInstructions = {
prompt: string
export type FullWorkspace_Output = {
name: string
config?: WorkspaceConfig_Output | null
}

export type HTTPValidationError = {
Expand Down Expand Up @@ -265,8 +269,13 @@ export type Workspace = {
is_active: boolean
}

export type WorkspaceConfig = {
system_prompt: string
export type WorkspaceConfig_Input = {
custom_instructions: string
muxing_rules: Array<MuxRule>
}

export type WorkspaceConfig_Output = {
custom_instructions: string
muxing_rules: Array<MuxRule>
}

Expand Down Expand Up @@ -362,10 +371,10 @@ export type V1ListWorkspacesResponse = ListWorkspacesResponse
export type V1ListWorkspacesError = unknown

export type V1CreateWorkspaceData = {
body: CreateOrRenameWorkspaceRequest
body: FullWorkspace_Input
}

export type V1CreateWorkspaceResponse = Workspace
export type V1CreateWorkspaceResponse = FullWorkspace_Output

export type V1CreateWorkspaceError = HTTPValidationError

Expand All @@ -384,6 +393,17 @@ export type V1ActivateWorkspaceResponse = unknown

export type V1ActivateWorkspaceError = HTTPValidationError

export type V1UpdateWorkspaceData = {
body: FullWorkspace_Input
path: {
workspace_name: string
}
}

export type V1UpdateWorkspaceResponse = FullWorkspace_Output

export type V1UpdateWorkspaceError = HTTPValidationError

export type V1DeleteWorkspaceData = {
path: {
workspace_name: string
Expand Down
Loading
Loading