api compatibility
This commit is contained in:
parent
7134e2f715
commit
2c9cf1e164
@ -2,8 +2,8 @@ import { Component, Injector, OnInit } from '@angular/core';
|
||||
import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import { DictionaryControllerService, TypeValue } from '@redaction/red-ui-http';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { defaultIfEmpty, tap } from 'rxjs/operators';
|
||||
import { forkJoin } from 'rxjs';
|
||||
import { catchError, defaultIfEmpty, tap } from 'rxjs/operators';
|
||||
import { forkJoin, of } from 'rxjs';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { AdminDialogService } from '../../services/admin-dialog.service';
|
||||
@ -61,9 +61,14 @@ export class DictionaryListingScreenComponent extends BaseListingComponent<TypeV
|
||||
.filter((d) => !d.virtual);
|
||||
this.displayedEntities = [...this.allEntities];
|
||||
const dataObs = this.allEntities.map((dict) =>
|
||||
this._dictionaryControllerService.getDictionaryForType(dict.type, this._appStateService.activeRuleSetId).pipe(
|
||||
this._dictionaryControllerService.getDictionaryForType(this._appStateService.activeRuleSetId, dict.type).pipe(
|
||||
tap((values) => {
|
||||
dict.entries = values.entries ? values.entries : [];
|
||||
}),
|
||||
catchError(() => {
|
||||
console.log('error');
|
||||
dict.entries = [];
|
||||
return of({});
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
@ -177,7 +177,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
this.processing = true;
|
||||
let obs: Observable<any>;
|
||||
if (entriesToAdd.length > 0) {
|
||||
obs = this._dictionaryControllerService.addEntry(entriesToAdd, this.dictionary.type, this.dictionary.ruleSetId, true);
|
||||
obs = this._dictionaryControllerService.addEntry(entriesToAdd, this.dictionary.type, this.dictionary.ruleSetId, null, true);
|
||||
} else {
|
||||
obs = this._dictionaryControllerService.deleteEntries(this.initialDictionaryEntries, this.dictionary.type, this.dictionary.ruleSetId);
|
||||
}
|
||||
@ -264,7 +264,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
|
||||
private _onDictionaryChanged(dictionary: TypeValue) {
|
||||
if (dictionary !== this.selectDictionary) {
|
||||
this._dictionaryControllerService.getDictionaryForType(dictionary.type, dictionary.ruleSetId).subscribe(
|
||||
this._dictionaryControllerService.getDictionaryForType(dictionary.ruleSetId, dictionary.type).subscribe(
|
||||
(data) => {
|
||||
this.compareDictionaryEntries = data.entries.sort((str1, str2) => str1.localeCompare(str2, undefined, { sensitivity: 'accent' }));
|
||||
DictionaryOverviewScreenComponent._setEditorValue(this._compareEditorComponent, this.compareDictionaryEntries);
|
||||
@ -298,12 +298,14 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple
|
||||
|
||||
private _initializeEditor() {
|
||||
if (this.dictionary.type)
|
||||
this._dictionaryControllerService.getDictionaryForType(this.dictionary.type, this.dictionary.ruleSetId).subscribe(
|
||||
this._dictionaryControllerService.getDictionaryForType(this.dictionary.ruleSetId, this.dictionary.type).subscribe(
|
||||
(data) => {
|
||||
this.initialDictionaryEntries = data.entries.sort((str1, str2) => str1.localeCompare(str2, undefined, { sensitivity: 'accent' }));
|
||||
this.revert();
|
||||
},
|
||||
() => {
|
||||
this.initialDictionaryEntries = [];
|
||||
this.revert();
|
||||
this.processing = false;
|
||||
}
|
||||
);
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
* 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.
|
||||
*/ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/member-ordering */
|
||||
*/ /* tslint:disable:no-unused-variable member-ordering */
|
||||
|
||||
import { Inject, Injectable, Optional } from '@angular/core';
|
||||
import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http';
|
||||
@ -27,9 +27,9 @@ import { Configuration } from '../configuration';
|
||||
|
||||
@Injectable()
|
||||
export class DictionaryControllerService {
|
||||
protected basePath = '';
|
||||
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) {
|
||||
@ -41,40 +41,63 @@ export class DictionaryControllerService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add dictionary entries with entry type.
|
||||
* None
|
||||
* @param body entries
|
||||
* @param type type
|
||||
* @param ruleSetId ruleSetId
|
||||
* @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<string>, type: string, ruleSetId: string, removeCurrent?: boolean, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
|
||||
public addEntry(
|
||||
body: Array<string>,
|
||||
type: string,
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
removeCurrent?: boolean,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
public addEntry(
|
||||
body: Array<string>,
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
removeCurrent?: boolean,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
|
||||
public addEntry(
|
||||
body: Array<string>,
|
||||
type: string,
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
removeCurrent?: boolean,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
|
||||
public addEntry(
|
||||
body: Array<string>,
|
||||
type: string,
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
removeCurrent?: boolean,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
@ -83,15 +106,18 @@ export class DictionaryControllerService {
|
||||
throw new Error('Required parameter body 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.');
|
||||
}
|
||||
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId 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', <any>dossierId);
|
||||
}
|
||||
if (removeCurrent !== undefined && removeCurrent !== null) {
|
||||
queryParameters = queryParameters.set('removeCurrent', <any>removeCurrent);
|
||||
}
|
||||
@ -136,21 +162,23 @@ export class DictionaryControllerService {
|
||||
* Creates entry type with colors, hint and caseInsensitive
|
||||
* None
|
||||
* @param body typeValue
|
||||
* @param ruleSetId ruleSetId
|
||||
* @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: TypeValue, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
|
||||
public addType(body: TypeValue, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
|
||||
public addType(body: TypeValue, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
|
||||
public addType(body: TypeValue, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
public addType(body: TypeValue, dossierId?: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public addType(body: TypeValue, dossierId?: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public addType(body: TypeValue, dossierId?: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public addType(body: TypeValue, dossierId?: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
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', <any>dossierId);
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
|
||||
// authentication (RED-OAUTH) required
|
||||
@ -175,6 +203,7 @@ export class DictionaryControllerService {
|
||||
|
||||
return this.httpClient.request<any>('post', `${this.basePath}/dictionary/type`, {
|
||||
body: body,
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
@ -186,28 +215,52 @@ export class DictionaryControllerService {
|
||||
* Delete dictionary entries with entry type.
|
||||
* None
|
||||
* @param body entries
|
||||
* @param type type
|
||||
* @param ruleSetId ruleSetId
|
||||
* @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<string>, type: string, ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
|
||||
public deleteEntries(body: Array<string>, type: string, ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
|
||||
public deleteEntries(body: Array<string>, type: string, ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
|
||||
public deleteEntries(body: Array<string>, type: string, ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
public deleteEntries(body: Array<string>, ruleSetId: string, type: string, dossierId?: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public deleteEntries(
|
||||
body: Array<string>,
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public deleteEntries(
|
||||
body: Array<string>,
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public deleteEntries(
|
||||
body: Array<string>,
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling deleteEntries.');
|
||||
}
|
||||
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId 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.');
|
||||
}
|
||||
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId was null or undefined when calling deleteEntries.');
|
||||
let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
|
||||
if (dossierId !== undefined && dossierId !== null) {
|
||||
queryParameters = queryParameters.set('dossierId', <any>dossierId);
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
@ -237,6 +290,7 @@ export class DictionaryControllerService {
|
||||
`${this.basePath}/dictionary/delete/${encodeURIComponent(String(type))}/${encodeURIComponent(String(ruleSetId))}`,
|
||||
{
|
||||
body: body,
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
@ -248,29 +302,53 @@ export class DictionaryControllerService {
|
||||
/**
|
||||
* Delete dictionary entry with entry type.
|
||||
* None
|
||||
* @param type type
|
||||
* @param ruleSetId ruleSetId
|
||||
* @param entry entry
|
||||
* @param ruleSetId ruleSetId
|
||||
* @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(type: string, ruleSetId: string, entry: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
|
||||
public deleteEntry(type: string, ruleSetId: string, entry: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
|
||||
public deleteEntry(type: string, ruleSetId: string, entry: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
|
||||
public deleteEntry(type: string, ruleSetId: string, entry: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
if (type === null || type === undefined) {
|
||||
throw new Error('Required parameter type was null or undefined when calling deleteEntry.');
|
||||
public deleteEntry(entry: string, ruleSetId: string, type: string, dossierId?: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public deleteEntry(
|
||||
entry: string,
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public deleteEntry(
|
||||
entry: string,
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public deleteEntry(
|
||||
entry: string,
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
if (entry === null || entry === undefined) {
|
||||
throw new Error('Required parameter entry was null or undefined when calling deleteEntry.');
|
||||
}
|
||||
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId 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', <any>dossierId);
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
@ -288,13 +366,11 @@ export class DictionaryControllerService {
|
||||
headers = headers.set('Accept', httpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [];
|
||||
|
||||
return this.httpClient.request<any>(
|
||||
'delete',
|
||||
`${this.basePath}/dictionary/${encodeURIComponent(String(type))}/${encodeURIComponent(String(ruleSetId))}/${encodeURIComponent(String(entry))}`,
|
||||
{
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
@ -306,24 +382,27 @@ export class DictionaryControllerService {
|
||||
/**
|
||||
* Deletes entry type
|
||||
* None
|
||||
* @param type type
|
||||
* @param ruleSetId ruleSetId
|
||||
* @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(type: string, ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public deleteType(ruleSetId: string, type: string, dossierId?: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public deleteType(ruleSetId: string, type: string, dossierId?: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public deleteType(ruleSetId: string, type: string, dossierId?: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public deleteType(ruleSetId: string, type: string, dossierId?: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId was null or undefined when calling deleteType.');
|
||||
}
|
||||
|
||||
public deleteType(type: string, ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
|
||||
public deleteType(type: string, ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
|
||||
public deleteType(type: string, ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
if (type === null || type === undefined) {
|
||||
throw new Error('Required parameter type was null or undefined when calling deleteType.');
|
||||
}
|
||||
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId was null or undefined when calling deleteType.');
|
||||
let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
|
||||
if (dossierId !== undefined && dossierId !== null) {
|
||||
queryParameters = queryParameters.set('dossierId', <any>dossierId);
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
@ -341,13 +420,11 @@ export class DictionaryControllerService {
|
||||
headers = headers.set('Accept', httpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [];
|
||||
|
||||
return this.httpClient.request<any>(
|
||||
'delete',
|
||||
`${this.basePath}/dictionary/type/${encodeURIComponent(String(type))}/${encodeURIComponent(String(ruleSetId))}`,
|
||||
{
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
@ -359,24 +436,45 @@ export class DictionaryControllerService {
|
||||
/**
|
||||
* Returns file containing the the dictionary entries for given type..
|
||||
*
|
||||
* @param type type
|
||||
* @param ruleSetId ruleSetId
|
||||
* @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(type: string, ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public downloadDictionaryFile(ruleSetId: string, type: string, dossierId?: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public downloadDictionaryFile(
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public downloadDictionaryFile(
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public downloadDictionaryFile(
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId was null or undefined when calling downloadDictionaryFile.');
|
||||
}
|
||||
|
||||
public downloadDictionaryFile(type: string, ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
|
||||
public downloadDictionaryFile(type: string, ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
|
||||
public downloadDictionaryFile(type: string, ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
if (type === null || type === undefined) {
|
||||
throw new Error('Required parameter type was null or undefined when calling downloadDictionaryFile.');
|
||||
}
|
||||
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId was null or undefined when calling downloadDictionaryFile.');
|
||||
let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
|
||||
if (dossierId !== undefined && dossierId !== null) {
|
||||
queryParameters = queryParameters.set('dossierId', <any>dossierId);
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
@ -401,6 +499,7 @@ export class DictionaryControllerService {
|
||||
'get',
|
||||
`${this.basePath}/dictionary/download/${encodeURIComponent(String(type))}/${encodeURIComponent(String(ruleSetId))}`,
|
||||
{
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
@ -413,20 +512,23 @@ export class DictionaryControllerService {
|
||||
* Retrieve all entry types
|
||||
* None
|
||||
* @param ruleSetId ruleSetId
|
||||
* @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(ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable<TypeResponse>;
|
||||
|
||||
public getAllTypes(ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<TypeResponse>>;
|
||||
|
||||
public getAllTypes(ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<TypeResponse>>;
|
||||
|
||||
public getAllTypes(ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
public getAllTypes(ruleSetId: string, dossierId?: string, observe?: 'body', reportProgress?: boolean): Observable<TypeResponse>;
|
||||
public getAllTypes(ruleSetId: string, dossierId?: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<TypeResponse>>;
|
||||
public getAllTypes(ruleSetId: string, dossierId?: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<TypeResponse>>;
|
||||
public getAllTypes(ruleSetId: string, dossierId?: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId was null or undefined when calling getAllTypes.');
|
||||
}
|
||||
|
||||
let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
|
||||
if (dossierId !== undefined && dossierId !== null) {
|
||||
queryParameters = queryParameters.set('dossierId', <any>dossierId);
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
|
||||
// authentication (RED-OAUTH) required
|
||||
@ -446,6 +548,7 @@ export class DictionaryControllerService {
|
||||
const consumes: string[] = [];
|
||||
|
||||
return this.httpClient.request<TypeResponse>('get', `${this.basePath}/dictionary/type/${encodeURIComponent(String(ruleSetId))}`, {
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
@ -461,11 +564,8 @@ export class DictionaryControllerService {
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public getColors(ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable<Colors>;
|
||||
|
||||
public getColors(ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Colors>>;
|
||||
|
||||
public getColors(ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Colors>>;
|
||||
|
||||
public getColors(ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId was null or undefined when calling getColors.');
|
||||
@ -500,24 +600,39 @@ export class DictionaryControllerService {
|
||||
/**
|
||||
* Retrieves all dictionary entries of an entry type
|
||||
* None
|
||||
* @param type type
|
||||
* @param ruleSetId ruleSetId
|
||||
* @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(type: string, ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable<Dictionary>;
|
||||
public getDictionaryForType(ruleSetId: string, type: string, dossierId?: string, observe?: 'body', reportProgress?: boolean): Observable<Dictionary>;
|
||||
public getDictionaryForType(
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<Dictionary>>;
|
||||
public getDictionaryForType(
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<Dictionary>>;
|
||||
public getDictionaryForType(ruleSetId: string, type: string, dossierId?: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId was null or undefined when calling getDictionaryForType.');
|
||||
}
|
||||
|
||||
public getDictionaryForType(type: string, ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Dictionary>>;
|
||||
|
||||
public getDictionaryForType(type: string, ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Dictionary>>;
|
||||
|
||||
public getDictionaryForType(type: string, ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
if (type === null || type === undefined) {
|
||||
throw new Error('Required parameter type was null or undefined when calling getDictionaryForType.');
|
||||
}
|
||||
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId was null or undefined when calling getDictionaryForType.');
|
||||
let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
|
||||
if (dossierId !== undefined && dossierId !== null) {
|
||||
queryParameters = queryParameters.set('dossierId', <any>dossierId);
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
@ -535,13 +650,11 @@ export class DictionaryControllerService {
|
||||
headers = headers.set('Accept', httpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [];
|
||||
|
||||
return this.httpClient.request<Dictionary>(
|
||||
'get',
|
||||
`${this.basePath}/dictionary/${encodeURIComponent(String(type))}/${encodeURIComponent(String(ruleSetId))}`,
|
||||
{
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
@ -559,11 +672,8 @@ export class DictionaryControllerService {
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public setColors(body: Colors, ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
|
||||
public setColors(body: Colors, ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
|
||||
public setColors(body: Colors, ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
|
||||
public setColors(body: Colors, ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling setColors.');
|
||||
@ -608,28 +718,52 @@ export class DictionaryControllerService {
|
||||
* Updates colors, hint and caseInsensitive of an entry type.
|
||||
* None
|
||||
* @param body typeValue
|
||||
* @param type type
|
||||
* @param ruleSetId ruleSetId
|
||||
* @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, type: string, ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
|
||||
public updateType(body: UpdateTypeValue, type: string, ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
|
||||
public updateType(body: UpdateTypeValue, type: string, ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
|
||||
public updateType(body: UpdateTypeValue, type: string, ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
public updateType(body: UpdateTypeValue, ruleSetId: string, type: string, dossierId?: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public updateType(
|
||||
body: UpdateTypeValue,
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public updateType(
|
||||
body: UpdateTypeValue,
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public updateType(
|
||||
body: UpdateTypeValue,
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
dossierId?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling updateType.');
|
||||
}
|
||||
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId 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.');
|
||||
}
|
||||
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId was null or undefined when calling updateType.');
|
||||
let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
|
||||
if (dossierId !== undefined && dossierId !== null) {
|
||||
queryParameters = queryParameters.set('dossierId', <any>dossierId);
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
@ -659,6 +793,7 @@ export class DictionaryControllerService {
|
||||
`${this.basePath}/dictionary/type/${encodeURIComponent(String(type))}/${encodeURIComponent(String(ruleSetId))}`,
|
||||
{
|
||||
body: body,
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
@ -668,33 +803,55 @@ export class DictionaryControllerService {
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes object containing string or rules as argument, which will be used by the redaction service.
|
||||
* Upload a text-file with 1 entry per line and add each line as an entry to a dictionary for a specific type
|
||||
*
|
||||
* @param file
|
||||
* @param type type
|
||||
* @param ruleSetId ruleSetId
|
||||
* @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(file: Blob, type: string, ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
|
||||
public uploadDictionaryFileForm(file: Blob, type: string, ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
|
||||
public uploadDictionaryFileForm(file: Blob, type: string, ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
|
||||
public uploadDictionaryFileForm(file: Blob, type: string, ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
if (file === null || file === undefined) {
|
||||
throw new Error('Required parameter file was null or undefined when calling uploadDictionaryFile.');
|
||||
public uploadDictionaryFileForm(
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
file?: Blob,
|
||||
dossierId?: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
public uploadDictionaryFileForm(
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
file?: Blob,
|
||||
dossierId?: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public uploadDictionaryFileForm(
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
file?: Blob,
|
||||
dossierId?: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public uploadDictionaryFileForm(
|
||||
ruleSetId: string,
|
||||
type: string,
|
||||
file?: Blob,
|
||||
dossierId?: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId 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.');
|
||||
}
|
||||
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId was null or undefined when calling uploadDictionaryFile.');
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
|
||||
// authentication (RED-OAUTH) required
|
||||
@ -730,6 +887,9 @@ export class DictionaryControllerService {
|
||||
if (file !== undefined) {
|
||||
formParams = (formParams.append('file', <any>file) as any) || formParams;
|
||||
}
|
||||
if (dossierId !== undefined) {
|
||||
formParams = (formParams.append('dossierId', <any>dossierId) as any) || formParams;
|
||||
}
|
||||
|
||||
return this.httpClient.request<any>(
|
||||
'post',
|
||||
@ -743,18 +903,4 @@ export class DictionaryControllerService {
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
* 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.
|
||||
*/ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/member-ordering */
|
||||
*/ /* tslint:disable:no-unused-variable member-ordering */
|
||||
|
||||
import { Inject, Injectable, Optional } from '@angular/core';
|
||||
import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http';
|
||||
@ -23,9 +23,9 @@ import { Configuration } from '../configuration';
|
||||
|
||||
@Injectable()
|
||||
export class VersionsControllerService {
|
||||
protected basePath = '';
|
||||
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) {
|
||||
@ -37,6 +37,67 @@ export class VersionsControllerService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves current version for dossier dictionary.
|
||||
* None
|
||||
* @param dossierId dossierId
|
||||
* @param ruleSetId ruleSetId
|
||||
* @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, ruleSetId: string, observe?: 'body', reportProgress?: boolean): Observable<number>;
|
||||
public getDossierDictionaryVersion(dossierId: string, ruleSetId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<number>>;
|
||||
public getDossierDictionaryVersion(dossierId: string, ruleSetId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<number>>;
|
||||
public getDossierDictionaryVersion(dossierId: string, ruleSetId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
if (dossierId === null || dossierId === undefined) {
|
||||
throw new Error('Required parameter dossierId was null or undefined when calling getDossierDictionaryVersion.');
|
||||
}
|
||||
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId 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<number>(
|
||||
'get',
|
||||
`${this.basePath}/version/dossier/${encodeURIComponent(String(ruleSetId))}/${encodeURIComponent(String(dossierId))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves current versions.
|
||||
* None
|
||||
@ -45,11 +106,8 @@ export class VersionsControllerService {
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public getVersions(ruleSetId: Array<string>, observe?: 'body', reportProgress?: boolean): Observable<{ [key: string]: VersionsResponse }>;
|
||||
|
||||
public getVersions(ruleSetId: Array<string>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<{ [key: string]: VersionsResponse }>>;
|
||||
|
||||
public getVersions(ruleSetId: Array<string>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<{ [key: string]: VersionsResponse }>>;
|
||||
|
||||
public getVersions(ruleSetId: Array<string>, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
if (ruleSetId === null || ruleSetId === undefined) {
|
||||
throw new Error('Required parameter ruleSetId was null or undefined when calling getVersions.');
|
||||
@ -77,9 +135,6 @@ export class VersionsControllerService {
|
||||
headers = headers.set('Accept', httpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [];
|
||||
|
||||
return this.httpClient.request<{ [key: string]: VersionsResponse }>('get', `${this.basePath}/version`, {
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
@ -88,18 +143,4 @@ export class VersionsControllerService {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user