forked from eclipse-apoapsis/ort-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ui): Regenerate query client
OpenAPI query client library update to v1 (PR eclipse-apoapsis#157) introduced major changes to the structure and functionality of the query client. Moreover, PR eclipse-apoapsis#181 introduced a fix to OpenAPI generation of nullable values, which brought major changes to the Swagger JSON. This commit regenerates the query client from scratch to adapt to these changes. The command used for regenerating is: pnpm codegen Signed-off-by: Jyrki Keisala <[email protected]>
- Loading branch information
Showing
47 changed files
with
8,276 additions
and
3,955 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export type ApiResult = { | ||
readonly url: string; | ||
export type ApiResult<TData = any> = { | ||
readonly body: TData; | ||
readonly ok: boolean; | ||
readonly status: number; | ||
readonly statusText: string; | ||
readonly body: any; | ||
readonly url: string; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,56 @@ | ||
/* istanbul ignore file */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import type { ApiRequestOptions } from './ApiRequestOptions'; | ||
|
||
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>; | ||
type Headers = Record<string, string>; | ||
type Middleware<T> = (value: T) => T | Promise<T>; | ||
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>; | ||
|
||
export class Interceptors<T> { | ||
_fns: Middleware<T>[]; | ||
|
||
constructor() { | ||
this._fns = []; | ||
} | ||
|
||
eject(fn: Middleware<T>) { | ||
const index = this._fns.indexOf(fn); | ||
if (index !== -1) { | ||
this._fns = [...this._fns.slice(0, index), ...this._fns.slice(index + 1)]; | ||
} | ||
} | ||
|
||
use(fn: Middleware<T>) { | ||
this._fns = [...this._fns, fn]; | ||
} | ||
} | ||
|
||
export type OpenAPIConfig = { | ||
BASE: string; | ||
CREDENTIALS: 'include' | 'omit' | 'same-origin'; | ||
ENCODE_PATH?: ((path: string) => string) | undefined; | ||
HEADERS?: Headers | Resolver<Headers> | undefined; | ||
PASSWORD?: string | Resolver<string> | undefined; | ||
TOKEN?: string | Resolver<string> | undefined; | ||
USERNAME?: string | Resolver<string> | undefined; | ||
VERSION: string; | ||
WITH_CREDENTIALS: boolean; | ||
CREDENTIALS: 'include' | 'omit' | 'same-origin'; | ||
TOKEN?: string | Resolver<string>; | ||
USERNAME?: string | Resolver<string>; | ||
PASSWORD?: string | Resolver<string>; | ||
HEADERS?: Headers | Resolver<Headers>; | ||
ENCODE_PATH?: (path: string) => string; | ||
interceptors: { | ||
request: Interceptors<RequestInit>; | ||
response: Interceptors<Response>; | ||
}; | ||
}; | ||
|
||
export const OpenAPI: OpenAPIConfig = { | ||
BASE: 'http://localhost:8080', | ||
VERSION: '1.0.0-SNAPSHOT+1918.sha.4aaf8e7', | ||
WITH_CREDENTIALS: false, | ||
CREDENTIALS: 'include', | ||
ENCODE_PATH: undefined, | ||
HEADERS: undefined, | ||
PASSWORD: undefined, | ||
TOKEN: undefined, | ||
USERNAME: undefined, | ||
PASSWORD: undefined, | ||
HEADERS: undefined, | ||
ENCODE_PATH: undefined, | ||
VERSION: '0.1.0-SNAPSHOT+001.sha.523cacc', | ||
WITH_CREDENTIALS: false, | ||
interceptors: { | ||
request: new Interceptors(), | ||
response: new Interceptors(), | ||
}, | ||
}; |
Oops, something went wrong.