From d6644bc785d9366dda64e67fdae511d95ba25b83 Mon Sep 17 00:00:00 2001 From: "Felix T.J. Dietrich" Date: Sat, 26 Oct 2024 17:39:07 +0200 Subject: [PATCH] update api client --- .../modules/openapi/.openapi-generator/FILES | 26 +- .../core/modules/openapi/api/admin.service.ts | 10 +- .../openapi/api/admin.serviceInterface.ts | 4 +- .../src/app/core/modules/openapi/api/api.ts | 5 +- .../core/modules/openapi/api/meta.service.ts | 10 +- .../openapi/api/meta.serviceInterface.ts | 4 +- .../openapi/api/pull-request.service.ts | 224 ------------------ .../api/pull-request.serviceInterface.ts | 41 ---- .../core/modules/openapi/api/user.service.ts | 140 +---------- .../openapi/api/user.serviceInterface.ts | 20 +- .../{user-info-dto.ts => auth-user-info.ts} | 2 +- .../openapi/model/issue-comment-dto.ts | 24 -- .../modules/openapi/model/issue-comment.ts | 24 -- .../{pull-request-label.ts => label-info.ts} | 7 +- .../openapi/model/leaderboard-entry.ts | 29 +-- .../model/{meta-data-dto.ts => meta-data.ts} | 2 +- .../app/core/modules/openapi/model/models.ts | 24 +- .../openapi/model/pull-request-base-info.ts | 31 +++ .../modules/openapi/model/pull-request-dto.ts | 42 ---- .../openapi/model/pull-request-info.ts | 43 ++++ .../model/pull-request-review-comment.ts | 25 -- ...iew-dto.ts => pull-request-review-info.ts} | 24 +- .../openapi/model/pull-request-review.ts | 38 --- .../modules/openapi/model/pull-request.ts | 49 ---- .../{repository-dto.ts => repository-info.ts} | 5 +- .../core/modules/openapi/model/repository.ts | 36 --- .../core/modules/openapi/model/user-dto.ts | 25 -- .../core/modules/openapi/model/user-info.ts | 21 ++ .../modules/openapi/model/user-profile-dto.ts | 25 -- .../modules/openapi/model/user-profile.ts | 25 ++ .../app/core/modules/openapi/model/user.ts | 56 ----- 31 files changed, 192 insertions(+), 849 deletions(-) delete mode 100644 webapp/src/app/core/modules/openapi/api/pull-request.service.ts delete mode 100644 webapp/src/app/core/modules/openapi/api/pull-request.serviceInterface.ts rename webapp/src/app/core/modules/openapi/model/{user-info-dto.ts => auth-user-info.ts} (92%) delete mode 100644 webapp/src/app/core/modules/openapi/model/issue-comment-dto.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/issue-comment.ts rename webapp/src/app/core/modules/openapi/model/{pull-request-label.ts => label-info.ts} (80%) rename webapp/src/app/core/modules/openapi/model/{meta-data-dto.ts => meta-data.ts} (92%) create mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-base-info.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-dto.ts create mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-info.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-review-comment.ts rename webapp/src/app/core/modules/openapi/model/{pull-request-review-dto.ts => pull-request-review-info.ts} (57%) delete mode 100644 webapp/src/app/core/modules/openapi/model/pull-request-review.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/pull-request.ts rename webapp/src/app/core/modules/openapi/model/{repository-dto.ts => repository-info.ts} (85%) delete mode 100644 webapp/src/app/core/modules/openapi/model/repository.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/user-dto.ts create mode 100644 webapp/src/app/core/modules/openapi/model/user-info.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/user-profile-dto.ts create mode 100644 webapp/src/app/core/modules/openapi/model/user-profile.ts delete mode 100644 webapp/src/app/core/modules/openapi/model/user.ts diff --git a/webapp/src/app/core/modules/openapi/.openapi-generator/FILES b/webapp/src/app/core/modules/openapi/.openapi-generator/FILES index ef18ebb1..060dd8c4 100644 --- a/webapp/src/app/core/modules/openapi/.openapi-generator/FILES +++ b/webapp/src/app/core/modules/openapi/.openapi-generator/FILES @@ -9,30 +9,22 @@ api/leaderboard.service.ts api/leaderboard.serviceInterface.ts api/meta.service.ts api/meta.serviceInterface.ts -api/pull-request.service.ts -api/pull-request.serviceInterface.ts api/user.service.ts api/user.serviceInterface.ts configuration.ts encoder.ts git_push.sh index.ts -model/issue-comment-dto.ts -model/issue-comment.ts +model/auth-user-info.ts +model/label-info.ts model/leaderboard-entry.ts -model/meta-data-dto.ts +model/meta-data.ts model/models.ts -model/pull-request-dto.ts -model/pull-request-label.ts -model/pull-request-review-comment.ts -model/pull-request-review-dto.ts -model/pull-request-review.ts -model/pull-request.ts -model/repository-dto.ts -model/repository.ts -model/user-dto.ts -model/user-info-dto.ts -model/user-profile-dto.ts -model/user.ts +model/pull-request-base-info.ts +model/pull-request-info.ts +model/pull-request-review-info.ts +model/repository-info.ts +model/user-info.ts +model/user-profile.ts param.ts variables.ts diff --git a/webapp/src/app/core/modules/openapi/api/admin.service.ts b/webapp/src/app/core/modules/openapi/api/admin.service.ts index f3f4bfa5..833c896d 100644 --- a/webapp/src/app/core/modules/openapi/api/admin.service.ts +++ b/webapp/src/app/core/modules/openapi/api/admin.service.ts @@ -19,7 +19,7 @@ import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore -import { UserInfoDto } from '../model/user-info-dto'; +import { AuthUserInfo } from '../model/auth-user-info'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; @@ -158,9 +158,9 @@ export class AdminService implements AdminServiceInterface { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getGretting(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getGretting(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getGretting(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getGretting(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getGretting(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getGretting(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; public getGretting(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { let localVarHeaders = this.defaultHeaders; @@ -200,7 +200,7 @@ export class AdminService implements AdminServiceInterface { } let localVarPath = `/admin/me`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, diff --git a/webapp/src/app/core/modules/openapi/api/admin.serviceInterface.ts b/webapp/src/app/core/modules/openapi/api/admin.serviceInterface.ts index 8a67a141..1890bb32 100644 --- a/webapp/src/app/core/modules/openapi/api/admin.serviceInterface.ts +++ b/webapp/src/app/core/modules/openapi/api/admin.serviceInterface.ts @@ -13,7 +13,7 @@ import { HttpHeaders } from '@angular/comm import { Observable } from 'rxjs'; -import { UserInfoDto } from '../model/models'; +import { AuthUserInfo } from '../model/models'; import { Configuration } from '../configuration'; @@ -34,6 +34,6 @@ export interface AdminServiceInterface { * * */ - getGretting(extraHttpRequestParams?: any): Observable; + getGretting(extraHttpRequestParams?: any): Observable; } diff --git a/webapp/src/app/core/modules/openapi/api/api.ts b/webapp/src/app/core/modules/openapi/api/api.ts index d8152646..c5aae02f 100644 --- a/webapp/src/app/core/modules/openapi/api/api.ts +++ b/webapp/src/app/core/modules/openapi/api/api.ts @@ -7,10 +7,7 @@ export * from './leaderboard.serviceInterface'; export * from './meta.service'; import { MetaService } from './meta.service'; export * from './meta.serviceInterface'; -export * from './pull-request.service'; -import { PullRequestService } from './pull-request.service'; -export * from './pull-request.serviceInterface'; export * from './user.service'; import { UserService } from './user.service'; export * from './user.serviceInterface'; -export const APIS = [AdminService, LeaderboardService, MetaService, PullRequestService, UserService]; +export const APIS = [AdminService, LeaderboardService, MetaService, UserService]; diff --git a/webapp/src/app/core/modules/openapi/api/meta.service.ts b/webapp/src/app/core/modules/openapi/api/meta.service.ts index a3da5964..9ea8e973 100644 --- a/webapp/src/app/core/modules/openapi/api/meta.service.ts +++ b/webapp/src/app/core/modules/openapi/api/meta.service.ts @@ -19,7 +19,7 @@ import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore -import { MetaDataDTO } from '../model/meta-data-dto'; +import { MetaData } from '../model/meta-data'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; @@ -99,9 +99,9 @@ export class MetaService implements MetaServiceInterface { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getMetaData(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getMetaData(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getMetaData(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getMetaData(observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getMetaData(observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getMetaData(observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; public getMetaData(observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { let localVarHeaders = this.defaultHeaders; @@ -141,7 +141,7 @@ export class MetaService implements MetaServiceInterface { } let localVarPath = `/meta`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, diff --git a/webapp/src/app/core/modules/openapi/api/meta.serviceInterface.ts b/webapp/src/app/core/modules/openapi/api/meta.serviceInterface.ts index f6fb5e53..693ec87e 100644 --- a/webapp/src/app/core/modules/openapi/api/meta.serviceInterface.ts +++ b/webapp/src/app/core/modules/openapi/api/meta.serviceInterface.ts @@ -13,7 +13,7 @@ import { HttpHeaders } from '@angular/comm import { Observable } from 'rxjs'; -import { MetaDataDTO } from '../model/models'; +import { MetaData } from '../model/models'; import { Configuration } from '../configuration'; @@ -28,6 +28,6 @@ export interface MetaServiceInterface { * * */ - getMetaData(extraHttpRequestParams?: any): Observable; + getMetaData(extraHttpRequestParams?: any): Observable; } diff --git a/webapp/src/app/core/modules/openapi/api/pull-request.service.ts b/webapp/src/app/core/modules/openapi/api/pull-request.service.ts deleted file mode 100644 index 5511e994..00000000 --- a/webapp/src/app/core/modules/openapi/api/pull-request.service.ts +++ /dev/null @@ -1,224 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -/* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpHeaders, HttpParams, - HttpResponse, HttpEvent, HttpParameterCodec, HttpContext - } from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; - -// @ts-ignore -import { PullRequest } from '../model/pull-request'; - -// @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; -import { - PullRequestServiceInterface -} from './pull-request.serviceInterface'; - - - -@Injectable({ - providedIn: 'root' -}) -export class PullRequestService implements PullRequestServiceInterface { - - protected basePath = 'http://localhost'; - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - public encoder: HttpParameterCodec; - - constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string|string[], @Optional() configuration: Configuration) { - if (configuration) { - this.configuration = configuration; - } - if (typeof this.configuration.basePath !== 'string') { - const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; - if (firstBasePath != undefined) { - basePath = firstBasePath; - } - - if (typeof basePath !== 'string') { - basePath = this.basePath; - } - this.configuration.basePath = basePath; - } - this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); - } - - - // @ts-ignore - private addToHttpParams(httpParams: HttpParams, value: any, key?: string): HttpParams { - if (typeof value === "object" && value instanceof Date === false) { - httpParams = this.addToHttpParamsRecursive(httpParams, value); - } else { - httpParams = this.addToHttpParamsRecursive(httpParams, value, key); - } - return httpParams; - } - - private addToHttpParamsRecursive(httpParams: HttpParams, value?: any, key?: string): HttpParams { - if (value == null) { - return httpParams; - } - - if (typeof value === "object") { - if (Array.isArray(value)) { - (value as any[]).forEach( elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); - } else if (value instanceof Date) { - if (key != null) { - httpParams = httpParams.append(key, (value as Date).toISOString().substring(0, 10)); - } else { - throw Error("key may not be null if value is Date"); - } - } else { - Object.keys(value).forEach( k => httpParams = this.addToHttpParamsRecursive( - httpParams, value[k], key != null ? `${key}.${k}` : k)); - } - } else if (key != null) { - httpParams = httpParams.append(key, value); - } else { - throw Error("key may not be null if value is not object or array"); - } - return httpParams; - } - - /** - * @param id - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPullRequest(id: number, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPullRequest(id: number, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPullRequest(id: number, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPullRequest(id: number, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (id === null || id === undefined) { - throw new Error('Required parameter id was null or undefined when calling getPullRequest.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/pullrequest/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: "int64"})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * @param login - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getPullRequestsByAuthor(login: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPullRequestsByAuthor(login: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getPullRequestsByAuthor(login: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>>; - public getPullRequestsByAuthor(login: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (login === null || login === undefined) { - throw new Error('Required parameter login was null or undefined when calling getPullRequestsByAuthor.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/pullrequest/author/${this.configuration.encodeParam({name: "login", value: login, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request>('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - -} diff --git a/webapp/src/app/core/modules/openapi/api/pull-request.serviceInterface.ts b/webapp/src/app/core/modules/openapi/api/pull-request.serviceInterface.ts deleted file mode 100644 index 66d5615b..00000000 --- a/webapp/src/app/core/modules/openapi/api/pull-request.serviceInterface.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { HttpHeaders } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { PullRequest } from '../model/models'; - - -import { Configuration } from '../configuration'; - - - -export interface PullRequestServiceInterface { - defaultHeaders: HttpHeaders; - configuration: Configuration; - - /** - * - * - * @param id - */ - getPullRequest(id: number, extraHttpRequestParams?: any): Observable; - - /** - * - * - * @param login - */ - getPullRequestsByAuthor(login: string, extraHttpRequestParams?: any): Observable>; - -} diff --git a/webapp/src/app/core/modules/openapi/api/user.service.ts b/webapp/src/app/core/modules/openapi/api/user.service.ts index 96945444..413fbca9 100644 --- a/webapp/src/app/core/modules/openapi/api/user.service.ts +++ b/webapp/src/app/core/modules/openapi/api/user.service.ts @@ -19,11 +19,7 @@ import { CustomHttpParameterCodec } from '../encoder'; import { Observable } from 'rxjs'; // @ts-ignore -import { User } from '../model/user'; -// @ts-ignore -import { UserDTO } from '../model/user-dto'; -// @ts-ignore -import { UserProfileDTO } from '../model/user-profile-dto'; +import { UserProfile } from '../model/user-profile'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; @@ -104,135 +100,9 @@ export class UserService implements UserServiceInterface { * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getFullUser(login: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getFullUser(login: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getFullUser(login: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getFullUser(login: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (login === null || login === undefined) { - throw new Error('Required parameter login was null or undefined when calling getFullUser.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/user/${this.configuration.encodeParam({name: "login", value: login, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/full`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * @param login - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getUser(login: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getUser(login: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getUser(login: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getUser(login: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - if (login === null || login === undefined) { - throw new Error('Required parameter login was null or undefined when calling getUser.'); - } - - let localVarHeaders = this.defaultHeaders; - - let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; - if (localVarHttpHeaderAcceptSelected === undefined) { - // to determine the Accept header - const httpHeaderAccepts: string[] = [ - 'application/json' - ]; - localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); - } - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); - } - - let localVarHttpContext: HttpContext | undefined = options && options.context; - if (localVarHttpContext === undefined) { - localVarHttpContext = new HttpContext(); - } - - let localVarTransferCache: boolean | undefined = options && options.transferCache; - if (localVarTransferCache === undefined) { - localVarTransferCache = true; - } - - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/user/${this.configuration.encodeParam({name: "login", value: login, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - withCredentials: this.configuration.withCredentials, - headers: localVarHeaders, - observe: observe, - transferCache: localVarTransferCache, - reportProgress: reportProgress - } - ); - } - - /** - * @param login - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getUserProfile(login: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getUserProfile(login: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getUserProfile(login: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUserProfile(login: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getUserProfile(login: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getUserProfile(login: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; public getUserProfile(login: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { if (login === null || login === undefined) { throw new Error('Required parameter login was null or undefined when calling getUserProfile.'); @@ -275,7 +145,7 @@ export class UserService implements UserServiceInterface { } let localVarPath = `/user/${this.configuration.encodeParam({name: "login", value: login, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/profile`; - return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, + return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, diff --git a/webapp/src/app/core/modules/openapi/api/user.serviceInterface.ts b/webapp/src/app/core/modules/openapi/api/user.serviceInterface.ts index 23e5f0d3..b3ccf040 100644 --- a/webapp/src/app/core/modules/openapi/api/user.serviceInterface.ts +++ b/webapp/src/app/core/modules/openapi/api/user.serviceInterface.ts @@ -13,9 +13,7 @@ import { HttpHeaders } from '@angular/comm import { Observable } from 'rxjs'; -import { User } from '../model/models'; -import { UserDTO } from '../model/models'; -import { UserProfileDTO } from '../model/models'; +import { UserProfile } from '../model/models'; import { Configuration } from '../configuration'; @@ -31,20 +29,6 @@ export interface UserServiceInterface { * * @param login */ - getFullUser(login: string, extraHttpRequestParams?: any): Observable; - - /** - * - * - * @param login - */ - getUser(login: string, extraHttpRequestParams?: any): Observable; - - /** - * - * - * @param login - */ - getUserProfile(login: string, extraHttpRequestParams?: any): Observable; + getUserProfile(login: string, extraHttpRequestParams?: any): Observable; } diff --git a/webapp/src/app/core/modules/openapi/model/user-info-dto.ts b/webapp/src/app/core/modules/openapi/model/auth-user-info.ts similarity index 92% rename from webapp/src/app/core/modules/openapi/model/user-info-dto.ts rename to webapp/src/app/core/modules/openapi/model/auth-user-info.ts index ecad333f..6eaf9b25 100644 --- a/webapp/src/app/core/modules/openapi/model/user-info-dto.ts +++ b/webapp/src/app/core/modules/openapi/model/auth-user-info.ts @@ -11,7 +11,7 @@ */ -export interface UserInfoDto { +export interface AuthUserInfo { name?: string; roles?: Array; } diff --git a/webapp/src/app/core/modules/openapi/model/issue-comment-dto.ts b/webapp/src/app/core/modules/openapi/model/issue-comment-dto.ts deleted file mode 100644 index b1f01fb9..00000000 --- a/webapp/src/app/core/modules/openapi/model/issue-comment-dto.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequestDTO } from './pull-request-dto'; -import { UserDTO } from './user-dto'; - - -export interface IssueCommentDTO { - id?: number; - body?: string; - createdAt?: string; - updatedAt?: string; - author?: UserDTO; - pullRequest?: PullRequestDTO; -} - diff --git a/webapp/src/app/core/modules/openapi/model/issue-comment.ts b/webapp/src/app/core/modules/openapi/model/issue-comment.ts deleted file mode 100644 index 2bdafa3b..00000000 --- a/webapp/src/app/core/modules/openapi/model/issue-comment.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { User } from './user'; -import { PullRequest } from './pull-request'; - - -export interface IssueComment { - id?: number; - createdAt?: string; - updatedAt?: string; - body?: string; - author?: User; - pullRequest?: PullRequest; -} - diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-label.ts b/webapp/src/app/core/modules/openapi/model/label-info.ts similarity index 80% rename from webapp/src/app/core/modules/openapi/model/pull-request-label.ts rename to webapp/src/app/core/modules/openapi/model/label-info.ts index 9e0750c2..3eac7c02 100644 --- a/webapp/src/app/core/modules/openapi/model/pull-request-label.ts +++ b/webapp/src/app/core/modules/openapi/model/label-info.ts @@ -11,8 +11,9 @@ */ -export interface PullRequestLabel { - name?: string; - color?: string; +export interface LabelInfo { + id: number; + name: string; + color: string; } diff --git a/webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts b/webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts index e65a9c77..c29e816f 100644 --- a/webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts +++ b/webapp/src/app/core/modules/openapi/model/leaderboard-entry.ts @@ -9,27 +9,18 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { PullRequestReviewDTO } from './pull-request-review-dto'; +import { UserInfo } from './user-info'; export interface LeaderboardEntry { - githubName?: string; - avatarUrl?: string; - name?: string; - type?: LeaderboardEntry.TypeEnum; - score?: number; - rank?: number; - numberOfReviewedPRs?: number; - changesRequested?: Array; - approvals?: Array; - comments?: Array; + rank: number; + score: number; + user: UserInfo; + numberOfReviewedPRs: number; + numberOfApprovals: number; + numberOfChangeRequests: number; + numberOfComments: number; + numberOfUnknowns: number; + numberOfCodeComments: number; } -export namespace LeaderboardEntry { - export type TypeEnum = 'USER' | 'BOT'; - export const TypeEnum = { - User: 'USER' as TypeEnum, - Bot: 'BOT' as TypeEnum - }; -} - diff --git a/webapp/src/app/core/modules/openapi/model/meta-data-dto.ts b/webapp/src/app/core/modules/openapi/model/meta-data.ts similarity index 92% rename from webapp/src/app/core/modules/openapi/model/meta-data-dto.ts rename to webapp/src/app/core/modules/openapi/model/meta-data.ts index 0049533e..6e8dcc24 100644 --- a/webapp/src/app/core/modules/openapi/model/meta-data-dto.ts +++ b/webapp/src/app/core/modules/openapi/model/meta-data.ts @@ -11,7 +11,7 @@ */ -export interface MetaDataDTO { +export interface MetaData { repositoriesToMonitor?: Array; } diff --git a/webapp/src/app/core/modules/openapi/model/models.ts b/webapp/src/app/core/modules/openapi/model/models.ts index 492d9c34..b374d5fc 100644 --- a/webapp/src/app/core/modules/openapi/model/models.ts +++ b/webapp/src/app/core/modules/openapi/model/models.ts @@ -1,16 +1,10 @@ -export * from './issue-comment'; -export * from './issue-comment-dto'; +export * from './auth-user-info'; +export * from './label-info'; export * from './leaderboard-entry'; -export * from './meta-data-dto'; -export * from './pull-request'; -export * from './pull-request-dto'; -export * from './pull-request-label'; -export * from './pull-request-review'; -export * from './pull-request-review-comment'; -export * from './pull-request-review-dto'; -export * from './repository'; -export * from './repository-dto'; -export * from './user'; -export * from './user-dto'; -export * from './user-info-dto'; -export * from './user-profile-dto'; +export * from './meta-data'; +export * from './pull-request-base-info'; +export * from './pull-request-info'; +export * from './pull-request-review-info'; +export * from './repository-info'; +export * from './user-info'; +export * from './user-profile'; diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-base-info.ts b/webapp/src/app/core/modules/openapi/model/pull-request-base-info.ts new file mode 100644 index 00000000..5fd60dde --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/pull-request-base-info.ts @@ -0,0 +1,31 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { RepositoryInfo } from './repository-info'; + + +export interface PullRequestBaseInfo { + id: number; + number: number; + title: string; + state: PullRequestBaseInfo.StateEnum; + repository?: RepositoryInfo; + htmlUrl: string; +} +export namespace PullRequestBaseInfo { + export type StateEnum = 'OPEN' | 'CLOSED'; + export const StateEnum = { + Open: 'OPEN' as StateEnum, + Closed: 'CLOSED' as StateEnum + }; +} + + diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-dto.ts b/webapp/src/app/core/modules/openapi/model/pull-request-dto.ts deleted file mode 100644 index 2237a970..00000000 --- a/webapp/src/app/core/modules/openapi/model/pull-request-dto.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequestLabel } from './pull-request-label'; -import { UserDTO } from './user-dto'; -import { IssueCommentDTO } from './issue-comment-dto'; -import { RepositoryDTO } from './repository-dto'; - - -export interface PullRequestDTO { - id: number; - title: string; - number: number; - url: string; - state: PullRequestDTO.StateEnum; - additions: number; - deletions: number; - createdAt: string; - updatedAt: string; - mergedAt?: string; - author?: UserDTO; - comments?: Set; - labels?: Set; - repository?: RepositoryDTO; -} -export namespace PullRequestDTO { - export type StateEnum = 'CLOSED' | 'OPEN'; - export const StateEnum = { - Closed: 'CLOSED' as StateEnum, - Open: 'OPEN' as StateEnum - }; -} - - diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-info.ts b/webapp/src/app/core/modules/openapi/model/pull-request-info.ts new file mode 100644 index 00000000..e5eaa4ff --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/pull-request-info.ts @@ -0,0 +1,43 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { LabelInfo } from './label-info'; +import { RepositoryInfo } from './repository-info'; +import { UserInfo } from './user-info'; + + +export interface PullRequestInfo { + id: number; + number: number; + title: string; + state: PullRequestInfo.StateEnum; + commentsCount: number; + author?: UserInfo; + labels?: Array; + assignees?: Array; + repository?: RepositoryInfo; + additions: number; + deletions: number; + mergedAt?: string; + closedAt?: string; + htmlUrl: string; + createdAt?: string; + updatedAt?: string; +} +export namespace PullRequestInfo { + export type StateEnum = 'OPEN' | 'CLOSED'; + export const StateEnum = { + Open: 'OPEN' as StateEnum, + Closed: 'CLOSED' as StateEnum + }; +} + + diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-review-comment.ts b/webapp/src/app/core/modules/openapi/model/pull-request-review-comment.ts deleted file mode 100644 index 1781825d..00000000 --- a/webapp/src/app/core/modules/openapi/model/pull-request-review-comment.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequestReview } from './pull-request-review'; -import { User } from './user'; - - -export interface PullRequestReviewComment { - id?: number; - createdAt?: string; - updatedAt?: string; - body?: string; - author?: User; - review?: PullRequestReview; - commit: string; -} - diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-review-dto.ts b/webapp/src/app/core/modules/openapi/model/pull-request-review-info.ts similarity index 57% rename from webapp/src/app/core/modules/openapi/model/pull-request-review-dto.ts rename to webapp/src/app/core/modules/openapi/model/pull-request-review-info.ts index 86479807..d9f4d53b 100644 --- a/webapp/src/app/core/modules/openapi/model/pull-request-review-dto.ts +++ b/webapp/src/app/core/modules/openapi/model/pull-request-review-info.ts @@ -9,25 +9,27 @@ * https://openapi-generator.tech * Do not edit the class manually. */ -import { PullRequestDTO } from './pull-request-dto'; +import { PullRequestBaseInfo } from './pull-request-base-info'; +import { UserInfo } from './user-info'; -export interface PullRequestReviewDTO { +export interface PullRequestReviewInfo { id: number; - createdAt: string; - updatedAt: string; - submittedAt: string; - state: PullRequestReviewDTO.StateEnum; - url?: string; - pullRequest?: PullRequestDTO; + isDismissed: boolean; + state: PullRequestReviewInfo.StateEnum; + codeComments: number; + author?: UserInfo; + pullRequest?: PullRequestBaseInfo; + htmlUrl: string; + submittedAt?: string; } -export namespace PullRequestReviewDTO { - export type StateEnum = 'COMMENTED' | 'APPROVED' | 'CHANGES_REQUESTED' | 'DISMISSED'; +export namespace PullRequestReviewInfo { + export type StateEnum = 'COMMENTED' | 'APPROVED' | 'CHANGES_REQUESTED' | 'UNKNOWN'; export const StateEnum = { Commented: 'COMMENTED' as StateEnum, Approved: 'APPROVED' as StateEnum, ChangesRequested: 'CHANGES_REQUESTED' as StateEnum, - Dismissed: 'DISMISSED' as StateEnum + Unknown: 'UNKNOWN' as StateEnum }; } diff --git a/webapp/src/app/core/modules/openapi/model/pull-request-review.ts b/webapp/src/app/core/modules/openapi/model/pull-request-review.ts deleted file mode 100644 index 68ca75ad..00000000 --- a/webapp/src/app/core/modules/openapi/model/pull-request-review.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequestReviewComment } from './pull-request-review-comment'; -import { User } from './user'; -import { PullRequest } from './pull-request'; - - -export interface PullRequestReview { - id?: number; - createdAt?: string; - updatedAt?: string; - author?: User; - state: PullRequestReview.StateEnum; - submittedAt?: string; - url?: string; - comments?: Set; - pullRequest?: PullRequest; -} -export namespace PullRequestReview { - export type StateEnum = 'COMMENTED' | 'APPROVED' | 'CHANGES_REQUESTED' | 'DISMISSED'; - export const StateEnum = { - Commented: 'COMMENTED' as StateEnum, - Approved: 'APPROVED' as StateEnum, - ChangesRequested: 'CHANGES_REQUESTED' as StateEnum, - Dismissed: 'DISMISSED' as StateEnum - }; -} - - diff --git a/webapp/src/app/core/modules/openapi/model/pull-request.ts b/webapp/src/app/core/modules/openapi/model/pull-request.ts deleted file mode 100644 index 98c19061..00000000 --- a/webapp/src/app/core/modules/openapi/model/pull-request.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { Repository } from './repository'; -import { PullRequestLabel } from './pull-request-label'; -import { PullRequestReview } from './pull-request-review'; -import { User } from './user'; -import { IssueComment } from './issue-comment'; - - -export interface PullRequest { - id?: number; - createdAt?: string; - updatedAt?: string; - number?: number; - title: string; - url: string; - /** - * State of the PullRequest. Does not include the state of the merge. - */ - state: PullRequest.StateEnum; - additions?: number; - deletions?: number; - commits?: number; - changedFiles?: number; - mergedAt?: string; - author?: User; - comments?: Set; - reviews?: Set; - repository?: Repository; - pullRequestLabels?: Set; -} -export namespace PullRequest { - export type StateEnum = 'CLOSED' | 'OPEN'; - export const StateEnum = { - Closed: 'CLOSED' as StateEnum, - Open: 'OPEN' as StateEnum - }; -} - - diff --git a/webapp/src/app/core/modules/openapi/model/repository-dto.ts b/webapp/src/app/core/modules/openapi/model/repository-info.ts similarity index 85% rename from webapp/src/app/core/modules/openapi/model/repository-dto.ts rename to webapp/src/app/core/modules/openapi/model/repository-info.ts index 9aa946fc..42dcf703 100644 --- a/webapp/src/app/core/modules/openapi/model/repository-dto.ts +++ b/webapp/src/app/core/modules/openapi/model/repository-info.ts @@ -11,10 +11,11 @@ */ -export interface RepositoryDTO { +export interface RepositoryInfo { + id: number; name: string; nameWithOwner: string; description?: string; - url: string; + htmlUrl: string; } diff --git a/webapp/src/app/core/modules/openapi/model/repository.ts b/webapp/src/app/core/modules/openapi/model/repository.ts deleted file mode 100644 index 3c7f9428..00000000 --- a/webapp/src/app/core/modules/openapi/model/repository.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequest } from './pull-request'; - - -export interface Repository { - id?: number; - createdAt?: string; - updatedAt?: string; - name: string; - nameWithOwner: string; - description?: string; - defaultBranch: string; - visibility: Repository.VisibilityEnum; - url: string; - homepage?: string; - pullRequests?: Set; -} -export namespace Repository { - export type VisibilityEnum = 'PUBLIC' | 'PRIVATE'; - export const VisibilityEnum = { - Public: 'PUBLIC' as VisibilityEnum, - Private: 'PRIVATE' as VisibilityEnum - }; -} - - diff --git a/webapp/src/app/core/modules/openapi/model/user-dto.ts b/webapp/src/app/core/modules/openapi/model/user-dto.ts deleted file mode 100644 index aaaae01b..00000000 --- a/webapp/src/app/core/modules/openapi/model/user-dto.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequestDTO } from './pull-request-dto'; -import { IssueCommentDTO } from './issue-comment-dto'; - - -export interface UserDTO { - id?: number; - login?: string; - email?: string; - name?: string; - url?: string; - pullRequests?: Set; - comments?: Set; -} - diff --git a/webapp/src/app/core/modules/openapi/model/user-info.ts b/webapp/src/app/core/modules/openapi/model/user-info.ts new file mode 100644 index 00000000..ced80a51 --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/user-info.ts @@ -0,0 +1,21 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface UserInfo { + id: number; + login: string; + avatarUrl: string; + name: string; + htmlUrl: string; +} + diff --git a/webapp/src/app/core/modules/openapi/model/user-profile-dto.ts b/webapp/src/app/core/modules/openapi/model/user-profile-dto.ts deleted file mode 100644 index dbaadabe..00000000 --- a/webapp/src/app/core/modules/openapi/model/user-profile-dto.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequestDTO } from './pull-request-dto'; -import { PullRequestReviewDTO } from './pull-request-review-dto'; - - -export interface UserProfileDTO { - id: number; - login: string; - avatarUrl: string; - firstContribution: string; - repositories: Set; - activity?: Set; - pullRequests?: Set; -} - diff --git a/webapp/src/app/core/modules/openapi/model/user-profile.ts b/webapp/src/app/core/modules/openapi/model/user-profile.ts new file mode 100644 index 00000000..86463a2b --- /dev/null +++ b/webapp/src/app/core/modules/openapi/model/user-profile.ts @@ -0,0 +1,25 @@ +/** + * Hephaestus API + * API documentation for the Hephaestus application server. + * + * The version of the OpenAPI document: 0.0.1 + * Contact: felixtj.dietrich@tum.de + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { PullRequestInfo } from './pull-request-info'; +import { PullRequestReviewInfo } from './pull-request-review-info'; +import { RepositoryInfo } from './repository-info'; +import { UserInfo } from './user-info'; + + +export interface UserProfile { + userInfo: UserInfo; + firstContribution: string; + contributedRepositories: Array; + reviewActivity?: Array; + openPullRequests?: Array; +} + diff --git a/webapp/src/app/core/modules/openapi/model/user.ts b/webapp/src/app/core/modules/openapi/model/user.ts deleted file mode 100644 index 8e8311bd..00000000 --- a/webapp/src/app/core/modules/openapi/model/user.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Hephaestus API - * API documentation for the Hephaestus application server. - * - * The version of the OpenAPI document: 0.0.1 - * Contact: felixtj.dietrich@tum.de - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -import { PullRequestReviewComment } from './pull-request-review-comment'; -import { PullRequestReview } from './pull-request-review'; -import { PullRequest } from './pull-request'; -import { IssueComment } from './issue-comment'; - - -export interface User { - id?: number; - createdAt?: string; - updatedAt?: string; - /** - * Unique login identifier for a user. - */ - login: string; - email?: string; - /** - * Display name of the user. - */ - name?: string; - /** - * Unique URL to the user\'s profile. Not the website a user can set in their profile. - */ - url: string; - /** - * URL to the user\'s avatar. If unavailable, a fallback can be generated from the login, e.g. on Github: https://github.com/{login}.png - */ - avatarUrl?: string; - /** - * Type of the user. Used to distinguish between users and bots. - */ - type: User.TypeEnum; - pullRequests?: Set; - issueComments?: Set; - reviewComments?: Set; - reviews?: Set; -} -export namespace User { - export type TypeEnum = 'USER' | 'BOT'; - export const TypeEnum = { - User: 'USER' as TypeEnum, - Bot: 'BOT' as TypeEnum - }; -} - -