Skip to content

Commit cd549d2

Browse files
fix: breaking changes in openapi spec (#113)
1 parent a38e2cd commit cd549d2

File tree

6 files changed

+146
-105
lines changed

6 files changed

+146
-105
lines changed

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

+48-36
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ import type { OptionsLegacyParser } from "@hey-api/client-fetch";
44
import { queryOptions, type UseMutationOptions } from "@tanstack/react-query";
55
import {
66
client,
7-
getMessagesDashboardMessagesGet,
8-
getAlertsDashboardAlertsGet,
9-
streamSseDashboardAlertsNotificationGet,
10-
versionCheckDashboardVersionGet,
7+
healthCheckHealthGet,
8+
v1GetMessages,
9+
v1GetAlerts,
10+
v1StreamSse,
11+
v1VersionCheck,
1112
v1ListWorkspaces,
1213
v1CreateWorkspace,
1314
v1ListActiveWorkspaces,
@@ -60,87 +61,98 @@ const createQueryKey = <TOptions extends OptionsLegacyParser>(
6061
return params;
6162
};
6263

63-
export const getMessagesDashboardMessagesGetQueryKey = (
64-
options?: OptionsLegacyParser,
65-
) => [createQueryKey("getMessagesDashboardMessagesGet", options)];
64+
export const healthCheckHealthGetQueryKey = (options?: OptionsLegacyParser) => [
65+
createQueryKey("healthCheckHealthGet", options),
66+
];
6667

67-
export const getMessagesDashboardMessagesGetOptions = (
68-
options?: OptionsLegacyParser,
69-
) => {
68+
export const healthCheckHealthGetOptions = (options?: OptionsLegacyParser) => {
7069
return queryOptions({
7170
queryFn: async ({ queryKey, signal }) => {
72-
const { data } = await getMessagesDashboardMessagesGet({
71+
const { data } = await healthCheckHealthGet({
7372
...options,
7473
...queryKey[0],
7574
signal,
7675
throwOnError: true,
7776
});
7877
return data;
7978
},
80-
queryKey: getMessagesDashboardMessagesGetQueryKey(options),
79+
queryKey: healthCheckHealthGetQueryKey(options),
8180
});
8281
};
8382

84-
export const getAlertsDashboardAlertsGetQueryKey = (
85-
options?: OptionsLegacyParser,
86-
) => [createQueryKey("getAlertsDashboardAlertsGet", options)];
83+
export const v1GetMessagesQueryKey = (options?: OptionsLegacyParser) => [
84+
createQueryKey("v1GetMessages", options),
85+
];
8786

88-
export const getAlertsDashboardAlertsGetOptions = (
89-
options?: OptionsLegacyParser,
90-
) => {
87+
export const v1GetMessagesOptions = (options?: OptionsLegacyParser) => {
9188
return queryOptions({
9289
queryFn: async ({ queryKey, signal }) => {
93-
const { data } = await getAlertsDashboardAlertsGet({
90+
const { data } = await v1GetMessages({
9491
...options,
9592
...queryKey[0],
9693
signal,
9794
throwOnError: true,
9895
});
9996
return data;
10097
},
101-
queryKey: getAlertsDashboardAlertsGetQueryKey(options),
98+
queryKey: v1GetMessagesQueryKey(options),
10299
});
103100
};
104101

105-
export const streamSseDashboardAlertsNotificationGetQueryKey = (
106-
options?: OptionsLegacyParser,
107-
) => [createQueryKey("streamSseDashboardAlertsNotificationGet", options)];
102+
export const v1GetAlertsQueryKey = (options?: OptionsLegacyParser) => [
103+
createQueryKey("v1GetAlerts", options),
104+
];
108105

109-
export const streamSseDashboardAlertsNotificationGetOptions = (
110-
options?: OptionsLegacyParser,
111-
) => {
106+
export const v1GetAlertsOptions = (options?: OptionsLegacyParser) => {
112107
return queryOptions({
113108
queryFn: async ({ queryKey, signal }) => {
114-
const { data } = await streamSseDashboardAlertsNotificationGet({
109+
const { data } = await v1GetAlerts({
115110
...options,
116111
...queryKey[0],
117112
signal,
118113
throwOnError: true,
119114
});
120115
return data;
121116
},
122-
queryKey: streamSseDashboardAlertsNotificationGetQueryKey(options),
117+
queryKey: v1GetAlertsQueryKey(options),
123118
});
124119
};
125120

126-
export const versionCheckDashboardVersionGetQueryKey = (
127-
options?: OptionsLegacyParser,
128-
) => [createQueryKey("versionCheckDashboardVersionGet", options)];
121+
export const v1StreamSseQueryKey = (options?: OptionsLegacyParser) => [
122+
createQueryKey("v1StreamSse", options),
123+
];
129124

130-
export const versionCheckDashboardVersionGetOptions = (
131-
options?: OptionsLegacyParser,
132-
) => {
125+
export const v1StreamSseOptions = (options?: OptionsLegacyParser) => {
126+
return queryOptions({
127+
queryFn: async ({ queryKey, signal }) => {
128+
const { data } = await v1StreamSse({
129+
...options,
130+
...queryKey[0],
131+
signal,
132+
throwOnError: true,
133+
});
134+
return data;
135+
},
136+
queryKey: v1StreamSseQueryKey(options),
137+
});
138+
};
139+
140+
export const v1VersionCheckQueryKey = (options?: OptionsLegacyParser) => [
141+
createQueryKey("v1VersionCheck", options),
142+
];
143+
144+
export const v1VersionCheckOptions = (options?: OptionsLegacyParser) => {
133145
return queryOptions({
134146
queryFn: async ({ queryKey, signal }) => {
135-
const { data } = await versionCheckDashboardVersionGet({
147+
const { data } = await v1VersionCheck({
136148
...options,
137149
...queryKey[0],
138150
signal,
139151
throwOnError: true,
140152
});
141153
return data;
142154
},
143-
queryKey: versionCheckDashboardVersionGetQueryKey(options),
155+
queryKey: v1VersionCheckQueryKey(options),
144156
});
145157
};
146158

src/api/generated/sdk.gen.ts

+42-32
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ import {
66
type OptionsLegacyParser,
77
} from "@hey-api/client-fetch";
88
import type {
9-
GetMessagesDashboardMessagesGetError,
10-
GetMessagesDashboardMessagesGetResponse,
11-
GetAlertsDashboardAlertsGetError,
12-
GetAlertsDashboardAlertsGetResponse,
13-
StreamSseDashboardAlertsNotificationGetError,
14-
StreamSseDashboardAlertsNotificationGetResponse,
15-
VersionCheckDashboardVersionGetError,
16-
VersionCheckDashboardVersionGetResponse,
9+
HealthCheckHealthGetError,
10+
HealthCheckHealthGetResponse,
11+
V1GetMessagesError,
12+
V1GetMessagesResponse,
13+
V1GetAlertsError,
14+
V1GetAlertsResponse,
15+
V1StreamSseError,
16+
V1StreamSseResponse,
17+
V1VersionCheckError,
18+
V1VersionCheckResponse,
1719
V1ListWorkspacesError,
1820
V1ListWorkspacesResponse,
1921
V1CreateWorkspaceData,
@@ -31,78 +33,86 @@ import type {
3133

3234
export const client = createClient(createConfig());
3335

36+
/**
37+
* Health Check
38+
*/
39+
export const healthCheckHealthGet = <ThrowOnError extends boolean = false>(
40+
options?: OptionsLegacyParser<unknown, ThrowOnError>,
41+
) => {
42+
return (options?.client ?? client).get<
43+
HealthCheckHealthGetResponse,
44+
HealthCheckHealthGetError,
45+
ThrowOnError
46+
>({
47+
...options,
48+
url: "/health",
49+
});
50+
};
51+
3452
/**
3553
* Get Messages
3654
* Get all the messages from the database and return them as a list of conversations.
3755
*/
38-
export const getMessagesDashboardMessagesGet = <
39-
ThrowOnError extends boolean = false,
40-
>(
56+
export const v1GetMessages = <ThrowOnError extends boolean = false>(
4157
options?: OptionsLegacyParser<unknown, ThrowOnError>,
4258
) => {
4359
return (options?.client ?? client).get<
44-
GetMessagesDashboardMessagesGetResponse,
45-
GetMessagesDashboardMessagesGetError,
60+
V1GetMessagesResponse,
61+
V1GetMessagesError,
4662
ThrowOnError
4763
>({
4864
...options,
49-
url: "/dashboard/messages",
65+
url: "/api/v1/dashboard/messages",
5066
});
5167
};
5268

5369
/**
5470
* Get Alerts
5571
* Get all the messages from the database and return them as a list of conversations.
5672
*/
57-
export const getAlertsDashboardAlertsGet = <
58-
ThrowOnError extends boolean = false,
59-
>(
73+
export const v1GetAlerts = <ThrowOnError extends boolean = false>(
6074
options?: OptionsLegacyParser<unknown, ThrowOnError>,
6175
) => {
6276
return (options?.client ?? client).get<
63-
GetAlertsDashboardAlertsGetResponse,
64-
GetAlertsDashboardAlertsGetError,
77+
V1GetAlertsResponse,
78+
V1GetAlertsError,
6579
ThrowOnError
6680
>({
6781
...options,
68-
url: "/dashboard/alerts",
82+
url: "/api/v1/dashboard/alerts",
6983
});
7084
};
7185

7286
/**
7387
* Stream Sse
7488
* Send alerts event
7589
*/
76-
export const streamSseDashboardAlertsNotificationGet = <
77-
ThrowOnError extends boolean = false,
78-
>(
90+
export const v1StreamSse = <ThrowOnError extends boolean = false>(
7991
options?: OptionsLegacyParser<unknown, ThrowOnError>,
8092
) => {
8193
return (options?.client ?? client).get<
82-
StreamSseDashboardAlertsNotificationGetResponse,
83-
StreamSseDashboardAlertsNotificationGetError,
94+
V1StreamSseResponse,
95+
V1StreamSseError,
8496
ThrowOnError
8597
>({
8698
...options,
87-
url: "/dashboard/alerts_notification",
99+
url: "/api/v1/dashboard/alerts_notification",
88100
});
89101
};
90102

91103
/**
92104
* Version Check
93105
*/
94-
export const versionCheckDashboardVersionGet = <
95-
ThrowOnError extends boolean = false,
96-
>(
106+
export const v1VersionCheck = <ThrowOnError extends boolean = false>(
97107
options?: OptionsLegacyParser<unknown, ThrowOnError>,
98108
) => {
99109
return (options?.client ?? client).get<
100-
VersionCheckDashboardVersionGetResponse,
101-
VersionCheckDashboardVersionGetError,
110+
V1VersionCheckResponse,
111+
V1VersionCheckError,
102112
ThrowOnError
103113
>({
104114
...options,
105-
url: "/dashboard/version",
115+
url: "/api/v1/dashboard/version",
106116
});
107117
};
108118

src/api/generated/types.gen.ts

+12-9
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,25 @@ export type Workspace = {
9090
is_active: boolean;
9191
};
9292

93-
export type GetMessagesDashboardMessagesGetResponse = Array<Conversation>;
93+
export type HealthCheckHealthGetResponse = unknown;
9494

95-
export type GetMessagesDashboardMessagesGetError = unknown;
95+
export type HealthCheckHealthGetError = unknown;
9696

97-
export type GetAlertsDashboardAlertsGetResponse =
98-
Array<AlertConversation | null>;
97+
export type V1GetMessagesResponse = Array<Conversation>;
9998

100-
export type GetAlertsDashboardAlertsGetError = unknown;
99+
export type V1GetMessagesError = unknown;
101100

102-
export type StreamSseDashboardAlertsNotificationGetResponse = unknown;
101+
export type V1GetAlertsResponse = Array<AlertConversation | null>;
103102

104-
export type StreamSseDashboardAlertsNotificationGetError = unknown;
103+
export type V1GetAlertsError = unknown;
105104

106-
export type VersionCheckDashboardVersionGetResponse = unknown;
105+
export type V1StreamSseResponse = unknown;
107106

108-
export type VersionCheckDashboardVersionGetError = unknown;
107+
export type V1StreamSseError = unknown;
108+
109+
export type V1VersionCheckResponse = unknown;
110+
111+
export type V1VersionCheckError = unknown;
109112

110113
export type V1ListWorkspacesResponse = ListWorkspacesResponse;
111114

0 commit comments

Comments
 (0)