new lib version [CI SKIP]

This commit is contained in:
Nicolai Ort 2020-12-13 08:11:57 +00:00
parent 20f716d134
commit f5489e1b1e
88 changed files with 1750 additions and 0 deletions

20
dist/core/ApiError.ts vendored Normal file
View File

@ -0,0 +1,20 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { ApiResult } from './ApiResult';
export class ApiError extends Error {
public readonly url: string;
public readonly status: number;
public readonly statusText: string;
public readonly body: any;
constructor(response: ApiResult, message: string) {
super(message);
this.url = response.url;
this.status = response.status;
this.statusText = response.statusText;
this.body = response.body;
}
}

14
dist/core/ApiRequestOptions.ts vendored Normal file
View File

@ -0,0 +1,14 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type ApiRequestOptions = {
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
readonly path: string;
readonly cookies?: Record<string, any>;
readonly headers?: Record<string, any>;
readonly query?: Record<string, any>;
readonly formData?: Record<string, any>;
readonly body?: any;
readonly responseHeader?: string;
readonly errors?: Record<number, string>;
}

10
dist/core/ApiResult.ts vendored Normal file
View File

@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type ApiResult = {
readonly url: string;
readonly ok: boolean;
readonly status: number;
readonly statusText: string;
readonly body: any;
}

25
dist/core/OpenAPI.ts vendored Normal file
View File

@ -0,0 +1,25 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
type Resolver<T> = () => Promise<T>;
type Headers = Record<string, string>;
type Config = {
BASE: string;
VERSION: string;
WITH_CREDENTIALS: boolean;
TOKEN?: string | Resolver<string>;
USERNAME?: string | Resolver<string>;
PASSWORD?: string | Resolver<string>;
HEADERS?: Headers | Resolver<Headers>;
}
export const OpenAPI: Config = {
BASE: '',
VERSION: '1.0.0',
WITH_CREDENTIALS: false,
TOKEN: undefined,
USERNAME: undefined,
PASSWORD: undefined,
HEADERS: undefined,
};

202
dist/core/request.ts vendored Normal file
View File

@ -0,0 +1,202 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import { ApiError } from './ApiError';
import type { ApiRequestOptions } from './ApiRequestOptions';
import type { ApiResult } from './ApiResult';
import { OpenAPI } from './OpenAPI';
function isDefined<T>(value: T | null | undefined): value is Exclude<T, null | undefined> {
return value !== undefined && value !== null;
}
function isString(value: any): value is string {
return typeof value === 'string';
}
function isStringWithValue(value: any): value is string {
return isString(value) && value !== '';
}
function isBlob(value: any): value is Blob {
return value instanceof Blob;
}
function getQueryString(params: Record<string, any>): string {
const qs: string[] = [];
Object.keys(params).forEach(key => {
const value = params[key];
if (isDefined(value)) {
if (Array.isArray(value)) {
value.forEach(value => {
qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
});
} else {
qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
}
}
});
if (qs.length > 0) {
return `?${qs.join('&')}`;
}
return '';
}
function getUrl(options: ApiRequestOptions): string {
const path = options.path.replace(/[:]/g, '_');
const url = `${OpenAPI.BASE}${path}`;
if (options.query) {
return `${url}${getQueryString(options.query)}`;
}
return url;
}
function getFormData(params: Record<string, any>): FormData {
const formData = new FormData();
Object.keys(params).forEach(key => {
const value = params[key];
if (isDefined(value)) {
formData.append(key, value);
}
});
return formData;
}
type Resolver<T> = () => Promise<T>;
async function resolve<T>(resolver?: T | Resolver<T>): Promise<T | undefined> {
if (typeof resolver === 'function') {
return (resolver as Resolver<T>)();
}
return resolver;
}
async function getHeaders(options: ApiRequestOptions): Promise<Headers> {
const headers = new Headers({
Accept: 'application/json',
...OpenAPI.HEADERS,
...options.headers,
});
const token = await resolve(OpenAPI.TOKEN);
const username = await resolve(OpenAPI.USERNAME);
const password = await resolve(OpenAPI.PASSWORD);
if (isStringWithValue(token)) {
headers.append('Authorization', `Bearer ${token}`);
}
if (isStringWithValue(username) && isStringWithValue(password)) {
const credentials = btoa(`${username}:${password}`);
headers.append('Authorization', `Basic ${credentials}`);
}
if (options.body) {
if (isBlob(options.body)) {
headers.append('Content-Type', options.body.type || 'application/octet-stream');
} else if (isString(options.body)) {
headers.append('Content-Type', 'text/plain');
} else {
headers.append('Content-Type', 'application/json');
}
}
return headers;
}
function getRequestBody(options: ApiRequestOptions): BodyInit | undefined {
if (options.formData) {
return getFormData(options.formData);
}
if (options.body) {
if (isString(options.body) || isBlob(options.body)) {
return options.body;
} else {
return JSON.stringify(options.body);
}
}
return undefined;
}
async function sendRequest(options: ApiRequestOptions, url: string): Promise<Response> {
const request: RequestInit = {
method: options.method,
headers: await getHeaders(options),
body: getRequestBody(options),
};
return await fetch(url, request);
}
function getResponseHeader(response: Response, responseHeader?: string): string | null {
if (responseHeader) {
const content = response.headers.get(responseHeader);
if (isString(content)) {
return content;
}
}
return null;
}
async function getResponseBody(response: Response): Promise<any> {
try {
const contentType = response.headers.get('Content-Type');
if (contentType) {
const isJSON = contentType.toLowerCase().startsWith('application/json');
if (isJSON) {
return await response.json();
} else {
return await response.text();
}
}
} catch (error) {
console.error(error);
}
return null;
}
function catchErrors(options: ApiRequestOptions, result: ApiResult): void {
const errors: Record<number, string> = {
400: 'Bad Request',
401: 'Unauthorized',
403: 'Forbidden',
404: 'Not Found',
500: 'Internal Server Error',
502: 'Bad Gateway',
503: 'Service Unavailable',
...options.errors,
}
const error = errors[result.status];
if (error) {
throw new ApiError(result, error);
}
if (!result.ok) {
throw new ApiError(result, 'Generic Error');
}
}
/**
* Request using fetch client
* @param options The request options from the the service
* @result ApiResult
* @throws ApiError
*/
export async function request(options: ApiRequestOptions): Promise<ApiResult> {
const url = getUrl(options);
const response = await sendRequest(options, url);
const responseBody = await getResponseBody(response);
const responseHeader = getResponseHeader(response, options.responseHeader);
const result: ApiResult = {
url,
ok: response.ok,
status: response.status,
statusText: response.statusText,
body: responseHeader || responseBody,
};
catchErrors(options, result);
return result;
}

