Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not found handler #34

Merged
merged 10 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ workspace.resolver = "2"
[workspace.dependencies]
clap = { version = "4.5.3", features = ["derive"] }
axum = { version = "0.7.5", features = ["ws"] }
matchit = { version = "0.7.3" }
tokio = { version = "1", features = ["full"] }
tokio-stream = { version = "0.1.15", features = ["sync"] }
futures = "0.3.30"
Expand All @@ -31,3 +32,4 @@ toml = { version = "0.8.12" }
mime_guess = "2.0.4"
tempfile = "3.10.1"
insta = { version = "1.38.0", features = ["yaml"] }
miette = { version = "7.2.0", features = ["fancy", "syntect-highlighter"] }
58 changes: 25 additions & 33 deletions crates/bsnext_client/generated/dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,38 +51,19 @@ export interface ServerDTO {
socket_addr: string;
}

export interface GetServersMessageResponse {
export interface GetServersMessageResponseDTO {
servers: ServerDTO[];
}

export interface ServersChanged {
servers_resp: GetServersMessageResponse;
export interface ServersChangedDTO {
servers_resp: GetServersMessageResponseDTO;
}

export enum EventLevel {
External = "BSLIVE_EXTERNAL",
}

export type ExternalEvents =
| { kind: "ServersChanged", payload: ServersChanged }
| { kind: "Watching", payload: Watching }
| { kind: "WatchingStopped", payload: StoppedWatching }
| { kind: "FileChanged", payload: FileChanged }
| { kind: "FilesChanged", payload: FilesChangedDTO }
| { kind: "InputFileChanged", payload: FileChanged }
| { kind: "InputAccepted", payload: InputAccepted }
| { kind: "InputError", payload: InputErrorDTO };

export interface ExternalEvent {
level: EventLevel;
fields: ExternalEvents;
}

export interface InputAccepted {
export interface InputAcceptedDTO {
path: string;
}

export interface FileChanged {
export interface FileChangedDTO {
path: string;
}

Expand All @@ -95,12 +76,12 @@ export interface DebounceDTO {
ms: string;
}

export interface Watching {
export interface WatchingDTO {
paths: string[];
debounce: DebounceDTO;
}

export interface StoppedWatching {
export interface StoppedWatchingDTO {
paths: string[];
}

Expand Down Expand Up @@ -139,14 +120,24 @@ export interface ClientConfigDTO {
* todo(alpha): clean this up
*/
export type InternalEventsDTO =
| { kind: "ServersChanged", payload: GetServersMessageResponse };
| { kind: "ServersChanged", payload: GetServersMessageResponseDTO };

export type StartupEvent =
| { kind: "Started", payload?: undefined }
| { kind: "FailedStartup", payload: StartupErrorDTO };
export enum EventLevel {
External = "BSLIVE_EXTERNAL",
}

export type StartupErrorDTO =
| { kind: "InputError", payload: InputErrorDTO };
export type ExternalEventsDTO =
| { kind: "ServersChanged", payload: ServersChangedDTO }
| { kind: "Watching", payload: WatchingDTO }
| { kind: "WatchingStopped", payload: StoppedWatchingDTO }
| { kind: "FileChanged", payload: FileChangedDTO }
| { kind: "FilesChanged", payload: FilesChangedDTO }
| { kind: "InputFileChanged", payload: FileChangedDTO }
| { kind: "InputAccepted", payload: InputAcceptedDTO };

export type StartupEventDTO =
| { kind: "Started", payload?: undefined }
| { kind: "FailedStartup", payload: string };

export type InputErrorDTO =
| { kind: "MissingInputs", payload: string }
Expand All @@ -161,7 +152,8 @@ export type InputErrorDTO =
| { kind: "Io", payload: string }
| { kind: "UnsupportedExtension", payload: string }
| { kind: "MissingExtension", payload: string }
| { kind: "EmptyInput", payload: string };
| { kind: "EmptyInput", payload: string }
| { kind: "BsLiveRules", payload: string };

export type ClientEvent =
| { kind: "Change", payload: ChangeDTO }
Expand Down
Loading