Skip to content

Commit cc27728

Browse files
authored
chore: update api moved under v1 (#187)
1 parent a67b265 commit cc27728

File tree

8 files changed

+136
-283
lines changed

8 files changed

+136
-283
lines changed

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

Lines changed: 40 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import { queryOptions, type UseMutationOptions } from "@tanstack/react-query";
55
import {
66
client,
77
healthCheckHealthGet,
8-
v1GetMessages,
9-
v1GetAlerts,
10-
v1StreamSse,
11-
v1VersionCheck,
128
v1ListWorkspaces,
139
v1CreateWorkspace,
1410
v1ListActiveWorkspaces,
@@ -22,6 +18,8 @@ import {
2218
v1GetWorkspaceCustomInstructions,
2319
v1SetWorkspaceCustomInstructions,
2420
v1DeleteWorkspaceCustomInstructions,
21+
v1StreamSse,
22+
v1VersionCheck,
2523
} from "../sdk.gen";
2624
import type {
2725
V1CreateWorkspaceData,
@@ -103,82 +101,6 @@ export const healthCheckHealthGetOptions = (options?: OptionsLegacyParser) => {
103101
});
104102
};
105103

106-
export const v1GetMessagesQueryKey = (options?: OptionsLegacyParser) => [
107-
createQueryKey("v1GetMessages", options),
108-
];
109-
110-
export const v1GetMessagesOptions = (options?: OptionsLegacyParser) => {
111-
return queryOptions({
112-
queryFn: async ({ queryKey, signal }) => {
113-
const { data } = await v1GetMessages({
114-
...options,
115-
...queryKey[0],
116-
signal,
117-
throwOnError: true,
118-
});
119-
return data;
120-
},
121-
queryKey: v1GetMessagesQueryKey(options),
122-
});
123-
};
124-
125-
export const v1GetAlertsQueryKey = (options?: OptionsLegacyParser) => [
126-
createQueryKey("v1GetAlerts", options),
127-
];
128-
129-
export const v1GetAlertsOptions = (options?: OptionsLegacyParser) => {
130-
return queryOptions({
131-
queryFn: async ({ queryKey, signal }) => {
132-
const { data } = await v1GetAlerts({
133-
...options,
134-
...queryKey[0],
135-
signal,
136-
throwOnError: true,
137-
});
138-
return data;
139-
},
140-
queryKey: v1GetAlertsQueryKey(options),
141-
});
142-
};
143-
144-
export const v1StreamSseQueryKey = (options?: OptionsLegacyParser) => [
145-
createQueryKey("v1StreamSse", options),
146-
];
147-
148-
export const v1StreamSseOptions = (options?: OptionsLegacyParser) => {
149-
return queryOptions({
150-
queryFn: async ({ queryKey, signal }) => {
151-
const { data } = await v1StreamSse({
152-
...options,
153-
...queryKey[0],
154-
signal,
155-
throwOnError: true,
156-
});
157-
return data;
158-
},
159-
queryKey: v1StreamSseQueryKey(options),
160-
});
161-
};
162-
163-
export const v1VersionCheckQueryKey = (options?: OptionsLegacyParser) => [
164-
createQueryKey("v1VersionCheck", options),
165-
];
166-
167-
export const v1VersionCheckOptions = (options?: OptionsLegacyParser) => {
168-
return queryOptions({
169-
queryFn: async ({ queryKey, signal }) => {
170-
const { data } = await v1VersionCheck({
171-
...options,
172-
...queryKey[0],
173-
signal,
174-
throwOnError: true,
175-
});
176-
return data;
177-
},
178-
queryKey: v1VersionCheckQueryKey(options),
179-
});
180-
};
181-
182104
export const v1ListWorkspacesQueryKey = (options?: OptionsLegacyParser) => [
183105
createQueryKey("v1ListWorkspaces", options),
184106
];
@@ -507,3 +429,41 @@ export const v1DeleteWorkspaceCustomInstructionsMutation = (
507429
};
508430
return mutationOptions;
509431
};
432+
433+
export const v1StreamSseQueryKey = (options?: OptionsLegacyParser) => [
434+
createQueryKey("v1StreamSse", options),
435+
];
436+
437+
export const v1StreamSseOptions = (options?: OptionsLegacyParser) => {
438+
return queryOptions({
439+
queryFn: async ({ queryKey, signal }) => {
440+
const { data } = await v1StreamSse({
441+
...options,
442+
...queryKey[0],
443+
signal,
444+
throwOnError: true,
445+
});
446+
return data;
447+
},
448+
queryKey: v1StreamSseQueryKey(options),
449+
});
450+
};
451+
452+
export const v1VersionCheckQueryKey = (options?: OptionsLegacyParser) => [
453+
createQueryKey("v1VersionCheck", options),
454+
];
455+
456+
export const v1VersionCheckOptions = (options?: OptionsLegacyParser) => {
457+
return queryOptions({
458+
queryFn: async ({ queryKey, signal }) => {
459+
const { data } = await v1VersionCheck({
460+
...options,
461+
...queryKey[0],
462+
signal,
463+
throwOnError: true,
464+
});
465+
return data;
466+
},
467+
queryKey: v1VersionCheckQueryKey(options),
468+
});
469+
};

src/api/generated/sdk.gen.ts