88
dist/index.ts vendored Normal file
View File

@ -0,0 +1,88 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export { ApiError } from './core/ApiError';
export { OpenAPI } from './core/OpenAPI';
export type { Address } from './models/Address';
export type { AddressNotFoundError } from './models/AddressNotFoundError';
export type { AddressWrongTypeError } from './models/AddressWrongTypeError';
export type { Auth } from './models/Auth';
export type { CreateAuth } from './models/CreateAuth';
export type { CreateParticipant } from './models/CreateParticipant';
export type { CreateRunner } from './models/CreateRunner';
export type { CreateRunnerGroup } from './models/CreateRunnerGroup';
export type { CreateRunnerOrganisation } from './models/CreateRunnerOrganisation';
export type { CreateRunnerTeam } from './models/CreateRunnerTeam';
export type { CreateTrack } from './models/CreateTrack';
export type { CreateUser } from './models/CreateUser';
export type { CreateUserGroup } from './models/CreateUserGroup';
export type { DistanceDonation } from './models/DistanceDonation';
export type { Donation } from './models/Donation';
export type { ExpiredJWTError } from './models/ExpiredJWTError';
export type { GroupContact } from './models/GroupContact';
export type { GroupContactNotFoundError } from './models/GroupContactNotFoundError';
export type { GroupContactWrongTypeError } from './models/GroupContactWrongTypeError';
export type { GroupNameNeededError } from './models/GroupNameNeededError';
export type { HandleLogout } from './models/HandleLogout';
export type { IllegalJWTError } from './models/IllegalJWTError';
export type { InvalidCredentialsError } from './models/InvalidCredentialsError';
export type { JwtNotProvidedError } from './models/JwtNotProvidedError';
export type { Logout } from './models/Logout';
export type { NoPermissionError } from './models/NoPermissionError';
export type { Participant } from './models/Participant';
export type { PasswordNeededError } from './models/PasswordNeededError';
export type { Permission } from './models/Permission';
export type { RefreshAuth } from './models/RefreshAuth';
export type { RefreshTokenCountInvalidError } from './models/RefreshTokenCountInvalidError';
export type { ResponseEmpty } from './models/ResponseEmpty';
export type { ResponseParticipant } from './models/ResponseParticipant';
export type { ResponseRunner } from './models/ResponseRunner';
export type { ResponseRunnerGroup } from './models/ResponseRunnerGroup';
export type { ResponseRunnerOrganisation } from './models/ResponseRunnerOrganisation';
export type { ResponseRunnerTeam } from './models/ResponseRunnerTeam';
export type { ResponseTrack } from './models/ResponseTrack';
export type { Runner } from './models/Runner';
export type { RunnerCard } from './models/RunnerCard';
export type { RunnerGroup } from './models/RunnerGroup';
export type { RunnerGroupNeededError } from './models/RunnerGroupNeededError';
export type { RunnerGroupNotFoundError } from './models/RunnerGroupNotFoundError';
export type { RunnerIdsNotMatchingError } from './models/RunnerIdsNotMatchingError';
export type { RunnerNotFoundError } from './models/RunnerNotFoundError';
export type { RunnerOrganisation } from './models/RunnerOrganisation';
export type { RunnerOrganisationHasRunnersError } from './models/RunnerOrganisationHasRunnersError';
export type { RunnerOrganisationHasTeamsError } from './models/RunnerOrganisationHasTeamsError';
export type { RunnerOrganisationIdsNotMatchingError } from './models/RunnerOrganisationIdsNotMatchingError';
export type { RunnerOrganisationNotFoundError } from './models/RunnerOrganisationNotFoundError';
export type { RunnerOrganisationWrongTypeError } from './models/RunnerOrganisationWrongTypeError';
export type { RunnerTeam } from './models/RunnerTeam';
export type { RunnerTeamHasRunnersError } from './models/RunnerTeamHasRunnersError';
export type { RunnerTeamIdsNotMatchingError } from './models/RunnerTeamIdsNotMatchingError';
export type { RunnerTeamNeedsParentError } from './models/RunnerTeamNeedsParentError';
export type { RunnerTeamNotFoundError } from './models/RunnerTeamNotFoundError';
export type { Scan } from './models/Scan';
export type { ScanStation } from './models/ScanStation';
export type { Track } from './models/Track';
export type { TrackIdsNotMatchingError } from './models/TrackIdsNotMatchingError';
export type { TrackNotFoundError } from './models/TrackNotFoundError';
export type { TrackScan } from './models/TrackScan';
export type { UpdateRunner } from './models/UpdateRunner';
export type { UpdateRunnerTeam } from './models/UpdateRunnerTeam';
export type { User } from './models/User';
export type { UserAction } from './models/UserAction';
export type { UserGroup } from './models/UserGroup';
export type { UserGroupIdsNotMatchingError } from './models/UserGroupIdsNotMatchingError';
export type { UserGroupNotFoundError } from './models/UserGroupNotFoundError';
export type { UserIdsNotMatchingError } from './models/UserIdsNotMatchingError';
export type { UsernameOrEmailNeededError } from './models/UsernameOrEmailNeededError';
export type { UserNonexistantOrRefreshtokenInvalidError } from './models/UserNonexistantOrRefreshtokenInvalidError';
export type { UserNotFoundError } from './models/UserNotFoundError';
export type { UserNotFoundOrRefreshTokenCountInvalidError } from './models/UserNotFoundOrRefreshTokenCountInvalidError';
export { AuthService } from './services/AuthService';
export { RunnerOrganisationService } from './services/RunnerOrganisationService';
export { RunnerService } from './services/RunnerService';
export { RunnerTeamService } from './services/RunnerTeamService';
export { TrackService } from './services/TrackService';
export { UserGroupService } from './services/UserGroupService';
export { UserService } from './services/UserService';

