Skip to content

Commit

Permalink
chore(api): update generated types (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
peppescg authored Jan 15, 2025
1 parent 8a98ec1 commit 8e732f6
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 86 deletions.
4 changes: 2 additions & 2 deletions src/api/generated/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// This file is auto-generated by @hey-api/openapi-ts
export * from "./sdk.gen";
export * from "./types.gen";
export * from './sdk.gen';
export * from './types.gen';
71 changes: 18 additions & 53 deletions src/api/generated/sdk.gen.ts
Original file line number Diff line number Diff line change
@@ -1,74 +1,39 @@
// This file is auto-generated by @hey-api/openapi-ts

import {
createClient,
createConfig,
type OptionsLegacyParser,
} from "@hey-api/client-fetch";
import type {
GetMessagesDashboardMessagesGetError,
GetMessagesDashboardMessagesGetResponse,
GetAlertsDashboardAlertsGetError,
GetAlertsDashboardAlertsGetResponse,
StreamSseDashboardAlertsNotificationGetError,
StreamSseDashboardAlertsNotificationGetResponse,
} from "./types.gen";
import { createClient, createConfig, type OptionsLegacyParser } from '@hey-api/client-fetch';
import type { GetMessagesDashboardMessagesGetError, GetMessagesDashboardMessagesGetResponse, GetAlertsDashboardAlertsGetError, GetAlertsDashboardAlertsGetResponse, StreamSseDashboardAlertsNotificationGetError, StreamSseDashboardAlertsNotificationGetResponse } from './types.gen';

export const client = createClient(createConfig());

/**
* Get Messages
* Get all the messages from the database and return them as a list of conversations.
*/
export const getMessagesDashboardMessagesGet = <
ThrowOnError extends boolean = false,
>(
options?: OptionsLegacyParser<unknown, ThrowOnError>,
) => {
return (options?.client ?? client).get<
GetMessagesDashboardMessagesGetResponse,
GetMessagesDashboardMessagesGetError,
ThrowOnError
>({
...options,
url: "/dashboard/messages",
});
export const getMessagesDashboardMessagesGet = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => {
return (options?.client ?? client).get<GetMessagesDashboardMessagesGetResponse, GetMessagesDashboardMessagesGetError, ThrowOnError>({
...options,
url: '/dashboard/messages'
});
};

/**
* Get Alerts
* Get all the messages from the database and return them as a list of conversations.
*/
export const getAlertsDashboardAlertsGet = <
ThrowOnError extends boolean = false,
>(
options?: OptionsLegacyParser<unknown, ThrowOnError>,
) => {
return (options?.client ?? client).get<
GetAlertsDashboardAlertsGetResponse,
GetAlertsDashboardAlertsGetError,
ThrowOnError
>({
...options,
url: "/dashboard/alerts",
});
export const getAlertsDashboardAlertsGet = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => {
return (options?.client ?? client).get<GetAlertsDashboardAlertsGetResponse, GetAlertsDashboardAlertsGetError, ThrowOnError>({
...options,
url: '/dashboard/alerts'
});
};

/**
* Stream Sse
* Send alerts event
*/
export const streamSseDashboardAlertsNotificationGet = <
ThrowOnError extends boolean = false,
>(
options?: OptionsLegacyParser<unknown, ThrowOnError>,
) => {
return (options?.client ?? client).get<
StreamSseDashboardAlertsNotificationGetResponse,
StreamSseDashboardAlertsNotificationGetError,
ThrowOnError
>({
...options,
url: "/dashboard/alerts_notification",
});
};
export const streamSseDashboardAlertsNotificationGet = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<unknown, ThrowOnError>) => {
return (options?.client ?? client).get<StreamSseDashboardAlertsNotificationGetResponse, StreamSseDashboardAlertsNotificationGetError, ThrowOnError>({
...options,
url: '/dashboard/alerts_notification'
});
};
58 changes: 27 additions & 31 deletions src/api/generated/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,64 +4,60 @@
* Represents an alert with it's respective conversation.
*/
export type AlertConversation = {
conversation: Conversation;
alert_id: string;
code_snippet: CodeSnippet | null;
trigger_string:
| string
| {
[key: string]: unknown;
}
| null;
trigger_type: string;
trigger_category: string | null;
timestamp: string;
conversation: Conversation;
alert_id: string;
code_snippet: (CodeSnippet | null);
trigger_string: (string | {
[key: string]: unknown;
} | null);
trigger_type: string;
trigger_category: (string | null);
timestamp: string;
};

/**
* Represents a chat message.
*/
export type ChatMessage = {
message: string;
timestamp: string;
message_id: string;
message: string;
timestamp: string;
message_id: string;
};

export type CodeSnippet = {
code: string;
language: string | null;
filepath: string | null;
libraries?: Array<string>;
code: string;
language: (string | null);
filepath: (string | null);
libraries?: Array<(string)>;
};

/**
* Represents a conversation.
*/
export type Conversation = {
question_answers: Array<QuestionAnswer>;
provider: string | null;
type: string;
chat_id: string;
conversation_timestamp: string;
question_answers: Array<QuestionAnswer>;
provider: (string | null);
type: string;
chat_id: string;
conversation_timestamp: string;
};

/**
* Represents a question and answer pair.
*/
export type QuestionAnswer = {
question: ChatMessage;
answer: ChatMessage | null;
question: ChatMessage;
answer: (ChatMessage | null);
};

export type GetMessagesDashboardMessagesGetResponse = Array<Conversation>;
export type GetMessagesDashboardMessagesGetResponse = (Array<Conversation>);

export type GetMessagesDashboardMessagesGetError = unknown;

export type GetAlertsDashboardAlertsGetResponse =
Array<AlertConversation | null>;
export type GetAlertsDashboardAlertsGetResponse = (Array<(AlertConversation | null)>);

export type GetAlertsDashboardAlertsGetError = unknown;

export type StreamSseDashboardAlertsNotificationGetResponse = unknown;
export type StreamSseDashboardAlertsNotificationGetResponse = (unknown);

export type StreamSseDashboardAlertsNotificationGetError = unknown;
export type StreamSseDashboardAlertsNotificationGetError = unknown;

0 comments on commit 8e732f6

Please sign in to comment.