Lines changed: 37 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,6 @@ import {
88
import type {
99
HealthCheckHealthGetError,
1010
HealthCheckHealthGetResponse,
11-
V1GetMessagesError,
12-
V1GetMessagesResponse,
13-
V1GetAlertsError,
14-
V1GetAlertsResponse,
15-
V1StreamSseError,
16-
V1StreamSseResponse,
17-
V1VersionCheckError,
18-
V1VersionCheckResponse,
1911
V1ListWorkspacesError,
2012
V1ListWorkspacesResponse,
2113
V1CreateWorkspaceData,
@@ -52,6 +44,10 @@ import type {
5244
V1DeleteWorkspaceCustomInstructionsData,
5345
V1DeleteWorkspaceCustomInstructionsError,
5446
V1DeleteWorkspaceCustomInstructionsResponse,
47+
V1StreamSseError,
48+
V1StreamSseResponse,
49+
V1VersionCheckError,
50+
V1VersionCheckResponse,
5551
} from "./types.gen";
5652

5753
export const client = createClient(createConfig());
@@ -72,73 +68,6 @@ export const healthCheckHealthGet = <ThrowOnError extends boolean = false>(
7268
});
7369
};
7470

75-
/**
76-
* Get Messages
77-
* Get all the messages from the database and return them as a list of conversations.
78-
*/
79-
export const v1GetMessages = <ThrowOnError extends boolean = false>(
80-
options?: OptionsLegacyParser<unknown, ThrowOnError>,
81-
) => {
82-
return (options?.client ?? client).get<
83-
V1GetMessagesResponse,
84-
V1GetMessagesError,
85-
ThrowOnError
86-
>({
87-
...options,
88-
url: "/api/v1/dashboard/messages",
89-
});
90-
};
91-
92-
/**
93-
* Get Alerts
94-
* Get all the messages from the database and return them as a list of conversations.
95-
*/
96-
export const v1GetAlerts = <ThrowOnError extends boolean = false>(
97-
options?: OptionsLegacyParser<unknown, ThrowOnError>,
98-
) => {
99-
return (options?.client ?? client).get<
100-
V1GetAlertsResponse,
101-
V1GetAlertsError,
102-
ThrowOnError
103-
>({
104-
...options,
105-
url: "/api/v1/dashboard/alerts",
106-
});
107-
};
108-
109-
/**
110-
* Stream Sse
111-
* Send alerts event
112-
*/
113-
export const v1StreamSse = <ThrowOnError extends boolean = false>(
114-
options?: OptionsLegacyParser<unknown, ThrowOnError>,
115-
) => {
116-
return (options?.client ?? client).get<
117-
V1StreamSseResponse,
118-
V1StreamSseError,
119-
ThrowOnError
120-
>({
121-
...options,
122-
url: "/api/v1/dashboard/alerts_notification",
123-
});
124-
};
125-
126-
/**
127-
* Version Check
128-
*/
129-
export const v1VersionCheck = <ThrowOnError extends boolean = false>(
130-
options?: OptionsLegacyParser<unknown, ThrowOnError>,
131-
) => {
132-
return (options?.client ?? client).get<
133-
V1VersionCheckResponse,
134-
V1VersionCheckError,
135-
ThrowOnError
136-
>({
137-
...options,
138-
url: "/api/v1/dashboard/version",
139-
});
140-
};
141-
14271
/**
14372
* List Workspaces
14473
* List all workspaces.
@@ -375,3 +304,36 @@ export const v1DeleteWorkspaceCustomInstructions = <
375304
url: "/api/v1/workspaces/{workspace_name}/custom-instructions",
376305
});
377306
};
307+
308+
/**
309+
* Stream Sse
310+
* Send alerts event
311+
*/
312+
export const v1StreamSse = <ThrowOnError extends boolean = false>(
313+
options?: OptionsLegacyParser<unknown, ThrowOnError>,
314+
) => {
315+
return (options?.client ?? client).get<
316+
V1StreamSseResponse,
317+
V1StreamSseError,
318+
ThrowOnError
319+
>({
320+
...options,
321+
url: "/api/v1/alerts_notification",
322+
});
323+
};
324+
325+
/**
326+
* Version Check
327+
*/
328+
export const v1VersionCheck = <ThrowOnError extends boolean = false>(
329+
options?: OptionsLegacyParser<unknown, ThrowOnError>,
330+
) => {
331+
return (options?.client ?? client).get<
332+
V1VersionCheckResponse,
333+
V1VersionCheckError,
334+
ThrowOnError
335+
>({
336+
...options,
337+
url: "/api/v1/version",
338+
});
339+
};

src/api/generated/types.gen.ts

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -99,22 +99,6 @@ export type HealthCheckHealthGetResponse = unknown;
9999

100100
export type HealthCheckHealthGetError = unknown;
101101

102-
export type V1GetMessagesResponse = Array<Conversation>;
103-
104-
export type V1GetMessagesError = unknown;
105-
106-
export type V1GetAlertsResponse = Array<AlertConversation | null>;
107-
108-
export type V1GetAlertsError = unknown;
109-
110-
export type V1StreamSseResponse = unknown;
111-
112-
export type V1StreamSseError = unknown;
113-
114-
export type V1VersionCheckResponse = unknown;
115-
116-
export type V1VersionCheckError = unknown;
117-
118102
export type V1ListWorkspacesResponse = ListWorkspacesResponse;
119103

120104
export type V1ListWorkspacesError = unknown;
@@ -226,3 +210,11 @@ export type V1DeleteWorkspaceCustomInstructionsData = {
226210
export type V1DeleteWorkspaceCustomInstructionsResponse = void;
227211

228212
export type V1DeleteWorkspaceCustomInstructionsError = HTTPValidationError;
213+
214+
export type V1StreamSseResponse = unknown;
215+
216+
export type V1StreamSseError = unknown;
217+
218+
export type V1VersionCheckResponse = unknown;
219+
220+
export type V1VersionCheckError = unknown;

0 commit comments

Comments
 (0)