13
dist/models/Address.ts vendored Normal file
View File

@ -0,0 +1,13 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type Address = {
id: number;
description?: string;
address1: string;
address2?: string;
postalcode: string;
city: string;
country: string;
}

8
dist/models/AddressNotFoundError.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type AddressNotFoundError = {
name: string;
message: string;
}

8
dist/models/AddressWrongTypeError.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type AddressWrongTypeError = {
name: string;
message: string;
}

10
dist/models/Auth.ts vendored Normal file
View File

@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type Auth = {
access_token: string;
refresh_token: string;
access_token_expires_at: number;
refresh_token_expires_at: number;
}

9
dist/models/CreateAuth.ts vendored Normal file
View File

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type CreateAuth = {
username?: string;
password: string;
email?: string;
}

12
dist/models/CreateParticipant.ts vendored Normal file
View File

@ -0,0 +1,12 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type CreateParticipant = {
firstname: string;
middlename?: string;
lastname: string;
phone?: string;
email?: string;
address?: number;
}

13
dist/models/CreateRunner.ts vendored Normal file
View File

@ -0,0 +1,13 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type CreateRunner = {
group: number;
firstname: string;
middlename?: string;
lastname: string;
phone?: string;
email?: string;
address?: number;
}

8
dist/models/CreateRunnerGroup.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type CreateRunnerGroup = {
name: string;
contact?: number;
}

View File

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type CreateRunnerOrganisation = {
address?: number;
name: string;
contact?: number;
}

9
dist/models/CreateRunnerTeam.ts vendored Normal file
View File

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type CreateRunnerTeam = {
parentGroup: number;
name: string;
contact?: number;
}

8
dist/models/CreateTrack.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type CreateTrack = {
name: string;
distance: number;
}

14
dist/models/CreateUser.ts vendored Normal file
View File

