diff --git a/webclient/README.md b/webclient/README.md index 61fec2352..8b88465e3 100644 --- a/webclient/README.md +++ b/webclient/README.md @@ -55,10 +55,11 @@ pnpm run dev pnpm run build ``` -### Linting with [ESLint](https://eslint.org/) +### Linting with [ESLint](https://eslint.org/) and formatting via prettier ```sh pnpm run lint +pnpm run format ``` ### Update the API's type definitions @@ -68,6 +69,7 @@ From the folder of this README, run: ```sh npx openapi-typescript ../openapi.yaml --output ./src/api_types/index.ts --export-type --immutable-types --support-array-length pnpm run lint +pnpm run format ``` ## Build files & Serving release build diff --git a/webclient/src/api_types/index.ts b/webclient/src/api_types/index.ts index 74acbea0a..a21db36d1 100644 --- a/webclient/src/api_types/index.ts +++ b/webclient/src/api_types/index.ts @@ -3,7 +3,6 @@ * Do not make direct changes to the file. */ - export type paths = { "/api/search": { /** @@ -288,7 +287,7 @@ export type components = { * @description null would mean no overlay maps are displayed by default. * For rooms you should add a warning that no floor map is available for this room */ - readonly overlays?: ({ + readonly overlays?: { /** * @description The floor-id of the map, that should be shown as a default. * null: @@ -299,7 +298,7 @@ export type components = { */ readonly default: number | null; readonly available: readonly components["schemas"]["OverlayMapEntry"][]; - }) | null; + } | null; }; readonly RoomfinderMap: { /** @@ -388,7 +387,12 @@ export type components = { */ readonly file: string; /** @description Coordinates are four [lon, lat] pairs, for the top left, top right, bottom right, bottom left image corners. */ - readonly coordinates: readonly [readonly [number, number], readonly [number, number], readonly [number, number], readonly [number, number]]; + readonly coordinates: readonly [ + readonly [number, number], + readonly [number, number], + readonly [number, number], + readonly [number, number], + ]; }; readonly Rooms: { /** @@ -465,7 +469,7 @@ export type components = { */ readonly time_ms: number; }; - readonly DetailsResponse: components["schemas"]["BaseDetailsResponse"] & ({ + readonly DetailsResponse: components["schemas"]["BaseDetailsResponse"] & { /** @description The id, that was requested */ readonly id: string; /** @@ -483,20 +487,20 @@ export type components = { readonly poi?: { readonly mvg: readonly [components["schemas"]["Station"], ...components["schemas"]["Station"][]]; }; - }); + }; readonly BuildingsOverview: { readonly entries: readonly (components["schemas"]["ChildEntry"] & { - /** - * @description What should be displayed below this Building - * @example Gebäudekomplex mit 512 Räumen - */ - readonly subtext: string; - /** - * @description The thumbnail for the building - * @example mi_0.webp - */ - readonly thumb?: string; - })[]; + /** + * @description What should be displayed below this Building + * @example Gebäudekomplex mit 512 Räumen + */ + readonly subtext: string; + /** + * @description The thumbnail for the building + * @example mi_0.webp + */ + readonly thumb?: string; + })[]; /** * Format: int64 * @description A recommendation how many of the entries should be displayed by default. @@ -510,32 +514,32 @@ export type components = { }; readonly RoomsOverview: { readonly usages?: readonly { - /** - * @description Category Name - * @example Büro - */ - readonly name: string; - /** - * @description How many children this category has - * @example 126 - */ - readonly count: number; - readonly children: readonly components["schemas"]["ChildEntry"][]; - }[]; + /** + * @description Category Name + * @example Büro + */ + readonly name: string; + /** + * @description How many children this category has + * @example 126 + */ + readonly count: number; + readonly children: readonly components["schemas"]["ChildEntry"][]; + }[]; }; readonly FeaturedOverview: { readonly entries: readonly (components["schemas"]["ChildEntry"] & { - /** - * @description What should be displayed below this Building - * @example Gebäudekomplex mit 512 Räumen - */ - readonly subtext: string; - /** - * @description The thumbnail for the building - * @example mi_0.webp - */ - readonly image_url: string; - })[]; + /** + * @description What should be displayed below this Building + * @example Gebäudekomplex mit 512 Räumen + */ + readonly subtext: string; + /** + * @description The thumbnail for the building + * @example mi_0.webp + */ + readonly image_url: string; + })[]; }; readonly ChildEntry: { /** @@ -555,22 +559,22 @@ export type components = { * The first entry is the site with the most importance */ readonly SitesOverview: readonly (components["schemas"]["ChildEntry"] & { - /** - * Format: int64 - * @description A recommendation how many of the entries should be displayed by default. - * The number is usually from 0-5. - * More results might be displayed when clicking "expand". - * If this field is not present, then all entries are displayed. - * - * @example 6 - */ - readonly n_visible: number; - /** - * @description A select list of buildings, that are in this site. - * Derived from the areatree. - */ - readonly children: readonly components["schemas"]["ChildEntry"][]; - })[]; + /** + * Format: int64 + * @description A recommendation how many of the entries should be displayed by default. + * The number is usually from 0-5. + * More results might be displayed when clicking "expand". + * If this field is not present, then all entries are displayed. + * + * @example 6 + */ + readonly n_visible: number; + /** + * @description A select list of buildings, that are in this site. + * Derived from the areatree. + */ + readonly children: readonly components["schemas"]["ChildEntry"][]; + })[]; readonly RootResponse: components["schemas"]["BaseDetailsResponse"] & { /** * @description The id, that was requested @@ -614,17 +618,17 @@ export type components = { readonly patched?: boolean; /** @description What is the basis of the data we have */ readonly base: readonly { - /** - * @description The name of the provider - * @example NavigaTUM - */ - readonly name: string; - /** - * @description The url of the provider - * @example https://nav.tum.de - */ - readonly url?: string; - }[]; + /** + * @description The name of the provider + * @example NavigaTUM + */ + readonly name: string; + /** + * @description The url of the provider + * @example https://nav.tum.de + */ + readonly url?: string; + }[]; }; /** * @description The url, this item should be displayed at. @@ -755,7 +759,7 @@ export type components = { */ readonly additional_context: string; }; - readonly PostFeedbackRequest: components["schemas"]["TokenRequest"] & ({ + readonly PostFeedbackRequest: components["schemas"]["TokenRequest"] & { /** * @description The category of the feedback. * Enum attribute is softly enforced: Any value not listed below will be replaced by "other" @@ -781,7 +785,7 @@ export type components = { * @example true */ readonly deletion_requested: boolean; - }); + }; readonly TokenRequest: { /** * @description The JWT token, that can be used to generate feedback @@ -804,13 +808,13 @@ export type components = { /** Format: double */ readonly lon: number; readonly sub_stations: readonly { - readonly station_id: string; - readonly name: string; - /** Format: double */ - readonly lat: number; - /** Format: double */ - readonly lon: number; - }[]; + readonly station_id: string; + readonly name: string; + /** Format: double */ + readonly lat: number; + /** Format: double */ + readonly lon: number; + }[]; }; }; responses: never; @@ -825,7 +829,6 @@ export type $defs = Record; export type external = Record; export type operations = { - /** * Search entries * @description This endpoint is designed to support search-as-you-type results. @@ -1095,7 +1098,11 @@ export type operations = { */ 403: { content: { - readonly "text/plain": "Invalid token" | "Token not old enough, please wait" | "Token expired" | "Token already used"; + readonly "text/plain": + | "Invalid token" + | "Token not old enough, please wait" + | "Token expired" + | "Token already used"; }; }; /** @@ -1170,7 +1177,11 @@ export type operations = { */ 403: { content: { - readonly "text/plain": "Invalid token" | "Token not old enough, please wait" | "Token expired" | "Token already used"; + readonly "text/plain": + | "Invalid token" + | "Token not old enough, please wait" + | "Token expired" + | "Token already used"; }; }; /**