Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

Commit 7021e3a

Browse files
authored
chore: update api (#167)
* chore: update api * update msw
1 parent e77a837 commit 7021e3a

File tree

10 files changed

+144
-119
lines changed

10 files changed

+144
-119
lines changed

src/api/generated/@tanstack/react-query.gen.ts

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import {
1919
v1HardDeleteWorkspace,
2020
v1GetWorkspaceAlerts,
2121
v1GetWorkspaceMessages,
22-
v1GetWorkspaceSystemPrompt,
23-
v1SetWorkspaceSystemPrompt,
24-
v1DeleteWorkspaceSystemPrompt,
22+
v1GetWorkspaceCustomInstructions,
23+
v1SetWorkspaceCustomInstructions,
24+
v1DeleteWorkspaceCustomInstructions,
2525
} from "../sdk.gen";
2626
import type {
2727
V1CreateWorkspaceData,
@@ -41,13 +41,13 @@ import type {
4141
V1HardDeleteWorkspaceResponse,
4242
V1GetWorkspaceAlertsData,
4343
V1GetWorkspaceMessagesData,
44-
V1GetWorkspaceSystemPromptData,
45-
V1SetWorkspaceSystemPromptData,
46-
V1SetWorkspaceSystemPromptError,
47-
V1SetWorkspaceSystemPromptResponse,
48-
V1DeleteWorkspaceSystemPromptData,
49-
V1DeleteWorkspaceSystemPromptError,
50-
V1DeleteWorkspaceSystemPromptResponse,
44+
V1GetWorkspaceCustomInstructionsData,
45+
V1SetWorkspaceCustomInstructionsData,
46+
V1SetWorkspaceCustomInstructionsError,
47+
V1SetWorkspaceCustomInstructionsResponse,
48+
V1DeleteWorkspaceCustomInstructionsData,
49+
V1DeleteWorkspaceCustomInstructionsError,
50+
V1DeleteWorkspaceCustomInstructionsResponse,
5151
} from "../types.gen";
5252

5353
type QueryKey<TOptions extends OptionsLegacyParser> = [
@@ -445,37 +445,37 @@ export const v1GetWorkspaceMessagesOptions = (
445445
});
446446
};
447447

448-
export const v1GetWorkspaceSystemPromptQueryKey = (
449-
options: OptionsLegacyParser<V1GetWorkspaceSystemPromptData>,
450-
) => [createQueryKey("v1GetWorkspaceSystemPrompt", options)];
448+
export const v1GetWorkspaceCustomInstructionsQueryKey = (
449+
options: OptionsLegacyParser<V1GetWorkspaceCustomInstructionsData>,
450+
) => [createQueryKey("v1GetWorkspaceCustomInstructions", options)];
451451

452-
export const v1GetWorkspaceSystemPromptOptions = (
453-
options: OptionsLegacyParser<V1GetWorkspaceSystemPromptData>,
452+
export const v1GetWorkspaceCustomInstructionsOptions = (
453+
options: OptionsLegacyParser<V1GetWorkspaceCustomInstructionsData>,
454454
) => {
455455
return queryOptions({
456456
queryFn: async ({ queryKey, signal }) => {
457-
const { data } = await v1GetWorkspaceSystemPrompt({
457+
const { data } = await v1GetWorkspaceCustomInstructions({
458458
...options,
459459
...queryKey[0],
460460
signal,
461461
throwOnError: true,
462462
});
463463
return data;
464464
},
465-
queryKey: v1GetWorkspaceSystemPromptQueryKey(options),
465+
queryKey: v1GetWorkspaceCustomInstructionsQueryKey(options),
466466
});
467467
};
468468

469-
export const v1SetWorkspaceSystemPromptMutation = (
470-
options?: Partial<OptionsLegacyParser<V1SetWorkspaceSystemPromptData>>,
469+
export const v1SetWorkspaceCustomInstructionsMutation = (
470+
options?: Partial<OptionsLegacyParser<V1SetWorkspaceCustomInstructionsData>>,
471471
) => {
472472
const mutationOptions: UseMutationOptions<
473-
V1SetWorkspaceSystemPromptResponse,
474-
V1SetWorkspaceSystemPromptError,
475-
OptionsLegacyParser<V1SetWorkspaceSystemPromptData>
473+
V1SetWorkspaceCustomInstructionsResponse,
474+
V1SetWorkspaceCustomInstructionsError,
475+
OptionsLegacyParser<V1SetWorkspaceCustomInstructionsData>
476476
> = {
477477
mutationFn: async (localOptions) => {
478-
const { data } = await v1SetWorkspaceSystemPrompt({
478+
const { data } = await v1SetWorkspaceCustomInstructions({
479479
...options,
480480
...localOptions,
481481
throwOnError: true,
@@ -486,16 +486,18 @@ export const v1SetWorkspaceSystemPromptMutation = (
486486
return mutationOptions;
487487
};
488488

489-
export const v1DeleteWorkspaceSystemPromptMutation = (
490-
options?: Partial<OptionsLegacyParser<V1DeleteWorkspaceSystemPromptData>>,
489+
export const v1DeleteWorkspaceCustomInstructionsMutation = (
490+
options?: Partial<
491+
OptionsLegacyParser<V1DeleteWorkspaceCustomInstructionsData>
492+
>,
491493
) => {
492494
const mutationOptions: UseMutationOptions<
493-
V1DeleteWorkspaceSystemPromptResponse,
494-
V1DeleteWorkspaceSystemPromptError,
495-
OptionsLegacyParser<V1DeleteWorkspaceSystemPromptData>
495+
V1DeleteWorkspaceCustomInstructionsResponse,
496+
V1DeleteWorkspaceCustomInstructionsError,
497+
OptionsLegacyParser<V1DeleteWorkspaceCustomInstructionsData>
496498
> = {
497499
mutationFn: async (localOptions) => {
498-
const { data } = await v1DeleteWorkspaceSystemPrompt({
500+
const { data } = await v1DeleteWorkspaceCustomInstructions({
499501
...options,
500502
...localOptions,
501503
throwOnError: true,

src/api/generated/sdk.gen.ts

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ import type {
4343
V1GetWorkspaceMessagesData,
4444
V1GetWorkspaceMessagesError,
4545
V1GetWorkspaceMessagesResponse,
46-
V1GetWorkspaceSystemPromptData,
47-
V1GetWorkspaceSystemPromptError,
48-
V1GetWorkspaceSystemPromptResponse,
49-
V1SetWorkspaceSystemPromptData,
50-
V1SetWorkspaceSystemPromptError,
51-
V1SetWorkspaceSystemPromptResponse,
52-
V1DeleteWorkspaceSystemPromptData,
53-
V1DeleteWorkspaceSystemPromptError,
54-
V1DeleteWorkspaceSystemPromptResponse,
46+
V1GetWorkspaceCustomInstructionsData,
47+
V1GetWorkspaceCustomInstructionsError,
48+
V1GetWorkspaceCustomInstructionsResponse,
49+
V1SetWorkspaceCustomInstructionsData,
50+
V1SetWorkspaceCustomInstructionsError,
51+
V1SetWorkspaceCustomInstructionsResponse,
52+
V1DeleteWorkspaceCustomInstructionsData,
53+
V1DeleteWorkspaceCustomInstructionsError,
54+
V1DeleteWorkspaceCustomInstructionsResponse,
5555
} from "./types.gen";
5656

5757
export const client = createClient(createConfig());
@@ -313,56 +313,65 @@ export const v1GetWorkspaceMessages = <ThrowOnError extends boolean = false>(
313313
};
314314

315315
/**
316-
* Get Workspace System Prompt
317-
* Get the system prompt for a workspace.
316+
* Get Workspace Custom Instructions
317+
* Get the custom instructions of a workspace.
318318
*/
319-
export const v1GetWorkspaceSystemPrompt = <
319+
export const v1GetWorkspaceCustomInstructions = <
320320
ThrowOnError extends boolean = false,
321321
>(
322-
options: OptionsLegacyParser<V1GetWorkspaceSystemPromptData, ThrowOnError>,
322+
options: OptionsLegacyParser<
323+
V1GetWorkspaceCustomInstructionsData,
324+
ThrowOnError
325+
>,
323326
) => {
324327
return (options?.client ?? client).get<
325-
V1GetWorkspaceSystemPromptResponse,
326-
V1GetWorkspaceSystemPromptError,
328+
V1GetWorkspaceCustomInstructionsResponse,
329+
V1GetWorkspaceCustomInstructionsError,
327330
ThrowOnError
328331
>({
329332
...options,
330-
url: "/api/v1/workspaces/{workspace_name}/system-prompt",
333+
url: "/api/v1/workspaces/{workspace_name}/custom-instructions",
331334
});
332335
};
333336

334337
/**
335-
* Set Workspace System Prompt
338+
* Set Workspace Custom Instructions
336339
*/
337-
export const v1SetWorkspaceSystemPrompt = <
340+
export const v1SetWorkspaceCustomInstructions = <
338341
ThrowOnError extends boolean = false,
339342
>(
340-
options: OptionsLegacyParser<V1SetWorkspaceSystemPromptData, ThrowOnError>,
343+
options: OptionsLegacyParser<
344+
V1SetWorkspaceCustomInstructionsData,
345+
ThrowOnError
346+
>,
341347
) => {
342348
return (options?.client ?? client).put<
343-
V1SetWorkspaceSystemPromptResponse,
344-
V1SetWorkspaceSystemPromptError,
349+
V1SetWorkspaceCustomInstructionsResponse,
350+
V1SetWorkspaceCustomInstructionsError,
345351
ThrowOnError
346352
>({
347353
...options,
348-
url: "/api/v1/workspaces/{workspace_name}/system-prompt",
354+
url: "/api/v1/workspaces/{workspace_name}/custom-instructions",
349355
});
350356
};
351357

352358
/**
353-
* Delete Workspace System Prompt
359+
* Delete Workspace Custom Instructions
354360
*/
355-
export const v1DeleteWorkspaceSystemPrompt = <
361+
export const v1DeleteWorkspaceCustomInstructions = <
356362
ThrowOnError extends boolean = false,
357363
>(
358-
options: OptionsLegacyParser<V1DeleteWorkspaceSystemPromptData, ThrowOnError>,
364+
options: OptionsLegacyParser<
365+
V1DeleteWorkspaceCustomInstructionsData,
366+
ThrowOnError
367+
>,
359368
) => {
360369
return (options?.client ?? client).delete<
361-
V1DeleteWorkspaceSystemPromptResponse,
362-
V1DeleteWorkspaceSystemPromptError,
370+
V1DeleteWorkspaceCustomInstructionsResponse,
371+
V1DeleteWorkspaceCustomInstructionsError,
363372
ThrowOnError
364373
>({
365374
...options,
366-
url: "/api/v1/workspaces/{workspace_name}/system-prompt",
375+
url: "/api/v1/workspaces/{workspace_name}/custom-instructions",
367376
});
368377
};

src/api/generated/types.gen.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ export type CreateOrRenameWorkspaceRequest = {
6060
rename_to?: string | null;
6161
};
6262

63+
export type CustomInstructions = {
64+
prompt: string;
65+
};
66+
6367
export type HTTPValidationError = {
6468
detail?: Array<ValidationError>;
6569
};
@@ -80,10 +84,6 @@ export type QuestionAnswer = {
8084
answer: ChatMessage | null;
8185
};
8286

83-
export type SystemPrompt = {
84-
prompt: string;
85-
};
86-
8787
export type ValidationError = {
8888
loc: Array<string | number>;
8989
msg: string;
@@ -196,33 +196,33 @@ export type V1GetWorkspaceMessagesResponse = Array<Conversation>;
196196

197197
export type V1GetWorkspaceMessagesError = HTTPValidationError;
198198

199-
export type V1GetWorkspaceSystemPromptData = {
199+
export type V1GetWorkspaceCustomInstructionsData = {
200200
path: {
201201
workspace_name: string;
202202
};
203203
};
204204

205-
export type V1GetWorkspaceSystemPromptResponse = SystemPrompt;
205+
export type V1GetWorkspaceCustomInstructionsResponse = CustomInstructions;
206206

207-
export type V1GetWorkspaceSystemPromptError = HTTPValidationError;
207+
export type V1GetWorkspaceCustomInstructionsError = HTTPValidationError;
208208

209-
export type V1SetWorkspaceSystemPromptData = {
210-
body: SystemPrompt;
209+
export type V1SetWorkspaceCustomInstructionsData = {
210+
body: CustomInstructions;
211211
path: {
212212
workspace_name: string;
213213
};
214214
};
215215

216-
export type V1SetWorkspaceSystemPromptResponse = void;
216+
export type V1SetWorkspaceCustomInstructionsResponse = void;
217217

218-
export type V1SetWorkspaceSystemPromptError = HTTPValidationError;
218+
export type V1SetWorkspaceCustomInstructionsError = HTTPValidationError;
219219

220-
export type V1DeleteWorkspaceSystemPromptData = {
220+
export type V1DeleteWorkspaceCustomInstructionsData = {
221221
path: {
222222
workspace_name: string;
223223
};
224224
};
225225

226-
export type V1DeleteWorkspaceSystemPromptResponse = void;
226+
export type V1DeleteWorkspaceCustomInstructionsResponse = void;
227227

228-
export type V1DeleteWorkspaceSystemPromptError = HTTPValidationError;
228+
export type V1DeleteWorkspaceCustomInstructionsError = HTTPValidationError;

src/api/openapi.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -511,15 +511,15 @@
511511
}
512512
}
513513
},
514-
"/api/v1/workspaces/{workspace_name}/system-prompt": {
514+
"/api/v1/workspaces/{workspace_name}/custom-instructions": {
515515
"get": {
516516
"tags": [
517517
"CodeGate API",
518518
"Workspaces"
519519
],
520-
"summary": "Get Workspace System Prompt",
521-
"description": "Get the system prompt for a workspace.",
522-
"operationId": "v1_get_workspace_system_prompt",
520+
"summary": "Get Workspace Custom Instructions",
521+
"description": "Get the custom instructions of a workspace.",
522+
"operationId": "v1_get_workspace_custom_instructions",
523523
"parameters": [
524524
{
525525
"name": "workspace_name",
@@ -537,7 +537,7 @@
537537
"content": {
538538
"application/json": {
539539
"schema": {
540-
"$ref": "#/components/schemas/SystemPrompt"
540+
"$ref": "#/components/schemas/CustomInstructions"
541541
}
542542
}
543543
}
@@ -559,8 +559,8 @@
559559
"CodeGate API",
560560
"Workspaces"
561561
],
562-
"summary": "Set Workspace System Prompt",
563-
"operationId": "v1_set_workspace_system_prompt",
562+
"summary": "Set Workspace Custom Instructions",
563+
"operationId": "v1_set_workspace_custom_instructions",
564564
"parameters": [
565565
{
566566
"name": "workspace_name",
@@ -577,7 +577,7 @@
577577
"content": {
578578
"application/json": {
579579
"schema": {
580-
"$ref": "#/components/schemas/SystemPrompt"
580+
"$ref": "#/components/schemas/CustomInstructions"
581581
}
582582
}
583583
}
@@ -603,8 +603,8 @@
603603
"CodeGate API",
604604
"Workspaces"
605605
],
606-
"summary": "Delete Workspace System Prompt",
607-
"operationId": "v1_delete_workspace_system_prompt",
606+
"summary": "Delete Workspace Custom Instructions",
607+
"operationId": "v1_delete_workspace_custom_instructions",
608608
"parameters": [
609609
{
610610
"name": "workspace_name",
@@ -876,6 +876,19 @@
876876
],
877877
"title": "CreateOrRenameWorkspaceRequest"
878878
},
879+
"CustomInstructions": {
880+
"properties": {
881+
"prompt": {
882+
"type": "string",
883+
"title": "Prompt"
884+
}
885+
},
886+
"type": "object",
887+
"required": [
888+
"prompt"
889+
],
890+
"title": "CustomInstructions"
891+
},
879892
"HTTPValidationError": {
880893
"properties": {
881894
"detail": {
@@ -945,19 +958,6 @@
945958
"title": "QuestionAnswer",
946959
"description": "Represents a question and answer pair."
947960
},
948-
"SystemPrompt": {
949-
"properties": {
950-
"prompt": {
951-
"type": "string",
952-
"title": "Prompt"
953-
}
954-
},
955-
"type": "object",
956-
"required": [
957-
"prompt"
958-
],
959-
"title": "SystemPrompt"
960-
},
961961
"ValidationError": {
962962
"properties": {
963963
"loc": {

0 commit comments

Comments
 (0)