Skip to content

Commit 8e732f6

Browse files
authored
chore(api): update generated types (#74)
1 parent 8a98ec1 commit 8e732f6

File tree

3 files changed

+47
-86
lines changed

3 files changed

+47
-86
lines changed

src/api/generated/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
// This file is auto-generated by @hey-api/openapi-ts
2-
export * from "./sdk.gen";
3-
export * from "./types.gen";
2+
export * from './sdk.gen';
3+
export * from './types.gen';

src/api/generated/sdk.gen.ts

+18-53
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,39 @@
11
// This file is auto-generated by @hey-api/openapi-ts
22

3-
import {
4-
createClient,
5-
createConfig,
6-
type OptionsLegacyParser,
7-
} from "@hey-api/client-fetch";
8-
import type {
9-
GetMessagesDashboardMessagesGetError,
10-
GetMessagesDashboardMessagesGetResponse,
11-
GetAlertsDashboardAlertsGetError,
12-
GetAlertsDashboardAlertsGetResponse,
13-
StreamSseDashboardAlertsNotificationGetError,
14-
StreamSseDashboardAlertsNotificationGetResponse,
15-
} from "./types.gen";
3+
import { createClient, createConfig, type OptionsLegacyParser } from '@hey-api/client-fetch';
4+
import type { GetMessagesDashboardMessagesGetError, GetMessagesDashboardMessagesGetResponse, GetAlertsDashboardAlertsGetError, GetAlertsDashboardAlertsGetResponse, StreamSseDashboardAlertsNotificationGetError, StreamSseDashboardAlertsNotificationGetResponse } from './types.gen';
165

176
export const client = createClient(createConfig());
187

198
/**
209
* Get Messages
2110
* Get all the messages from the database and return them as a list of conversations.
2211
*/
23-
export const getMessagesDashboardMessagesGet = <
24-
ThrowOnError extends boolean = false,
25-
>(
26-
options?: OptionsLegacyParser<unknown, ThrowOnError>,
27-
) => {
28-
return (options?.client ?? client).get<
29-
GetMessagesDashboardMessagesGetResponse,
30-
GetMessagesDashboardMessagesGetError,
31-
ThrowOnError
32-
>({
33-
...options,
34-
url: "/dashboard/messages",
35-
});
12+
export const getMessagesDashboardMessagesGet = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => {
13+
return (options?.client ?? client).get<GetMessagesDashboardMessagesGetResponse, GetMessagesDashboardMessagesGetError, ThrowOnError>({
14+
...options,
15+
url: '/dashboard/messages'
16+
});
3617
};
3718

3819
/**
3920
* Get Alerts
4021
* Get all the messages from the database and return them as a list of conversations.
4122
*/
42-
export const getAlertsDashboardAlertsGet = <
43-
ThrowOnError extends boolean = false,
44-
>(
45-
options?: OptionsLegacyParser<unknown, ThrowOnError>,
46-
) => {
47-
return (options?.client ?? client).get<
48-
GetAlertsDashboardAlertsGetResponse,
49-
GetAlertsDashboardAlertsGetError,
50-
ThrowOnError
51-
>({
52-
...options,
53-
url: "/dashboard/alerts",
54-
});
23+
export const getAlertsDashboardAlertsGet = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => {
24+
return (options?.client ?? client).get<GetAlertsDashboardAlertsGetResponse, GetAlertsDashboardAlertsGetError, ThrowOnError>({
25+
...options,
26+
url: '/dashboard/alerts'
27+
});
5528
};
5629

5730
/**
5831
* Stream Sse
5932
* Send alerts event
6033
*/
61-
export const streamSseDashboardAlertsNotificationGet = <
62-
ThrowOnError extends boolean = false,
63-
>(
64-
options?: OptionsLegacyParser<unknown, ThrowOnError>,
65-
) => {
66-
return (options?.client ?? client).get<
67-
StreamSseDashboardAlertsNotificationGetResponse,
68-
StreamSseDashboardAlertsNotificationGetError,
69-
ThrowOnError
70-
>({
71-
...options,
72-
url: "/dashboard/alerts_notification",
73-
});
74-
};
34+
export const streamSseDashboardAlertsNotificationGet = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => {
35+
return (options?.client ?? client).get<StreamSseDashboardAlertsNotificationGetResponse, StreamSseDashboardAlertsNotificationGetError, ThrowOnError>({
36+
...options,
37+
url: '/dashboard/alerts_notification'
38+
});
39+
};

src/api/generated/types.gen.ts

+27-31
Original file line numberDiff line numberDiff line change
@@ -4,64 +4,60 @@
44
* Represents an alert with it's respective conversation.
55
*/
66
export type AlertConversation = {
7-
conversation: Conversation;
8-
alert_id: string;
9-
code_snippet: CodeSnippet | null;
10-
trigger_string:
11-
| string
12-
| {
13-
[key: string]: unknown;
14-
}
15-
| null;
16-
trigger_type: string;
17-
trigger_category: string | null;
18-
timestamp: string;
7+
conversation: Conversation;
8+
alert_id: string;
9+
code_snippet: (CodeSnippet | null);
10+
trigger_string: (string | {
11+
[key: string]: unknown;
12+
} | null);
13+
trigger_type: string;
14+
trigger_category: (string | null);
15+
timestamp: string;
1916
};
2017

2118
/**
2219
* Represents a chat message.
2320
*/
2421
export type ChatMessage = {
25-
message: string;
26-
timestamp: string;
27-
message_id: string;
22+
message: string;
23+
timestamp: string;
24+
message_id: string;
2825
};
2926

3027
export type CodeSnippet = {
31-
code: string;
32-
language: string | null;
33-
filepath: string | null;
34-
libraries?: Array<string>;
28+
code: string;
29+
language: (string | null);
30+
filepath: (string | null);
31+
libraries?: Array<(string)>;
3532
};
3633

3734
/**
3835
* Represents a conversation.
3936
*/
4037
export type Conversation = {
41-
question_answers: Array<QuestionAnswer>;
42-
provider: string | null;
43-
type: string;
44-
chat_id: string;
45-
conversation_timestamp: string;
38+
question_answers: Array<QuestionAnswer>;
39+
provider: (string | null);
40+
type: string;
41+
chat_id: string;
42+
conversation_timestamp: string;
4643
};
4744

4845
/**
4946
* Represents a question and answer pair.
5047
*/
5148
export type QuestionAnswer = {
52-
question: ChatMessage;
53-
answer: ChatMessage | null;
49+
question: ChatMessage;
50+
answer: (ChatMessage | null);
5451
};
5552

56-
export type GetMessagesDashboardMessagesGetResponse = Array<Conversation>;
53+
export type GetMessagesDashboardMessagesGetResponse = (Array<Conversation>);
5754

5855
export type GetMessagesDashboardMessagesGetError = unknown;
5956

60-
export type GetAlertsDashboardAlertsGetResponse =
61-
Array<AlertConversation | null>;
57+
export type GetAlertsDashboardAlertsGetResponse = (Array<(AlertConversation | null)>);
6258

6359
export type GetAlertsDashboardAlertsGetError = unknown;
6460

65-
export type StreamSseDashboardAlertsNotificationGetResponse = unknown;
61+
export type StreamSseDashboardAlertsNotificationGetResponse = (unknown);
6662

67-
export type StreamSseDashboardAlertsNotificationGetError = unknown;
63+
export type StreamSseDashboardAlertsNotificationGetError = unknown;

0 commit comments

Comments
 (0)