@ -0,0 +1,14 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type CreateUser = {
firstname: string;
middlename?: string;
lastname: string;
username?: string;
email?: string;
phone?: string;
password: string;
groupId?: any;
}

8
dist/models/CreateUserGroup.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type CreateUserGroup = {
name: string;
description?: string;
}

10
dist/models/DistanceDonation.ts vendored Normal file
View File

@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type DistanceDonation = {
runner: string;
amountPerDistance: number;
id: number;
donor: string;
}

8
dist/models/Donation.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type Donation = {
id: number;
donor: string;
}

8
dist/models/ExpiredJWTError.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type ExpiredJWTError = {
name: string;
message: string;
}

13
dist/models/GroupContact.ts vendored Normal file
View File

@ -0,0 +1,13 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type GroupContact = {
id: number;
firstname: string;
middlename?: string;
lastname: string;
address?: any;
phone?: string;
email?: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type GroupContactNotFoundError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type GroupContactWrongTypeError = {
name: string;
message: string;
}

8
dist/models/GroupNameNeededError.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type GroupNameNeededError = {
name: string;
message: string;
}

7
dist/models/HandleLogout.ts vendored Normal file
View File

@ -0,0 +1,7 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type HandleLogout = {
token?: string;
}

8
dist/models/IllegalJWTError.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type IllegalJWTError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type InvalidCredentialsError = {
name: string;
message: string;
}

8
dist/models/JwtNotProvidedError.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type JwtNotProvidedError = {
name: string;
message: string;
}

7
dist/models/Logout.ts vendored Normal file
View File

@ -0,0 +1,7 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type Logout = {
timestamp: string;
}

8
dist/models/NoPermissionError.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type NoPermissionError = {
name: string;
message: string;
}

12
dist/models/Participant.ts vendored Normal file
View File

@ -0,0 +1,12 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type Participant = {
id: number;
firstname: string;
middlename?: string;
lastname: string;
phone?: string;
email?: string;
}

8
dist/models/PasswordNeededError.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type PasswordNeededError = {
name: string;
message: string;
}

9
dist/models/Permission.ts vendored Normal file
View File

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type Permission = {
id: number;
target: string;
action: string;
}

7
dist/models/RefreshAuth.ts vendored Normal file
View File

@ -0,0 +1,7 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RefreshAuth = {
token?: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RefreshTokenCountInvalidError = {
name: string;
message: string;
}

7
dist/models/ResponseEmpty.ts vendored Normal file
View File

@ -0,0 +1,7 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type ResponseEmpty = {
response: string;
}

12
dist/models/ResponseParticipant.ts vendored Normal file
View File

@ -0,0 +1,12 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type ResponseParticipant = {
id: number;
firstname: string;
middlename: string;
lastname: string;
phone: string;
email: string;
}

16
dist/models/ResponseRunner.ts vendored Normal file
View File

@ -0,0 +1,16 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { RunnerGroup } from './RunnerGroup';
export type ResponseRunner = {
distance: number;
group: RunnerGroup;
id: number;
firstname: string;
middlename: string;
lastname: string;
phone: string;
email: string;
}

11
dist/models/ResponseRunnerGroup.ts vendored Normal file
View File

@ -0,0 +1,11 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { GroupContact } from './GroupContact';
export type ResponseRunnerGroup = {
id: number;
name: string;
contact?: GroupContact;
}

View File

@ -0,0 +1,14 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { Address } from './Address';
import type { GroupContact } from './GroupContact';
export type ResponseRunnerOrganisation = {
address: Address;
teams: Array<any>;
id: number;
name: string;
contact?: GroupContact;
}

13
dist/models/ResponseRunnerTeam.ts vendored Normal file
View File

@ -0,0 +1,13 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { GroupContact } from './GroupContact';
import type { RunnerOrganisation } from './RunnerOrganisation';
export type ResponseRunnerTeam = {
parentGroup: RunnerOrganisation;
id: number;
name: string;
contact?: GroupContact;
}

9
dist/models/ResponseTrack.ts vendored Normal file
View File

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type ResponseTrack = {
id: number;
name: string;
distance: number;
}

14
dist/models/Runner.ts vendored Normal file
View File

@ -0,0 +1,14 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type Runner = {
group: string;
distance: number;
id: number;
firstname: string;
middlename?: string;
lastname: string;
phone?: string;
email?: string;
}

10
dist/models/RunnerCard.ts vendored Normal file
View File

@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerCard = {
id: number;
runner?: any;
code: string;
enabled: boolean;
}

9
dist/models/RunnerGroup.ts vendored Normal file
View File

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerGroup = {
id: number;
name: string;
contact?: any;
}

8
dist/models/RunnerGroupNeededError.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerGroupNeededError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerGroupNotFoundError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerIdsNotMatchingError = {
name: string;
message: string;
}

8
dist/models/RunnerNotFoundError.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerNotFoundError = {
name: string;
message: string;
}

10
dist/models/RunnerOrganisation.ts vendored Normal file
View File

@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerOrganisation = {
address?: any;
id: number;
name: string;
contact?: any;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerOrganisationHasRunnersError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerOrganisationHasTeamsError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerOrganisationIdsNotMatchingError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerOrganisationNotFoundError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerOrganisationWrongTypeError = {
name: string;
message: string;
}

10
dist/models/RunnerTeam.ts vendored Normal file
View File

@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerTeam = {
parentGroup: string;
id: number;
name: string;
contact?: any;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerTeamHasRunnersError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerTeamIdsNotMatchingError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerTeamNeedsParentError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type RunnerTeamNotFoundError = {
name: string;
message: string;
}

10
dist/models/Scan.ts vendored Normal file
View File

@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type Scan = {
id: number;
runner: string;
distance: number;
valid: boolean;
}

11
dist/models/ScanStation.ts vendored Normal file
View File

@ -0,0 +1,11 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type ScanStation = {
id: number;
description?: string;
track: string;
key: string;
enabled: boolean;
}

9
dist/models/Track.ts vendored Normal file
View File

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type Track = {
id: number;
name: string;
distance: number;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type TrackIdsNotMatchingError = {
name: string;
message: string;
}

8
dist/models/TrackNotFoundError.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type TrackNotFoundError = {
name: string;
message: string;
}

14
dist/models/TrackScan.ts vendored Normal file
View File

@ -0,0 +1,14 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type TrackScan = {
track: string;
card: string;
station: string;
distance: number;
timestamp: string;
id: number;
runner: string;
valid: boolean;
}

16
dist/models/UpdateRunner.ts vendored Normal file
View File

@ -0,0 +1,16 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { RunnerGroup } from './RunnerGroup';
export type UpdateRunner = {
id: number;
group: RunnerGroup;
firstname: string;
middlename?: string;
lastname: string;
phone?: string;
email?: string;
address?: number;
}

12
dist/models/UpdateRunnerTeam.ts vendored Normal file
View File

@ -0,0 +1,12 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { RunnerOrganisation } from './RunnerOrganisation';
export type UpdateRunnerTeam = {
id: number;
parentGroup: RunnerOrganisation;
name: string;
contact?: number;
}

21
dist/models/User.ts vendored Normal file
View File

@ -0,0 +1,21 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type User = {
id: number;
uuid: string;
email: string;
phone?: string;
username: string;
firstname: string;
middlename?: string;
lastname: string;
password: string;
permissions?: any;
groups?: any;
enabled: boolean;
refreshTokenCount: number;
profilePic?: string;
actions?: any;
}

10
dist/models/UserAction.ts vendored Normal file
View File

@ -0,0 +1,10 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type UserAction = {
id: number;
target: string;
action: string;
changed?: string;
}

9
dist/models/UserGroup.ts vendored Normal file
View File

@ -0,0 +1,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type UserGroup = {
id: number;
name: string;
description?: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type UserGroupIdsNotMatchingError = {
name: string;
message: string;
}

8
dist/models/UserGroupNotFoundError.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type UserGroupNotFoundError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type UserIdsNotMatchingError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type UserNonexistantOrRefreshtokenInvalidError = {
name: string;
message: string;
}

8
dist/models/UserNotFoundError.ts vendored Normal file
View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type UserNotFoundError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type UserNotFoundOrRefreshTokenCountInvalidError = {
name: string;
message: string;
}

View File

@ -0,0 +1,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type UsernameOrEmailNeededError = {
name: string;
message: string;
}

74
dist/services/AuthService.ts vendored Normal file
View File

@ -0,0 +1,74 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { Auth } from '../models/Auth';
import type { CreateAuth } from '../models/CreateAuth';
import type { HandleLogout } from '../models/HandleLogout';
import type { IllegalJWTError } from '../models/IllegalJWTError';
import type { InvalidCredentialsError } from '../models/InvalidCredentialsError';
import type { JwtNotProvidedError } from '../models/JwtNotProvidedError';
import type { Logout } from '../models/Logout';
import type { PasswordNeededError } from '../models/PasswordNeededError';
import type { RefreshAuth } from '../models/RefreshAuth';
import type { RefreshTokenCountInvalidError } from '../models/RefreshTokenCountInvalidError';
import type { UsernameOrEmailNeededError } from '../models/UsernameOrEmailNeededError';
import type { UserNotFoundError } from '../models/UserNotFoundError';
import { request as __request } from '../core/request';
export class AuthService {
/**
* Login
* Create a new access token object
* @param requestBody CreateAuth
* @result any
* @throws ApiError
*/
public static async authControllerLogin(
requestBody?: CreateAuth,
): Promise<(Auth | InvalidCredentialsError | UserNotFoundError | UsernameOrEmailNeededError | PasswordNeededError | InvalidCredentialsError)> {
const result = await __request({
method: 'POST',
path: `/api/auth/login`,
body: requestBody,
});
return result.body;
}
/**
* Logout
* Create a new access token object
* @param requestBody HandleLogout
* @result any
* @throws ApiError
*/
public static async authControllerLogout(
requestBody?: HandleLogout,
): Promise<(Logout | InvalidCredentialsError | UserNotFoundError | UsernameOrEmailNeededError | PasswordNeededError | InvalidCredentialsError)> {
const result = await __request({
method: 'POST',
path: `/api/auth/logout`,
body: requestBody,
});
return result.body;
}
/**
* Refresh
* refresh a access token
* @param requestBody RefreshAuth
* @result any
* @throws ApiError
*/
public static async authControllerRefresh(
requestBody?: RefreshAuth,
): Promise<(Auth | JwtNotProvidedError | IllegalJWTError | UserNotFoundError | RefreshTokenCountInvalidError)> {
const result = await __request({
method: 'POST',
path: `/api/auth/refresh`,
body: requestBody,
});
return result.body;
}
}

View File

@ -0,0 +1,104 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { CreateRunnerOrganisation } from '../models/CreateRunnerOrganisation';
import type { ResponseEmpty } from '../models/ResponseEmpty';
import type { ResponseRunnerOrganisation } from '../models/ResponseRunnerOrganisation';
import type { RunnerOrganisation } from '../models/RunnerOrganisation';
import { request as __request } from '../core/request';
export class RunnerOrganisationService {
/**
* Get all
* Lists all runnerOrganisations.
* @result ResponseRunnerOrganisation
* @throws ApiError
*/
public static async runnerOrganisationControllerGetAll(): Promise<Array<ResponseRunnerOrganisation>> {
const result = await __request({
method: 'GET',
path: `/api/organisations`,
});
return result.body;
}
/**
* Post
* Create a new runnerOrganisation object (id will be generated automagicly).
* @param requestBody CreateRunnerOrganisation
* @result ResponseRunnerOrganisation
* @throws ApiError
*/
public static async runnerOrganisationControllerPost(
requestBody?: CreateRunnerOrganisation,
): Promise<ResponseRunnerOrganisation> {
const result = await __request({
method: 'POST',
path: `/api/organisations`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Returns a runnerOrganisation of a specified id (if it exists)
* @param id
* @result ResponseRunnerOrganisation
* @throws ApiError
*/
public static async runnerOrganisationControllerGetOne(
id: number,
): Promise<ResponseRunnerOrganisation> {
const result = await __request({
method: 'GET',
path: `/api/organisations/${id}`,
});
return result.body;
}
/**
* Put
* Update a runnerOrganisation object (id can't be changed).
* @param id
* @param requestBody RunnerOrganisation
* @result ResponseRunnerOrganisation
* @throws ApiError
*/
public static async runnerOrganisationControllerPut(
id: number,
requestBody?: RunnerOrganisation,
): Promise<ResponseRunnerOrganisation> {
const result = await __request({
method: 'PUT',
path: `/api/organisations/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete a specified runnerOrganisation (if it exists).
* @param id
* @param force
* @result ResponseRunnerOrganisation
* @result ResponseEmpty
* @throws ApiError
*/
public static async runnerOrganisationControllerRemove(
id: number,
force?: boolean,
): Promise<ResponseRunnerOrganisation | ResponseEmpty> {
const result = await __request({
method: 'DELETE',
path: `/api/organisations/${id}`,
query: {
'force': force,
},
});
return result.body;
}
}

106
dist/services/RunnerService.ts vendored Normal file
View File

@ -0,0 +1,106 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { CreateRunner } from '../models/CreateRunner';
import type { ResponseEmpty } from '../models/ResponseEmpty';
import type { ResponseRunner } from '../models/ResponseRunner';
import type { RunnerGroupNeededError } from '../models/RunnerGroupNeededError';
import type { RunnerGroupNotFoundError } from '../models/RunnerGroupNotFoundError';
import type { UpdateRunner } from '../models/UpdateRunner';
import { request as __request } from '../core/request';
export class RunnerService {
/**
* Get all
* Lists all runners.
* @result ResponseRunner
* @throws ApiError
*/
public static async runnerControllerGetAll(): Promise<Array<ResponseRunner>> {
const result = await __request({
method: 'GET',
path: `/api/runners`,
});
return result.body;
}
/**
* Post
* Create a new runner object (id will be generated automagicly).
* @param requestBody CreateRunner
* @result any
* @throws ApiError
*/
public static async runnerControllerPost(
requestBody?: CreateRunner,
): Promise<(ResponseRunner | RunnerGroupNeededError | RunnerGroupNotFoundError)> {
const result = await __request({
method: 'POST',
path: `/api/runners`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Returns a runner of a specified id (if it exists)
* @param id
* @result ResponseRunner
* @throws ApiError
*/
public static async runnerControllerGetOne(
id: number,
): Promise<ResponseRunner> {
const result = await __request({
method: 'GET',
path: `/api/runners/${id}`,
});
return result.body;
}
/**
* Put
* Update a runner object (id can't be changed).
* @param id
* @param requestBody UpdateRunner
* @result ResponseRunner
* @throws ApiError
*/
public static async runnerControllerPut(
id: number,
requestBody?: UpdateRunner,
): Promise<ResponseRunner> {
const result = await __request({
method: 'PUT',
path: `/api/runners/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete a specified runner (if it exists).
* @param id
* @param force
* @result ResponseRunner
* @result ResponseEmpty
* @throws ApiError
*/
public static async runnerControllerRemove(
id: number,
force?: boolean,
): Promise<ResponseRunner | ResponseEmpty> {
const result = await __request({
method: 'DELETE',
path: `/api/runners/${id}`,
query: {
'force': force,
},
});
return result.body;
}
}

104
dist/services/RunnerTeamService.ts vendored Normal file
View File

@ -0,0 +1,104 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { CreateRunnerTeam } from '../models/CreateRunnerTeam';
import type { ResponseEmpty } from '../models/ResponseEmpty';
import type { ResponseRunnerTeam } from '../models/ResponseRunnerTeam';
import type { UpdateRunnerTeam } from '../models/UpdateRunnerTeam';
import { request as __request } from '../core/request';
export class RunnerTeamService {
/**
* Get all
* Lists all runnerTeams.
* @result ResponseRunnerTeam
* @throws ApiError
*/
public static async runnerTeamControllerGetAll(): Promise<Array<ResponseRunnerTeam>> {
const result = await __request({
method: 'GET',
path: `/api/teams`,
});
return result.body;
}
/**
* Post
* Create a new runnerTeam object (id will be generated automagicly).
* @param requestBody CreateRunnerTeam
* @result ResponseRunnerTeam
* @throws ApiError
*/
public static async runnerTeamControllerPost(
requestBody?: CreateRunnerTeam,
): Promise<ResponseRunnerTeam> {
const result = await __request({
method: 'POST',
path: `/api/teams`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Returns a runnerTeam of a specified id (if it exists)
* @param id
* @result ResponseRunnerTeam
* @throws ApiError
*/
public static async runnerTeamControllerGetOne(
id: number,
): Promise<ResponseRunnerTeam> {
const result = await __request({
method: 'GET',
path: `/api/teams/${id}`,
});
return result.body;
}
/**
* Put
* Update a runnerTeam object (id can't be changed).
* @param id
* @param requestBody UpdateRunnerTeam
* @result ResponseRunnerTeam
* @throws ApiError
*/
public static async runnerTeamControllerPut(
id: number,
requestBody?: UpdateRunnerTeam,
): Promise<ResponseRunnerTeam> {
const result = await __request({
method: 'PUT',
path: `/api/teams/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete a specified runnerTeam (if it exists).
* @param id
* @param force
* @result ResponseRunnerTeam
* @result ResponseEmpty
* @throws ApiError
*/
public static async runnerTeamControllerRemove(
id: number,
force?: boolean,
): Promise<ResponseRunnerTeam | ResponseEmpty> {
const result = await __request({
method: 'DELETE',
path: `/api/teams/${id}`,
query: {
'force': force,
},
});
return result.body;
}
}

99
dist/services/TrackService.ts vendored Normal file
View File

@ -0,0 +1,99 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { CreateTrack } from '../models/CreateTrack';
import type { ResponseEmpty } from '../models/ResponseEmpty';
import type { ResponseTrack } from '../models/ResponseTrack';
import type { Track } from '../models/Track';
import { request as __request } from '../core/request';
export class TrackService {
/**
* Get all
* Lists all tracks.
* @result ResponseTrack
* @throws ApiError
*/
public static async trackControllerGetAll(): Promise<Array<ResponseTrack>> {
const result = await __request({
method: 'GET',
path: `/api/tracks`,
});
return result.body;
}
/**
* Post
* Create a new track object (id will be generated automagicly).
* @param requestBody CreateTrack
* @result ResponseTrack
* @throws ApiError
*/
public static async trackControllerPost(
requestBody?: CreateTrack,
): Promise<ResponseTrack> {
const result = await __request({
method: 'POST',
path: `/api/tracks`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Returns a track of a specified id (if it exists)
* @param id
* @result ResponseTrack
* @throws ApiError
*/
public static async trackControllerGetOne(
id: number,
): Promise<ResponseTrack> {
const result = await __request({
method: 'GET',
path: `/api/tracks/${id}`,
});
return result.body;
}
/**
* Put
* Update a track object (id can't be changed).
* @param id
* @param requestBody Track
* @result ResponseTrack
* @throws ApiError
*/
public static async trackControllerPut(
id: number,
requestBody?: Track,
): Promise<ResponseTrack> {
const result = await __request({
method: 'PUT',
path: `/api/tracks/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete a specified track (if it exists).
* @param id
* @result ResponseTrack
* @result ResponseEmpty
* @throws ApiError
*/
public static async trackControllerRemove(
id: number,
): Promise<ResponseTrack | ResponseEmpty> {
const result = await __request({
method: 'DELETE',
path: `/api/tracks/${id}`,
});
return result.body;
}
}

99
dist/services/UserGroupService.ts vendored Normal file
View File

@ -0,0 +1,99 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { CreateUserGroup } from '../models/CreateUserGroup';
import type { ResponseEmpty } from '../models/ResponseEmpty';
import type { UserGroup } from '../models/UserGroup';
import type { UserGroupNotFoundError } from '../models/UserGroupNotFoundError';
import { request as __request } from '../core/request';
export class UserGroupService {
/**
* Get all
* Lists all usergroups.
* @result UserGroup
* @throws ApiError
*/
public static async userGroupControllerGetAll(): Promise<Array<UserGroup>> {
const result = await __request({
method: 'GET',
path: `/api/usergroups`,
});
return result.body;
}
/**
* Post
* Create a new usergroup object (id will be generated automagicly).
* @param requestBody CreateUserGroup
* @result any
* @throws ApiError
*/
public static async userGroupControllerPost(
requestBody?: CreateUserGroup,
): Promise<(UserGroup | UserGroupNotFoundError)> {
const result = await __request({
method: 'POST',
path: `/api/usergroups`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Returns a usergroup of a specified id (if it exists)
* @param id
* @result UserGroup
* @throws ApiError
*/
public static async userGroupControllerGetOne(
id: number,
): Promise<UserGroup> {
const result = await __request({
method: 'GET',
path: `/api/usergroups/${id}`,
});
return result.body;
}
/**
* Put
* Update a usergroup object (id can't be changed).
* @param id
* @param requestBody UserGroup
* @result UserGroup
* @throws ApiError
*/
public static async userGroupControllerPut(
id: number,
requestBody?: UserGroup,
): Promise<UserGroup> {
const result = await __request({
method: 'PUT',
path: `/api/usergroups/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete a specified usergroup (if it exists).
* @param id
* @result UserGroup
* @result ResponseEmpty
* @throws ApiError
*/
public static async userGroupControllerRemove(
id: number,
): Promise<UserGroup | ResponseEmpty> {
const result = await __request({
method: 'DELETE',
path: `/api/usergroups/${id}`,
});
return result.body;
}
}

99
dist/services/UserService.ts vendored Normal file
View File

@ -0,0 +1,99 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { CreateUser } from '../models/CreateUser';
import type { ResponseEmpty } from '../models/ResponseEmpty';
import type { User } from '../models/User';
import type { UserGroupNotFoundError } from '../models/UserGroupNotFoundError';
import { request as __request } from '../core/request';
export class UserService {
/**
* Get all
* Lists all users.
* @result User
* @throws ApiError
*/
public static async userControllerGetAll(): Promise<Array<User>> {
const result = await __request({
method: 'GET',
path: `/api/users`,
});
return result.body;
}
/**
* Post
* Create a new user object (id will be generated automagicly).
* @param requestBody CreateUser
* @result any
* @throws ApiError
*/
public static async userControllerPost(
requestBody?: CreateUser,
): Promise<(User | UserGroupNotFoundError)> {
const result = await __request({
method: 'POST',
path: `/api/users`,
body: requestBody,
});
return result.body;
}
/**
* Get one
* Returns a user of a specified id (if it exists)
* @param id
* @result User
* @throws ApiError
*/
public static async userControllerGetOne(
id: number,
): Promise<User> {
const result = await __request({
method: 'GET',
path: `/api/users/${id}`,
});
return result.body;
}
/**
* Put
* Update a user object (id can't be changed).
* @param id
* @param requestBody User
* @result User
* @throws ApiError
*/
public static async userControllerPut(
id: number,
requestBody?: User,
): Promise<User> {
const result = await __request({
method: 'PUT',
path: `/api/users/${id}`,
body: requestBody,
});
return result.body;
}
/**
* Remove
* Delete a specified runner (if it exists).
* @param id
* @result User
* @result ResponseEmpty
* @throws ApiError
*/
public static async userControllerRemove(
id: number,
): Promise<User | ResponseEmpty> {
const result = await __request({
method: 'DELETE',
path: `/api/users/${id}`,
});
return result.body;
}
}

1
openapi.json Normal file

File diff suppressed because one or more lines are too long