Skip to content

Commit

Permalink
made sure that npm run format is documented
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Jan 24, 2024
1 parent 3ecc1c6 commit fbc7c7d
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 80 deletions.
4 changes: 3 additions & 1 deletion webclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
169 changes: 90 additions & 79 deletions webclient/src/api_types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* Do not make direct changes to the file.
*/


export type paths = {
"/api/search": {
/**
Expand Down Expand Up @@ -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:
Expand All @@ -299,7 +298,7 @@ export type components = {
*/
readonly default: number | null;
readonly available: readonly components["schemas"]["OverlayMapEntry"][];
}) | null;
} | null;
};
readonly RoomfinderMap: {
/**
Expand Down Expand Up @@ -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: {
/**
Expand Down Expand Up @@ -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;
/**
Expand All @@ -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.
Expand All @@ -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: {
/**
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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;
Expand All @@ -825,7 +829,6 @@ export type $defs = Record<string, never>;
export type external = Record<string, never>;

export type operations = {

/**
* Search entries
* @description This endpoint is designed to support search-as-you-type results.
Expand Down Expand Up @@ -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";
};
};
/**
Expand Down Expand Up @@ -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";
};
};
/**
Expand Down

0 comments on commit fbc7c7d

Please sign in to comment.