diff --git a/apps/red-ui/src/app/models/file/dossier-template.ts b/apps/red-ui/src/app/models/file/dossier-template.ts index cd6717d11..ae5364686 100644 --- a/apps/red-ui/src/app/models/file/dossier-template.ts +++ b/apps/red-ui/src/app/models/file/dossier-template.ts @@ -1,5 +1,5 @@ -import { DownloadFileType, IDossierTemplate, List } from '@redaction/red-ui-http'; -import { IListable } from '@iqser/common-ui'; +import { DownloadFileType, IDossierTemplate } from '@redaction/red-ui-http'; +import { IListable, List } from '@iqser/common-ui'; export class DossierTemplate implements IDossierTemplate, IListable { readonly createdBy?: string; diff --git a/apps/red-ui/src/app/models/file/file.ts b/apps/red-ui/src/app/models/file/file.ts index 56a80bb4e..7b6577115 100644 --- a/apps/red-ui/src/app/models/file/file.ts +++ b/apps/red-ui/src/app/models/file/file.ts @@ -1,5 +1,5 @@ -import { IListable } from '@iqser/common-ui'; -import { FileAttributes, FileAttributesConfig, FileStatus, FileStatuses, IFile, List } from '@redaction/red-ui-http'; +import { IListable, List } from '@iqser/common-ui'; +import { FileAttributes, FileAttributesConfig, FileStatus, FileStatuses, IFile } from '@redaction/red-ui-http'; import { StatusSorter } from '@utils/sorters/status-sorter'; const processingStatuses: List = [ diff --git a/apps/red-ui/src/app/models/user.ts b/apps/red-ui/src/app/models/user.ts index 75d775736..70b6f180b 100644 --- a/apps/red-ui/src/app/models/user.ts +++ b/apps/red-ui/src/app/models/user.ts @@ -1,5 +1,5 @@ -import { IUser, List } from '@redaction/red-ui-http'; -import { IListable } from '@iqser/common-ui'; +import { IUser } from '@redaction/red-ui-http'; +import { IListable, List } from '@iqser/common-ui'; import { KeycloakProfile } from 'keycloak-js'; export class User implements IUser, IListable { diff --git a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts index 796c72289..15d5ce6ca 100644 --- a/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/watermark/watermark-screen.component.ts @@ -5,7 +5,7 @@ import { environment } from '@environments/environment'; import { HttpClient } from '@angular/common/http'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { Debounce, IconButtonTypes, LoadingService, Toaster } from '@iqser/common-ui'; -import { WatermarkModel } from '@redaction/red-ui-http'; +import { IWatermark, WatermarkOrientation, WatermarkOrientations } from '@redaction/red-ui-http'; import { ActivatedRoute } from '@angular/router'; import { BASE_HREF } from '../../../../tokens'; import { stampPDFPage } from '@utils/page-stamper'; @@ -13,13 +13,13 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service'; import { WatermarkService } from '../../services/watermark.service'; -export const DEFAULT_WATERMARK: WatermarkModel = { +export const DEFAULT_WATERMARK: IWatermark = { text: null, hexColor: '#dd4d50', opacity: 70, fontSize: 11, fontType: 'sans-serif', - orientation: WatermarkModel.OrientationEnum.DIAGONAL, + orientation: WatermarkOrientations.DIAGONAL, } as const; @Component({ @@ -31,7 +31,7 @@ export class WatermarkScreenComponent implements OnInit { readonly iconButtonTypes = IconButtonTypes; configForm: FormGroup; private _instance: WebViewerInstance; - private _watermark: WatermarkModel = {}; + private _watermark: IWatermark = {}; @ViewChild('viewer', { static: true }) private _viewer: ElementRef; @@ -167,7 +167,7 @@ export class WatermarkScreenComponent implements OnInit { const text = this.configForm.get('text').value || ''; const fontSize = this.configForm.get('fontSize').value; const fontType = this.configForm.get('fontType').value; - const orientation: WatermarkModel.OrientationEnum = this.configForm.get('orientation').value; + const orientation: WatermarkOrientation = this.configForm.get('orientation').value; const opacity = this.configForm.get('opacity').value; const color = this.configForm.get('hexColor').value; diff --git a/apps/red-ui/src/app/modules/admin/services/watermark.service.ts b/apps/red-ui/src/app/modules/admin/services/watermark.service.ts index 560835922..69335bb26 100644 --- a/apps/red-ui/src/app/modules/admin/services/watermark.service.ts +++ b/apps/red-ui/src/app/modules/admin/services/watermark.service.ts @@ -1,15 +1,15 @@ import { Injectable, Injector } from '@angular/core'; import { GenericService, RequiredParam, Validate } from '@iqser/common-ui'; -import { WatermarkModel } from '@redaction/red-ui-http'; +import { IWatermark } from '@redaction/red-ui-http'; @Injectable() -export class WatermarkService extends GenericService { +export class WatermarkService extends GenericService { constructor(protected readonly _injector: Injector) { super(_injector, 'watermark'); } @Validate() - saveWatermark(@RequiredParam() body: WatermarkModel, @RequiredParam() dossierTemplateId: string) { + saveWatermark(@RequiredParam() body: IWatermark, @RequiredParam() dossierTemplateId: string) { return this._post(body, `${this._defaultModelPath}/${dossierTemplateId}`); } diff --git a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts index e4faf60bc..a87ca0c38 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/file-preview-screen/file-preview-screen.component.ts @@ -9,6 +9,7 @@ import { Debounce, FilterService, INestedFilter, + List, LoadingService, OnAttach, OnDetach, @@ -28,7 +29,7 @@ import { PermissionsService } from '@services/permissions.service'; import { timer } from 'rxjs'; import { UserPreferenceService } from '@services/user-preference.service'; import { UserService } from '@services/user.service'; -import { FileStatus, List } from '@redaction/red-ui-http'; +import { FileStatus } from '@redaction/red-ui-http'; import { PdfViewerDataService } from '../../services/pdf-viewer-data.service'; import { download } from '@utils/file-download-utils'; import { ViewMode } from '@models/file/view-mode'; diff --git a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts index bf133e511..60695ee80 100644 --- a/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts +++ b/apps/red-ui/src/app/modules/dossier/screens/search-screen/search-screen.component.ts @@ -3,13 +3,14 @@ import { DefaultListingServices, IListable, keyChecker, + List, ListingComponent, LoadingService, NestedFilter, SearchPositions, TableColumnConfig, } from '@iqser/common-ui'; -import { List, MatchedDocument, SearchResult } from '@redaction/red-ui-http'; +import { MatchedDocument, SearchResult } from '@redaction/red-ui-http'; import { BehaviorSubject, Observable } from 'rxjs'; import { debounceTime, map, skip, switchMap, tap } from 'rxjs/operators'; import { ActivatedRoute, Router } from '@angular/router'; diff --git a/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.ts b/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.ts index 200f0dc00..f1b76ef91 100644 --- a/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/assign-user-dropdown/assign-user-dropdown.component.ts @@ -1,7 +1,7 @@ import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { UserService } from '@services/user.service'; -import { List } from '@redaction/red-ui-http'; import { User } from '@models/user'; +import { List } from '@iqser/common-ui'; @Component({ selector: 'redaction-assign-user-dropdown', diff --git a/apps/red-ui/src/app/modules/shared/components/team-members/team-members.component.ts b/apps/red-ui/src/app/modules/shared/components/team-members/team-members.component.ts index 3ba00cf93..1e24ef746 100644 --- a/apps/red-ui/src/app/modules/shared/components/team-members/team-members.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/team-members/team-members.component.ts @@ -1,7 +1,6 @@ import { Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core'; -import { CircleButtonTypes } from '@iqser/common-ui'; +import { CircleButtonTypes, List } from '@iqser/common-ui'; import { UserService } from '@services/user.service'; -import { List } from '@redaction/red-ui-http'; @Component({ selector: 'redaction-team-members', diff --git a/apps/red-ui/src/app/modules/upload-download/model/download-status.ts b/apps/red-ui/src/app/modules/upload-download/model/download-status.ts index 7dec1bd37..84ae062ce 100644 --- a/apps/red-ui/src/app/modules/upload-download/model/download-status.ts +++ b/apps/red-ui/src/app/modules/upload-download/model/download-status.ts @@ -1,5 +1,5 @@ -import { DownloadFileType, DownloadStatusType, IDownloadStatus, List } from '@redaction/red-ui-http'; -import { IListable } from '@iqser/common-ui'; +import { DownloadFileType, DownloadStatusType, IDownloadStatus } from '@redaction/red-ui-http'; +import { IListable, List } from '@iqser/common-ui'; export class DownloadStatus implements IDownloadStatus, IListable { readonly creationDate?: string; diff --git a/apps/red-ui/src/app/services/user-preference.service.ts b/apps/red-ui/src/app/services/user-preference.service.ts index 4c918615f..9f279aaf4 100644 --- a/apps/red-ui/src/app/services/user-preference.service.ts +++ b/apps/red-ui/src/app/services/user-preference.service.ts @@ -1,6 +1,5 @@ import { Injectable, Injector } from '@angular/core'; -import { List } from '@redaction/red-ui-http'; -import { GenericService, RequiredParam, Validate } from '@iqser/common-ui'; +import { GenericService, List, RequiredParam, Validate } from '@iqser/common-ui'; type UserAttributes = Record; diff --git a/apps/red-ui/src/app/state/model/dossier.ts b/apps/red-ui/src/app/state/model/dossier.ts index b0c8336b5..82e45aa2a 100644 --- a/apps/red-ui/src/app/state/model/dossier.ts +++ b/apps/red-ui/src/app/state/model/dossier.ts @@ -1,6 +1,6 @@ import { File } from '@models/file/file'; -import { DossierStatus, DownloadFileType, IDictionary, IDossier, List } from '@redaction/red-ui-http'; -import { IListable } from '@iqser/common-ui'; +import { DossierStatus, DownloadFileType, IDictionary, IDossier } from '@redaction/red-ui-http'; +import { IListable, List } from '@iqser/common-ui'; export class Dossier implements IDossier, IListable { readonly dossierId: string; diff --git a/libs/red-ui-http/src/lib/api/api.ts b/libs/red-ui-http/src/lib/api/api.ts deleted file mode 100644 index f79a1b3bc..000000000 --- a/libs/red-ui-http/src/lib/api/api.ts +++ /dev/null @@ -1,75 +0,0 @@ -export * from './auditController.service'; - -export * from './dictionaryController.service'; - -export * from './digitalSignatureController.service'; - -export * from './dossierAttributesController.service'; - -export * from './dossierController.service'; - -export * from './dossierTemplateController.service'; - -export * from './downloadController.service'; - -export * from './fileAttributesController.service'; - -export * from './fileManagementController.service'; - -export * from './generalSettingsController.service'; - -export * from './infoController.service'; - -export * from './licenseReportController.service'; - -export * from './manualRedactionController.service'; - -export * from './notificationController.service'; - -export * from './reanalysisController.service'; - -export * from './redactionLogController.service'; - -export * from './reportTemplateController.service'; - -export * from './rulesController.service'; - -export * from './searchController.service'; - -export * from './smtpConfigurationController.service'; - -export * from './statusController.service'; - -export * from './statusReportController.service'; - -export * from './uploadController.service'; - -export * from './userController.service'; - -export * from './userPreferenceController.service'; - -export * from './versionsController.service'; - -export * from './viewedPagesController.service'; - -export * from './watermarkController.service'; - -export * from './downloadController.service'; - -export * from './digitalSignatureController.service'; - -export * from './fileAttributesController.service'; - -export * from './smtpConfigurationController.service'; - -export * from './reportTemplateController.service'; - -export * from './uploadController.service'; - -export * from './generalSettingsController.service'; - -export * from './dossierAttributesController.service'; - -export * from './searchController.service'; - -export * from './notificationController.service'; diff --git a/libs/red-ui-http/src/lib/api/auditController.service.ts b/libs/red-ui-http/src/lib/api/auditController.service.ts deleted file mode 100644 index ffae52057..000000000 --- a/libs/red-ui-http/src/lib/api/auditController.service.ts +++ /dev/null @@ -1,149 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { AuditResponse } from '../model/auditResponse'; -import { AuditSearchRequest } from '../model/auditSearchRequest'; -import { CategoryModel } from '../model/categoryModel'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class AuditControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Get a list of available categories for the audit-log - * None - * @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 getAuditCategories(observe?: 'body', reportProgress?: boolean): Observable>; - - public getAuditCategories(observe?: 'response', reportProgress?: boolean): Observable>>; - - public getAuditCategories(observe?: 'events', reportProgress?: boolean): Observable>>; - - public getAuditCategories(observe: any = 'body', reportProgress: boolean = false): Observable { - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request>('get', `${this.basePath}/audit/categories`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Search the audit-log based on some entries the digital signature used to sign PDF's - * None - * @param body auditSearchRequest - * @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 searchAuditLog(body: AuditSearchRequest, observe?: 'body', reportProgress?: boolean): Observable; - - public searchAuditLog( - body: AuditSearchRequest, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public searchAuditLog(body: AuditSearchRequest, observe?: 'events', reportProgress?: boolean): Observable>; - - public searchAuditLog(body: AuditSearchRequest, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling searchAuditLog.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/audit/search`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/dictionaryController.service.ts b/libs/red-ui-http/src/lib/api/dictionaryController.service.ts deleted file mode 100644 index 203aae7e4..000000000 --- a/libs/red-ui-http/src/lib/api/dictionaryController.service.ts +++ /dev/null @@ -1,1128 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; - -import { Colors } from '../model/colors'; -import { IDictionary } from '../model/dictionary'; -import { TypeResponse } from '../model/typeResponse'; -import { ITypeValue } from '../model/typeValue'; -import { UpdateTypeValue } from '../model/updateTypeValue'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class DictionaryControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Add dictionary entries with entry type. - * None - * @param body entries - * @param dossierTemplateId dossierTemplateId - * @param type type - * @param dossierId dossierId - * @param removeCurrent removeCurrent - * @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 addEntry( - body: Array, - dossierTemplateId: string, - type: string, - dossierId?: string, - removeCurrent?: boolean, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public addEntry( - body: Array, - dossierTemplateId: string, - type: string, - dossierId?: string, - removeCurrent?: boolean, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public addEntry( - body: Array, - dossierTemplateId: string, - type: string, - dossierId?: string, - removeCurrent?: boolean, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public addEntry( - body: Array, - dossierTemplateId: string, - type: string, - dossierId?: string, - removeCurrent?: boolean, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addEntry.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling addEntry.'); - } - - if (type === null || type === undefined) { - throw new Error('Required parameter type was null or undefined when calling addEntry.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (dossierId !== undefined && dossierId !== null) { - queryParameters = queryParameters.set('dossierId', dossierId); - } - if (removeCurrent !== undefined && removeCurrent !== null) { - queryParameters = queryParameters.set('removeCurrent', removeCurrent); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/dictionary/${encodeURIComponent(String(type))}/${encodeURIComponent(String(dossierTemplateId))}`, - { - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Creates entry type with colors, hint and caseInsensitive - * None - * @param body typeValue - * @param dossierId dossierId - * @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 addType(body: ITypeValue, dossierId?: string, observe?: 'body', reportProgress?: boolean): Observable; - - public addType(body: ITypeValue, dossierId?: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public addType(body: ITypeValue, dossierId?: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public addType(body: ITypeValue, dossierId?: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addType.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (dossierId !== undefined && dossierId !== null) { - queryParameters = queryParameters.set('dossierId', dossierId); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/dictionary/type`, { - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Delete dictionary entries with entry type. - * None - * @param body entries - * @param dossierTemplateId dossierTemplateId - * @param type type - * @param dossierId dossierId - * @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 deleteEntries( - body: Array, - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public deleteEntries( - body: Array, - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public deleteEntries( - body: Array, - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public deleteEntries( - body: Array, - dossierTemplateId: string, - type: string, - dossierId?: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling deleteEntries.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteEntries.'); - } - - if (type === null || type === undefined) { - throw new Error('Required parameter type was null or undefined when calling deleteEntries.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (dossierId !== undefined && dossierId !== null) { - queryParameters = queryParameters.set('dossierId', dossierId); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/dictionary/delete/${encodeURIComponent(String(type))}/${encodeURIComponent(String(dossierTemplateId))}`, - { - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Delete dictionary entry with entry type. - * None - * @param dossierTemplateId dossierTemplateId - * @param entry entry - * @param type type - * @param dossierId dossierId - * @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 deleteEntry( - dossierTemplateId: string, - entry: string, - type: string, - dossierId?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public deleteEntry( - dossierTemplateId: string, - entry: string, - type: string, - dossierId?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public deleteEntry( - dossierTemplateId: string, - entry: string, - type: string, - dossierId?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public deleteEntry( - dossierTemplateId: string, - entry: string, - type: string, - dossierId?: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteEntry.'); - } - - if (entry === null || entry === undefined) { - throw new Error('Required parameter entry was null or undefined when calling deleteEntry.'); - } - - if (type === null || type === undefined) { - throw new Error('Required parameter type was null or undefined when calling deleteEntry.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (dossierId !== undefined && dossierId !== null) { - queryParameters = queryParameters.set('dossierId', dossierId); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'delete', - `${this.basePath}/dictionary/${encodeURIComponent(String(type))}/${encodeURIComponent( - String(dossierTemplateId), - )}/${encodeURIComponent(String(entry))}`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Deletes entry type - * None - * @param dossierTemplateId dossierTemplateId - * @param type type - * @param dossierId dossierId - * @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 deleteType( - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public deleteType( - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public deleteType( - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public deleteType( - dossierTemplateId: string, - type: string, - dossierId?: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteType.'); - } - - if (type === null || type === undefined) { - throw new Error('Required parameter type was null or undefined when calling deleteType.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (dossierId !== undefined && dossierId !== null) { - queryParameters = queryParameters.set('dossierId', dossierId); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'delete', - `${this.basePath}/dictionary/type/${encodeURIComponent(String(type))}/${encodeURIComponent(String(dossierTemplateId))}`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Deletes entry types - * None - * @param body types - * @param dossierTemplateId dossierTemplateId - * @param dossierId dossierId - * @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 deleteTypes( - body: Array, - dossierTemplateId: string, - dossierId?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public deleteTypes( - body: Array, - dossierTemplateId: string, - dossierId?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public deleteTypes( - body: Array, - dossierTemplateId: string, - dossierId?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public deleteTypes( - body: Array, - dossierTemplateId: string, - dossierId?: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling deleteTypes.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteTypes.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (dossierId !== undefined && dossierId !== null) { - queryParameters = queryParameters.set('dossierId', dossierId); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/dictionary/type/${encodeURIComponent(String(dossierTemplateId))}/delete`, - { - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns file containing the the dictionary entries for given type.. - * - * @param dossierTemplateId dossierTemplateId - * @param type type - * @param dossierId dossierId - * @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 downloadDictionaryFile( - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public downloadDictionaryFile( - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public downloadDictionaryFile( - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public downloadDictionaryFile( - dossierTemplateId: string, - type: string, - dossierId?: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling downloadDictionaryFile.'); - } - - if (type === null || type === undefined) { - throw new Error('Required parameter type was null or undefined when calling downloadDictionaryFile.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (dossierId !== undefined && dossierId !== null) { - queryParameters = queryParameters.set('dossierId', dossierId); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['*/*']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/dictionary/download/${encodeURIComponent(String(type))}/${encodeURIComponent(String(dossierTemplateId))}`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Retrieve all entry types - * None - * @param dossierTemplateId dossierTemplateId - * @param dossierId dossierId - * @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 getAllTypes(dossierTemplateId: string, dossierId?: string, observe?: 'body', reportProgress?: boolean): Observable; - - public getAllTypes( - dossierTemplateId: string, - dossierId?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getAllTypes( - dossierTemplateId: string, - dossierId?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public getAllTypes( - dossierTemplateId: string, - dossierId?: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling getAllTypes.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (dossierId !== undefined && dossierId !== null) { - queryParameters = queryParameters.set('dossierId', dossierId); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/dictionary/type/${encodeURIComponent(String(dossierTemplateId))}`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Retrieves system colors for redaction. - * None - * @param dossierTemplateId dossierTemplateId - * @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 getColors(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public getColors(dossierTemplateId: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public getColors(dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public getColors(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling getColors.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('get', `${this.basePath}/color/${encodeURIComponent(String(dossierTemplateId))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Retrieves all dictionary entries of an entry type - * None - * @param dossierTemplateId dossierTemplateId - * @param type type - * @param dossierId dossierId - * @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 getDictionaryForType( - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public getDictionaryForType( - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getDictionaryForType( - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public getDictionaryForType( - dossierTemplateId: string, - type: string, - dossierId?: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling getDictionaryForType.'); - } - - if (type === null || type === undefined) { - throw new Error('Required parameter type was null or undefined when calling getDictionaryForType.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (dossierId !== undefined && dossierId !== null) { - queryParameters = queryParameters.set('dossierId', dossierId); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/dictionary/${encodeURIComponent(String(type))}/${encodeURIComponent(String(dossierTemplateId))}`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Set system colors for redaction - * - * @param body colors - * @param dossierTemplateId dossierTemplateId - * @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 setColors(body: Colors, dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public setColors( - body: Colors, - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setColors(body: Colors, dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public setColors(body: Colors, dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling setColors.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling setColors.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/color/${encodeURIComponent(String(dossierTemplateId))}`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Updates colors, hint and caseInsensitive of an entry type. - * None - * @param body typeValue - * @param dossierTemplateId dossierTemplateId - * @param type type - * @param dossierId dossierId - * @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 updateType( - body: UpdateTypeValue, - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public updateType( - body: UpdateTypeValue, - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public updateType( - body: UpdateTypeValue, - dossierTemplateId: string, - type: string, - dossierId?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public updateType( - body: UpdateTypeValue, - dossierTemplateId: string, - type: string, - dossierId?: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateType.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling updateType.'); - } - - if (type === null || type === undefined) { - throw new Error('Required parameter type was null or undefined when calling updateType.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (dossierId !== undefined && dossierId !== null) { - queryParameters = queryParameters.set('dossierId', dossierId); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/dictionary/type/${encodeURIComponent(String(type))}/${encodeURIComponent(String(dossierTemplateId))}`, - { - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Upload a text-file with 1 entry per line and add each line as an entry to a dictionary for a specific type - * - * @param dossierTemplateId dossierTemplateId - * @param type type - * @param file - * @param dossierId - * @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 uploadDictionaryFileForm( - dossierTemplateId: string, - type: string, - file?: Blob, - dossierId?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public uploadDictionaryFileForm( - dossierTemplateId: string, - type: string, - file?: Blob, - dossierId?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public uploadDictionaryFileForm( - dossierTemplateId: string, - type: string, - file?: Blob, - dossierId?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public uploadDictionaryFileForm( - dossierTemplateId: string, - type: string, - file?: Blob, - dossierId?: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling uploadDictionaryFile.'); - } - - if (type === null || type === undefined) { - throw new Error('Required parameter type was null or undefined when calling uploadDictionaryFile.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['multipart/form-data']; - - const canConsumeForm = this.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): void }; - let useForm = false; - const convertFormParamsToString = false; - // use FormData to transmit files using content-type "multipart/form-data" - // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data - useForm = canConsumeForm; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - } - - if (file !== undefined) { - formParams = (formParams.append('file', file) as any) || formParams; - } - if (dossierId !== undefined) { - formParams = (formParams.append('dossierId', dossierId) as any) || formParams; - } - - return this.httpClient.request( - 'post', - `${this.basePath}/dictionary/upload/${encodeURIComponent(String(type))}/${encodeURIComponent(String(dossierTemplateId))}`, - { - body: convertFormParamsToString ? formParams.toString() : formParams, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/digitalSignatureController.service.ts b/libs/red-ui-http/src/lib/api/digitalSignatureController.service.ts deleted file mode 100644 index dada73e88..000000000 --- a/libs/red-ui-http/src/lib/api/digitalSignatureController.service.ts +++ /dev/null @@ -1,251 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { DigitalSignature } from '../model/digitalSignature'; -import { DigitalSignatureViewModel } from '../model/digitalSignatureViewModel'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class DigitalSignatureControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Remove the digital signature - * None - * @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 deleteDigitalSignature(observe?: 'body', reportProgress?: boolean): Observable; - - public deleteDigitalSignature(observe?: 'response', reportProgress?: boolean): Observable>; - - public deleteDigitalSignature(observe?: 'events', reportProgress?: boolean): Observable>; - - public deleteDigitalSignature(observe: any = 'body', reportProgress: boolean = false): Observable { - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('delete', `${this.basePath}/digital-signature`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Get the current digital signature - * None - * @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 getDigitalSignature(observe?: 'body', reportProgress?: boolean): Observable; - - public getDigitalSignature(observe?: 'response', reportProgress?: boolean): Observable>; - - public getDigitalSignature(observe?: 'events', reportProgress?: boolean): Observable>; - - public getDigitalSignature(observe: any = 'body', reportProgress: boolean = false): Observable { - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('get', `${this.basePath}/digital-signature`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Save a new digital signature used to sign PDF's - * None - * @param body digitalSignatureModel - * @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 saveDigitalSignature(body: DigitalSignature, observe?: 'body', reportProgress?: boolean): Observable; - - public saveDigitalSignature( - body: DigitalSignature, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public saveDigitalSignature( - body: DigitalSignature, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public saveDigitalSignature(body: DigitalSignature, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling saveDigitalSignature.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/digital-signature`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Update the digital signature used to sign PDF's - * None - * @param body digitalSignatureModel - * @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 updateDigitalSignature(body: DigitalSignatureViewModel, observe?: 'body', reportProgress?: boolean): Observable; - - public updateDigitalSignature( - body: DigitalSignatureViewModel, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public updateDigitalSignature( - body: DigitalSignatureViewModel, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public updateDigitalSignature( - body: DigitalSignatureViewModel, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateDigitalSignaturegit_.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('put', `${this.basePath}/digital-signature`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/dossierAttributesController.service.ts b/libs/red-ui-http/src/lib/api/dossierAttributesController.service.ts deleted file mode 100644 index 220c01aa5..000000000 --- a/libs/red-ui-http/src/lib/api/dossierAttributesController.service.ts +++ /dev/null @@ -1,708 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; -import { DossierAttributes } from '../model/dossierAttributes'; -import { DossierAttribute } from '../model/dossierAttribute'; -import { IDossierAttributeConfig } from '../model/dossierAttributeConfig'; -import { DossierAttributesConfig } from '../model/dossierAttributesConfig'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class DossierAttributesControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Add or update a dossier attribute in existing dossier. - * None - * @param body dossierAttribute - * @param dossierId dossierId - * @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 addOrUpdateDossierAttributes( - body: DossierAttribute, - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public addOrUpdateDossierAttributes( - body: DossierAttribute, - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public addOrUpdateDossierAttributes( - body: DossierAttribute, - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public addOrUpdateDossierAttributes( - body: DossierAttribute, - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addOrUpdateDossierAttributes.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling addOrUpdateDossierAttributes.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/dossier-attributes/update/${encodeURIComponent(String(dossierId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Add or update a dossier attribute in base configuration. - * None - * @param body dossierAttribute - * @param dossierTemplateId dossierTemplateId - * @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 addOrUpdateDossierAttributesConfig( - body: IDossierAttributeConfig, - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public addOrUpdateDossierAttributesConfig( - body: IDossierAttributeConfig, - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public addOrUpdateDossierAttributesConfig( - body: IDossierAttributeConfig, - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public addOrUpdateDossierAttributesConfig( - body: IDossierAttributeConfig, - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addOrUpdateDossierAttributesConfig.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling addOrUpdateDossierAttributesConfig.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/dossier-attributes/config/${encodeURIComponent(String(dossierTemplateId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Delete a specific dossier attribute. - * None - * @param dossierAttributeId dossierAttributeId - * @param dossierId dossierId - * @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 deleteDossierAttribute( - dossierAttributeId: string, - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public deleteDossierAttribute( - dossierAttributeId: string, - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public deleteDossierAttribute( - dossierAttributeId: string, - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public deleteDossierAttribute( - dossierAttributeId: string, - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierAttributeId === null || dossierAttributeId === undefined) { - throw new Error('Required parameter dossierAttributeId was null or undefined when calling deleteDossierAttribute.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling deleteDossierAttribute.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'delete', - `${this.basePath}/dossier-attributes/set/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(dossierAttributeId), - )}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Delete a specific dossier attribute. - * None - * @param dossierAttributeId dossierAttributeId - * @param dossierTemplateId dossierTemplateId - * @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 deleteDossierAttributeConfig( - dossierAttributeId: string, - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public deleteDossierAttributeConfig( - dossierAttributeId: string, - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public deleteDossierAttributeConfig( - dossierAttributeId: string, - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public deleteDossierAttributeConfig( - dossierAttributeId: string, - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierAttributeId === null || dossierAttributeId === undefined) { - throw new Error('Required parameter dossierAttributeId was null or undefined when calling deleteDossierAttributeConfig.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteDossierAttributeConfig.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'delete', - `${this.basePath}/dossier-attributes/config/${encodeURIComponent(String(dossierTemplateId))}/${encodeURIComponent( - String(dossierAttributeId), - )}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Bulk delete dossier attributes. - * None - * @param dossierAttributeIds dossierAttributeIds - * @param dossierTemplateId dossierTemplateId - * @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 deleteDossierAttributesConfig( - dossierAttributeIds: Array, - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public deleteDossierAttributesConfig( - dossierAttributeIds: Array, - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public deleteDossierAttributesConfig( - dossierAttributeIds: Array, - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public deleteDossierAttributesConfig( - dossierAttributeIds: Array, - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierAttributeIds === null || dossierAttributeIds === undefined) { - throw new Error('Required parameter dossierAttributeIds was null or undefined when calling deleteDossierAttributesConfig.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteDossierAttributesConfig.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (dossierAttributeIds) { - dossierAttributeIds.forEach(element => { - queryParameters = queryParameters.append('dossierAttributeIds', element); - }); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/dossier-attributes/config/delete/${encodeURIComponent(String(dossierTemplateId))}`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Get the dossier attributes. - * None - * @param dossierId dossierId - * @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 getDossierAttributes(dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public getDossierAttributes( - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getDossierAttributes(dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public getDossierAttributes(dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling getDossierAttributes.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/dossier-attributes/${encodeURIComponent(String(dossierId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Get the dossier attributes configuration. - * None - * @param dossierTemplateId dossierTemplateId - * @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 getDossierAttributesConfig( - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public getDossierAttributesConfig( - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getDossierAttributesConfig( - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public getDossierAttributesConfig(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling getDossierAttributesConfig.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/dossier-attributes/config/${encodeURIComponent(String(dossierTemplateId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Set dossier attributes to an existing dossier - * None - * @param body dossierAttributes - * @param dossierId dossierId - * @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 setDossierAttributes( - body: DossierAttributes, - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public setDossierAttributes( - body: DossierAttributes, - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setDossierAttributes( - body: DossierAttributes, - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setDossierAttributes( - body: DossierAttributes, - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling setDossierAttributes.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling setDossierAttributes.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/dossier-attributes/set/${encodeURIComponent(String(dossierId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Set dossier attributes base configuration. - * None - * @param body dossierAttributesConfig - * @param dossierTemplateId dossierTemplateId - * @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 setDossierAttributesConfig( - body: DossierAttributesConfig, - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public setDossierAttributesConfig( - body: DossierAttributesConfig, - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setDossierAttributesConfig( - body: DossierAttributesConfig, - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setDossierAttributesConfig( - body: DossierAttributesConfig, - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling setDossierAttributesConfig.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling setDossierAttributesConfig.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'put', - `${this.basePath}/dossier-attributes/config/${encodeURIComponent(String(dossierTemplateId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/dossierController.service.ts b/libs/red-ui-http/src/lib/api/dossierController.service.ts deleted file mode 100644 index bf0ec01fb..000000000 --- a/libs/red-ui-http/src/lib/api/dossierController.service.ts +++ /dev/null @@ -1,366 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; - -import { IDossier } from '../model/dossier'; -import { DossierRequest } from '../model/dossierRequest'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class DossierControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Creates or updates a dossier. - * None - * @param body dossier - * @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 createOrUpdateDossier(body: DossierRequest, observe?: 'body', reportProgress?: boolean): Observable; - - public createOrUpdateDossier(body: DossierRequest, observe?: 'response', reportProgress?: boolean): Observable>; - - public createOrUpdateDossier(body: DossierRequest, observe?: 'events', reportProgress?: boolean): Observable>; - - public createOrUpdateDossier(body: DossierRequest, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createOrUpdateDossier.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/dossier`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Deletes an existing dossier. - * None - * @param dossierId dossierId - * @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 deleteDossier(dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public deleteDossier(dossierId: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public deleteDossier(dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public deleteDossier(dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling deleteDossier.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('delete', `${this.basePath}/dossier/${encodeURIComponent(String(dossierId))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Gets all deleted dossiers. - * None - * @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 getDeletedDossiers(observe?: 'body', reportProgress?: boolean): Observable>; - - public getDeletedDossiers(observe?: 'response', reportProgress?: boolean): Observable>>; - - public getDeletedDossiers(observe?: 'events', reportProgress?: boolean): Observable>>; - - public getDeletedDossiers(observe: any = 'body', reportProgress: boolean = false): Observable { - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request>('get', `${this.basePath}/deleted-dossiers`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Gets an existing dossier. - * None - * @param dossierId dossierId - * @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 getDossier(dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public getDossier(dossierId: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public getDossier(dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public getDossier(dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling getDossier.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('get', `${this.basePath}/dossier/${encodeURIComponent(String(dossierId))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Gets all existing dossiers. - * None - * @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 getDossiers(observe?: 'body', reportProgress?: boolean): Observable>; - - public getDossiers(observe?: 'response', reportProgress?: boolean): Observable>>; - - public getDossiers(observe?: 'events', reportProgress?: boolean): Observable>>; - - public getDossiers(observe: any = 'body', reportProgress: boolean = false): Observable { - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request>('get', `${this.basePath}/dossier`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Hard deletes existing dossiers. - * None - * @param dossierId dossierId - * @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 hardDeleteDossiers(dossierId: Array, observe?: 'body', reportProgress?: boolean): Observable; - - public hardDeleteDossiers(dossierId: Array, observe?: 'response', reportProgress?: boolean): Observable>; - - public hardDeleteDossiers(dossierId: Array, observe?: 'events', reportProgress?: boolean): Observable>; - - public hardDeleteDossiers(dossierId: Array, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling hardDeleteDossiers.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (dossierId) { - dossierId.forEach(element => { - queryParameters = queryParameters.append('dossierId', element); - }); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('delete', `${this.basePath}/deleted-dossiers/hard-delete`, { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Restores dossiers. - * None - * @param body dossierIds - * @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 restoreDossiers(body: Array, observe?: 'body', reportProgress?: boolean): Observable; - - public restoreDossiers(body: Array, observe?: 'response', reportProgress?: boolean): Observable>; - - public restoreDossiers(body: Array, observe?: 'events', reportProgress?: boolean): Observable>; - - public restoreDossiers(body: Array, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling restoreDossiers.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/deleted-dossiers/restore`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/dossierTemplateController.service.ts b/libs/red-ui-http/src/lib/api/dossierTemplateController.service.ts deleted file mode 100644 index 34baed127..000000000 --- a/libs/red-ui-http/src/lib/api/dossierTemplateController.service.ts +++ /dev/null @@ -1,300 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; -import { IDossierTemplate } from '../model/dossierTemplate'; - -@Injectable() -export class DossierTemplateControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Creates a new DossierTemplates or updates an existing one. - * None - * @param body dossierTemplateModel - * @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 createOrUpdateDossierTemplate(body: IDossierTemplate, observe?: 'body', reportProgress?: boolean): Observable; - - public createOrUpdateDossierTemplate( - body: IDossierTemplate, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public createOrUpdateDossierTemplate( - body: IDossierTemplate, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public createOrUpdateDossierTemplate(body: IDossierTemplate, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createOrUpdateDossierTemplate.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['*/*']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/dossier-template`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Delete a specific DossierTemplate by its ID - * None - * @param dossierTemplateId dossierTemplateId - * @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 deleteDossierTemplate(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public deleteDossierTemplate(dossierTemplateId: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public deleteDossierTemplate(dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public deleteDossierTemplate(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteDossierTemplate.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'delete', - `${this.basePath}/dossier-template/${encodeURIComponent(String(dossierTemplateId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Delete multiple DossierTemplates by their IDs - * None - * @param body dossierTemplateIds - * @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 deleteDossierTemplates(body: Array, observe?: 'body', reportProgress?: boolean): Observable; - - public deleteDossierTemplates(body: Array, observe?: 'response', reportProgress?: boolean): Observable>; - - public deleteDossierTemplates(body: Array, observe?: 'events', reportProgress?: boolean): Observable>; - - public deleteDossierTemplates(body: Array, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling deleteDossierTemplates.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/dossier-template/delete`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Lists all existing DossierTemplates. - * None - * @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 getAllDossierTemplates(observe?: 'body', reportProgress?: boolean): Observable>; - - public getAllDossierTemplates(observe?: 'response', reportProgress?: boolean): Observable>>; - - public getAllDossierTemplates(observe?: 'events', reportProgress?: boolean): Observable>>; - - public getAllDossierTemplates(observe: any = 'body', reportProgress: boolean = false): Observable { - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request>('get', `${this.basePath}/dossier-template`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Get a specific DossierTemplate by its ID - * None - * @param dossierTemplateId dossierTemplateId - * @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 getDossierTemplate(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public getDossierTemplate( - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getDossierTemplate( - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public getDossierTemplate(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling getDossierTemplate.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/dossier-template/${encodeURIComponent(String(dossierTemplateId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/downloadController.service.ts b/libs/red-ui-http/src/lib/api/downloadController.service.ts deleted file mode 100644 index 471dd8d5f..000000000 --- a/libs/red-ui-http/src/lib/api/downloadController.service.ts +++ /dev/null @@ -1,257 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; - -import { DownloadResponse } from '../model/downloadResponse'; -import { DownloadStatusResponse } from '../model/downloadStatusResponse'; -import { PrepareDownloadRequest } from '../model/prepareDownloadRequest'; -import { RemoveDownloadRequest } from '../model/removeDownloadRequest'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class DownloadControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Removes a previously created download status - * None - * @param body removeDownloadRequest - * @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 deleteDownload(body: RemoveDownloadRequest, observe?: 'body', reportProgress?: boolean): Observable; - - public deleteDownload(body: RemoveDownloadRequest, observe?: 'response', reportProgress?: boolean): Observable>; - - public deleteDownload(body: RemoveDownloadRequest, observe?: 'events', reportProgress?: boolean): Observable>; - - public deleteDownload(body: RemoveDownloadRequest, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling deleteDownload.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/async/download/delete`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Returns a downloadable byte stream of the requested file - * Use the optional \"inline\" request parameter to select, if this report will be opened in the browser. - * @param storageId storageId - * @param inline inline - * @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 downloadFile(storageId: string, inline?: boolean, observe?: 'body', reportProgress?: boolean): Observable; - - public downloadFile(storageId: string, inline?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; - - public downloadFile(storageId: string, inline?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; - - public downloadFile(storageId: string, inline?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable { - if (storageId === null || storageId === undefined) { - throw new Error('Required parameter storageId was null or undefined when calling downloadFile.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (inline !== undefined && inline !== null) { - queryParameters = queryParameters.set('inline', inline); - } - if (storageId !== undefined && storageId !== null) { - queryParameters = queryParameters.set('storageId', storageId); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['*/*']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('get', `${this.basePath}/async/download`, { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Gets to download status for the current user - * None - * @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 getDownloadStatus(observe?: 'body', reportProgress?: boolean): Observable; - - public getDownloadStatus(observe?: 'response', reportProgress?: boolean): Observable>; - - public getDownloadStatus(observe?: 'events', reportProgress?: boolean): Observable>; - - public getDownloadStatus(observe: any = 'body', reportProgress: boolean = false): Observable { - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('get', `${this.basePath}/async/download/status`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Prepares a download for given fileIds and types - * None - * @param body request - * @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 prepareDownload(body: PrepareDownloadRequest, observe?: 'body', reportProgress?: boolean): Observable; - - public prepareDownload( - body: PrepareDownloadRequest, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public prepareDownload( - body: PrepareDownloadRequest, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public prepareDownload(body: PrepareDownloadRequest, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling prepareDownload.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/async/download/prepare`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/fileAttributesController.service.ts b/libs/red-ui-http/src/lib/api/fileAttributesController.service.ts deleted file mode 100644 index 79aa0c00e..000000000 --- a/libs/red-ui-http/src/lib/api/fileAttributesController.service.ts +++ /dev/null @@ -1,518 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { IFileAttributeConfig } from '../model/fileAttributeConfig'; -import { FileAttributes } from '../model/fileAttributes'; -import { FileAttributesConfig } from '../model/fileAttributesConfig'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class FileAttributesControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Delete a specific file attribute. - * None - * @param dossierTemplateId dossierTemplateId - * @param fileAttributeId fileAttributeId - * @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 deleteFileAttribute( - dossierTemplateId: string, - fileAttributeId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public deleteFileAttribute( - dossierTemplateId: string, - fileAttributeId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public deleteFileAttribute( - dossierTemplateId: string, - fileAttributeId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public deleteFileAttribute( - dossierTemplateId: string, - fileAttributeId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteFileAttribute.'); - } - - if (fileAttributeId === null || fileAttributeId === undefined) { - throw new Error('Required parameter fileAttributeId was null or undefined when calling deleteFileAttribute.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'delete', - `${this.basePath}/fileAttributes/config/fileAttribute/${encodeURIComponent(String(dossierTemplateId))}/${encodeURIComponent( - String(fileAttributeId), - )}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Bulk delete file attributes. - * None - * @param body fileAttributeIds - * @param dossierTemplateId dossierTemplateId - * @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 deleteFileAttributes( - body: Array, - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public deleteFileAttributes( - body: Array, - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public deleteFileAttributes( - body: Array, - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public deleteFileAttributes( - body: Array, - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling deleteFileAttributes.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteFileAttributes.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/fileAttributes/config/fileAttribute/${encodeURIComponent(String(dossierTemplateId))}/delete`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Get the file attributes that can be used at importing csv. - * None - * @param dossierTemplateId dossierTemplateId - * @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 getFileAttributesConfiguration( - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public getFileAttributesConfiguration( - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getFileAttributesConfiguration( - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public getFileAttributesConfiguration( - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling getFileAttributesConfiguration.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/fileAttributes/config/${encodeURIComponent(String(dossierTemplateId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Set file attributes to an existing file - * None - * @param body fileAttributes - * @param dossierId dossierId - * @param fileId fileId - * @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 setFileAttributes( - body: FileAttributes, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public setFileAttributes( - body: FileAttributes, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setFileAttributes( - body: FileAttributes, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setFileAttributes( - body: FileAttributes, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling setFileAttributes.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling setFileAttributes.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling setFileAttributes.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/fileAttributes/set/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Set file attributes base configuration and a list of file attributes, - * None - * @param body fileAttributesConfig - * @param dossierTemplateId dossierTemplateId - * @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 setFileAttributesConfig( - body: FileAttributesConfig, - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public setFileAttributesConfig( - body: FileAttributesConfig, - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setFileAttributesConfig( - body: FileAttributesConfig, - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setFileAttributesConfig( - body: FileAttributesConfig, - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling setFileAttributesConfig.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling setFileAttributesConfig.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'put', - `${this.basePath}/fileAttributes/config/baseConfig/${encodeURIComponent(String(dossierTemplateId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Add or update a file attribute that can be used at importing csv. - * None - * @param body fileAttribute - * @param dossierTemplateId dossierTemplateId - * @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 setFileAttributesConfiguration( - body: IFileAttributeConfig, - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public setFileAttributesConfiguration( - body: IFileAttributeConfig, - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setFileAttributesConfiguration( - body: IFileAttributeConfig, - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setFileAttributesConfiguration( - body: IFileAttributeConfig, - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling setFileAttributesConfiguration.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling setFileAttributesConfiguration.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/fileAttributes/config/fileAttribute/${encodeURIComponent(String(dossierTemplateId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/fileManagementController.service.ts b/libs/red-ui-http/src/lib/api/fileManagementController.service.ts deleted file mode 100644 index ed56449e2..000000000 --- a/libs/red-ui-http/src/lib/api/fileManagementController.service.ts +++ /dev/null @@ -1,468 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class FileManagementControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Deletes a file for a given dossierId and FileId - * None - * @param dossierId dossierId - * @param fileId fileId - * @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 deleteFile(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public deleteFile(dossierId: string, fileId: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public deleteFile(dossierId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public deleteFile(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling deleteFile.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling deleteFile.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'delete', - `${this.basePath}/delete/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Deletes a a list of files for a given dossierId - * None - * @param body fileIds - * @param dossierId dossierId - * @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 deleteFiles(body: Array, dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public deleteFiles( - body: Array, - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public deleteFiles(body: Array, dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public deleteFiles(body: Array, dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling deleteFiles.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling deleteFiles.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/delete/${encodeURIComponent(String(dossierId))}`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Returns a downloadable byte stream of the annotated file with the specified fileId - * Use the optional \"inline\" request parameter to select, if this downloadAnnotated will be opened in the browser. - * @param dossierId dossierId - * @param fileId fileId - * @param inline inline - * @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 downloadAnnotatedFile( - dossierId: string, - fileId: string, - inline?: boolean, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public downloadAnnotatedFile( - dossierId: string, - fileId: string, - inline?: boolean, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public downloadAnnotatedFile( - dossierId: string, - fileId: string, - inline?: boolean, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public downloadAnnotatedFile( - dossierId: string, - fileId: string, - inline?: boolean, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling downloadAnnotatedFile.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling downloadAnnotatedFile.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (inline !== undefined && inline !== null) { - queryParameters = queryParameters.set('inline', inline); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['*/*']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/download/annotated/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns a downloadable byte stream of the original file with the specified fileId - * Use the optional \"inline\" request parameter to select, if this downloadAnnotated will be opened in the browser. - * @param dossierId dossierId - * @param fileId fileId - * @param inline inline - * @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 downloadOriginalFile( - dossierId: string, - fileId: string, - inline?: boolean, - indicator?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public downloadOriginalFile( - dossierId: string, - fileId: string, - inline?: boolean, - indicator?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public downloadOriginalFile( - dossierId: string, - fileId: string, - inline?: boolean, - indicator?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public downloadOriginalFile( - dossierId: string, - fileId: string, - inline?: boolean, - indicator?: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling downloadOriginalFile.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling downloadOriginalFile.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (inline !== undefined && inline !== null) { - queryParameters = queryParameters.set('inline', inline); - } - if (indicator !== undefined && indicator !== null) { - queryParameters = queryParameters.set('indicator', indicator); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['*/*']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/download/original/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - responseType: 'blob', - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Hard deletes an uploaded file. - * None - * @param dossierId dossierId - * @param fileIds fileIds - * @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 hardDeleteFile(dossierId: string, fileIds: Array, observe?: 'body', reportProgress?: boolean): Observable; - - public hardDeleteFile( - dossierId: string, - fileIds: Array, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public hardDeleteFile( - dossierId: string, - fileIds: Array, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public hardDeleteFile( - dossierId: string, - fileIds: Array, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling hardDeleteFile.'); - } - - if (fileIds === null || fileIds === undefined) { - throw new Error('Required parameter fileIds was null or undefined when calling hardDeleteFile.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (fileIds) { - fileIds.forEach(element => { - queryParameters = queryParameters.append('fileIds', element); - }); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('delete', `${this.basePath}/delete/hard-delete/${encodeURIComponent(String(dossierId))}`, { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Restores an deleted file. - * None - * @param body fileIds - * @param dossierId dossierId - * @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 restoreFiles(body: Array, dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public restoreFiles( - body: Array, - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public restoreFiles(body: Array, dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public restoreFiles(body: Array, dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling restoreFiles.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling restoreFiles.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/delete/restore/${encodeURIComponent(String(dossierId))}`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/generalSettingsController.service.ts b/libs/red-ui-http/src/lib/api/generalSettingsController.service.ts deleted file mode 100644 index 2f7ce83c0..000000000 --- a/libs/red-ui-http/src/lib/api/generalSettingsController.service.ts +++ /dev/null @@ -1,155 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { GeneralConfigurationModel } from '../model/generalConfigurationModel'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class GeneralSettingsControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Returns the current general Configuration. - * - * @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 getGeneralConfigurations(observe?: 'body', reportProgress?: boolean): Observable; - - public getGeneralConfigurations(observe?: 'response', reportProgress?: boolean): Observable>; - - public getGeneralConfigurations(observe?: 'events', reportProgress?: boolean): Observable>; - - public getGeneralConfigurations(observe: any = 'body', reportProgress: boolean = false): Observable { - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('get', `${this.basePath}/configuration/general`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Write General Configurations to KeyCloak - * - * @param body generalConfigurationModel - * @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 updateGeneralConfigurations(body: GeneralConfigurationModel, observe?: 'body', reportProgress?: boolean): Observable; - - public updateGeneralConfigurations( - body: GeneralConfigurationModel, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public updateGeneralConfigurations( - body: GeneralConfigurationModel, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public updateGeneralConfigurations( - body: GeneralConfigurationModel, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateGeneralConfigurations.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/configuration/general`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/infoController.service.ts b/libs/red-ui-http/src/lib/api/infoController.service.ts deleted file mode 100644 index 8fcf6925b..000000000 --- a/libs/red-ui-http/src/lib/api/infoController.service.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { AuthInfo } from '../model/authInfo'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class InfoControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Gets the auth information. - * None - * @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 getAuthInfo(observe?: 'body', reportProgress?: boolean): Observable; - - public getAuthInfo(observe?: 'response', reportProgress?: boolean): Observable>; - - public getAuthInfo(observe?: 'events', reportProgress?: boolean): Observable>; - - public getAuthInfo(observe: any = 'body', reportProgress: boolean = false): Observable { - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('get', `${this.basePath}/info`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/legalBasisMappingController.service.ts b/libs/red-ui-http/src/lib/api/legalBasisMappingController.service.ts deleted file mode 100644 index 88059ace0..000000000 --- a/libs/red-ui-http/src/lib/api/legalBasisMappingController.service.ts +++ /dev/null @@ -1,185 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { ILegalBasis } from '../model/legalBasis'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class LegalBasisMappingControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Set the mapping between legal basis and redaction reason. - * None - * @param dossierTemplateId dossierTemplateId - * @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 getLegalBasisMapping(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable>; - - public getLegalBasisMapping( - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean, - ): Observable>>; - - public getLegalBasisMapping( - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean, - ): Observable>>; - - public getLegalBasisMapping(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling getLegalBasisMapping.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request>( - 'get', - `${this.basePath}/legalBasis/${encodeURIComponent(String(dossierTemplateId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Set the mapping between legal basis and redaction reason. - * None - * @param body legalBasisMapping - * @param dossierTemplateId dossierTemplateId - * @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 setLegalBasisMapping( - body: Array, - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean, - ): Observable; - - public setLegalBasisMapping( - body: Array, - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean, - ): Observable>; - - public setLegalBasisMapping( - body: Array, - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean, - ): Observable>; - - public setLegalBasisMapping( - body: Array, - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling setLegalBasisMapping.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling setLegalBasisMapping.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/legalBasis/${encodeURIComponent(String(dossierTemplateId))}`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/licenseReportController.service.ts b/libs/red-ui-http/src/lib/api/licenseReportController.service.ts deleted file mode 100644 index fbefc55e1..000000000 --- a/libs/red-ui-http/src/lib/api/licenseReportController.service.ts +++ /dev/null @@ -1,143 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; - -import { LicenseReport } from '../model/licenseReport'; -import { LicenseReportRequest } from '../model/licenseReportRequest'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class LicenseReportControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Creates and serves license report. - * None - * @param body reportRequest - * @param limit limit - * @param offset offset - * @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 licenseReport( - body: LicenseReportRequest, - limit?: number, - offset?: number, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public licenseReport( - body: LicenseReportRequest, - limit?: number, - offset?: number, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public licenseReport( - body: LicenseReportRequest, - limit?: number, - offset?: number, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public licenseReport( - body: LicenseReportRequest, - limit?: number, - offset?: number, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling licenseReport.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (limit !== undefined && limit !== null) { - queryParameters = queryParameters.set('limit', limit); - } - if (offset !== undefined && offset !== null) { - queryParameters = queryParameters.set('offset', offset); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/report/license`, { - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/manualRedactionController.service.ts b/libs/red-ui-http/src/lib/api/manualRedactionController.service.ts deleted file mode 100644 index 7521f7aae..000000000 --- a/libs/red-ui-http/src/lib/api/manualRedactionController.service.ts +++ /dev/null @@ -1,1467 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { AddCommentRequest } from '../model/addCommentRequest'; -import { AddRedactionRequest } from '../model/addRedactionRequest'; -import { ApproveRequest } from '../model/approveRequest'; -import { CommentResponse } from '../model/commentResponse'; -import { ForceRedactionRequest } from '../model/forceRedactionRequest'; -import { ImageRecategorizationRequest } from '../model/imageRecategorizationRequest'; -import { LegalBasisChangeRequest } from '../model/legalBasisChangeRequest'; -import { ManualAddResponse } from '../model/manualAddResponse'; -import { ManualRedactions } from '../model/manualRedactions'; -import { RemoveRedactionRequest } from '../model/removeRedactionRequest'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class ManualRedactionControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Adds a comment to a redaction/redaction request - * None - * @param body addCommentRequest - * @param annotationId annotationId - * @param dossierId dossierId - * @param fileId fileId - * @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 addComment( - body: AddCommentRequest, - annotationId: string, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public addComment( - body: AddCommentRequest, - annotationId: string, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public addComment( - body: AddCommentRequest, - annotationId: string, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public addComment( - body: AddCommentRequest, - annotationId: string, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addComment.'); - } - - if (annotationId === null || annotationId === undefined) { - throw new Error('Required parameter annotationId was null or undefined when calling addComment.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling addComment.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling addComment.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/manualRedaction/comment/add/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId), - )}/${encodeURIComponent(String(annotationId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Adds a manual redaction - * None - * @param body addRedactionRequest - * @param dossierId dossierId - * @param fileId fileId - * @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 addRedaction( - body: AddRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public addRedaction( - body: AddRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public addRedaction( - body: AddRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public addRedaction( - body: AddRedactionRequest, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addRedaction.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling addRedaction.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling addRedaction.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/manualRedaction/redaction/add/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Approves a redaction request/ remove redaction request - * None - * @param body approveRequest - * @param annotationId annotationId - * @param dossierId dossierId - * @param fileId fileId - * @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 approveRequest( - body: ApproveRequest, - annotationId: string, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public approveRequest( - body: ApproveRequest, - annotationId: string, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public approveRequest( - body: ApproveRequest, - annotationId: string, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public approveRequest( - body: ApproveRequest, - annotationId: string, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling approveRequest.'); - } - - if (annotationId === null || annotationId === undefined) { - throw new Error('Required parameter annotationId was null or undefined when calling approveRequest.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling approveRequest.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling approveRequest.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/manualRedaction/approve/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId), - )}/${encodeURIComponent(String(annotationId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Declines a redaction request/ remove redaction request - * None - * @param annotationId annotationId - * @param dossierId dossierId - * @param fileId fileId - * @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 declineRequest( - annotationId: string, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public declineRequest( - annotationId: string, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public declineRequest( - annotationId: string, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public declineRequest( - annotationId: string, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (annotationId === null || annotationId === undefined) { - throw new Error('Required parameter annotationId was null or undefined when calling declineRequest.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling declineRequest.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling declineRequest.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/manualRedaction/decline/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId), - )}/${encodeURIComponent(String(annotationId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Forces a redaction - * None - * @param body forceRedactionRequest - * @param dossierId dossierId - * @param fileId fileId - * @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 forceRedaction( - body: ForceRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public forceRedaction( - body: ForceRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public forceRedaction( - body: ForceRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public forceRedaction( - body: ForceRedactionRequest, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling forceRedaction.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling forceRedaction.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling forceRedaction.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/manualRedaction/redaction/force/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId), - )}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns the manual redactions - * None - * @param dossierId dossierId - * @param fileId fileId - * @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 getManualRedaction(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public getManualRedaction( - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getManualRedaction( - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public getManualRedaction(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling getManualRedaction.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling getManualRedaction.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/manualRedaction/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Changes a legal basis reason - * None - * @param body legalBasisChangeRequest - * @param dossierId dossierId - * @param fileId fileId - * @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 legalBasisChange( - body: LegalBasisChangeRequest, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public legalBasisChange( - body: LegalBasisChangeRequest, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public legalBasisChange( - body: LegalBasisChangeRequest, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public legalBasisChange( - body: LegalBasisChangeRequest, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling legalBasisChange.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling legalBasisChange.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling legalBasisChange.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/manualRedaction/redaction/legalBasisChange/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId), - )}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Recategorizes an image - * None - * @param body imageRecategorizationRequest - * @param dossierId dossierId - * @param fileId fileId - * @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 recategorizeImage( - body: ImageRecategorizationRequest, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public recategorizeImage( - body: ImageRecategorizationRequest, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public recategorizeImage( - body: ImageRecategorizationRequest, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public recategorizeImage( - body: ImageRecategorizationRequest, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling recategorizeImage.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling recategorizeImage.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling recategorizeImage.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/manualRedaction/redaction/recategorize/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId), - )}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Removes a redaction - * None - * @param body removeRedactionRequest - * @param dossierId dossierId - * @param fileId fileId - * @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 removeRedaction( - body: RemoveRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public removeRedaction( - body: RemoveRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public removeRedaction( - body: RemoveRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public removeRedaction( - body: RemoveRedactionRequest, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling removeRedaction.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling removeRedaction.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling removeRedaction.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/manualRedaction/redaction/remove/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId), - )}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Adds a request for a redaction. - * None - * @param body addRedactionRequest - * @param dossierId dossierId - * @param fileId fileId - * @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 requestAddRedaction( - body: AddRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public requestAddRedaction( - body: AddRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public requestAddRedaction( - body: AddRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public requestAddRedaction( - body: AddRedactionRequest, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling requestAddRedaction.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling requestAddRedaction.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling requestAddRedaction.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/manualRedaction/request/add/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Adds a request to force a redaction. - * None - * @param body forceRedactionRequest - * @param dossierId dossierId - * @param fileId fileId - * @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 requestForceRedaction( - body: ForceRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public requestForceRedaction( - body: ForceRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public requestForceRedaction( - body: ForceRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public requestForceRedaction( - body: ForceRedactionRequest, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling requestForceRedaction.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling requestForceRedaction.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling requestForceRedaction.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/manualRedaction/request/force/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Adds a request to recategorize a image. - * None - * @param body imageRecategorizationRequest - * @param dossierId dossierId - * @param fileId fileId - * @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 requestImageRecategorization( - body: ImageRecategorizationRequest, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public requestImageRecategorization( - body: ImageRecategorizationRequest, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public requestImageRecategorization( - body: ImageRecategorizationRequest, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public requestImageRecategorization( - body: ImageRecategorizationRequest, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling requestImageRecategorization.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling requestImageRecategorization.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling requestImageRecategorization.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/manualRedaction/request/recategorize/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId), - )}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Adds a request to change the legal basis reason. - * None - * @param body legalBasisChangeRequest - * @param dossierId dossierId - * @param fileId fileId - * @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 requestLegalBasisChange( - body: LegalBasisChangeRequest, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public requestLegalBasisChange( - body: LegalBasisChangeRequest, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public requestLegalBasisChange( - body: LegalBasisChangeRequest, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public requestLegalBasisChange( - body: LegalBasisChangeRequest, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling requestLegalBasisChange.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling requestLegalBasisChange.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling requestLegalBasisChange.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/manualRedaction/request/legalBasis/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId), - )}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Adds a request to remove a redaction. - * None - * @param body removeRedactionRequest - * @param dossierId dossierId - * @param fileId fileId - * @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 requestRemoveRedaction( - body: RemoveRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public requestRemoveRedaction( - body: RemoveRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public requestRemoveRedaction( - body: RemoveRedactionRequest, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public requestRemoveRedaction( - body: RemoveRedactionRequest, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling requestRemoveRedaction.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling requestRemoveRedaction.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling requestRemoveRedaction.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/manualRedaction/request/remove/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId), - )}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Undo a manual request or redaction - * Can only be done be the user who added the request/redaction. - * @param annotationId annotationId - * @param dossierId dossierId - * @param fileId fileId - * @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 undo(annotationId: string, dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public undo( - annotationId: string, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public undo( - annotationId: string, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public undo( - annotationId: string, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (annotationId === null || annotationId === undefined) { - throw new Error('Required parameter annotationId was null or undefined when calling undo.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling undo.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling undo.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'delete', - `${this.basePath}/manualRedaction/undo/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId), - )}/${encodeURIComponent(String(annotationId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Undo a comment - * Can only be done be the user who added the comment. - * @param annotationId annotationId - * @param commentId commentId - * @param dossierId dossierId - * @param fileId fileId - * @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 undoComment( - annotationId: string, - commentId: string, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public undoComment( - annotationId: string, - commentId: string, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public undoComment( - annotationId: string, - commentId: string, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public undoComment( - annotationId: string, - commentId: string, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (annotationId === null || annotationId === undefined) { - throw new Error('Required parameter annotationId was null or undefined when calling undoComment.'); - } - - if (commentId === null || commentId === undefined) { - throw new Error('Required parameter commentId was null or undefined when calling undoComment.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling undoComment.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling undoComment.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'delete', - `${this.basePath}/manualRedaction/comment/undo/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId), - )}/${encodeURIComponent(String(annotationId))}/${encodeURIComponent(String(commentId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/notificationController.service.ts b/libs/red-ui-http/src/lib/api/notificationController.service.ts deleted file mode 100644 index 7efa7274e..000000000 --- a/libs/red-ui-http/src/lib/api/notificationController.service.ts +++ /dev/null @@ -1,315 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; - -import { NotificationResponse } from '../model/notificationResponse'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class NotificationControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Delete notifications - * None - * @param body notificationIds - * @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 deleteNotifications(body: Array, observe?: 'body', reportProgress?: boolean): Observable; - - public deleteNotifications(body: Array, observe?: 'response', reportProgress?: boolean): Observable>; - - public deleteNotifications(body: Array, observe?: 'events', reportProgress?: boolean): Observable>; - - public deleteNotifications(body: Array, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling deleteNotifications.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/notification/delete`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Retrieves notifications for the current user - * None - * @param includeSeen includeSeen - * @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 getNotifications(includeSeen: boolean, observe?: 'body', reportProgress?: boolean): Observable; - - public getNotifications( - includeSeen: boolean, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getNotifications( - includeSeen: boolean, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public getNotifications(includeSeen: boolean, observe: any = 'body', reportProgress: boolean = false): Observable { - if (includeSeen === null || includeSeen === undefined) { - throw new Error('Required parameter includeSeen was null or undefined when calling getNotifications.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (includeSeen !== undefined && includeSeen !== null) { - queryParameters = queryParameters.set('includeSeen', includeSeen); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('get', `${this.basePath}/notification`, { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Mark a notifications as read or unread - * None - * @param body notificationIds - * @param setRead setRead - * @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 toggleNotificationRead(body: Array, setRead: boolean, observe?: 'body', reportProgress?: boolean): Observable; - - public toggleNotificationRead( - body: Array, - setRead: boolean, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public toggleNotificationRead( - body: Array, - setRead: boolean, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public toggleNotificationRead( - body: Array, - setRead: boolean, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling toggleNotificationRead.'); - } - - if (setRead === null || setRead === undefined) { - throw new Error('Required parameter setRead was null or undefined when calling toggleNotificationRead.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (setRead !== undefined && setRead !== null) { - queryParameters = queryParameters.set('setRead', setRead); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/notification/toggle-read`, { - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Mark a notifications as seen or unseen - * None - * @param body notificationIds - * @param setSeen setSeen - * @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 toggleNotificationSeen(body: Array, setSeen: boolean, observe?: 'body', reportProgress?: boolean): Observable; - - public toggleNotificationSeen( - body: Array, - setSeen: boolean, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public toggleNotificationSeen( - body: Array, - setSeen: boolean, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public toggleNotificationSeen( - body: Array, - setSeen: boolean, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling toggleNotificationSeen.'); - } - - if (setSeen === null || setSeen === undefined) { - throw new Error('Required parameter setSeen was null or undefined when calling toggleNotificationSeen.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (setSeen !== undefined && setSeen !== null) { - queryParameters = queryParameters.set('setSeen', setSeen); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/notification/toggle-seen`, { - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/reanalysisController.service.ts b/libs/red-ui-http/src/lib/api/reanalysisController.service.ts deleted file mode 100644 index 20fef4590..000000000 --- a/libs/red-ui-http/src/lib/api/reanalysisController.service.ts +++ /dev/null @@ -1,761 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; - -import { PageExclusionRequest } from '../model/pageExclusionRequest'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class ReanalysisControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Exclude pages from analysis for a file - * None - * @param body pageExclusionRequest - * @param dossierId dossierId - * @param fileId fileId - * @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 excludePages( - body: PageExclusionRequest, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public excludePages( - body: PageExclusionRequest, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public excludePages( - body: PageExclusionRequest, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public excludePages( - body: PageExclusionRequest, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling excludePages.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling excludePages.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling excludePages.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/exclude-pages/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Include pages from analysis for a file - * None - * @param body pageInclusionRequest - * @param dossierId dossierId - * @param fileId fileId - * @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 includePages( - body: PageExclusionRequest, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public includePages( - body: PageExclusionRequest, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public includePages( - body: PageExclusionRequest, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public includePages( - body: PageExclusionRequest, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling includePages.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling includePages.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling includePages.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/include-pages/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Ocr and reanalyze a dossier - * None - * @param dossierId dossierId - * @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 ocrDossier(dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public ocrDossier(dossierId: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public ocrDossier(dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public ocrDossier(dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling ocrDossier.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('post', `${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(dossierId))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Ocr and reanalyze a file - * None - * @param dossierId dossierId - * @param fileId fileId - * @param force force - * @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 ocrFile(dossierId: string, fileId: string, force?: boolean, observe?: 'body', reportProgress?: boolean): Observable; - - public ocrFile( - dossierId: string, - fileId: string, - force?: boolean, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public ocrFile( - dossierId: string, - fileId: string, - force?: boolean, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public ocrFile( - dossierId: string, - fileId: string, - force?: boolean, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling ocrFile.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling ocrFile.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (force !== undefined && force !== null) { - queryParameters = queryParameters.set('force', force); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Ocr and reanalyze multiple files for a dossier - * None - * @param body fileIds - * @param dossierId dossierId - * @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 ocrFiles(body: Array, dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public ocrFiles(body: Array, dossierId: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public ocrFiles(body: Array, dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public ocrFiles(body: Array, dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling ocrFiles.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling ocrFiles.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(dossierId))}/bulk`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Reanalyze all files of the dossier. - * None - * @param dossierId dossierId - * @param force force - * @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 reanalyzeDossier(dossierId: string, force?: boolean, observe?: 'body', reportProgress?: boolean): Observable; - - public reanalyzeDossier( - dossierId: string, - force?: boolean, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public reanalyzeDossier(dossierId: string, force?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; - - public reanalyzeDossier(dossierId: string, force?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling reanalyzeDossier.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (force !== undefined && force !== null) { - queryParameters = queryParameters.set('force', force); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('post', `${this.basePath}/reanalyze/${encodeURIComponent(String(dossierId))}`, { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Reanalyze a file - * None - * @param dossierId dossierId - * @param fileId fileId - * @param force force - * @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 reanalyzeFile(dossierId: string, fileId: string, force?: boolean, observe?: 'body', reportProgress?: boolean): Observable; - - public reanalyzeFile( - dossierId: string, - fileId: string, - force?: boolean, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public reanalyzeFile( - dossierId: string, - fileId: string, - force?: boolean, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public reanalyzeFile( - dossierId: string, - fileId: string, - force?: boolean, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling reanalyzeFile.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling reanalyzeFile.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (force !== undefined && force !== null) { - queryParameters = queryParameters.set('force', force); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/reanalyze/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Reanalyze multiple files for a dossier - * None - * @param body fileIds - * @param dossierId dossierId - * @param force force - * @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 reanalyzeFilesForDossier( - body: Array, - dossierId: string, - force?: boolean, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public reanalyzeFilesForDossier( - body: Array, - dossierId: string, - force?: boolean, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public reanalyzeFilesForDossier( - body: Array, - dossierId: string, - force?: boolean, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public reanalyzeFilesForDossier( - body: Array, - dossierId: string, - force?: boolean, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling reanalyzeFilesForDossier.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling reanalyzeFilesForDossier.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (force !== undefined && force !== null) { - queryParameters = queryParameters.set('force', force); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/reanalyze/${encodeURIComponent(String(dossierId))}/bulk`, { - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Reindex a dossier, files of a dossier or all - * None - * @param body fileIds - * @param dossierId dossierId - * @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 reindex(body: Array, dossierId?: string, observe?: 'body', reportProgress?: boolean): Observable; - - public reindex(body: Array, dossierId?: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public reindex(body: Array, dossierId?: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public reindex(body: Array, dossierId?: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling reindex.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (dossierId !== undefined && dossierId !== null) { - queryParameters = queryParameters.set('dossierId', dossierId); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/reindex`, { - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Exclude or re-include a file to analysis - * None - * @param dossierId dossierId - * @param fileId fileId - * @param excluded excluded - * @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 toggleAnalysis( - dossierId: string, - fileId: string, - excluded?: boolean, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public toggleAnalysis( - dossierId: string, - fileId: string, - excluded?: boolean, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public toggleAnalysis( - dossierId: string, - fileId: string, - excluded?: boolean, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public toggleAnalysis( - dossierId: string, - fileId: string, - excluded?: boolean, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling toggleAnalysis.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling toggleAnalysis.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (excluded !== undefined && excluded !== null) { - queryParameters = queryParameters.set('excluded', excluded); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/toggle-analysis/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/redactionLogController.service.ts b/libs/red-ui-http/src/lib/api/redactionLogController.service.ts deleted file mode 100644 index 4f785770f..000000000 --- a/libs/red-ui-http/src/lib/api/redactionLogController.service.ts +++ /dev/null @@ -1,201 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; - -import { RedactionLog } from '../model/redactionLog'; -import { SectionGrid } from '../model/sectionGrid'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class RedactionLogControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Gets the redaction log for a fileId - * None - * @param dossierId dossierId - * @param fileId fileId - * @param withManualRedactions withManualRedactions - * @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 getRedactionLog( - dossierId: string, - fileId: string, - withManualRedactions?: boolean, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public getRedactionLog( - dossierId: string, - fileId: string, - withManualRedactions?: boolean, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getRedactionLog( - dossierId: string, - fileId: string, - withManualRedactions?: boolean, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public getRedactionLog( - dossierId: string, - fileId: string, - withManualRedactions?: boolean, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling getRedactionLog.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling getRedactionLog.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (withManualRedactions !== undefined && withManualRedactions !== null) { - queryParameters = queryParameters.set('withManualRedactions', withManualRedactions); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/redactionLog/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Gets the section grid for a fileId - * None - * @param dossierId dossierId - * @param fileId fileId - * @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 getSectionGrid(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public getSectionGrid( - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getSectionGrid( - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public getSectionGrid(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling getSectionGrid.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling getSectionGrid.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/sectionGrid/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/reportTemplateController.service.ts b/libs/red-ui-http/src/lib/api/reportTemplateController.service.ts deleted file mode 100644 index a152d1660..000000000 --- a/libs/red-ui-http/src/lib/api/reportTemplateController.service.ts +++ /dev/null @@ -1,402 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; - -import { PlaceholdersResponse } from '../model/placeholdersResponse'; -import { ReportTemplate } from '../model/reportTemplate'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class ReportTemplateControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Delete template file for redaction-report - * None - * @param dossierTemplateId dossierTemplateId - * @param templateId templateId - * @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 deleteTemplate(dossierTemplateId: string, templateId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public deleteTemplate( - dossierTemplateId: string, - templateId: string, - observe?: 'response', - reportProgress?: boolean, - ): Observable>; - - public deleteTemplate( - dossierTemplateId: string, - templateId: string, - observe?: 'events', - reportProgress?: boolean, - ): Observable>; - - public deleteTemplate( - dossierTemplateId: string, - templateId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteTemplate.'); - } - - if (templateId === null || templateId === undefined) { - throw new Error('Required parameter templateId was null or undefined when calling deleteTemplate.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'delete', - `${this.basePath}/templateUpload/${encodeURIComponent(String(dossierTemplateId))}/${encodeURIComponent(String(templateId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Download template file for redaction-report - * None - * @param dossierTemplateId dossierTemplateId - * @param templateId templateId - * @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 downloadReportTemplate( - dossierTemplateId: string, - templateId: string, - observe?: 'body', - reportProgress?: boolean, - ): Observable; - - public downloadReportTemplate( - dossierTemplateId: string, - templateId: string, - observe?: 'response', - reportProgress?: boolean, - ): Observable>; - - public downloadReportTemplate( - dossierTemplateId: string, - templateId: string, - observe?: 'events', - reportProgress?: boolean, - ): Observable>; - - public downloadReportTemplate( - dossierTemplateId: string, - templateId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling downloadReportTemplate.'); - } - - if (templateId === null || templateId === undefined) { - throw new Error('Required parameter templateId was null or undefined when calling downloadReportTemplate.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/templateUpload/${encodeURIComponent(String(dossierTemplateId))}/${encodeURIComponent(String(templateId))}`, - { - responseType: 'blob', - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns list of available placeholders - * None - * @param dossierTemplateId dossierTemplateId - * @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 getAvailablePlaceholders( - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean, - ): Observable; - - public getAvailablePlaceholders( - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean, - ): Observable>; - - public getAvailablePlaceholders( - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean, - ): Observable>; - - public getAvailablePlaceholders(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling getAvailablePlaceholders.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/placeholders/${encodeURIComponent(String(dossierTemplateId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns available templates for redaction-report - * None - * @param dossierTemplateId dossierTemplateId - * @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 getAvailableReportTemplates( - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean, - ): Observable>; - - public getAvailableReportTemplates( - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean, - ): Observable>>; - - public getAvailableReportTemplates( - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean, - ): Observable>>; - - public getAvailableReportTemplates(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling getAvailableReportTemplates.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request>( - 'get', - `${this.basePath}/templateUpload/${encodeURIComponent(String(dossierTemplateId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Upload template file for redaction-report - * None - * @param dossierTemplateId The dossierTemplateId, the report template belongs to - * @param multiFileReport - * @param file - * @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 uploadTemplateForm( - dossierTemplateId: string, - multiFileReport?: boolean, - file?: Blob, - observe?: 'body', - reportProgress?: boolean, - ): Observable; - - public uploadTemplateForm( - dossierTemplateId: string, - multiFileReport?: boolean, - file?: Blob, - observe?: 'response', - reportProgress?: boolean, - ): Observable>; - - public uploadTemplateForm( - dossierTemplateId: string, - multiFileReport?: boolean, - file?: Blob, - observe?: 'events', - reportProgress?: boolean, - ): Observable>; - - public uploadTemplateForm( - dossierTemplateId: string, - multiFileReport?: boolean, - file?: Blob, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling uploadTemplate.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['multipart/form-data']; - - const canConsumeForm = this.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): void }; - let useForm = false; - const convertFormParamsToString = false; - // use FormData to transmit files using content-type "multipart/form-data" - // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data - useForm = canConsumeForm; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - } - - if (multiFileReport !== undefined) { - formParams = (formParams.append('multiFileReport', multiFileReport) as any) || formParams; - } - if (file !== undefined) { - formParams = (formParams.append('file', file) as any) || formParams; - } - - return this.httpClient.request( - 'post', - `${this.basePath}/templateUpload/${encodeURIComponent(String(dossierTemplateId))}`, - { - body: convertFormParamsToString ? formParams.toString() : formParams, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/rulesController.service.ts b/libs/red-ui-http/src/lib/api/rulesController.service.ts deleted file mode 100644 index cb83081e2..000000000 --- a/libs/red-ui-http/src/lib/api/rulesController.service.ts +++ /dev/null @@ -1,271 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; - -import { Rules } from '../model/rules'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class RulesControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Returns object containing the currently used Drools rules. - * - * @param dossierTemplateId dossierTemplateId - * @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 downloadRules(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public downloadRules(dossierTemplateId: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public downloadRules(dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public downloadRules(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling downloadRules.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('get', `${this.basePath}/rules/${encodeURIComponent(String(dossierTemplateId))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Returns file containing the currently used Drools rules. - * - * @param dossierTemplateId dossierTemplateId - * @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 downloadRulesFile(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public downloadRulesFile(dossierTemplateId: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public downloadRulesFile(dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public downloadRulesFile(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling downloadRulesFile.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['*/*']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('get', `${this.basePath}/rules/${encodeURIComponent(String(dossierTemplateId))}/download`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Takes object containing string or rules as argument, which will be used by the redaction service. - * - * @param body rules - * @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 uploadRules(body: Rules, observe?: 'body', reportProgress?: boolean): Observable; - - public uploadRules(body: Rules, observe?: 'response', reportProgress?: boolean): Observable>; - - public uploadRules(body: Rules, observe?: 'events', reportProgress?: boolean): Observable>; - - public uploadRules(body: Rules, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling uploadRules.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/rules`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Takes object containing string or rules as argument, which will be used by the redaction service. - * - * @param dossierTemplateId dossierTemplateId - * @param file - * @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 uploadRulesFileForm(dossierTemplateId: string, file?: Blob, observe?: 'body', reportProgress?: boolean): Observable; - - public uploadRulesFileForm( - dossierTemplateId: string, - file?: Blob, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public uploadRulesFileForm( - dossierTemplateId: string, - file?: Blob, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public uploadRulesFileForm( - dossierTemplateId: string, - file?: Blob, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling uploadRulesFile.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['multipart/form-data']; - - const canConsumeForm = this.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): void }; - let useForm = false; - const convertFormParamsToString = false; - // use FormData to transmit files using content-type "multipart/form-data" - // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data - useForm = canConsumeForm; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - } - - if (file !== undefined) { - formParams = (formParams.append('file', file) as any) || formParams; - } - - return this.httpClient.request('post', `${this.basePath}/rules/${encodeURIComponent(String(dossierTemplateId))}/upload`, { - body: convertFormParamsToString ? formParams.toString() : formParams, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/searchController.service.ts b/libs/red-ui-http/src/lib/api/searchController.service.ts deleted file mode 100644 index a2c9cfed2..000000000 --- a/libs/red-ui-http/src/lib/api/searchController.service.ts +++ /dev/null @@ -1,107 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { SearchRequest } from '../model/searchRequest'; -import { SearchResult } from '../model/searchResult'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class SearchControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Search for contents of documents - * None - * @param body searchRequest - * @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 search(body: SearchRequest, observe?: 'body', reportProgress?: boolean): Observable; - - public search(body: SearchRequest, observe?: 'response', reportProgress?: boolean): Observable>; - - public search(body: SearchRequest, observe?: 'events', reportProgress?: boolean): Observable>; - - public search(body: SearchRequest, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling search.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/search`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/smtpConfigurationController.service.ts b/libs/red-ui-http/src/lib/api/smtpConfigurationController.service.ts deleted file mode 100644 index d10788582..000000000 --- a/libs/red-ui-http/src/lib/api/smtpConfigurationController.service.ts +++ /dev/null @@ -1,229 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; -import { SMTPConfiguration } from '../model/sMTPConfiguration'; - -@Injectable() -export class SmtpConfigurationControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Clear SMTP Settings to KeyCloak - * - * @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 clearSMTPConfiguration(observe?: 'body', reportProgress?: boolean): Observable; - - public clearSMTPConfiguration(observe?: 'response', reportProgress?: boolean): Observable>; - - public clearSMTPConfiguration(observe?: 'events', reportProgress?: boolean): Observable>; - - public clearSMTPConfiguration(observe: any = 'body', reportProgress: boolean = false): Observable { - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('delete', `${this.basePath}/configuration/smtp`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Returns the current SMTP Configuration. - * - * @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 getCurrentSMTPConfiguration(observe?: 'body', reportProgress?: boolean): Observable; - - public getCurrentSMTPConfiguration(observe?: 'response', reportProgress?: boolean): Observable>; - - public getCurrentSMTPConfiguration(observe?: 'events', reportProgress?: boolean): Observable>; - - public getCurrentSMTPConfiguration(observe: any = 'body', reportProgress: boolean = false): Observable { - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('get', `${this.basePath}/configuration/smtp`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Test SMTP Settings to KeyCloak - * - * @param body smtpConfigurationModel - * @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 testSMTPConfiguration(body: SMTPConfiguration, observe?: 'body', reportProgress?: boolean): Observable; - - public testSMTPConfiguration(body: SMTPConfiguration, observe?: 'response', reportProgress?: boolean): Observable>; - - public testSMTPConfiguration(body: SMTPConfiguration, observe?: 'events', reportProgress?: boolean): Observable>; - - public testSMTPConfiguration(body: SMTPConfiguration, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling testSMTPConfiguration.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/configuration/smtp/test`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Write SMTP Settings to KeyCloak - * - * @param body smtpConfigurationModel - * @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 updateSMTPConfiguration(body: SMTPConfiguration, observe?: 'body', reportProgress?: boolean): Observable; - - public updateSMTPConfiguration(body: SMTPConfiguration, observe?: 'response', reportProgress?: boolean): Observable>; - - public updateSMTPConfiguration(body: SMTPConfiguration, observe?: 'events', reportProgress?: boolean): Observable>; - - public updateSMTPConfiguration(body: SMTPConfiguration, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateSMTPConfiguration.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/configuration/smtp`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/statusController.service.ts b/libs/red-ui-http/src/lib/api/statusController.service.ts deleted file mode 100644 index 0ebf68cf9..000000000 --- a/libs/red-ui-http/src/lib/api/statusController.service.ts +++ /dev/null @@ -1,1043 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; - -import { IFile } from '../model/file'; -import { JSONPrimitive } from '../model/JSONPrimitive'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class StatusControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Gets the deleted status for a file. - * None - * @param dossierId dossierId - * @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 getDeletedFileStatus(dossierId: string, observe?: 'body', reportProgress?: boolean): Observable>; - - public getDeletedFileStatus(dossierId: string, observe?: 'response', reportProgress?: boolean): Observable>>; - - public getDeletedFileStatus(dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>>; - public getDeletedFileStatus(dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling getDeletedFileStatus.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request>( - 'get', - `${this.basePath}/status/softdeleted/${encodeURIComponent(String(dossierId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Gets the status for all files in a dossier. - * None - * @param dossierId The id of the dossier you want the status for. - * @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 getDossierStatus(dossierId: string, observe?: 'body', reportProgress?: boolean): Observable>; - - public getDossierStatus(dossierId: string, observe?: 'response', reportProgress?: boolean): Observable>>; - - public getDossierStatus(dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>>; - - public getDossierStatus(dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling getDossierStatus.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request>('get', `${this.basePath}/status/${encodeURIComponent(String(dossierId))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Gets the status for a file. - * None - * @param dossierId dossierId - * @param fileId fileId - * @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 getFileStatus(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public getFileStatus( - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getFileStatus(dossierId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public getFileStatus(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling getFileStatus.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling getFileStatus.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/status/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Gets the status for all files of a list of dossiers. - * None - * @param body dossierIds - * @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 getFileStatusForDossiers( - body: Array, - observe?: 'body', - reportProgress?: boolean - ): Observable<{ [key: string]: Array }>; - - public getFileStatusForDossiers( - body: Array, - observe?: 'response', - reportProgress?: boolean - ): Observable }>>; - - public getFileStatusForDossiers( - body: Array, - observe?: 'events', - reportProgress?: boolean - ): Observable }>>; - - public getFileStatusForDossiers(body: Array, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling getFileStatusForDossiers.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request<{ [key: string]: Array }>('post', `${this.basePath}/status`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Assigns a reviewer for a file. - * None - * @param body reviewerId - * @param dossierId dossierId - * @param fileId fileId - * @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 setFileReviewer( - body: JSONPrimitive, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public setFileReviewer( - body: JSONPrimitive, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setFileReviewer( - body: JSONPrimitive, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setFileReviewer( - body: JSONPrimitive, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling setFileReviewer.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling setFileReviewer.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling setFileReviewer.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/status/set-reviewer/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Assigns a reviewer for a file. - * None - * @param dossierId dossierId - * @param fileId fileId - * @param reviewerId reviewerId - * @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 setFileReviewer1( - dossierId: string, - fileId: string, - reviewerId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public setFileReviewer1( - dossierId: string, - fileId: string, - reviewerId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setFileReviewer1( - dossierId: string, - fileId: string, - reviewerId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setFileReviewer1( - dossierId: string, - fileId: string, - reviewerId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling setFileReviewer1.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling setFileReviewer1.'); - } - - if (reviewerId === null || reviewerId === undefined) { - throw new Error('Required parameter reviewerId was null or undefined when calling setFileReviewer1.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/status/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}/${encodeURIComponent( - String(reviewerId), - )}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Assign a reviewer for a list of files. - * None - * @param body fileIds - * @param dossierId dossierId - * @param reviewerId reviewerId - * @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 setFileReviewerForList( - body: Array, - dossierId: string, - reviewerId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public setFileReviewerForList( - body: Array, - dossierId: string, - reviewerId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setFileReviewerForList( - body: Array, - dossierId: string, - reviewerId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setFileReviewerForList( - body: Array, - dossierId: string, - reviewerId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling setFileReviewerForList.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling setFileReviewerForList.'); - } - - if (reviewerId === null || reviewerId === undefined) { - throw new Error('Required parameter reviewerId was null or undefined when calling setFileReviewerForList.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/status/${encodeURIComponent(String(dossierId))}/bulk/${encodeURIComponent(String(reviewerId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Sets the status APPROVED for a file. - * None - * @param dossierId dossierId - * @param fileId fileId - * @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 setStatusApproved(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public setStatusApproved( - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setStatusApproved(dossierId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public setStatusApproved(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling setStatusApproved.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling setStatusApproved.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/status/approved/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Sets the status APPROVED for a list of files. - * None - * @param body fileIds - * @param dossierId dossierId - * @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 setStatusApprovedForList(body: Array, dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public setStatusApprovedForList( - body: Array, - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setStatusApprovedForList( - body: Array, - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setStatusApprovedForList( - body: Array, - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling setStatusApprovedForList.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling setStatusApprovedForList.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/status/approved/${encodeURIComponent(String(dossierId))}/bulk`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Sets the status UNDER_APPROVAL for a file. - * None - * @param body approverId - * @param dossierId dossierId - * @param fileId fileId - * @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 setStatusUnderApproval( - body: JSONPrimitive, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public setStatusUnderApproval( - body: JSONPrimitive, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setStatusUnderApproval( - body: JSONPrimitive, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setStatusUnderApproval( - body: JSONPrimitive, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling setStatusUnderApproval.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling setStatusUnderApproval.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling setStatusUnderApproval.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/status/under-approval/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Sets the status UNDER_APPROVAL for a file. - * None - * @param dossierId dossierId - * @param fileId fileId - * @param approverId approverId - * @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 setStatusUnderApproval1( - dossierId: string, - fileId: string, - approverId?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public setStatusUnderApproval1( - dossierId: string, - fileId: string, - approverId?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setStatusUnderApproval1( - dossierId: string, - fileId: string, - approverId?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setStatusUnderApproval1( - dossierId: string, - fileId: string, - approverId?: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling setStatusUnderApproval1.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling setStatusUnderApproval1.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (approverId !== undefined && approverId !== null) { - queryParameters = queryParameters.set('approverId', approverId); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/status/underapproval/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Sets the status UNDER_APPROVAL for a list of files. - * None - * @param body fileIds - * @param approverId approverId - * @param dossierId dossierId - * @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 setStatusUnderApprovalForList( - body: Array, - approverId: string, - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public setStatusUnderApprovalForList( - body: Array, - approverId: string, - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setStatusUnderApprovalForList( - body: Array, - approverId: string, - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setStatusUnderApprovalForList( - body: Array, - approverId: string, - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling setStatusUnderApprovalForList.'); - } - - if (approverId === null || approverId === undefined) { - throw new Error('Required parameter approverId was null or undefined when calling setStatusUnderApprovalForList.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling setStatusUnderApprovalForList.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (approverId !== undefined && approverId !== null) { - queryParameters = queryParameters.set('approverId', approverId); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/status/underapproval/${encodeURIComponent(String(dossierId))}/bulk`, { - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Sets the status UNDER_REVIEW for a file. - * None - * @param dossierId dossierId - * @param fileId fileId - * @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 setStatusUnderReview(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public setStatusUnderReview( - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setStatusUnderReview( - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setStatusUnderReview( - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling setStatusUnderReview.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling setStatusUnderReview.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/status/underreview/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Sets the status UNDER_REVIEW for a list of files. - * None - * @param body fileIds - * @param dossierId dossierId - * @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 setStatusUnderReviewForList(body: Array, dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public setStatusUnderReviewForList( - body: Array, - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public setStatusUnderReviewForList( - body: Array, - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public setStatusUnderReviewForList( - body: Array, - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling setStatusUnderReviewForList.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling setStatusUnderReviewForList.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/status/underreview/${encodeURIComponent(String(dossierId))}/bulk`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/statusReportController.service.ts b/libs/red-ui-http/src/lib/api/statusReportController.service.ts deleted file mode 100644 index 7cd87c3ae..000000000 --- a/libs/red-ui-http/src/lib/api/statusReportController.service.ts +++ /dev/null @@ -1,96 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class StatusReportControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Generate status report for dossier - * None - * @param dossierId dossierId - * @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 generateStatusReport(dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public generateStatusReport(dossierId: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public generateStatusReport(dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public generateStatusReport(dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling generateStatusReport.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['*/*']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('get', `${this.basePath}/statusReport/${encodeURIComponent(String(dossierId))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/uploadController.service.ts b/libs/red-ui-http/src/lib/api/uploadController.service.ts deleted file mode 100644 index 47f1d2f23..000000000 --- a/libs/red-ui-http/src/lib/api/uploadController.service.ts +++ /dev/null @@ -1,132 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; - -import { FileUploadResult } from '../model/fileUploadResult'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class UploadControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Receives an uploaded file and returns its fileId. - * None - * @param dossierId The dossierId, the file belongs to - * @param file - * @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 uploadFileForm(dossierId: string, file?: Blob, observe?: 'body', reportProgress?: boolean): Observable; - - public uploadFileForm( - dossierId: string, - file?: Blob, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public uploadFileForm( - dossierId: string, - file?: Blob, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public uploadFileForm(dossierId: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling uploadFile.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['multipart/form-data']; - - const canConsumeForm = this.canConsumeForm(consumes); - - let formParams: { append(param: string, value: any): void }; - let useForm = false; - const convertFormParamsToString = false; - // use FormData to transmit files using content-type "multipart/form-data" - // see https://stackoverflow.com/questions/4007969/application-x-www-form-urlencoded-or-multipart-form-data - useForm = canConsumeForm; - if (useForm) { - formParams = new FormData(); - } else { - formParams = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - } - - if (file !== undefined) { - formParams = (formParams.append('file', file) as any) || formParams; - } - - return this.httpClient.request('post', `${this.basePath}/upload/${encodeURIComponent(String(dossierId))}`, { - body: convertFormParamsToString ? formParams.toString() : formParams, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/userController.service.ts b/libs/red-ui-http/src/lib/api/userController.service.ts deleted file mode 100644 index 64b3f08f8..000000000 --- a/libs/red-ui-http/src/lib/api/userController.service.ts +++ /dev/null @@ -1,583 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; - -import { CreateUserRequest } from '../model/createUserRequest'; -import { ResetPasswordRequest } from '../model/resetPasswordRequest'; -import { UpdateMyProfileRequest } from '../model/updateMyProfileRequest'; -import { UpdateProfileRequest } from '../model/updateProfileRequest'; -import { IUser } from '../model/user'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class UserControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Add a role to users - * None - * @param body roles - * @param userId userId - * @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 addRoleToUsers(body: Array, userId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public addRoleToUsers( - body: Array, - userId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public addRoleToUsers(body: Array, userId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public addRoleToUsers(body: Array, userId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addRoleToUsers.'); - } - - if (userId === null || userId === undefined) { - throw new Error('Required parameter userId was null or undefined when calling addRoleToUsers.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/user/${encodeURIComponent(String(userId))}/role`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Create a new user. - * None - * @param body user - * @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 createUser(body: CreateUserRequest, observe?: 'body', reportProgress?: boolean): Observable; - - public createUser(body: CreateUserRequest, observe?: 'response', reportProgress?: boolean): Observable>; - - public createUser(body: CreateUserRequest, observe?: 'events', reportProgress?: boolean): Observable>; - - public createUser(body: CreateUserRequest, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling createUser.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/user`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Deletes given user - * None - * @param userId userId - * @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 deleteUser(userId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public deleteUser(userId: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public deleteUser(userId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public deleteUser(userId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (userId === null || userId === undefined) { - throw new Error('Required parameter userId was null or undefined when calling deleteUser.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('delete', `${this.basePath}/user/${encodeURIComponent(String(userId))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Deletes given users - * None - * @param userId userId - * @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 deleteUsers(userId: Array, observe?: 'body', reportProgress?: boolean): Observable; - - public deleteUsers(userId: Array, observe?: 'response', reportProgress?: boolean): Observable>; - - public deleteUsers(userId: Array, observe?: 'events', reportProgress?: boolean): Observable>; - - public deleteUsers(userId: Array, observe: any = 'body', reportProgress: boolean = false): Observable { - if (userId === null || userId === undefined) { - throw new Error('Required parameter userId was null or undefined when calling deleteUsers.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (userId) { - userId.forEach(element => { - queryParameters = queryParameters.append('userId', element); - }); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('delete', `${this.basePath}/user`, { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Gets all the users in realm with information of roles. - * None - * @param refreshCache refreshCache - * @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 getAllUsers(refreshCache?: boolean, observe?: 'body', reportProgress?: boolean): Observable>; - - public getAllUsers(refreshCache?: boolean, observe?: 'response', reportProgress?: boolean): Observable>>; - - public getAllUsers(refreshCache?: boolean, observe?: 'events', reportProgress?: boolean): Observable>>; - - public getAllUsers(refreshCache?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable { - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (refreshCache !== undefined && refreshCache !== null) { - queryParameters = queryParameters.set('refreshCache', refreshCache); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request>('get', `${this.basePath}/user`, { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Gets the user in realm with information of roles. - * None - * @param userId userId - * @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 getUserById(userId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public getUserById(userId: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public getUserById(userId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public getUserById(userId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (userId === null || userId === undefined) { - throw new Error('Required parameter userId was null or undefined when calling getUserById.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('get', `${this.basePath}/user/${encodeURIComponent(String(userId))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Gets the users who contain redaction roles. - * None - * @param refreshCache refreshCache - * @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 getUsers(refreshCache?: boolean, observe?: 'body', reportProgress?: boolean): Observable>; - - public getUsers(refreshCache?: boolean, observe?: 'response', reportProgress?: boolean): Observable>>; - - public getUsers(refreshCache?: boolean, observe?: 'events', reportProgress?: boolean): Observable>>; - - public getUsers(refreshCache?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable { - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (refreshCache !== undefined && refreshCache !== null) { - queryParameters = queryParameters.set('refreshCache', refreshCache); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request>('get', `${this.basePath}/user/red`, { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Reset a user's password - * None - * @param body resetPasswordRequest - * @param userId userId - * @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 resetPassword(body: ResetPasswordRequest, userId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public resetPassword( - body: ResetPasswordRequest, - userId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public resetPassword( - body: ResetPasswordRequest, - userId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public resetPassword( - body: ResetPasswordRequest, - userId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling resetPassword.'); - } - - if (userId === null || userId === undefined) { - throw new Error('Required parameter userId was null or undefined when calling resetPassword.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/user/${encodeURIComponent(String(userId))}/reset-password`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Update your own user-profile. - * None - * @param body updateProfileRequest - * @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 updateMyProfile(body: UpdateMyProfileRequest, observe?: 'body', reportProgress?: boolean): Observable; - - public updateMyProfile(body: UpdateMyProfileRequest, observe?: 'response', reportProgress?: boolean): Observable>; - - public updateMyProfile(body: UpdateMyProfileRequest, observe?: 'events', reportProgress?: boolean): Observable>; - - public updateMyProfile(body: UpdateMyProfileRequest, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateMyProfile.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/user/my-profile`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Update your own user-profile. - * None - * @param body updateProfileRequest - * @param userId userId - * @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 updateProfile(body: UpdateProfileRequest, userId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public updateProfile( - body: UpdateProfileRequest, - userId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public updateProfile( - body: UpdateProfileRequest, - userId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public updateProfile( - body: UpdateProfileRequest, - userId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling updateProfile.'); - } - - if (userId === null || userId === undefined) { - throw new Error('Required parameter userId was null or undefined when calling updateProfile.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('post', `${this.basePath}/user/profile/${encodeURIComponent(String(userId))}`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/userPreferenceController.service.ts b/libs/red-ui-http/src/lib/api/userPreferenceController.service.ts deleted file mode 100644 index 053385219..000000000 --- a/libs/red-ui-http/src/lib/api/userPreferenceController.service.ts +++ /dev/null @@ -1,188 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class UserPreferenceControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Delete User Preferences by key. - * None - * @param key key - * @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 deletePreferences(key: string, observe?: 'body', reportProgress?: boolean): Observable; - - public deletePreferences(key: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public deletePreferences(key: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public deletePreferences(key: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (key === null || key === undefined) { - throw new Error('Required parameter key was null or undefined when calling deletePreferences.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('delete', `${this.basePath}/attributes/${encodeURIComponent(String(key))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Get User Attributes. - * None - * @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 getAllUserAttributes(observe?: 'body', reportProgress?: boolean): Observable<{ [key: string]: Array }>; - - public getAllUserAttributes(observe?: 'response', reportProgress?: boolean): Observable }>>; - - public getAllUserAttributes(observe?: 'events', reportProgress?: boolean): Observable }>>; - - public getAllUserAttributes(observe: any = 'body', reportProgress: boolean = false): Observable { - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request<{ [key: string]: Array }>('get', `${this.basePath}/attributes`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Store User Attribute by key. - * None - * @param body values - * @param key key - * @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 savePreferences(body: Array, key: string, observe?: 'body', reportProgress?: boolean): Observable; - - public savePreferences(body: Array, key: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public savePreferences(body: Array, key: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public savePreferences(body: Array, key: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling savePreferences.'); - } - - if (key === null || key === undefined) { - throw new Error('Required parameter key was null or undefined when calling savePreferences.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request('put', `${this.basePath}/attributes/${encodeURIComponent(String(key))}`, { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/versionsController.service.ts b/libs/red-ui-http/src/lib/api/versionsController.service.ts deleted file mode 100644 index ff589e9c9..000000000 --- a/libs/red-ui-http/src/lib/api/versionsController.service.ts +++ /dev/null @@ -1,190 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { CustomHttpUrlEncodingCodec } from '../encoder'; - -import { Observable } from 'rxjs'; - -import { VersionsResponse } from '../model/versionsResponse'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class VersionsControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Retrieves current version for dossier dictionary. - * None - * @param dossierId dossierId - * @param dossierTemplateId dossierTemplateId - * @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 getDossierDictionaryVersion( - dossierId: string, - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public getDossierDictionaryVersion( - dossierId: string, - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getDossierDictionaryVersion( - dossierId: string, - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public getDossierDictionaryVersion( - dossierId: string, - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling getDossierDictionaryVersion.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling getDossierDictionaryVersion.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['*/*']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/version/dossier/${encodeURIComponent(String(dossierTemplateId))}/${encodeURIComponent(String(dossierId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Retrieves current versions. - * None - * @param dossierTemplateId dossierTemplateId - * @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 getVersions( - dossierTemplateId: Array, - observe?: 'body', - reportProgress?: boolean - ): Observable<{ [key: string]: VersionsResponse }>; - - public getVersions( - dossierTemplateId: Array, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getVersions( - dossierTemplateId: Array, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public getVersions(dossierTemplateId: Array, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling getVersions.'); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (dossierTemplateId) { - dossierTemplateId.forEach(element => { - queryParameters = queryParameters.append('dossierTemplateId', element); - }); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['*/*']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request<{ [key: string]: VersionsResponse }>('get', `${this.basePath}/version`, { - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/viewedPagesController.service.ts b/libs/red-ui-http/src/lib/api/viewedPagesController.service.ts deleted file mode 100644 index a05770760..000000000 --- a/libs/red-ui-http/src/lib/api/viewedPagesController.service.ts +++ /dev/null @@ -1,282 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { ViewedPages } from '../model/viewedPages'; -import { ViewedPagesRequest } from '../model/viewedPagesRequest'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class ViewedPagesControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Adds a page to the viewed pages - * None - * @param body viewedPagesRequest - * @param dossierId dossierId - * @param fileId fileId - * @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 addPage( - body: ViewedPagesRequest, - dossierId: string, - fileId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public addPage( - body: ViewedPagesRequest, - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public addPage( - body: ViewedPagesRequest, - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public addPage( - body: ViewedPagesRequest, - dossierId: string, - fileId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling addPage.'); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling addPage.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling addPage.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/viewedPages/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Gets the viewed pages for a file, depending on the users role. - * None - * @param dossierId dossierId - * @param fileId fileId - * @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 getViewedPages(dossierId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public getViewedPages( - dossierId: string, - fileId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getViewedPages( - dossierId: string, - fileId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public getViewedPages(dossierId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling getViewedPages.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling getViewedPages.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/viewedPages/${encodeURIComponent(String(dossierId))}/${encodeURIComponent(String(fileId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Removes a page to the viewed pages - * None - * @param dossierId dossierId - * @param fileId fileId - * @param page page - * @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 removePage(dossierId: string, fileId: string, page: number, observe?: 'body', reportProgress?: boolean): Observable; - - public removePage( - dossierId: string, - fileId: string, - page: number, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public removePage( - dossierId: string, - fileId: string, - page: number, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public removePage( - dossierId: string, - fileId: string, - page: number, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (dossierId === null || dossierId === undefined) { - throw new Error('Required parameter dossierId was null or undefined when calling removePage.'); - } - - if (fileId === null || fileId === undefined) { - throw new Error('Required parameter fileId was null or undefined when calling removePage.'); - } - - if (page === null || page === undefined) { - throw new Error('Required parameter page was null or undefined when calling removePage.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'delete', - `${this.basePath}/viewedPages/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId), - )}/${encodeURIComponent(String(page))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/api/watermarkController.service.ts b/libs/red-ui-http/src/lib/api/watermarkController.service.ts deleted file mode 100644 index 4a2bac3c5..000000000 --- a/libs/red-ui-http/src/lib/api/watermarkController.service.ts +++ /dev/null @@ -1,227 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ /* tslint:disable:no-unused-variable member-ordering */ - -import { Inject, Injectable, Optional } from '@angular/core'; -import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http'; - -import { Observable } from 'rxjs'; - -import { WatermarkModel } from '../model/watermarkModel'; - -import { BASE_PATH } from '../variables'; -import { Configuration } from '../configuration'; - -@Injectable() -export class WatermarkControllerService { - public defaultHeaders = new HttpHeaders(); - public configuration = new Configuration(); - protected basePath = ''; - - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string, - @Optional() configuration: Configuration, - ) { - if (basePath) { - this.basePath = basePath; - } - if (configuration) { - this.configuration = configuration; - this.basePath = basePath || configuration.basePath || this.basePath; - } - } - - /** - * Remove watermark configuration - * None - * @param dossierTemplateId dossierTemplateId - * @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 deleteWatermark(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public deleteWatermark(dossierTemplateId: string, observe?: 'response', reportProgress?: boolean): Observable>; - - public deleteWatermark(dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public deleteWatermark(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling deleteWatermark.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = []; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request('delete', `${this.basePath}/watermark/${encodeURIComponent(String(dossierTemplateId))}`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }); - } - - /** - * Get the current watermark configuration - * None - * @param dossierTemplateId dossierTemplateId - * @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 getWatermark(dossierTemplateId: string, observe?: 'body', reportProgress?: boolean): Observable; - - public getWatermark( - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public getWatermark(dossierTemplateId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public getWatermark(dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling getWatermark.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - return this.httpClient.request( - 'get', - `${this.basePath}/watermark/${encodeURIComponent(String(dossierTemplateId))}`, - { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * Save/Update watermark configuration - * None - * @param body watermark - * @param dossierTemplateId dossierTemplateId - * @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 saveWatermark( - body: WatermarkModel, - dossierTemplateId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public saveWatermark( - body: WatermarkModel, - dossierTemplateId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public saveWatermark( - body: WatermarkModel, - dossierTemplateId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public saveWatermark( - body: WatermarkModel, - dossierTemplateId: string, - observe: any = 'body', - reportProgress: boolean = false, - ): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling saveWatermark.'); - } - - if (dossierTemplateId === null || dossierTemplateId === undefined) { - throw new Error('Required parameter dossierTemplateId was null or undefined when calling saveWatermark.'); - } - - let headers = this.defaultHeaders; - - // authentication (RED-OAUTH) required - if (this.configuration.accessToken) { - const accessToken = - typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; - headers = headers.set('Authorization', 'Bearer ' + accessToken); - } - - // to determine the Accept header - const httpHeaderAccepts: string[] = ['application/json']; - const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); - if (httpHeaderAcceptSelected !== undefined) { - headers = headers.set('Accept', httpHeaderAcceptSelected); - } - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - - return this.httpClient.request( - 'post', - `${this.basePath}/watermark/${encodeURIComponent(String(dossierTemplateId))}`, - { - body: body, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress, - }, - ); - } - - /** - * @param consumes string[] mime-types - * @return true: consumes contains 'multipart/form-data', false: otherwise - */ - private canConsumeForm(consumes: string[]): boolean { - const form = 'multipart/form-data'; - for (const consume of consumes) { - if (form === consume) { - return true; - } - } - return false; - } -} diff --git a/libs/red-ui-http/src/lib/configuration.ts b/libs/red-ui-http/src/lib/configuration.ts deleted file mode 100644 index 211acc151..000000000 --- a/libs/red-ui-http/src/lib/configuration.ts +++ /dev/null @@ -1,79 +0,0 @@ -export interface ConfigurationParameters { - readonly apiKeys?: { [key: string]: string }; - readonly username?: string; - readonly password?: string; - readonly accessToken?: string | (() => string); - readonly basePath?: string; - readonly withCredentials?: boolean; -} - -export class Configuration implements ConfigurationParameters { - readonly apiKeys?: { [key: string]: string }; - readonly username?: string; - readonly password?: string; - readonly accessToken?: string | (() => string); - readonly basePath: string; - readonly withCredentials: boolean; - - constructor(configurationParameters: ConfigurationParameters = {}) { - this.apiKeys = configurationParameters.apiKeys; - this.username = configurationParameters.username; - this.password = configurationParameters.password; - this.accessToken = configurationParameters.accessToken; - this.basePath = configurationParameters.basePath ?? ''; - this.withCredentials = !!configurationParameters.withCredentials; - } - - /** - * Select the correct content-type to use for a request. - * Uses {@link Configuration#isJsonMime} to determine the correct content-type. - * If no content type is found return the first found type if the contentTypes is not empty - * @param contentTypes - the array of content types that are available for selection - * @returns the selected content-type or undefined if no selection could be made. - */ - public selectHeaderContentType(contentTypes: string[]): string | undefined { - if (contentTypes.length === 0) { - return undefined; - } - - const type = contentTypes.find(x => this.isJsonMime(x)); - if (type === undefined) { - return contentTypes[0]; - } - return type; - } - - /** - * Select the correct accept content-type to use for a request. - * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. - * If no content type is found return the first found type if the contentTypes is not empty - * @param accepts - the array of content types that are available for selection. - * @returns the selected content-type or undefined if no selection could be made. - */ - public selectHeaderAccept(accepts: string[]): string | undefined { - if (accepts.length === 0) { - return undefined; - } - - const type = accepts.find(x => this.isJsonMime(x)); - if (type === undefined) { - return accepts[0]; - } - return type; - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * @param mime - MIME (Multipurpose Internet Mail Extensions) - * @return True if the given MIME is JSON, false otherwise. - */ - public isJsonMime(mime: string): boolean { - const jsonMime = new RegExp('^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); - return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); - } -} diff --git a/libs/red-ui-http/src/lib/encoder.ts b/libs/red-ui-http/src/lib/encoder.ts deleted file mode 100644 index 8e5a1fd28..000000000 --- a/libs/red-ui-http/src/lib/encoder.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { HttpUrlEncodingCodec } from '@angular/common/http'; - -/** - * CustomHttpUrlEncodingCodec - * Fix plus sign (+) not encoding, so sent as blank space - * See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 - */ -export class CustomHttpUrlEncodingCodec extends HttpUrlEncodingCodec { - encodeKey(k: string): string { - k = super.encodeKey(k); - return k.replace(/\+/gi, '%2B'); - } - - encodeValue(v: string): string { - v = super.encodeValue(v); - return v.replace(/\+/gi, '%2B'); - } -} diff --git a/libs/red-ui-http/src/lib/index.ts b/libs/red-ui-http/src/lib/index.ts index 50c198439..3ddad16a0 100644 --- a/libs/red-ui-http/src/lib/index.ts +++ b/libs/red-ui-http/src/lib/index.ts @@ -1,5 +1 @@ -export * from './api/api'; export * from './model/models'; -export * from './variables'; -export * from './configuration'; -export * from './red-types'; diff --git a/libs/red-ui-http/src/lib/model/JSONPrimitive.ts b/libs/red-ui-http/src/lib/model/JSONPrimitive.ts deleted file mode 100644 index 9dbc1ed49..000000000 --- a/libs/red-ui-http/src/lib/model/JSONPrimitive.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface JSONPrimitive { - value?: T; -} diff --git a/libs/red-ui-http/src/lib/model/addCommentRequest.ts b/libs/red-ui-http/src/lib/model/addCommentRequest.ts deleted file mode 100644 index 40e15beff..000000000 --- a/libs/red-ui-http/src/lib/model/addCommentRequest.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface AddCommentRequest { - text?: string; -} diff --git a/libs/red-ui-http/src/lib/model/addRedactionRequest.ts b/libs/red-ui-http/src/lib/model/addRedactionRequest.ts index 987904158..c939814cc 100644 --- a/libs/red-ui-http/src/lib/model/addRedactionRequest.ts +++ b/libs/red-ui-http/src/lib/model/addRedactionRequest.ts @@ -9,13 +9,12 @@ * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ -import { AddCommentRequest } from './addCommentRequest'; import { Rectangle } from './rectangle'; export interface AddRedactionRequest { addToDictionary?: boolean; addToDossierDictionary?: boolean; - comment?: AddCommentRequest; + comment?: { text: string }; legalBasis?: string; positions?: Array; reason?: string; diff --git a/libs/red-ui-http/src/lib/model/authInfo.ts b/libs/red-ui-http/src/lib/model/authInfo.ts deleted file mode 100644 index 55363a4d0..000000000 --- a/libs/red-ui-http/src/lib/model/authInfo.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/** - * Object containing information about authorization. - */ -export interface AuthInfo { - /** - * The authorization url to get access token. - */ - authorizationUrl?: string; - /** - * The token url to get the refresh token. - */ - tokenUrl?: string; -} diff --git a/libs/red-ui-http/src/lib/model/dossierRequest.ts b/libs/red-ui-http/src/lib/model/dossierRequest.ts index f1d90790f..4af90f1a9 100644 --- a/libs/red-ui-http/src/lib/model/dossierRequest.ts +++ b/libs/red-ui-http/src/lib/model/dossierRequest.ts @@ -11,6 +11,7 @@ */ import { List } from '../red-types'; +import { DownloadFileType } from './dossier'; /** * Object containing information about a dossier. @@ -39,7 +40,7 @@ export interface DossierRequest { /** * Download File Types for this dossiers submission package. */ - readonly downloadFileTypes?: List; + readonly downloadFileTypes?: List; /** * The date when the dossier is due. */ @@ -61,14 +62,3 @@ export interface DossierRequest { */ readonly watermarkEnabled?: boolean; } - -export namespace DossierRequest { - export type DownloadFileTypesEnum = 'ANNOTATED' | 'FLATTEN' | 'ORIGINAL' | 'PREVIEW' | 'REDACTED'; - export const DownloadFileTypesEnum = { - ANNOTATED: 'ANNOTATED' as DownloadFileTypesEnum, - FLATTEN: 'FLATTEN' as DownloadFileTypesEnum, - ORIGINAL: 'ORIGINAL' as DownloadFileTypesEnum, - PREVIEW: 'PREVIEW' as DownloadFileTypesEnum, - REDACTED: 'REDACTED' as DownloadFileTypesEnum, - }; -} diff --git a/libs/red-ui-http/src/lib/model/dossierTemplateIdUploadBody.ts b/libs/red-ui-http/src/lib/model/dossierTemplateIdUploadBody.ts deleted file mode 100644 index fcdf8fb1d..000000000 --- a/libs/red-ui-http/src/lib/model/dossierTemplateIdUploadBody.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface DossierTemplateIdUploadBody { - file?: Blob; -} diff --git a/libs/red-ui-http/src/lib/model/manualForceRedaction.ts b/libs/red-ui-http/src/lib/model/manualForceRedaction.ts deleted file mode 100644 index 54ead0b97..000000000 --- a/libs/red-ui-http/src/lib/model/manualForceRedaction.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface ManualForceRedaction { - annotationId?: string; - fileId?: string; - legalBasis?: string; - processedDate?: string; - requestDate?: string; - softDeletedTime?: string; - status?: ManualForceRedaction.StatusEnum; - user?: string; -} - -export namespace ManualForceRedaction { - export type StatusEnum = 'APPROVED' | 'DECLINED' | 'REQUESTED'; - export const StatusEnum = { - APPROVED: 'APPROVED' as StatusEnum, - DECLINED: 'DECLINED' as StatusEnum, - REQUESTED: 'REQUESTED' as StatusEnum, - }; -} diff --git a/libs/red-ui-http/src/lib/model/manualImageRecategorization.ts b/libs/red-ui-http/src/lib/model/manualImageRecategorization.ts deleted file mode 100644 index 0f0760954..000000000 --- a/libs/red-ui-http/src/lib/model/manualImageRecategorization.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface ManualImageRecategorization { - annotationId?: string; - fileId?: string; - processedDate?: string; - requestDate?: string; - softDeletedTime?: string; - status?: ManualImageRecategorization.StatusEnum; - type?: string; - user?: string; -} - -export namespace ManualImageRecategorization { - export type StatusEnum = 'APPROVED' | 'DECLINED' | 'REQUESTED'; - export const StatusEnum = { - APPROVED: 'APPROVED' as StatusEnum, - DECLINED: 'DECLINED' as StatusEnum, - REQUESTED: 'REQUESTED' as StatusEnum, - }; -} diff --git a/libs/red-ui-http/src/lib/model/manualLegalBasisChange.ts b/libs/red-ui-http/src/lib/model/manualLegalBasisChange.ts deleted file mode 100644 index 11c5b83e6..000000000 --- a/libs/red-ui-http/src/lib/model/manualLegalBasisChange.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface ManualLegalBasisChange { - annotationId?: string; - fileId?: string; - legalBasis?: string; - processedDate?: string; - requestDate?: string; - softDeletedTime?: string; - status?: ManualLegalBasisChange.StatusEnum; - user?: string; -} - -export namespace ManualLegalBasisChange { - export type StatusEnum = 'APPROVED' | 'DECLINED' | 'REQUESTED'; - export const StatusEnum = { - APPROVED: 'APPROVED' as StatusEnum, - DECLINED: 'DECLINED' as StatusEnum, - REQUESTED: 'REQUESTED' as StatusEnum, - }; -} diff --git a/libs/red-ui-http/src/lib/model/manualRedactions.ts b/libs/red-ui-http/src/lib/model/manualRedactions.ts deleted file mode 100644 index e94bf13e4..000000000 --- a/libs/red-ui-http/src/lib/model/manualRedactions.ts +++ /dev/null @@ -1,26 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ -import { Comment } from './comment'; -import { IdRemoval } from './idRemoval'; -import { ManualForceRedaction } from './manualForceRedaction'; -import { ManualImageRecategorization } from './manualImageRecategorization'; -import { ManualLegalBasisChange } from './manualLegalBasisChange'; -import { ManualRedactionEntry } from './manualRedactionEntry'; - -export interface ManualRedactions { - comments?: { [key: string]: Array }; - entriesToAdd?: Array; - forceRedactions?: Array; - idsToRemove?: Array; - imageRecategorization?: Array; - legalBasisChanges?: Array; -} diff --git a/libs/red-ui-http/src/lib/model/models.ts b/libs/red-ui-http/src/lib/model/models.ts index bf9664134..cdcb149a3 100644 --- a/libs/red-ui-http/src/lib/model/models.ts +++ b/libs/red-ui-http/src/lib/model/models.ts @@ -1,10 +1,8 @@ -export * from './addCommentRequest'; export * from './addRedactionRequest'; export * from './approveRequest'; export * from './audit'; export * from './auditResponse'; export * from './auditSearchRequest'; -export * from './authInfo'; export * from './categoryModel'; export * from './cellRectangle'; export * from './change'; @@ -21,7 +19,6 @@ export * from './dossierAttribute'; export * from './dossierAttributesConfig'; export * from './dossierAttributes'; export * from './dossierRequest'; -export * from './dossierTemplateIdUploadBody'; export * from './dossierTemplate'; export * from './downloadResponse'; export * from './downloadStatus'; @@ -35,18 +32,13 @@ export * from './forceRedactionRequest'; export * from './generalConfigurationModel'; export * from './idRemoval'; export * from './imageRecategorizationRequest'; -export * from './JSONPrimitive'; export * from './legalBasis'; export * from './legalBasisChangeRequest'; export * from './legalBasis'; export * from './licenseReport'; export * from './licenseReportRequest'; export * from './manualAddResponse'; -export * from './manualForceRedaction'; -export * from './manualImageRecategorization'; -export * from './manualLegalBasisChange'; export * from './manualRedactionEntry'; -export * from './manualRedactions'; export * from './matchedDocument'; export * from './matchedSection'; export * from './notification.model'; @@ -65,21 +57,16 @@ export * from './reportData'; export * from './reportTemplate'; export * from './resetPasswordRequest'; export * from './rules'; -export * from './sMTPConfiguration'; +export * from './smtp-configuration'; export * from './searchRequest'; export * from './searchResult'; export * from './sectionGrid'; export * from './sectionRectangle'; -export * from './templateUploadDossierTemplateIdBody'; -export * from './typeDossierTemplateIdBody'; -export * from './typeResponse'; export * from './typeValue'; export * from './updateMyProfileRequest'; export * from './updateProfileRequest'; export * from './updateTypeValue'; -export * from './uploadDossierIdBody'; export * from './user'; -export * from './versionsResponse'; export * from './viewedPage'; export * from './viewedPages'; export * from './viewedPagesRequest'; diff --git a/libs/red-ui-http/src/lib/model/redactionLogEntry.ts b/libs/red-ui-http/src/lib/model/redactionLogEntry.ts index d1aed05b9..dbed8eeac 100644 --- a/libs/red-ui-http/src/lib/model/redactionLogEntry.ts +++ b/libs/red-ui-http/src/lib/model/redactionLogEntry.ts @@ -20,7 +20,7 @@ export interface RedactionLogEntry { dictionaryEntry?: boolean; dossierDictionaryEntry?: boolean; endOffset?: number; - engines?: Array; + engines?: Array; excluded?: boolean; hint?: boolean; id?: string; @@ -29,7 +29,7 @@ export interface RedactionLogEntry { legalBasis?: string; legalBasisChangeValue?: string; manual?: boolean; - manualRedactionType?: RedactionLogEntry.ManualRedactionTypeEnum; + manualRedactionType?: ManualRedactionType; manualRedactionUserId?: string; matchedRule?: number; positions?: Array; @@ -41,32 +41,33 @@ export interface RedactionLogEntry { section?: string; sectionNumber?: number; startOffset?: number; - status?: RedactionLogEntry.StatusEnum; + status?: LogEntryStatus; textAfter?: string; textBefore?: string; type?: string; value?: string; } -export namespace RedactionLogEntry { - export type EnginesEnum = 'DICTIONARY' | 'NER' | 'RULE'; - export const EnginesEnum = { - DICTIONARY: 'DICTIONARY' as EnginesEnum, - NER: 'NER' as EnginesEnum, - RULE: 'RULE' as EnginesEnum, - }; - export type ManualRedactionTypeEnum = 'ADD' | 'FORCE_REDACT' | 'LEGAL_BASIS_CHANGE' | 'RECATEGORIZE' | 'REMOVE'; - export const ManualRedactionTypeEnum = { - ADD: 'ADD' as ManualRedactionTypeEnum, - FORCEREDACT: 'FORCE_REDACT' as ManualRedactionTypeEnum, - LEGALBASISCHANGE: 'LEGAL_BASIS_CHANGE' as ManualRedactionTypeEnum, - RECATEGORIZE: 'RECATEGORIZE' as ManualRedactionTypeEnum, - REMOVE: 'REMOVE' as ManualRedactionTypeEnum, - }; - export type StatusEnum = 'APPROVED' | 'DECLINED' | 'REQUESTED'; - export const StatusEnum = { - APPROVED: 'APPROVED' as StatusEnum, - DECLINED: 'DECLINED' as StatusEnum, - REQUESTED: 'REQUESTED' as StatusEnum, - }; -} +export const LogEntryEngines = { + DICTIONARY: 'DICTIONARY', + NER: 'NER', + RULE: 'RULE', +}; +export type LogEntryEngine = keyof typeof LogEntryEngines; + +export const ManualRedactionTypes = { + ADD: 'ADD', + FORCE_REDACT: 'FORCE_REDACT', + LEGAL_BASIS_CHANGE: 'LEGAL_BASIS_CHANGE', + RECATEGORIZE: 'RECATEGORIZE', + REMOVE: 'REMOVE', +} as const; +export type ManualRedactionType = keyof typeof ManualRedactionTypes; + +export const LogEntryStatuses = { + APPROVED: 'APPROVED', + DECLINED: 'DECLINED', + REQUESTED: 'REQUESTED', +} as const; + +export type LogEntryStatus = keyof typeof LogEntryStatuses; diff --git a/libs/red-ui-http/src/lib/model/sMTPConfiguration.ts b/libs/red-ui-http/src/lib/model/smtp-configuration.ts similarity index 100% rename from libs/red-ui-http/src/lib/model/sMTPConfiguration.ts rename to libs/red-ui-http/src/lib/model/smtp-configuration.ts diff --git a/libs/red-ui-http/src/lib/model/templateUploadDossierTemplateIdBody.ts b/libs/red-ui-http/src/lib/model/templateUploadDossierTemplateIdBody.ts deleted file mode 100644 index 8be86646e..000000000 --- a/libs/red-ui-http/src/lib/model/templateUploadDossierTemplateIdBody.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface TemplateUploadDossierTemplateIdBody { - multiFileReport?: boolean; - file?: Blob; -} diff --git a/libs/red-ui-http/src/lib/model/typeDossierTemplateIdBody.ts b/libs/red-ui-http/src/lib/model/typeDossierTemplateIdBody.ts deleted file mode 100644 index 950bce8bd..000000000 --- a/libs/red-ui-http/src/lib/model/typeDossierTemplateIdBody.ts +++ /dev/null @@ -1,16 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface TypeDossierTemplateIdBody { - file?: Blob; - dossierId?: string; -} diff --git a/libs/red-ui-http/src/lib/model/typeResponse.ts b/libs/red-ui-http/src/lib/model/typeResponse.ts deleted file mode 100644 index 8d820d630..000000000 --- a/libs/red-ui-http/src/lib/model/typeResponse.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ -import { ITypeValue } from './typeValue'; - -/** - * Object containing a list of values of an entry type. - */ -export interface TypeResponse { - /** - * The list of values of an entry type, which include colors, hint and caseInsensitive. - */ - types?: Array; -} diff --git a/libs/red-ui-http/src/lib/model/uploadDossierIdBody.ts b/libs/red-ui-http/src/lib/model/uploadDossierIdBody.ts deleted file mode 100644 index 04559d32d..000000000 --- a/libs/red-ui-http/src/lib/model/uploadDossierIdBody.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -export interface UploadDossierIdBody { - file?: Blob; -} diff --git a/libs/red-ui-http/src/lib/model/versionsResponse.ts b/libs/red-ui-http/src/lib/model/versionsResponse.ts deleted file mode 100644 index 2509569aa..000000000 --- a/libs/red-ui-http/src/lib/model/versionsResponse.ts +++ /dev/null @@ -1,25 +0,0 @@ -/** - * API Documentation for Redaction Gateway - * Description for redaction - * - * OpenAPI spec version: 1.0 - * - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -/** - * Object containing a list of values of user. - */ -export interface VersionsResponse { - /** - * The current dictionary version. - */ - dictionaryVersion?: number; - /** - * The current rules version. - */ - rulesVersion?: number; -} diff --git a/libs/red-ui-http/src/lib/model/watermarkModel.ts b/libs/red-ui-http/src/lib/model/watermarkModel.ts index b0503c202..4d897973d 100644 --- a/libs/red-ui-http/src/lib/model/watermarkModel.ts +++ b/libs/red-ui-http/src/lib/model/watermarkModel.ts @@ -10,20 +10,18 @@ * Do not edit the class manually. */ -export interface WatermarkModel { +export interface IWatermark { fontSize?: number; fontType?: string; hexColor?: string; opacity?: number; - orientation?: WatermarkModel.OrientationEnum; + orientation?: WatermarkOrientation; text?: string; } -export namespace WatermarkModel { - export type OrientationEnum = 'DIAGONAL' | 'HORIZONTAL' | 'VERTICAL'; - export const OrientationEnum = { - DIAGONAL: 'DIAGONAL' as OrientationEnum, - HORIZONTAL: 'HORIZONTAL' as OrientationEnum, - VERTICAL: 'VERTICAL' as OrientationEnum, - }; -} +export const WatermarkOrientations = { + DIAGONAL: 'DIAGONAL', + HORIZONTAL: 'HORIZONTAL', + VERTICAL: 'VERTICAL', +} as const; +export type WatermarkOrientation = keyof typeof WatermarkOrientations; diff --git a/libs/red-ui-http/src/lib/red-types.ts b/libs/red-ui-http/src/lib/red-types.ts index 5ead52e51..114f10ebc 100644 --- a/libs/red-ui-http/src/lib/red-types.ts +++ b/libs/red-ui-http/src/lib/red-types.ts @@ -1,5 +1 @@ -/** - * Custom list type to hold readonly arrays. - * Defaults to readonly string list - */ export type List = readonly T[]; diff --git a/libs/red-ui-http/src/lib/variables.ts b/libs/red-ui-http/src/lib/variables.ts deleted file mode 100644 index 00ed1fcf2..000000000 --- a/libs/red-ui-http/src/lib/variables.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { InjectionToken } from '@angular/core'; - -export const BASE_PATH = new InjectionToken('basePath'); -export const COLLECTION_FORMATS = { - csv: ',', - tsv: ' ', - ssv: ' ', - pipes: '|', -};