From 0f0a349679e89d63c9ac636ac77739a1f0692985 Mon Sep 17 00:00:00 2001 From: Timo Date: Tue, 1 Jun 2021 09:15:02 +0300 Subject: [PATCH] updated necessary apis --- .../src/app/models/file/file-data.model.ts | 8 +- .../src/app/models/file/type-value.wrapper.ts | 41 + .../add-edit-dictionary-dialog.component.ts | 6 +- .../dictionary-listing-screen.component.ts | 9 +- .../dictionary-overview-screen.component.ts | 5 +- .../admin/services/admin-dialog.service.ts | 10 +- .../manual-annotation-dialog.component.ts | 9 +- .../annotation-icon.component.ts | 3 +- .../dictionary-annotation-icon.component.ts | 4 +- .../dictionary-manager.component.ts | 11 +- .../services/file-upload.service.ts | 8 +- .../red-ui/src/app/state/app-state.service.ts | 274 +++-- .../src/app/state/model/dossier.wrapper.ts | 1 - libs/red-ui-http/src/lib/api/api.ts | 6 +- .../lib/api/dictionaryController.service.ts | 84 +- .../api/digitalSignatureController.service.ts | 230 +++-- .../api/fileAttributesController.service.ts | 42 +- .../api/fileManagementController.service.ts | 975 +----------------- .../api/reportTemplateController.service.ts | 370 +++++++ .../src/lib/api/uploadController.service.ts | 148 +++ .../lib/api/watermarkController.service.ts | 72 +- .../src/lib/model/addRedactionRequest.ts | 11 +- libs/red-ui-http/src/lib/model/colors.ts | 8 +- libs/red-ui-http/src/lib/model/dictionary.ts | 20 +- .../src/lib/model/digitalSignature.ts | 10 +- ...del.ts => digitalSignatureViewModelReq.ts} | 2 +- ...Ids.ts => digitalSignatureViewModelRes.ts} | 7 +- libs/red-ui-http/src/lib/model/dossier.ts | 1 - .../src/lib/model/dossierAttributeConfig.ts | 28 + ...eRequest.ts => dossierAttributesConfig.ts} | 6 +- .../src/lib/model/dossierTemplateModel.ts | 38 +- .../src/lib/model/downloadDetails.ts | 31 +- .../src/lib/model/downloadStatus.ts | 12 +- .../src/lib/model/fileAttribute.ts | 18 - .../src/lib/model/fileAttributeConfig.ts | 8 +- libs/red-ui-http/src/lib/model/fileStatus.ts | 21 +- .../src/lib/model/fileUploadResult.ts | 12 +- libs/red-ui-http/src/lib/model/idRemoval.ts | 7 +- .../src/lib/model/importCsvRequest.ts | 18 - .../src/lib/model/importCsvResponse.ts | 15 - .../src/lib/model/licenseReportRequest.ts | 4 +- .../src/lib/model/manualForceRedaction.ts | 6 +- .../src/lib/model/manualRedactionEntry.ts | 8 +- .../src/lib/model/manualRedactions.ts | 2 +- libs/red-ui-http/src/lib/model/modelFile.ts | 33 - libs/red-ui-http/src/lib/model/models.ts | 70 +- .../src/lib/model/prepareDownloadRequest.ts | 8 - .../src/lib/model/redactionChangeLogEntry.ts | 10 +- .../src/lib/model/redactionLogEntry.ts | 14 +- .../src/lib/model/removeRedactionRequest.ts | 2 +- libs/red-ui-http/src/lib/model/reportData.ts | 33 +- .../{downloadRequest.ts => reportTemplate.ts} | 9 +- .../red-ui-http/src/lib/model/rolesRequest.ts | 21 - libs/red-ui-http/src/lib/model/rules.ts | 8 +- libs/red-ui-http/src/lib/model/typeValue.ts | 26 +- .../src/lib/model/updateTypeValue.ts | 14 +- libs/red-ui-http/src/lib/model/userRequest.ts | 16 - .../red-ui-http/src/lib/model/userResponse.ts | 34 - .../src/lib/model/userSearchRequest.ts | 16 - .../src/lib/model/userSearchResponse.ts | 34 - .../src/lib/model/watermarkModel.ts | 29 - .../src/lib/model/watermarkModelReq.ts | 28 + .../src/lib/model/watermarkModelRes.ts | 28 + 63 files changed, 1316 insertions(+), 1726 deletions(-) create mode 100644 apps/red-ui/src/app/models/file/type-value.wrapper.ts create mode 100644 libs/red-ui-http/src/lib/api/reportTemplateController.service.ts create mode 100644 libs/red-ui-http/src/lib/api/uploadController.service.ts rename libs/red-ui-http/src/lib/model/{digitalSignatureViewModel.ts => digitalSignatureViewModelReq.ts} (88%) rename libs/red-ui-http/src/lib/model/{fileIds.ts => digitalSignatureViewModelRes.ts} (65%) create mode 100644 libs/red-ui-http/src/lib/model/dossierAttributeConfig.ts rename libs/red-ui-http/src/lib/model/{downloadSubmissionPackageRequest.ts => dossierAttributesConfig.ts} (62%) delete mode 100644 libs/red-ui-http/src/lib/model/fileAttribute.ts delete mode 100644 libs/red-ui-http/src/lib/model/importCsvRequest.ts delete mode 100644 libs/red-ui-http/src/lib/model/importCsvResponse.ts delete mode 100644 libs/red-ui-http/src/lib/model/modelFile.ts rename libs/red-ui-http/src/lib/model/{downloadRequest.ts => reportTemplate.ts} (69%) delete mode 100644 libs/red-ui-http/src/lib/model/rolesRequest.ts delete mode 100644 libs/red-ui-http/src/lib/model/userRequest.ts delete mode 100644 libs/red-ui-http/src/lib/model/userResponse.ts delete mode 100644 libs/red-ui-http/src/lib/model/userSearchRequest.ts delete mode 100644 libs/red-ui-http/src/lib/model/userSearchResponse.ts delete mode 100644 libs/red-ui-http/src/lib/model/watermarkModel.ts create mode 100644 libs/red-ui-http/src/lib/model/watermarkModelReq.ts create mode 100644 libs/red-ui-http/src/lib/model/watermarkModelRes.ts diff --git a/apps/red-ui/src/app/models/file/file-data.model.ts b/apps/red-ui/src/app/models/file/file-data.model.ts index 6492c7699..6d9018db4 100644 --- a/apps/red-ui/src/app/models/file/file-data.model.ts +++ b/apps/red-ui/src/app/models/file/file-data.model.ts @@ -5,7 +5,6 @@ import { RedactionChangeLog, RedactionLog, RedactionLogEntry, - TypeValue, ViewedPages } from '@redaction/red-ui-http'; import { FileStatusWrapper } from './file-status.wrapper'; @@ -13,6 +12,7 @@ import { UserWrapper } from '@services/user.service'; import { AnnotationWrapper } from './annotation.wrapper'; import { RedactionLogEntryWrapper } from './redaction-log-entry.wrapper'; import { ViewMode } from './view-mode'; +import { TypeValueWrapper } from './type-value.wrapper'; export class AnnotationData { visibleAnnotations: AnnotationWrapper[]; @@ -34,7 +34,7 @@ export class FileDataModel { } getAnnotations( - dictionaryData: { [p: string]: TypeValue }, + dictionaryData: { [p: string]: TypeValueWrapper }, currentUser: UserWrapper, viewMode: ViewMode, areDevFeaturesEnabled: boolean @@ -62,7 +62,9 @@ export class FileDataModel { }; } - private _convertData(dictionaryData: { [p: string]: TypeValue }): RedactionLogEntryWrapper[] { + private _convertData(dictionaryData: { + [p: string]: TypeValueWrapper; + }): RedactionLogEntryWrapper[] { let result: RedactionLogEntryWrapper[] = []; this.redactionChangeLog?.redactionLogEntry?.forEach((changeLogEntry) => { diff --git a/apps/red-ui/src/app/models/file/type-value.wrapper.ts b/apps/red-ui/src/app/models/file/type-value.wrapper.ts new file mode 100644 index 000000000..2afca4c19 --- /dev/null +++ b/apps/red-ui/src/app/models/file/type-value.wrapper.ts @@ -0,0 +1,41 @@ +import { TypeValue } from '@redaction/red-ui-http'; + +export class TypeValueWrapper { + constructor(public typeValue: TypeValue, public label?: string, public virtual?: boolean) {} + + get addToDictionaryAction() { + return this.typeValue.addToDictionaryAction; + } + + get caseInsensitive() { + return this.typeValue.caseInsensitive; + } + + get description() { + return this.typeValue.description; + } + + get dossierTemplateId() { + return this.typeValue.dossierTemplateId; + } + + get hexColor() { + return this.typeValue.hexColor; + } + + get hint() { + return this.typeValue.hint; + } + + get rank() { + return this.typeValue.rank; + } + + get recommendation() { + return this.typeValue.recommendation; + } + + get type() { + return this.typeValue.type; + } +} diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts index 2929b7244..1a81e9849 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-dictionary-dialog/add-edit-dictionary-dialog.component.ts @@ -6,6 +6,7 @@ import { DictionaryControllerService, TypeValue } from '@redaction/red-ui-http'; import { Observable } from 'rxjs'; import { NotificationService, NotificationType } from '@services/notification.service'; import { TranslateService } from '@ngx-translate/core'; +import { TypeValueWrapper } from '../../../../models/file/type-value.wrapper'; @Component({ selector: 'redaction-add-edit-dictionary-dialog', @@ -14,7 +15,7 @@ import { TranslateService } from '@ngx-translate/core'; }) export class AddEditDictionaryDialogComponent { dictionaryForm: FormGroup; - readonly dictionary: TypeValue; + readonly dictionary: TypeValueWrapper; private readonly _dossierTemplateId: string; constructor( @@ -24,7 +25,8 @@ export class AddEditDictionaryDialogComponent { private readonly _notificationService: NotificationService, private readonly _translateService: TranslateService, public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: { dictionary: TypeValue; dossierTemplateId: string } + @Inject(MAT_DIALOG_DATA) + public data: { dictionary: TypeValueWrapper; dossierTemplateId: string } ) { this.dictionary = data.dictionary; this._dossierTemplateId = data.dossierTemplateId; diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts index 3a013d077..9ba5b1024 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-listing/dictionary-listing-screen.component.ts @@ -1,6 +1,6 @@ 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 { DictionaryControllerService } from '@redaction/red-ui-http'; import { AppStateService } from '@state/app-state.service'; import { catchError, defaultIfEmpty, tap } from 'rxjs/operators'; import { forkJoin, of } from 'rxjs'; @@ -8,6 +8,7 @@ import { PermissionsService } from '@services/permissions.service'; import { ActivatedRoute } from '@angular/router'; import { AdminDialogService } from '../../services/admin-dialog.service'; import { BaseListingComponent } from '@shared/base/base-listing.component'; +import { TypeValueWrapper } from '../../../../models/file/type-value.wrapper'; @Component({ selector: 'redaction-dictionary-listing-screen', @@ -15,7 +16,7 @@ import { BaseListingComponent } from '@shared/base/base-listing.component'; styleUrls: ['./dictionary-listing-screen.component.scss'] }) export class DictionaryListingScreenComponent - extends BaseListingComponent + extends BaseListingComponent implements OnInit { viewReady = false; @@ -42,7 +43,7 @@ export class DictionaryListingScreenComponent this._loadDictionaryData(); } - openAddEditDictionaryDialog($event?: MouseEvent, dict?: TypeValue) { + openAddEditDictionaryDialog($event?: MouseEvent, dict?: TypeValueWrapper) { $event?.stopPropagation(); this._dialogService.openAddEditDictionaryDialog( dict, @@ -56,7 +57,7 @@ export class DictionaryListingScreenComponent ); } - openDeleteDictionaryDialog($event: any, dict: TypeValue) { + openDeleteDictionaryDialog($event: any, dict: TypeValueWrapper) { this._dialogService.openDeleteDictionaryDialog( $event, dict, diff --git a/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts index 9a7c08811..1d514c920 100644 --- a/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/dictionary-overview/dictionary-overview-screen.component.ts @@ -1,5 +1,5 @@ import { Component, ElementRef, OnInit, ViewChild } from '@angular/core'; -import { DictionaryControllerService, TypeValue } from '@redaction/red-ui-http'; +import { DictionaryControllerService } from '@redaction/red-ui-http'; import { AppStateService } from '@state/app-state.service'; import { PermissionsService } from '@services/permissions.service'; import { ActivatedRoute, Router } from '@angular/router'; @@ -9,6 +9,7 @@ import { ComponentHasChanges } from '@guards/can-deactivate.guard'; import { AdminDialogService } from '../../services/admin-dialog.service'; import { DictionaryManagerComponent } from '../../../shared/components/dictionary-manager/dictionary-manager.component'; import { DictionarySaveService } from '../../../shared/services/dictionary-save.service'; +import { TypeValueWrapper } from '../../../../models/file/type-value.wrapper'; @Component({ selector: 'redaction-dictionary-overview-screen', @@ -44,7 +45,7 @@ export class DictionaryOverviewScreenComponent extends ComponentHasChanges imple this._loadEntries(); } - get dictionary(): TypeValue { + get dictionary(): TypeValueWrapper { return this._appStateService.activeDictionary; } diff --git a/apps/red-ui/src/app/modules/admin/services/admin-dialog.service.ts b/apps/red-ui/src/app/modules/admin/services/admin-dialog.service.ts index 6ea8b3584..b5083acca 100644 --- a/apps/red-ui/src/app/modules/admin/services/admin-dialog.service.ts +++ b/apps/red-ui/src/app/modules/admin/services/admin-dialog.service.ts @@ -3,14 +3,13 @@ import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { Colors, DictionaryControllerService, + DossierTemplateControllerService, + DossierTemplateModel, FileAttributeConfig, FileAttributesConfig, FileManagementControllerService, ManualRedactionControllerService, - DossierTemplateControllerService, - DossierTemplateModel, SMTPConfigurationModel, - TypeValue, User } from '@redaction/red-ui-http'; import { AddEditFileAttributeDialogComponent } from '../dialogs/add-edit-file-attribute-dialog/add-edit-file-attribute-dialog.component'; @@ -26,6 +25,7 @@ import { SmtpAuthDialogComponent } from '../dialogs/smtp-auth-dialog/smtp-auth-d import { AddEditUserDialogComponent } from '../dialogs/add-edit-user-dialog/add-edit-user-dialog.component'; import { ConfirmDeleteUsersDialogComponent } from '../dialogs/confirm-delete-users-dialog/confirm-delete-users-dialog.component'; import { FileAttributesCsvImportDialogComponent } from '../dialogs/file-attributes-csv-import-dialog/file-attributes-csv-import-dialog.component'; +import { TypeValueWrapper } from '../../../models/file/type-value.wrapper'; const largeDialogConfig = { width: '90vw', @@ -55,7 +55,7 @@ export class AdminDialogService { openDeleteDictionaryDialog( $event: MouseEvent, - dictionary: TypeValue, + dictionary: TypeValueWrapper, dossierTemplateId: string, cb?: Function ): MatDialogRef { @@ -91,7 +91,7 @@ export class AdminDialogService { } openAddEditDictionaryDialog( - dictionary: TypeValue, + dictionary: TypeValueWrapper, dossierTemplateId: string, cb?: Function ): MatDialogRef { diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts index ff0430769..59f1322ee 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/manual-redaction-dialog/manual-annotation-dialog.component.ts @@ -2,11 +2,7 @@ import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { AppStateService } from '@state/app-state.service'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { - AddRedactionRequest, - LegalBasisMappingControllerService, - TypeValue -} from '@redaction/red-ui-http'; +import { AddRedactionRequest, LegalBasisMappingControllerService } from '@redaction/red-ui-http'; import { NotificationService } from '@services/notification.service'; import { TranslateService } from '@ngx-translate/core'; import { UserService } from '@services/user.service'; @@ -14,6 +10,7 @@ import { ManualRedactionEntryWrapper } from '@models/file/manual-redaction-entry import { ManualAnnotationService } from '../../services/manual-annotation.service'; import { ManualAnnotationResponse } from '@models/file/manual-annotation-response'; import { PermissionsService } from '@services/permissions.service'; +import { TypeValueWrapper } from '../../../../models/file/type-value.wrapper'; export interface LegalBasisOption { label?: string; @@ -33,7 +30,7 @@ export class ManualAnnotationDialogComponent implements OnInit { isDictionaryRequest: boolean; isFalsePositiveRequest: boolean; - redactionDictionaries: TypeValue[] = []; + redactionDictionaries: TypeValueWrapper[] = []; legalOptions: LegalBasisOption[] = []; constructor( diff --git a/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.ts b/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.ts index 8713aeb5a..3dfca2b33 100644 --- a/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/annotation-icon/annotation-icon.component.ts @@ -1,5 +1,6 @@ import { Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core'; import { TypeValue } from '@redaction/red-ui-http'; +import { TypeValueWrapper } from '@models/file/type-value.wrapper'; @Component({ selector: 'redaction-annotation-icon', @@ -10,7 +11,7 @@ export class AnnotationIconComponent implements OnInit { @Input() color: string; @Input() type: 'square' | 'rhombus' | 'circle' | 'hexagon' | 'none'; @Input() label: string; - @Input() dictType: TypeValue; + @Input() dictType: TypeValueWrapper; @ViewChild('icon', { static: true }) icon: ElementRef; diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.ts b/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.ts index a90630377..2bffab9f9 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-annotation-icon/dictionary-annotation-icon.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnChanges } from '@angular/core'; import { AppStateService } from '@state/app-state.service'; -import { TypeValue } from '@redaction/red-ui-http'; +import { TypeValueWrapper } from '@models/file/type-value.wrapper'; @Component({ selector: 'redaction-dictionary-annotation-icon', @@ -19,7 +19,7 @@ export class DictionaryAnnotationIconComponent implements OnChanges { ngOnChanges(): void { if (this.dictionaryKey) { - const typeValue: TypeValue = this._appStateService.getDictionaryTypeValue( + const typeValue: TypeValueWrapper = this._appStateService.getDictionaryTypeValue( this.dictionaryKey, this.dossierTemplateId ); diff --git a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts index 61ac8e725..30da32c0e 100644 --- a/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts +++ b/apps/red-ui/src/app/modules/shared/components/dictionary-manager/dictionary-manager.component.ts @@ -1,14 +1,11 @@ import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core'; -import { - DictionaryControllerService, - DossierTemplateModel, - TypeValue -} from '@redaction/red-ui-http'; +import { DictionaryControllerService, DossierTemplateModel } from '@redaction/red-ui-http'; import { FormBuilder, FormGroup } from '@angular/forms'; import { AppStateService } from '@state/app-state.service'; import { debounce } from '@utils/debounce'; import { Observable, of } from 'rxjs'; import { map } from 'rxjs/operators'; +import { TypeValueWrapper } from '@models/file/type-value.wrapper'; import ICodeEditor = monaco.editor.ICodeEditor; import IDiffEditor = monaco.editor.IDiffEditor; import IModelDeltaDecoration = monaco.editor.IModelDeltaDecoration; @@ -49,7 +46,7 @@ export class DictionaryManagerComponent implements OnChanges { selectDossierTemplate = { name: 'dictionary-overview.compare.select-dossier-template' }; selectDictionary = { label: 'dictionary-overview.compare.select-dictionary' }; dossierTemplates: DossierTemplateModel[]; - dictionaries: TypeValue[] = [this.selectDictionary]; + dictionaries: TypeValueWrapper[] = [this.selectDictionary]; form: FormGroup; private _codeEditor: ICodeEditor; @@ -251,7 +248,7 @@ export class DictionaryManagerComponent implements OnChanges { this.form.patchValue({ dictionary: this.selectDictionary }); } - private _onDictionaryChanged(dictionary: TypeValue): Observable { + private _onDictionaryChanged(dictionary: TypeValueWrapper): Observable { if (dictionary === this.selectDictionary) { return of(''); } diff --git a/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts b/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts index 9ed61e739..184ee7f46 100644 --- a/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts +++ b/apps/red-ui/src/app/modules/upload-download/services/file-upload.service.ts @@ -2,12 +2,12 @@ import { ApplicationRef, Injectable } from '@angular/core'; import { FileUploadModel } from '../model/file-upload.model'; import { AppStateService } from '@state/app-state.service'; import { HttpEventType } from '@angular/common/http'; -import { FileManagementControllerService } from '@redaction/red-ui-http'; import { interval, Subscription } from 'rxjs'; import { AppConfigKey, AppConfigService } from '@app-config/app-config.service'; import { TranslateService } from '@ngx-translate/core'; import { UploadDownloadDialogService } from './upload-download-dialog.service'; import { toNumber } from '@utils/functions'; +import { UploadControllerService } from '../../../../../../../libs/red-ui-http/src/lib/api/uploadController.service'; export interface ActiveUpload { subscription: Subscription; @@ -29,7 +29,7 @@ export class FileUploadService { private readonly _applicationRef: ApplicationRef, private readonly _translateService: TranslateService, private readonly _appConfigService: AppConfigService, - private readonly _fileManagementControllerService: FileManagementControllerService, + private readonly _uploadControllerService: UploadControllerService, private readonly _dialogService: UploadDownloadDialogService ) { interval(2500).subscribe(() => { @@ -153,9 +153,9 @@ export class FileUploadService { private _createSubscription(uploadFile: FileUploadModel) { this.activeUploads++; - const obs = this._fileManagementControllerService.uploadFileForm( - uploadFile.file, + const obs = this._uploadControllerService.uploadFileForm( uploadFile.dossierId, + uploadFile.file, 'events', true ); diff --git a/apps/red-ui/src/app/state/app-state.service.ts b/apps/red-ui/src/app/state/app-state.service.ts index 6cda1a128..692e492a3 100644 --- a/apps/red-ui/src/app/state/app-state.service.ts +++ b/apps/red-ui/src/app/state/app-state.service.ts @@ -9,8 +9,7 @@ import { FileAttributesControllerService, FileStatus, ReanalysisControllerService, - StatusControllerService, - TypeValue + StatusControllerService } from '@redaction/red-ui-http'; import { NotificationService, NotificationType } from '@services/notification.service'; import { TranslateService } from '@ngx-translate/core'; @@ -21,6 +20,7 @@ import { catchError, tap } from 'rxjs/operators'; import { humanize } from '@utils/functions'; import { FileStatusWrapper } from '@models/file/file-status.wrapper'; import { DossierWrapper } from './model/dossier.wrapper'; +import { TypeValueWrapper } from '@models/file/type-value.wrapper'; export interface AppState { dossiers: DossierWrapper[]; @@ -81,9 +81,9 @@ export class AppStateService { }); } - private _dictionaryData: { [key: string]: { [key: string]: TypeValue } } = null; + private _dictionaryData: { [key: string]: { [key: string]: TypeValueWrapper } } = null; - get dictionaryData(): { [key: string]: { [key: string]: TypeValue } } { + get dictionaryData(): { [key: string]: { [key: string]: TypeValueWrapper } } { return this._dictionaryData; } @@ -117,7 +117,7 @@ export class AppStateService { return this._appState.activeDictionaryType; } - get activeDictionary(): TypeValue { + get activeDictionary(): TypeValueWrapper { return this.activeDossierTemplateId && this.dictionaryData[this.activeDossierTemplateId] ? this.dictionaryData[this.activeDossierTemplateId][this.activeDictionaryType] : null; @@ -478,124 +478,182 @@ export class AppStateService { const colorsObs = this._dictionaryControllerService.getColors(dossierTemplateId).pipe( tap((colors) => { // declined - dictionaryData['declined-suggestion'] = { - hexColor: colors.notRedacted, - type: 'declined-suggestion', - virtual: true - }; + dictionaryData['declined-suggestion'] = new TypeValueWrapper( + { + hexColor: colors.notRedacted, + type: 'declined-suggestion' + }, + null, + true + ); // manual - dictionaryData['manual'] = { - hexColor: colors.manualRedactionColor, - type: 'manual', - virtual: true - }; + dictionaryData['manual'] = new TypeValueWrapper( + { + hexColor: colors.manualRedactionColor, + type: 'manual' + }, + null, + true + ); // manual - dictionaryData['manual-redaction'] = { - hexColor: colors.manualRedactionColor, - type: 'manual-redaction', - virtual: true - }; - + dictionaryData['manual-redaction'] = new TypeValueWrapper( + { + hexColor: colors.manualRedactionColor, + type: 'manual-redaction' + }, + null, + true + ); // dictionary actions - dictionaryData['recommendation'] = { - hexColor: '#c5d3eb', - type: 'recommendation', - virtual: true - }; + dictionaryData['recommendation'] = new TypeValueWrapper( + { + hexColor: '#c5d3eb', + type: 'recommendation' + }, + null, + true + ); // dictionary actions - dictionaryData['add-dictionary'] = { - hexColor: colors.analysisColor, - type: 'add-dictionary', - virtual: true - }; - dictionaryData['remove-dictionary'] = { - hexColor: colors.analysisColor, - type: 'remove-dictionary', - virtual: true - }; - dictionaryData['remove-only-here'] = { - hexColor: colors.analysisColor, - type: 'remove-only-here', - virtual: true - }; + dictionaryData['add-dictionary'] = new TypeValueWrapper( + { + hexColor: colors.analysisColor, + type: 'add-dictionary' + }, + null, + true + ); + dictionaryData['remove-dictionary'] = new TypeValueWrapper( + { + hexColor: colors.analysisColor, + type: 'remove-dictionary' + }, + null, + true + ); + dictionaryData['remove-only-here'] = new TypeValueWrapper( + { + hexColor: colors.analysisColor, + type: 'remove-only-here' + }, + null, + true + ); // generic suggestions - dictionaryData['suggestion'] = { - hexColor: colors.requestAdd, - type: 'suggestion', - virtual: true - }; + dictionaryData['suggestion'] = new TypeValueWrapper( + { + hexColor: colors.requestAdd, + type: 'suggestion' + }, + null, + true + ); // add suggestions - dictionaryData['suggestion-add'] = { - hexColor: colors.requestAdd, - type: 'suggestion-add', - virtual: true - }; - dictionaryData['suggestion-add-dictionary'] = { - hexColor: colors.dictionaryRequestColor, - type: 'suggestion-add', - virtual: true - }; + dictionaryData['suggestion-add'] = new TypeValueWrapper( + { + hexColor: colors.requestAdd, + type: 'suggestion-add' + }, + null, + true + ); + dictionaryData['suggestion-add-dictionary'] = new TypeValueWrapper( + { + hexColor: colors.dictionaryRequestColor, + type: 'suggestion-add' + }, + null, + true + ); // suggestion remove - dictionaryData['suggestion-remove'] = { - hexColor: colors.requestRemove, - type: 'suggestion-add', - virtual: true - }; + dictionaryData['suggestion-remove'] = new TypeValueWrapper( + { + hexColor: colors.requestRemove, + type: 'suggestion-add' + }, + null, + true + ); - dictionaryData['suggestion-remove-dictionary'] = { - hexColor: colors.dictionaryRequestColor, - type: 'suggestion-add', - virtual: true - }; + dictionaryData['suggestion-remove-dictionary'] = new TypeValueWrapper( + { + hexColor: colors.dictionaryRequestColor, + type: 'suggestion-add' + }, + null, + true + ); - dictionaryData['skipped'] = { - hexColor: colors.notRedacted, - type: 'skipped', - virtual: true - }; + dictionaryData['skipped'] = new TypeValueWrapper( + { + hexColor: colors.notRedacted, + type: 'skipped' + }, + null, + true + ); - dictionaryData['default'] = { - hexColor: colors.defaultColor, - type: 'default', - virtual: true - }; + dictionaryData['default'] = new TypeValueWrapper( + { + hexColor: colors.defaultColor, + type: 'default' + }, + null, + true + ); - dictionaryData['add'] = { - hexColor: colors.requestAdd, - type: 'add', - virtual: true - }; + dictionaryData['add'] = new TypeValueWrapper( + { + hexColor: colors.requestAdd, + type: 'add' + }, + null, + true + ); + dictionaryData['analysis'] = new TypeValueWrapper( + { + hexColor: colors.analysisColor, + type: 'analysis' + }, + null, + true + ); - dictionaryData['analysis'] = { - hexColor: colors.analysisColor, - type: 'analysis', - virtual: true - }; + dictionaryData['pending-analysis'] = new TypeValueWrapper( + { + hexColor: colors.analysisColor, + type: 'analysis' + }, + null, + true + ); - dictionaryData['pending-analysis'] = { - hexColor: colors.analysisColor, - type: 'analysis', - virtual: true - }; + dictionaryData['hint'] = new TypeValueWrapper( + { + hexColor: '#fa98f7', + type: 'hint', + hint: true + }, + null, + true + ); - dictionaryData['hint'] = { - hexColor: '#fa98f7', - type: 'hint', - virtual: true, - hint: true - }; + dictionaryData['redaction'] = new TypeValueWrapper( + { + hexColor: colors.previewColor, + type: 'redaction' + }, + null, + true + ); - dictionaryData['redaction'] = { - hexColor: colors.previewColor, - type: 'redaction', - virtual: true - }; - - dictionaryData['updated'] = { - hexColor: colors.updatedColor, - type: 'updated', - virtual: true - }; + dictionaryData['updated'] = new TypeValueWrapper( + { + hexColor: colors.updatedColor, + type: 'updated' + }, + null, + true + ); }) ); diff --git a/apps/red-ui/src/app/state/model/dossier.wrapper.ts b/apps/red-ui/src/app/state/model/dossier.wrapper.ts index 76b79bac4..e3b8d6630 100644 --- a/apps/red-ui/src/app/state/model/dossier.wrapper.ts +++ b/apps/red-ui/src/app/state/model/dossier.wrapper.ts @@ -13,7 +13,6 @@ export class DossierWrapper { allFilesApproved?: boolean; type: Dictionary; - dictionaryVersion?: number; constructor(public dossier: Dossier, files: FileStatusWrapper[]) { this._files = files ? files : []; diff --git a/libs/red-ui-http/src/lib/api/api.ts b/libs/red-ui-http/src/lib/api/api.ts index 4de4d1f90..762b8d248 100644 --- a/libs/red-ui-http/src/lib/api/api.ts +++ b/libs/red-ui-http/src/lib/api/api.ts @@ -21,6 +21,7 @@ import { DownloadControllerService } from './downloadController.service'; import { DigitalSignatureControllerService } from './digitalSignatureController.service'; import { FileAttributesControllerService } from './fileAttributesController.service'; import { SmtpConfigurationControllerService } from './smtpConfigurationController.service'; +import { ReportTemplateControllerService } from './reportTemplateController.service'; export * from './auditController.service'; @@ -68,6 +69,8 @@ export * from './fileAttributesController.service'; export * from './smtpConfigurationController.service'; +export * from './reportTemplateController.service'; + export const APIS = [ AuditControllerService, DebugControllerService, @@ -91,5 +94,6 @@ export const APIS = [ DownloadControllerService, DigitalSignatureControllerService, FileAttributesControllerService, - SmtpConfigurationControllerService + SmtpConfigurationControllerService, + ReportTemplateControllerService ]; diff --git a/libs/red-ui-http/src/lib/api/dictionaryController.service.ts b/libs/red-ui-http/src/lib/api/dictionaryController.service.ts index 2933cc35d..ea2d0fb45 100644 --- a/libs/red-ui-http/src/lib/api/dictionaryController.service.ts +++ b/libs/red-ui-http/src/lib/api/dictionaryController.service.ts @@ -157,9 +157,9 @@ export class DictionaryControllerService { return this.httpClient.request( 'post', - `${this.basePath}/dictionary/${encodeURIComponent(String(type))}/${encodeURIComponent( - String(dossierTemplateId) - )}`, + `${this.basePath}/redaction-gateway-v1/dictionary/${encodeURIComponent( + String(type) + )}/${encodeURIComponent(String(dossierTemplateId))}`, { body: body, params: queryParameters, @@ -239,14 +239,18 @@ export class DictionaryControllerService { 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 - }); + return this.httpClient.request( + 'post', + `${this.basePath}/redaction-gateway-v1/dictionary/type`, + { + body: body, + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } /** @@ -343,7 +347,7 @@ export class DictionaryControllerService { return this.httpClient.request( 'post', - `${this.basePath}/dictionary/delete/${encodeURIComponent( + `${this.basePath}/redaction-gateway-v1/dictionary/delete/${encodeURIComponent( String(type) )}/${encodeURIComponent(String(dossierTemplateId))}`, { @@ -360,57 +364,57 @@ export class DictionaryControllerService { /** * Delete dictionary entry with entry type. * None - * @param entry entry * @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( - entry: string, dossierTemplateId: string, + entry: string, type: string, dossierId?: string, observe?: 'body', reportProgress?: boolean ): Observable; public deleteEntry( - entry: string, dossierTemplateId: string, + entry: string, type: string, dossierId?: string, observe?: 'response', reportProgress?: boolean ): Observable>; public deleteEntry( - entry: string, dossierTemplateId: string, + entry: string, type: string, dossierId?: string, observe?: 'events', reportProgress?: boolean ): Observable>; public deleteEntry( - entry: string, dossierTemplateId: string, + entry: string, type: string, dossierId?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { - if (entry === null || entry === undefined) { - throw new Error( - 'Required parameter entry was null or undefined when calling deleteEntry.' - ); - } - 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.' @@ -443,9 +447,11 @@ export class DictionaryControllerService { return this.httpClient.request( 'delete', - `${this.basePath}/dictionary/${encodeURIComponent(String(type))}/${encodeURIComponent( - String(dossierTemplateId) - )}/${encodeURIComponent(String(entry))}`, + `${this.basePath}/redaction-gateway-v1/dictionary/${encodeURIComponent( + String(type) + )}/${encodeURIComponent(String(dossierTemplateId))}/${encodeURIComponent( + String(entry) + )}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, @@ -531,7 +537,7 @@ export class DictionaryControllerService { return this.httpClient.request( 'delete', - `${this.basePath}/dictionary/type/${encodeURIComponent( + `${this.basePath}/redaction-gateway-v1/dictionary/type/${encodeURIComponent( String(type) )}/${encodeURIComponent(String(dossierTemplateId))}`, { @@ -619,7 +625,7 @@ export class DictionaryControllerService { return this.httpClient.request( 'get', - `${this.basePath}/dictionary/download/${encodeURIComponent( + `${this.basePath}/redaction-gateway-v1/dictionary/download/${encodeURIComponent( String(type) )}/${encodeURIComponent(String(dossierTemplateId))}`, { @@ -696,7 +702,9 @@ export class DictionaryControllerService { return this.httpClient.request( 'get', - `${this.basePath}/dictionary/type/${encodeURIComponent(String(dossierTemplateId))}`, + `${this.basePath}/redaction-gateway-v1/dictionary/type/${encodeURIComponent( + String(dossierTemplateId) + )}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, @@ -761,7 +769,9 @@ export class DictionaryControllerService { return this.httpClient.request( 'get', - `${this.basePath}/color/${encodeURIComponent(String(dossierTemplateId))}`, + `${this.basePath}/redaction-gateway-v1/color/${encodeURIComponent( + String(dossierTemplateId) + )}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -846,9 +856,9 @@ export class DictionaryControllerService { return this.httpClient.request( 'get', - `${this.basePath}/dictionary/${encodeURIComponent(String(type))}/${encodeURIComponent( - String(dossierTemplateId) - )}`, + `${this.basePath}/redaction-gateway-v1/dictionary/${encodeURIComponent( + String(type) + )}/${encodeURIComponent(String(dossierTemplateId))}`, { params: queryParameters, withCredentials: this.configuration.withCredentials, @@ -932,7 +942,9 @@ export class DictionaryControllerService { return this.httpClient.request( 'post', - `${this.basePath}/color/${encodeURIComponent(String(dossierTemplateId))}`, + `${this.basePath}/redaction-gateway-v1/color/${encodeURIComponent( + String(dossierTemplateId) + )}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -1037,7 +1049,7 @@ export class DictionaryControllerService { return this.httpClient.request( 'post', - `${this.basePath}/dictionary/type/${encodeURIComponent( + `${this.basePath}/redaction-gateway-v1/dictionary/type/${encodeURIComponent( String(type) )}/${encodeURIComponent(String(dossierTemplateId))}`, { @@ -1150,7 +1162,7 @@ export class DictionaryControllerService { return this.httpClient.request( 'post', - `${this.basePath}/dictionary/upload/${encodeURIComponent( + `${this.basePath}/redaction-gateway-v1/dictionary/upload/${encodeURIComponent( String(type) )}/${encodeURIComponent(String(dossierTemplateId))}`, { diff --git a/libs/red-ui-http/src/lib/api/digitalSignatureController.service.ts b/libs/red-ui-http/src/lib/api/digitalSignatureController.service.ts index f9bb1bbec..5288eed8d 100644 --- a/libs/red-ui-http/src/lib/api/digitalSignatureController.service.ts +++ b/libs/red-ui-http/src/lib/api/digitalSignatureController.service.ts @@ -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, HttpResponse } from '@angular/common/http'; @@ -16,7 +16,8 @@ import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/commo import { Observable } from 'rxjs'; import { DigitalSignature } from '../model/digitalSignature'; -import { DigitalSignatureViewModel } from '../model/digitalSignatureViewModel'; +import { DigitalSignatureViewModelReq } from '../model/digitalSignatureViewModelReq'; +import { DigitalSignatureViewModelRes } from '../model/digitalSignatureViewModelRes'; import { BASE_PATH } from '../variables'; import { Configuration } from '../configuration'; @@ -27,7 +28,11 @@ export class DigitalSignatureControllerService { public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); - constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) { + constructor( + protected httpClient: HttpClient, + @Optional() @Inject(BASE_PATH) basePath: string, + @Optional() configuration: Configuration + ) { if (basePath) { this.basePath = basePath; } @@ -37,20 +42,6 @@ export class DigitalSignatureControllerService { } } - /** - * @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; - } - /** * Remove the digital signature * None @@ -58,33 +49,47 @@ export class DigitalSignatureControllerService { * @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 { + 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; + 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); + 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[] = []; - - return this.httpClient.request('delete', `${this.basePath}/digital-signature`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); + return this.httpClient.request( + 'delete', + `${this.basePath}/redaction-gateway-v1/digital-signature`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } /** @@ -93,34 +98,51 @@ export class DigitalSignatureControllerService { * @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 { + 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; + 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); + 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[] = []; - - return this.httpClient.request('get', `${this.basePath}/digital-signature`, { - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - }); + return this.httpClient.request( + 'get', + `${this.basePath}/redaction-gateway-v1/digital-signature`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } /** @@ -130,43 +152,70 @@ export class DigitalSignatureControllerService { * @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 { + 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.'); + 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; + 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); + 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); + 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 - }); + return this.httpClient.request( + 'post', + `${this.basePath}/redaction-gateway-v1/digital-signature`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } /** @@ -176,42 +225,69 @@ export class DigitalSignatureControllerService { * @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 { + public updateDigitalSignature( + body: DigitalSignatureViewModelReq, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public updateDigitalSignature( + body: DigitalSignatureViewModelReq, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public updateDigitalSignature( + body: DigitalSignatureViewModelReq, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public updateDigitalSignature( + body: DigitalSignatureViewModelReq, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling saveDigitalSignature1.'); + throw new Error( + 'Required parameter body was null or undefined when calling saveDigitalSignature1.' + ); } 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; + 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); + 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); + 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 - }); + return this.httpClient.request( + 'put', + `${this.basePath}/redaction-gateway-v1/digital-signature`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); } } diff --git a/libs/red-ui-http/src/lib/api/fileAttributesController.service.ts b/libs/red-ui-http/src/lib/api/fileAttributesController.service.ts index 0c602ce92..28bfb76d2 100644 --- a/libs/red-ui-http/src/lib/api/fileAttributesController.service.ts +++ b/libs/red-ui-http/src/lib/api/fileAttributesController.service.ts @@ -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, HttpResponse } from '@angular/common/http'; @@ -42,20 +42,6 @@ export class FileAttributesControllerService { } } - /** - * @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; - } - /** * Delete a specific file attribute. * None @@ -119,12 +105,11 @@ export class FileAttributesControllerService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = []; - return this.httpClient.request( 'delete', - `${this.basePath}/fileAttributes/config/fileAttribute/${encodeURIComponent( + `${ + this.basePath + }/redaction-gateway-v1/fileAttributes/config/fileAttribute/${encodeURIComponent( String(dossierTemplateId) )}/${encodeURIComponent(String(fileAttributeId))}`, { @@ -209,7 +194,9 @@ export class FileAttributesControllerService { return this.httpClient.request( 'post', - `${this.basePath}/fileAttributes/config/fileAttribute/${encodeURIComponent( + `${ + this.basePath + }/redaction-gateway-v1/fileAttributes/config/fileAttribute/${encodeURIComponent( String(dossierTemplateId) )}/delete`, { @@ -274,12 +261,9 @@ export class FileAttributesControllerService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = []; - return this.httpClient.request( 'get', - `${this.basePath}/fileAttributes/config/${encodeURIComponent( + `${this.basePath}/redaction-gateway-v1/fileAttributes/config/${encodeURIComponent( String(dossierTemplateId) )}`, { @@ -375,7 +359,7 @@ export class FileAttributesControllerService { return this.httpClient.request( 'post', - `${this.basePath}/fileAttributes/set/${encodeURIComponent( + `${this.basePath}/redaction-gateway-v1/fileAttributes/set/${encodeURIComponent( String(dossierId) )}/${encodeURIComponent(String(fileId))}`, { @@ -461,7 +445,9 @@ export class FileAttributesControllerService { return this.httpClient.request( 'put', - `${this.basePath}/fileAttributes/config/baseConfig/${encodeURIComponent( + `${ + this.basePath + }/redaction-gateway-v1/fileAttributes/config/baseConfig/${encodeURIComponent( String(dossierTemplateId) )}`, { @@ -547,7 +533,9 @@ export class FileAttributesControllerService { return this.httpClient.request( 'post', - `${this.basePath}/fileAttributes/config/fileAttribute/${encodeURIComponent( + `${ + this.basePath + }/redaction-gateway-v1/fileAttributes/config/fileAttribute/${encodeURIComponent( String(dossierTemplateId) )}`, { diff --git a/libs/red-ui-http/src/lib/api/fileManagementController.service.ts b/libs/red-ui-http/src/lib/api/fileManagementController.service.ts index 072bc50f2..ac89bbb26 100644 --- a/libs/red-ui-http/src/lib/api/fileManagementController.service.ts +++ b/libs/red-ui-http/src/lib/api/fileManagementController.service.ts @@ -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'; @@ -16,18 +16,14 @@ import { CustomHttpUrlEncodingCodec } from '../encoder'; import { Observable } from 'rxjs'; -import { DownloadSubmissionPackageRequest } from '../model/downloadSubmissionPackageRequest'; -import { FileIds } from '../model/fileIds'; -import { FileUploadResult } from '../model/fileUploadResult'; - import { BASE_PATH } from '../variables'; import { Configuration } from '../configuration'; @Injectable() export class FileManagementControllerService { + protected basePath = ''; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); - protected basePath = ''; constructor( protected httpClient: HttpClient, @@ -57,21 +53,18 @@ export class FileManagementControllerService { 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, @@ -109,14 +102,11 @@ export class FileManagementControllerService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = []; - return this.httpClient.request( 'delete', - `${this.basePath}/delete/${encodeURIComponent(String(dossierId))}/${encodeURIComponent( - String(fileId) - )}`, + `${this.basePath}/redaction-gateway-v1/delete/${encodeURIComponent( + String(dossierId) + )}/${encodeURIComponent(String(fileId))}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -140,21 +130,18 @@ export class FileManagementControllerService { 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, @@ -202,7 +189,7 @@ export class FileManagementControllerService { return this.httpClient.request( 'post', - `${this.basePath}/delete/${encodeURIComponent(String(dossierId))}`, + `${this.basePath}/redaction-gateway-v1/delete/${encodeURIComponent(String(dossierId))}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -226,34 +213,27 @@ export class FileManagementControllerService { dossierId: string, fileId: string, inline?: boolean, - indicator?: string, observe?: 'body', reportProgress?: boolean ): Observable; - public downloadAnnotatedFile( dossierId: string, fileId: string, inline?: boolean, - indicator?: string, observe?: 'response', reportProgress?: boolean ): Observable>; - public downloadAnnotatedFile( dossierId: string, fileId: string, inline?: boolean, - indicator?: string, observe?: 'events', reportProgress?: boolean ): Observable>; - public downloadAnnotatedFile( dossierId: string, fileId: string, inline?: boolean, - indicator?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { @@ -273,9 +253,6 @@ export class FileManagementControllerService { if (inline !== undefined && inline !== null) { queryParameters = queryParameters.set('inline', inline); } - if (indicator !== undefined && indicator !== null) { - queryParameters = queryParameters.set('indicator', indicator); - } let headers = this.defaultHeaders; @@ -296,118 +273,12 @@ export class FileManagementControllerService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = []; - - return this.httpClient.request( + return this.httpClient.request( 'get', - `${this.basePath}/download/annotated/${encodeURIComponent( + `${this.basePath}/redaction-gateway-v1/download/annotated/${encodeURIComponent( String(dossierId) )}/${encodeURIComponent(String(fileId))}`, { - responseType: 'blob', - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Returns a downloadable byte stream of the fatted redacted file with the specified fileId - * Use the optional \"inline\" request parameter to select, if this file 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 downloadFlatRedacted( - dossierId: string, - fileId: string, - inline?: boolean, - indicator?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public downloadFlatRedacted( - dossierId: string, - fileId: string, - inline?: boolean, - indicator?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public downloadFlatRedacted( - dossierId: string, - fileId: string, - inline?: boolean, - indicator?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public downloadFlatRedacted( - dossierId: string, - fileId: string, - inline?: boolean, - indicator?: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { - if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling downloadFlatRedacted.' - ); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling downloadFlatRedacted.' - ); - } - - 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); - } - - // to determine the Content-Type header - const consumes: string[] = []; - - return this.httpClient.request( - 'get', - `${this.basePath}/download/flatted/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, - { - responseType: 'blob', params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, @@ -430,34 +301,27 @@ export class FileManagementControllerService { 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 { @@ -477,9 +341,6 @@ export class FileManagementControllerService { if (inline !== undefined && inline !== null) { queryParameters = queryParameters.set('inline', inline); } - if (indicator !== undefined && indicator !== null) { - queryParameters = queryParameters.set('indicator', indicator); - } let headers = this.defaultHeaders; @@ -500,16 +361,12 @@ export class FileManagementControllerService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = []; - - return this.httpClient.request( + return this.httpClient.request( 'get', - `${this.basePath}/download/original/${encodeURIComponent( + `${this.basePath}/redaction-gateway-v1/download/original/${encodeURIComponent( String(dossierId) )}/${encodeURIComponent(String(fileId))}`, { - responseType: 'blob', params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, @@ -518,816 +375,4 @@ export class FileManagementControllerService { } ); } - - /** - * Returns a downloadable byte stream of the redaction preview 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 downloadPreviewFile( - dossierId: string, - fileId: string, - inline?: boolean, - indicator?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public downloadPreviewFile( - dossierId: string, - fileId: string, - inline?: boolean, - indicator?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public downloadPreviewFile( - dossierId: string, - fileId: string, - inline?: boolean, - indicator?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public downloadPreviewFile( - 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 downloadPreviewFile.' - ); - } - - if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling downloadPreviewFile.' - ); - } - - 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); - } - - // to determine the Content-Type header - const consumes: string[] = []; - - return this.httpClient.request( - 'get', - `${this.basePath}/download/preview/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, - { - responseType: 'blob', - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Returns a downloadable byte stream of the requested files in a zip format - * Use the optional \"inline\" request parameter to select, if this report will be opened in the browser. - * @param body fileIds - * @param dossierId The dossierId - * @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 downloadPreviewFiles( - body: FileIds, - dossierId: string, - inline?: boolean, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public downloadPreviewFiles( - body: FileIds, - dossierId: string, - inline?: boolean, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public downloadPreviewFiles( - body: FileIds, - dossierId: string, - inline?: boolean, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public downloadPreviewFiles( - body: FileIds, - dossierId: string, - inline?: 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 downloadPreviewFiles.' - ); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling downloadPreviewFiles.' - ); - } - - 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); - } - - // 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}/download/bulk/preview/${encodeURIComponent(String(dossierId))}`, - { - responseType: 'blob', - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Returns a downloadable byte stream of the redacted 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 downloadRedactedFile( - dossierId: string, - fileId: string, - inline?: boolean, - indicator?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public downloadRedactedFile( - dossierId: string, - fileId: string, - inline?: boolean, - indicator?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public downloadRedactedFile( - dossierId: string, - fileId: string, - inline?: boolean, - indicator?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public downloadRedactedFile( - 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 downloadRedactedFile.' - ); - } - - if (fileId === null || fileId === undefined) { - throw new Error( - 'Required parameter fileId was null or undefined when calling downloadRedactedFile.' - ); - } - - 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); - } - - // to determine the Content-Type header - const consumes: string[] = []; - - return this.httpClient.request( - 'get', - `${this.basePath}/download/redacted/${encodeURIComponent( - String(dossierId) - )}/${encodeURIComponent(String(fileId))}`, - { - responseType: 'blob', - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Returns a downloadable byte stream of the requested files in a zip format - * Use the optional \"inline\" request parameter to select, if this report will be opened in the browser. - * @param body fileIds - * @param dossierId The dossierId - * @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 downloadRedactedFiles( - body: FileIds, - dossierId: string, - inline?: boolean, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public downloadRedactedFiles( - body: FileIds, - dossierId: string, - inline?: boolean, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public downloadRedactedFiles( - body: FileIds, - dossierId: string, - inline?: boolean, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public downloadRedactedFiles( - body: FileIds, - dossierId: string, - inline?: 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 downloadRedactedFiles.' - ); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling downloadRedactedFiles.' - ); - } - - 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); - } - - // 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}/download/bulk/redacted/${encodeURIComponent(String(dossierId))}`, - { - responseType: 'blob', - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Returns a downloadable byte stream of the redaction report file for the specified fileIds - * Use the optional \"inline\" request parameter to select, if this report will be opened in the browser. - * @param body fileIds - * @param dossierId The dossierId - * @param inline inline - * @param template template - * @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 downloadRedactionReport( - body: FileIds, - dossierId: string, - inline?: boolean, - template?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public downloadRedactionReport( - body: FileIds, - dossierId: string, - inline?: boolean, - template?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public downloadRedactionReport( - body: FileIds, - dossierId: string, - inline?: boolean, - template?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public downloadRedactionReport( - body: FileIds, - dossierId: string, - inline?: boolean, - template?: 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 downloadRedactionReport.' - ); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling downloadRedactionReport.' - ); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (inline !== undefined && inline !== null) { - queryParameters = queryParameters.set('inline', inline); - } - if (template !== undefined && template !== null) { - queryParameters = queryParameters.set('template', template); - } - - 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}/download/report/${encodeURIComponent(String(dossierId))}`, - { - responseType: 'blob', - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Returns a downloadable byte stream of the redaction report file for the specified dossier - * Use the optional \"inline\" request parameter to select, if this report will be opened in the browser. - * @param dossierId The dossierId - * @param inline inline - * @param template template - * @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 downloadRedactionReportForDossier( - dossierId: string, - inline?: boolean, - template?: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public downloadRedactionReportForDossier( - dossierId: string, - inline?: boolean, - template?: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public downloadRedactionReportForDossier( - dossierId: string, - inline?: boolean, - template?: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public downloadRedactionReportForDossier( - dossierId: string, - inline?: boolean, - template?: 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 downloadRedactionReportForDossier.' - ); - } - - let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); - if (inline !== undefined && inline !== null) { - queryParameters = queryParameters.set('inline', inline); - } - if (template !== undefined && template !== null) { - queryParameters = queryParameters.set('template', template); - } - - 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[] = []; - - return this.httpClient.request( - 'get', - `${this.basePath}/download/report/${encodeURIComponent(String(dossierId))}`, - { - responseType: 'blob', - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Returns a zip archive containing all preview, redacted and report files - * Use the optional \"inline\" request parameter to select, if this report will be opened in the browser. - * @param body downloadSubmissionPackageRequest - * @param dossierId The dossierId - * @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 downloadSubmissionPackage( - body: DownloadSubmissionPackageRequest, - dossierId: string, - inline?: boolean, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public downloadSubmissionPackage( - body: DownloadSubmissionPackageRequest, - dossierId: string, - inline?: boolean, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public downloadSubmissionPackage( - body: DownloadSubmissionPackageRequest, - dossierId: string, - inline?: boolean, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public downloadSubmissionPackage( - body: DownloadSubmissionPackageRequest, - dossierId: string, - inline?: 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 downloadSubmissionPackage.' - ); - } - - if (dossierId === null || dossierId === undefined) { - throw new Error( - 'Required parameter dossierId was null or undefined when calling downloadSubmissionPackage.' - ); - } - - 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); - } - - // 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}/download/bulk/submission/${encodeURIComponent(String(dossierId))}`, - { - responseType: 'blob', - body: body, - params: queryParameters, - withCredentials: this.configuration.withCredentials, - headers: headers, - observe: observe, - reportProgress: reportProgress - } - ); - } - - /** - * Receives an uploaded file and returns its fileId. - * None - * @param file - * @param dossierId The dossierId, the file belongs to - * @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( - file: Blob, - dossierId: string, - observe?: 'body', - reportProgress?: boolean - ): Observable; - - public uploadFileForm( - file: Blob, - dossierId: string, - observe?: 'response', - reportProgress?: boolean - ): Observable>; - - public uploadFileForm( - file: Blob, - dossierId: string, - observe?: 'events', - reportProgress?: boolean - ): Observable>; - - public uploadFileForm( - file: Blob, - dossierId: string, - observe: any = 'body', - reportProgress: boolean = false - ): Observable { - if (file === null || file === undefined) { - throw new Error( - 'Required parameter file was null or undefined when calling uploadFile.' - ); - } - - 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/reportTemplateController.service.ts b/libs/red-ui-http/src/lib/api/reportTemplateController.service.ts new file mode 100644 index 000000000..c82a62c3c --- /dev/null +++ b/libs/red-ui-http/src/lib/api/reportTemplateController.service.ts @@ -0,0 +1,370 @@ +/** + * 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 { ReportTemplate } from '../model/reportTemplate'; + +import { BASE_PATH } from '../variables'; +import { Configuration } from '../configuration'; + +@Injectable() +export class ReportTemplateControllerService { + protected basePath = ''; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + + 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; + } + } + + /** + * @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; + } + + /** + * 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}/redaction-gateway-v1/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); + } + + // 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}/redaction-gateway-v1/templateUpload/${encodeURIComponent( + String(dossierTemplateId) + )}/${encodeURIComponent(String(templateId))}`, + { + 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}/redaction-gateway-v1/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 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, + file?: Blob, + observe?: 'body', + reportProgress?: boolean + ): Observable; + public uploadTemplateForm( + dossierTemplateId: string, + file?: Blob, + observe?: 'response', + reportProgress?: boolean + ): Observable>; + public uploadTemplateForm( + dossierTemplateId: string, + file?: Blob, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public uploadTemplateForm( + 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 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 (file !== undefined) { + formParams = (formParams.append('file', file) as any) || formParams; + } + + return this.httpClient.request( + 'post', + `${this.basePath}/redaction-gateway-v1/templateUpload/${encodeURIComponent( + String(dossierTemplateId) + )}`, + { + body: convertFormParamsToString ? formParams.toString() : formParams, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } +} diff --git a/libs/red-ui-http/src/lib/api/uploadController.service.ts b/libs/red-ui-http/src/lib/api/uploadController.service.ts new file mode 100644 index 000000000..66b6245ca --- /dev/null +++ b/libs/red-ui-http/src/lib/api/uploadController.service.ts @@ -0,0 +1,148 @@ +/** + * 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 { + protected basePath = ''; + public defaultHeaders = new HttpHeaders(); + public configuration = new Configuration(); + + 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; + } + } + + /** + * @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; + } + + /** + * 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}/redaction-gateway-v1/upload/${encodeURIComponent(String(dossierId))}`, + { + body: convertFormParamsToString ? formParams.toString() : formParams, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } +} diff --git a/libs/red-ui-http/src/lib/api/watermarkController.service.ts b/libs/red-ui-http/src/lib/api/watermarkController.service.ts index 952253a95..8617bc6a4 100644 --- a/libs/red-ui-http/src/lib/api/watermarkController.service.ts +++ b/libs/red-ui-http/src/lib/api/watermarkController.service.ts @@ -8,23 +8,24 @@ * 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, HttpResponse } from '@angular/common/http'; import { Observable } from 'rxjs'; -import { WatermarkModel } from '../model/watermarkModel'; +import { WatermarkModelReq } from '../model/watermarkModelReq'; +import { WatermarkModelRes } from '../model/watermarkModelRes'; import { BASE_PATH } from '../variables'; import { Configuration } from '../configuration'; @Injectable() export class WatermarkControllerService { + protected basePath = ''; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); - protected basePath = ''; constructor( protected httpClient: HttpClient, @@ -52,19 +53,16 @@ export class WatermarkControllerService { 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', @@ -95,12 +93,11 @@ export class WatermarkControllerService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = []; - return this.httpClient.request( 'delete', - `${this.basePath}/watermark/${encodeURIComponent(String(dossierTemplateId))}`, + `${this.basePath}/redaction-gateway-v1/watermark/${encodeURIComponent( + String(dossierTemplateId) + )}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -121,20 +118,17 @@ export class WatermarkControllerService { dossierTemplateId: string, observe?: 'body', reportProgress?: boolean - ): Observable; - + ): Observable; public getWatermark( dossierTemplateId: string, observe?: 'response', reportProgress?: boolean - ): Observable>; - + ): Observable>; public getWatermark( dossierTemplateId: string, observe?: 'events', reportProgress?: boolean - ): Observable>; - + ): Observable>; public getWatermark( dossierTemplateId: string, observe: any = 'body', @@ -165,12 +159,11 @@ export class WatermarkControllerService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = []; - - return this.httpClient.request( + return this.httpClient.request( 'get', - `${this.basePath}/watermark/${encodeURIComponent(String(dossierTemplateId))}`, + `${this.basePath}/redaction-gateway-v1/watermark/${encodeURIComponent( + String(dossierTemplateId) + )}`, { withCredentials: this.configuration.withCredentials, headers: headers, @@ -189,28 +182,25 @@ export class WatermarkControllerService { * @param reportProgress flag to report request and response progress. */ public saveWatermark( - body: WatermarkModel, + body: WatermarkModelReq, dossierTemplateId: string, observe?: 'body', reportProgress?: boolean - ): Observable; - + ): Observable; public saveWatermark( - body: WatermarkModel, + body: WatermarkModelReq, dossierTemplateId: string, observe?: 'response', reportProgress?: boolean - ): Observable>; - + ): Observable>; public saveWatermark( - body: WatermarkModel, + body: WatermarkModelReq, dossierTemplateId: string, observe?: 'events', reportProgress?: boolean - ): Observable>; - + ): Observable>; public saveWatermark( - body: WatermarkModel, + body: WatermarkModelReq, dossierTemplateId: string, observe: any = 'body', reportProgress: boolean = false @@ -254,9 +244,11 @@ export class WatermarkControllerService { headers = headers.set('Content-Type', httpContentTypeSelected); } - return this.httpClient.request( + return this.httpClient.request( 'post', - `${this.basePath}/watermark/${encodeURIComponent(String(dossierTemplateId))}`, + `${this.basePath}/redaction-gateway-v1/watermark/${encodeURIComponent( + String(dossierTemplateId) + )}`, { body: body, withCredentials: this.configuration.withCredentials, @@ -266,18 +258,4 @@ export class WatermarkControllerService { } ); } - - /** - * @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/model/addRedactionRequest.ts b/libs/red-ui-http/src/lib/model/addRedactionRequest.ts index 9111fb449..987904158 100644 --- a/libs/red-ui-http/src/lib/model/addRedactionRequest.ts +++ b/libs/red-ui-http/src/lib/model/addRedactionRequest.ts @@ -13,11 +13,12 @@ import { AddCommentRequest } from './addCommentRequest'; import { Rectangle } from './rectangle'; export interface AddRedactionRequest { + addToDictionary?: boolean; + addToDossierDictionary?: boolean; + comment?: AddCommentRequest; + legalBasis?: string; + positions?: Array; + reason?: string; type?: string; value?: string; - reason?: string; - legalBasis?: string; - addToDictionary?: boolean; - positions?: Array; - comment?: AddCommentRequest; } diff --git a/libs/red-ui-http/src/lib/model/colors.ts b/libs/red-ui-http/src/lib/model/colors.ts index 843ed8b33..f8444246c 100644 --- a/libs/red-ui-http/src/lib/model/colors.ts +++ b/libs/red-ui-http/src/lib/model/colors.ts @@ -11,13 +11,13 @@ */ export interface Colors { - defaultColor?: string; - notRedacted?: string; - requestAdd?: string; - requestRemove?: string; analysisColor?: string; + defaultColor?: string; dictionaryRequestColor?: string; manualRedactionColor?: string; + notRedacted?: string; previewColor?: string; + requestAdd?: string; + requestRemove?: string; updatedColor?: string; } diff --git a/libs/red-ui-http/src/lib/model/dictionary.ts b/libs/red-ui-http/src/lib/model/dictionary.ts index ac1eec22f..da92bed2f 100644 --- a/libs/red-ui-http/src/lib/model/dictionary.ts +++ b/libs/red-ui-http/src/lib/model/dictionary.ts @@ -14,10 +14,22 @@ * Object containing a list of dictionary entries and colors of an entry type. */ export interface Dictionary { + /** + * If true the ui will add a action to add values to dictionary + */ + addToDictionaryAction?: boolean; /** * True if the entries in this type should be matched case insensitively, default is false. */ caseInsensitive?: boolean; + /** + * The description of the dictionary type + */ + description?: string; + /** + * The DossierTemplate Id for this type + */ + dossierTemplateId?: string; /** * The list of dictionary entries of an entry type. */ @@ -38,12 +50,4 @@ export interface Dictionary { * True if the type just for recommendations, not for redaction, default is false. */ recommendation?: boolean; - /** - * The DossierTemplate Id for this type - */ - dossierTemplateId?: string; - /** - * The description of this dictionary - */ - description?: string; } diff --git a/libs/red-ui-http/src/lib/model/digitalSignature.ts b/libs/red-ui-http/src/lib/model/digitalSignature.ts index 657d5802f..31321fc50 100644 --- a/libs/red-ui-http/src/lib/model/digitalSignature.ts +++ b/libs/red-ui-http/src/lib/model/digitalSignature.ts @@ -11,10 +11,10 @@ */ export interface DigitalSignature { - certificateName?: string; - location?: string; - reason?: string; - contactInfo?: string; - password?: string; base64EncodedPrivateKey?: string; + certificateName?: string; + contactInfo?: string; + location?: string; + password?: string; + reason?: string; } diff --git a/libs/red-ui-http/src/lib/model/digitalSignatureViewModel.ts b/libs/red-ui-http/src/lib/model/digitalSignatureViewModelReq.ts similarity index 88% rename from libs/red-ui-http/src/lib/model/digitalSignatureViewModel.ts rename to libs/red-ui-http/src/lib/model/digitalSignatureViewModelReq.ts index f5e3110fb..fbbe24d69 100644 --- a/libs/red-ui-http/src/lib/model/digitalSignatureViewModel.ts +++ b/libs/red-ui-http/src/lib/model/digitalSignatureViewModelReq.ts @@ -10,7 +10,7 @@ * Do not edit the class manually. */ -export interface DigitalSignatureViewModel { +export interface DigitalSignatureViewModelReq { certificateName?: string; contactInfo?: string; location?: string; diff --git a/libs/red-ui-http/src/lib/model/fileIds.ts b/libs/red-ui-http/src/lib/model/digitalSignatureViewModelRes.ts similarity index 65% rename from libs/red-ui-http/src/lib/model/fileIds.ts rename to libs/red-ui-http/src/lib/model/digitalSignatureViewModelRes.ts index 0e90f76d2..1a7d4ec3b 100644 --- a/libs/red-ui-http/src/lib/model/fileIds.ts +++ b/libs/red-ui-http/src/lib/model/digitalSignatureViewModelRes.ts @@ -10,6 +10,9 @@ * Do not edit the class manually. */ -export interface FileIds { - fileIds?: Array; +export interface DigitalSignatureViewModelRes { + certificateName?: string; + contactInfo?: string; + location?: string; + reason?: string; } diff --git a/libs/red-ui-http/src/lib/model/dossier.ts b/libs/red-ui-http/src/lib/model/dossier.ts index f950fa242..87570231c 100644 --- a/libs/red-ui-http/src/lib/model/dossier.ts +++ b/libs/red-ui-http/src/lib/model/dossier.ts @@ -26,7 +26,6 @@ export interface Dossier { status?: Dossier.StatusEnum; watermarkEnabled?: boolean; } - export namespace Dossier { export type DownloadFileTypesEnum = | 'ANNOTATED' diff --git a/libs/red-ui-http/src/lib/model/dossierAttributeConfig.ts b/libs/red-ui-http/src/lib/model/dossierAttributeConfig.ts new file mode 100644 index 000000000..b3f972abf --- /dev/null +++ b/libs/red-ui-http/src/lib/model/dossierAttributeConfig.ts @@ -0,0 +1,28 @@ +/** + * 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 DossierAttributeConfig { + editable?: boolean; + id?: string; + label?: string; + placeholder?: string; + type?: DossierAttributeConfig.TypeEnum; +} +export namespace DossierAttributeConfig { + export type TypeEnum = 'DATE' | 'IMAGE' | 'NUMBER' | 'TEXT'; + export const TypeEnum = { + DATE: 'DATE' as TypeEnum, + IMAGE: 'IMAGE' as TypeEnum, + NUMBER: 'NUMBER' as TypeEnum, + TEXT: 'TEXT' as TypeEnum + }; +} diff --git a/libs/red-ui-http/src/lib/model/downloadSubmissionPackageRequest.ts b/libs/red-ui-http/src/lib/model/dossierAttributesConfig.ts similarity index 62% rename from libs/red-ui-http/src/lib/model/downloadSubmissionPackageRequest.ts rename to libs/red-ui-http/src/lib/model/dossierAttributesConfig.ts index 75a39fbe5..bdaf8a0af 100644 --- a/libs/red-ui-http/src/lib/model/downloadSubmissionPackageRequest.ts +++ b/libs/red-ui-http/src/lib/model/dossierAttributesConfig.ts @@ -9,8 +9,8 @@ * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ +import { DossierAttributeConfig } from './dossierAttributeConfig'; -export interface DownloadSubmissionPackageRequest { - fileIds?: Array; - reportsAsSingleFiles?: boolean; +export interface DossierAttributesConfig { + dossierAttributeConfigs?: Array; } diff --git a/libs/red-ui-http/src/lib/model/dossierTemplateModel.ts b/libs/red-ui-http/src/lib/model/dossierTemplateModel.ts index 8791591fa..b9aab2be8 100644 --- a/libs/red-ui-http/src/lib/model/dossierTemplateModel.ts +++ b/libs/red-ui-http/src/lib/model/dossierTemplateModel.ts @@ -27,6 +27,10 @@ export interface DossierTemplateModel { * The description of this dossierTemplate */ description?: string; + /** + * The Rule Set Id. Generated by the system on create. + */ + dossierTemplateId?: string; /** * Download File Types for this dossierTemplate's dossiers submission package. */ @@ -43,10 +47,6 @@ export interface DossierTemplateModel { * Report File Types for this dossierTemplate's dossiers submission package. */ reportTypes?: Array; - /** - * The Rule Set Id. Generated by the system on create. - */ - dossierTemplateId?: string; /** * Validity of start this dossierTemplate. */ @@ -55,35 +55,33 @@ export interface DossierTemplateModel { * Validity of end this dossierTemplate. */ validTo?: string; - - dictionariesCount?: number; - totalDictionaryEntries?: number; } export namespace DossierTemplateModel { export type DownloadFileTypesEnum = + | 'ANNOTATED' + | 'FLATTEN' | 'ORIGINAL' | 'PREVIEW' - | 'REDACTED' - | 'ANNOTATED' - | 'FLATTEN'; + | 'REDACTED'; export const DownloadFileTypesEnum = { + ANNOTATED: 'ANNOTATED' as DownloadFileTypesEnum, + FLATTEN: 'FLATTEN' as DownloadFileTypesEnum, ORIGINAL: 'ORIGINAL' as DownloadFileTypesEnum, PREVIEW: 'PREVIEW' as DownloadFileTypesEnum, - REDACTED: 'REDACTED' as DownloadFileTypesEnum, - ANNOTATED: 'ANNOTATED' as DownloadFileTypesEnum, - FLATTEN: 'FLATTEN' as DownloadFileTypesEnum + REDACTED: 'REDACTED' as DownloadFileTypesEnum }; export type ReportTypesEnum = - | 'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE' - | 'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE' | 'EXCEL_MULTI_FILE' - | 'EXCEL_SINGLE_FILE'; + | 'EXCEL_SINGLE_FILE' + | 'WORD_SINGLE_FILE' + | 'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE' + | 'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE'; export const ReportTypesEnum = { + EXCELMULTIFILE: 'EXCEL_MULTI_FILE' as ReportTypesEnum, + EXCELSINGLEFILE: 'EXCEL_SINGLE_FILE' as ReportTypesEnum, + WORDSINGLEFILE: 'WORD_SINGLE_FILE' as ReportTypesEnum, WORDSINGLEFILEAPPENDIXA1TEMPLATE: 'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE' as ReportTypesEnum, - WORDSINGLEFILEAPPENDIXA2TEMPLATE: - 'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE' as ReportTypesEnum, - EXCELMULTIFILE: 'EXCEL_MULTI_FILE' as ReportTypesEnum, - EXCELSINGLEFILE: 'EXCEL_SINGLE_FILE' as ReportTypesEnum + WORDSINGLEFILEAPPENDIXA2TEMPLATE: 'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE' as ReportTypesEnum }; } diff --git a/libs/red-ui-http/src/lib/model/downloadDetails.ts b/libs/red-ui-http/src/lib/model/downloadDetails.ts index b51a21756..6a21fd2a1 100644 --- a/libs/red-ui-http/src/lib/model/downloadDetails.ts +++ b/libs/red-ui-http/src/lib/model/downloadDetails.ts @@ -13,22 +13,35 @@ export interface DownloadDetails { downloadFileTypes?: Array; fileIds?: Array; + reportTemplateIds?: Array; reportTypes?: Array; } export namespace DownloadDetails { - export type DownloadFileTypesEnum = 'ORIGINAL' | 'PREVIEW' | 'REDACTED' | 'ANNOTATED' | 'FLATTEN'; + 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, - ANNOTATED: 'ANNOTATED' as DownloadFileTypesEnum, - FLATTEN: 'FLATTEN' as DownloadFileTypesEnum + REDACTED: 'REDACTED' as DownloadFileTypesEnum }; - export type ReportTypesEnum = 'SINGLE_FILE_EFSA_TEMPLATE' | 'SINGLE_FILE_SYNGENTA_TEMPLATE' | 'MULTI_FILE_EFSA_TEMPLATE' | 'MULTI_FILE_SYNGENTA_TEMPLATE'; + export type ReportTypesEnum = + | 'EXCEL_MULTI_FILE' + | 'EXCEL_SINGLE_FILE' + | 'WORD_SINGLE_FILE' + | 'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE' + | 'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE'; export const ReportTypesEnum = { - SINGLEFILEEFSATEMPLATE: 'SINGLE_FILE_EFSA_TEMPLATE' as ReportTypesEnum, - SINGLEFILESYNGENTATEMPLATE: 'SINGLE_FILE_SYNGENTA_TEMPLATE' as ReportTypesEnum, - MULTIFILEEFSATEMPLATE: 'MULTI_FILE_EFSA_TEMPLATE' as ReportTypesEnum, - MULTIFILESYNGENTATEMPLATE: 'MULTI_FILE_SYNGENTA_TEMPLATE' as ReportTypesEnum + EXCELMULTIFILE: 'EXCEL_MULTI_FILE' as ReportTypesEnum, + EXCELSINGLEFILE: 'EXCEL_SINGLE_FILE' as ReportTypesEnum, + WORDSINGLEFILE: 'WORD_SINGLE_FILE' as ReportTypesEnum, + WORDSINGLEFILEAPPENDIXA1TEMPLATE: + 'WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE' as ReportTypesEnum, + WORDSINGLEFILEAPPENDIXA2TEMPLATE: 'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE' as ReportTypesEnum }; } diff --git a/libs/red-ui-http/src/lib/model/downloadStatus.ts b/libs/red-ui-http/src/lib/model/downloadStatus.ts index 2d66d6c9d..842f46d48 100644 --- a/libs/red-ui-http/src/lib/model/downloadStatus.ts +++ b/libs/red-ui-http/src/lib/model/downloadStatus.ts @@ -13,22 +13,22 @@ import { DownloadDetails } from './downloadDetails'; export interface DownloadStatus { creationDate?: string; + dossierId?: string; downloadDetails?: DownloadDetails; + fileSize?: number; filename?: string; lastDownload?: string; mimeType?: string; - dossierId?: string; - fileSize?: number; status?: DownloadStatus.StatusEnum; storageId?: string; userId?: string; } export namespace DownloadStatus { - export type StatusEnum = 'QUEUED' | 'GENERATING' | 'READY' | 'FAILED'; + export type StatusEnum = 'FAILED' | 'GENERATING' | 'QUEUED' | 'READY'; export const StatusEnum = { - QUEUED: 'QUEUED' as StatusEnum, + FAILED: 'FAILED' as StatusEnum, GENERATING: 'GENERATING' as StatusEnum, - READY: 'READY' as StatusEnum, - FAILED: 'FAILED' as StatusEnum + QUEUED: 'QUEUED' as StatusEnum, + READY: 'READY' as StatusEnum }; } diff --git a/libs/red-ui-http/src/lib/model/fileAttribute.ts b/libs/red-ui-http/src/lib/model/fileAttribute.ts deleted file mode 100644 index c182c7015..000000000 --- a/libs/red-ui-http/src/lib/model/fileAttribute.ts +++ /dev/null @@ -1,18 +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 FileAttribute { - editable?: boolean; - id?: string; - name?: string; - visible?: boolean; -} diff --git a/libs/red-ui-http/src/lib/model/fileAttributeConfig.ts b/libs/red-ui-http/src/lib/model/fileAttributeConfig.ts index 76131bc73..0d616d95a 100644 --- a/libs/red-ui-http/src/lib/model/fileAttributeConfig.ts +++ b/libs/red-ui-http/src/lib/model/fileAttributeConfig.ts @@ -15,15 +15,15 @@ export interface FileAttributeConfig { editable?: boolean; id?: string; label?: string; + placeholder?: string; primaryAttribute?: boolean; type?: FileAttributeConfig.TypeEnum; } - export namespace FileAttributeConfig { - export type TypeEnum = 'TEXT' | 'NUMBER' | 'DATE'; + export type TypeEnum = 'DATE' | 'NUMBER' | 'TEXT'; export const TypeEnum = { - TEXT: 'TEXT' as TypeEnum, + DATE: 'DATE' as TypeEnum, NUMBER: 'NUMBER' as TypeEnum, - DATE: 'DATE' as TypeEnum + TEXT: 'TEXT' as TypeEnum }; } diff --git a/libs/red-ui-http/src/lib/model/fileStatus.ts b/libs/red-ui-http/src/lib/model/fileStatus.ts index dc5c9793d..b37b93eda 100644 --- a/libs/red-ui-http/src/lib/model/fileStatus.ts +++ b/libs/red-ui-http/src/lib/model/fileStatus.ts @@ -47,6 +47,14 @@ export interface FileStatus { * Shows which dossier dictionary versions was used during the analysis. */ dossierDictionaryVersion?: number; + /** + * The ID of the dossier the file belongs to. + */ + dossierId?: string; + /** + * The dossierTemplateId for this file. + */ + dossierTemplateId?: string; /** * Shows if the file was excluded from analysis. */ @@ -116,14 +124,6 @@ export interface FileStatus { * The number of pages of the file. */ numberOfPages?: number; - /** - * The ID of the dossier the file belongs to. - */ - dossierId?: string; - /** - * The dossierTemplateId for this file. - */ - dossierTemplateId?: string; /** * Shows which rules versions was used during the analysis. */ @@ -137,11 +137,11 @@ export interface FileStatus { */ uploader?: string; } - export namespace FileStatus { export type StatusEnum = | 'APPROVED' | 'ERROR' + | 'EXCLUDED' | 'FULLREPROCESS' | 'OCR_PROCESSING' | 'PROCESSING' @@ -153,8 +153,9 @@ export namespace FileStatus { export const StatusEnum = { APPROVED: 'APPROVED' as StatusEnum, ERROR: 'ERROR' as StatusEnum, + EXCLUDED: 'EXCLUDED' as StatusEnum, FULLREPROCESS: 'FULLREPROCESS' as StatusEnum, - OCR_PROCESSING: 'OCR_PROCESSING' as StatusEnum, + OCRPROCESSING: 'OCR_PROCESSING' as StatusEnum, PROCESSING: 'PROCESSING' as StatusEnum, REPROCESS: 'REPROCESS' as StatusEnum, UNASSIGNED: 'UNASSIGNED' as StatusEnum, diff --git a/libs/red-ui-http/src/lib/model/fileUploadResult.ts b/libs/red-ui-http/src/lib/model/fileUploadResult.ts index 27bc208bb..770633614 100644 --- a/libs/red-ui-http/src/lib/model/fileUploadResult.ts +++ b/libs/red-ui-http/src/lib/model/fileUploadResult.ts @@ -15,7 +15,15 @@ */ export interface FileUploadResult { /** - * The non-null file ID. + * List of fileIds generated for uploaded file(s). */ - fileId?: string; + fileIds?: Array; + /** + * List processed file attributes, in case the upload contained a CSV. + */ + processedAttributes?: Array; + /** + * List processed fileIds, in case the upload contained a CSV. + */ + processedFileIds?: Array; } diff --git a/libs/red-ui-http/src/lib/model/idRemoval.ts b/libs/red-ui-http/src/lib/model/idRemoval.ts index a2835cc8e..217bc30c4 100644 --- a/libs/red-ui-http/src/lib/model/idRemoval.ts +++ b/libs/red-ui-http/src/lib/model/idRemoval.ts @@ -18,12 +18,11 @@ export interface IdRemoval { status?: IdRemoval.StatusEnum; user?: string; } - export namespace IdRemoval { - export type StatusEnum = 'REQUESTED' | 'APPROVED' | 'DECLINED'; + export type StatusEnum = 'APPROVED' | 'DECLINED' | 'REQUESTED'; export const StatusEnum = { - REQUESTED: 'REQUESTED' as StatusEnum, APPROVED: 'APPROVED' as StatusEnum, - DECLINED: 'DECLINED' as StatusEnum + DECLINED: 'DECLINED' as StatusEnum, + REQUESTED: 'REQUESTED' as StatusEnum }; } diff --git a/libs/red-ui-http/src/lib/model/importCsvRequest.ts b/libs/red-ui-http/src/lib/model/importCsvRequest.ts deleted file mode 100644 index 2e0da5c62..000000000 --- a/libs/red-ui-http/src/lib/model/importCsvRequest.ts +++ /dev/null @@ -1,18 +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 ImportCsvRequest { - delimiter?: string; - fileStatusFilenameColumn?: number; - attributeIdToColumnMapping?: { [key: string]: number }; - csvFile?: string; -} diff --git a/libs/red-ui-http/src/lib/model/importCsvResponse.ts b/libs/red-ui-http/src/lib/model/importCsvResponse.ts deleted file mode 100644 index 7d671b42a..000000000 --- a/libs/red-ui-http/src/lib/model/importCsvResponse.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 ImportCsvResponse { - affectedFileIds?: Array; -} diff --git a/libs/red-ui-http/src/lib/model/licenseReportRequest.ts b/libs/red-ui-http/src/lib/model/licenseReportRequest.ts index 859666400..24f552f0c 100644 --- a/libs/red-ui-http/src/lib/model/licenseReportRequest.ts +++ b/libs/red-ui-http/src/lib/model/licenseReportRequest.ts @@ -11,8 +11,8 @@ */ export interface LicenseReportRequest { + dossierIds?: Array; + endDate?: Date; requestId?: string; startDate?: Date; - endDate?: Date; - dossierIds?: Array; } diff --git a/libs/red-ui-http/src/lib/model/manualForceRedaction.ts b/libs/red-ui-http/src/lib/model/manualForceRedaction.ts index 3fc515724..e5fc6cd03 100644 --- a/libs/red-ui-http/src/lib/model/manualForceRedaction.ts +++ b/libs/red-ui-http/src/lib/model/manualForceRedaction.ts @@ -19,10 +19,10 @@ export interface ManualForceRedaction { user?: string; } export namespace ManualForceRedaction { - export type StatusEnum = 'REQUESTED' | 'APPROVED' | 'DECLINED'; + export type StatusEnum = 'APPROVED' | 'DECLINED' | 'REQUESTED'; export const StatusEnum = { - REQUESTED: 'REQUESTED' as StatusEnum, APPROVED: 'APPROVED' as StatusEnum, - DECLINED: 'DECLINED' as StatusEnum + DECLINED: 'DECLINED' as StatusEnum, + REQUESTED: 'REQUESTED' as StatusEnum }; } diff --git a/libs/red-ui-http/src/lib/model/manualRedactionEntry.ts b/libs/red-ui-http/src/lib/model/manualRedactionEntry.ts index eba2e8a4e..de295adb1 100644 --- a/libs/red-ui-http/src/lib/model/manualRedactionEntry.ts +++ b/libs/red-ui-http/src/lib/model/manualRedactionEntry.ts @@ -13,6 +13,7 @@ import { Rectangle } from './rectangle'; export interface ManualRedactionEntry { addToDictionary?: boolean; + addToDossierDictionary?: boolean; id?: string; legalBasis?: string; positions?: Array; @@ -24,12 +25,11 @@ export interface ManualRedactionEntry { user?: string; value?: string; } - export namespace ManualRedactionEntry { - export type StatusEnum = 'REQUESTED' | 'APPROVED' | 'DECLINED'; + export type StatusEnum = 'APPROVED' | 'DECLINED' | 'REQUESTED'; export const StatusEnum = { - REQUESTED: 'REQUESTED' as StatusEnum, APPROVED: 'APPROVED' as StatusEnum, - DECLINED: 'DECLINED' 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 index 9756af330..b2ff2e307 100644 --- a/libs/red-ui-http/src/lib/model/manualRedactions.ts +++ b/libs/red-ui-http/src/lib/model/manualRedactions.ts @@ -11,8 +11,8 @@ */ import { Comment } from './comment'; import { IdRemoval } from './idRemoval'; -import { ManualRedactionEntry } from './manualRedactionEntry'; import { ManualForceRedaction } from './manualForceRedaction'; +import { ManualRedactionEntry } from './manualRedactionEntry'; export interface ManualRedactions { comments?: { [key: string]: Array }; diff --git a/libs/red-ui-http/src/lib/model/modelFile.ts b/libs/red-ui-http/src/lib/model/modelFile.ts deleted file mode 100644 index 74d52133a..000000000 --- a/libs/red-ui-http/src/lib/model/modelFile.ts +++ /dev/null @@ -1,33 +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 ModelFile { - absolute?: boolean; - absoluteFile?: any; - absolutePath?: string; - canonicalFile?: any; - canonicalPath?: string; - directory?: boolean; - executable?: boolean; - file?: boolean; - freeSpace?: number; - hidden?: boolean; - lastModified?: number; - name?: string; - parent?: string; - parentFile?: any; - path?: string; - readable?: boolean; - totalSpace?: number; - usableSpace?: number; - writable?: boolean; -} diff --git a/libs/red-ui-http/src/lib/model/models.ts b/libs/red-ui-http/src/lib/model/models.ts index 6623d00d5..985f45b2d 100644 --- a/libs/red-ui-http/src/lib/model/models.ts +++ b/libs/red-ui-http/src/lib/model/models.ts @@ -1,72 +1,66 @@ export * from './addCommentRequest'; export * from './addRedactionRequest'; export * from './approveRequest'; +export * from './auditModel'; +export * from './auditResponse'; +export * from './auditSearchRequest'; export * from './authInfo'; -export * from './downloadSubmissionPackageRequest'; +export * from './categoryModel'; export * from './cellRectangle'; export * from './colors'; export * from './comment'; export * from './commentResponse'; +export * from './createUserRequest'; export * from './dictionary'; -export * from './fileIds'; +export * from './digitalSignature'; +export * from './digitalSignatureViewModelReq'; +export * from './digitalSignatureViewModelRes'; +export * from './dossier'; +export * from './dossierAttributeConfig'; +export * from './dossierAttributesConfig'; +export * from './dossierRequest'; +export * from './dossierTemplateModel'; +export * from './downloadDetails'; +export * from './downloadResponse'; +export * from './downloadStatus'; +export * from './downloadStatusResponse'; +export * from './fileAttributeConfig'; +export * from './fileAttributes'; +export * from './fileAttributesConfig'; export * from './fileStatus'; export * from './fileUploadResult'; +export * from './forceRedactionRequest'; export * from './idRemoval'; export * from './legalBasisMapping'; export * from './licenseReport'; export * from './licenseReportRequest'; export * from './manualAddResponse'; +export * from './manualForceRedaction'; export * from './manualRedactionEntry'; export * from './manualRedactions'; -export * from './modelFile'; export * from './point'; -export * from './dossier'; -export * from './dossierRequest'; +export * from './prepareDownloadRequest'; export * from './rectangle'; +export * from './redactionChangeLog'; +export * from './redactionChangeLogEntry'; export * from './redactionLog'; export * from './redactionLogEntry'; +export * from './removeDownloadRequest'; export * from './removeRedactionRequest'; export * from './reportData'; -export * from './rolesRequest'; -export * from './dossierTemplateModel'; +export * from './reportTemplate'; export * from './rules'; +export * from './sMTPConfigurationModel'; export * from './sectionGrid'; export * from './sectionRectangle'; export * from './typeResponse'; export * from './typeValue'; +export * from './updateMyProfileRequest'; +export * from './updateProfileRequest'; export * from './updateTypeValue'; export * from './user'; -export * from './userRequest'; -export * from './userResponse'; export * from './versionsResponse'; export * from './viewedPages'; export * from './viewedPagesRequest'; -export * from './watermarkModel'; -export * from './downloadDetails'; -export * from './downloadRequest'; -export * from './downloadResponse'; -export * from './downloadStatus'; -export * from './downloadStatusResponse'; -export * from './prepareDownloadRequest'; -export * from './digitalSignature'; -export * from './digitalSignatureViewModel'; -export * from './redactionChangeLog'; -export * from './redactionChangeLogEntry'; -export * from './forceRedactionRequest'; -export * from './manualForceRedaction'; -export * from './auditModel'; -export * from './auditResponse'; -export * from './auditSearchRequest'; -export * from './categoryModel'; -export * from './fileAttribute'; -export * from './fileAttributes'; -export * from './fileAttributesConfig'; -export * from './importCsvRequest'; -export * from './importCsvResponse'; -export * from './fileAttributeConfig'; -export * from './removeDownloadRequest'; -export * from './sMTPConfigurationModel'; -export * from './userSearchRequest'; -export * from './userSearchResponse'; -export * from './updateProfileRequest'; -export * from './updateMyProfileRequest'; +export * from './watermarkModelReq'; +export * from './watermarkModelRes'; diff --git a/libs/red-ui-http/src/lib/model/prepareDownloadRequest.ts b/libs/red-ui-http/src/lib/model/prepareDownloadRequest.ts index 95869fb1b..f5e9b4f20 100644 --- a/libs/red-ui-http/src/lib/model/prepareDownloadRequest.ts +++ b/libs/red-ui-http/src/lib/model/prepareDownloadRequest.ts @@ -14,14 +14,6 @@ * Object containing information on which file and report types should be included in the download. */ export interface PrepareDownloadRequest { - /** - * Which files should be included. Possible values are ORIGINAL, PREVIEW, REDACTED, ANNOTATED, FLATTEN - */ - downloadFileTypes?: Array; dossierId?: string; - /** - * Which reports should be included. Possible values are SINGLE_FILE_EFSA_TEMPLATE, SINGLE_FILE_SYNGENTA_TEMPLATE, MULTI_FILE_EFSA_TEMPLATE, MULTI_FILE_SYNGENTA_TEMPLATE - */ - reportTypes?: Array; fileIds?: Array; } diff --git a/libs/red-ui-http/src/lib/model/redactionChangeLogEntry.ts b/libs/red-ui-http/src/lib/model/redactionChangeLogEntry.ts index a5bed54db..e060960fb 100644 --- a/libs/red-ui-http/src/lib/model/redactionChangeLogEntry.ts +++ b/libs/red-ui-http/src/lib/model/redactionChangeLogEntry.ts @@ -17,6 +17,7 @@ export interface RedactionChangeLogEntry { color?: Array; comments?: Array; dictionaryEntry?: boolean; + dossierDictionaryEntry?: boolean; hint?: boolean; id?: string; legalBasis?: string; @@ -41,15 +42,16 @@ export namespace RedactionChangeLogEntry { ADDED: 'ADDED' as ChangeTypeEnum, REMOVED: 'REMOVED' as ChangeTypeEnum }; - export type ManualRedactionTypeEnum = 'ADD' | 'REMOVE'; + export type ManualRedactionTypeEnum = 'ADD' | 'FORCE_REDACT' | 'REMOVE'; export const ManualRedactionTypeEnum = { ADD: 'ADD' as ManualRedactionTypeEnum, + FORCEREDACT: 'FORCE_REDACT' as ManualRedactionTypeEnum, REMOVE: 'REMOVE' as ManualRedactionTypeEnum }; - export type StatusEnum = 'REQUESTED' | 'APPROVED' | 'DECLINED'; + export type StatusEnum = 'APPROVED' | 'DECLINED' | 'REQUESTED'; export const StatusEnum = { - REQUESTED: 'REQUESTED' as StatusEnum, APPROVED: 'APPROVED' as StatusEnum, - DECLINED: 'DECLINED' as StatusEnum + DECLINED: 'DECLINED' as StatusEnum, + REQUESTED: 'REQUESTED' as StatusEnum }; } diff --git a/libs/red-ui-http/src/lib/model/redactionLogEntry.ts b/libs/red-ui-http/src/lib/model/redactionLogEntry.ts index 04d30a68f..d69bf9077 100644 --- a/libs/red-ui-http/src/lib/model/redactionLogEntry.ts +++ b/libs/red-ui-http/src/lib/model/redactionLogEntry.ts @@ -16,8 +16,11 @@ export interface RedactionLogEntry { color?: Array; comments?: Array; dictionaryEntry?: boolean; + dossierDictionaryEntry?: boolean; + endOffset?: number; hint?: boolean; id?: string; + image?: boolean; legalBasis?: string; manual?: boolean; manualRedactionType?: RedactionLogEntry.ManualRedactionTypeEnum; @@ -28,23 +31,24 @@ export interface RedactionLogEntry { redacted?: boolean; section?: string; sectionNumber?: number; + startOffset?: number; status?: RedactionLogEntry.StatusEnum; textAfter?: string; textBefore?: string; type?: string; value?: string; - image?: boolean; } export namespace RedactionLogEntry { - export type ManualRedactionTypeEnum = 'ADD' | 'REMOVE'; + export type ManualRedactionTypeEnum = 'ADD' | 'FORCE_REDACT' | 'REMOVE'; export const ManualRedactionTypeEnum = { ADD: 'ADD' as ManualRedactionTypeEnum, + FORCEREDACT: 'FORCE_REDACT' as ManualRedactionTypeEnum, REMOVE: 'REMOVE' as ManualRedactionTypeEnum }; - export type StatusEnum = 'REQUESTED' | 'APPROVED' | 'DECLINED'; + export type StatusEnum = 'APPROVED' | 'DECLINED' | 'REQUESTED'; export const StatusEnum = { - REQUESTED: 'REQUESTED' as StatusEnum, APPROVED: 'APPROVED' as StatusEnum, - DECLINED: 'DECLINED' as StatusEnum + DECLINED: 'DECLINED' as StatusEnum, + REQUESTED: 'REQUESTED' as StatusEnum }; } diff --git a/libs/red-ui-http/src/lib/model/removeRedactionRequest.ts b/libs/red-ui-http/src/lib/model/removeRedactionRequest.ts index 9663131ff..25ee3986a 100644 --- a/libs/red-ui-http/src/lib/model/removeRedactionRequest.ts +++ b/libs/red-ui-http/src/lib/model/removeRedactionRequest.ts @@ -12,6 +12,6 @@ export interface RemoveRedactionRequest { annotationId?: string; - removeFromDictionary?: boolean; comment?: string; + removeFromDictionary?: boolean; } diff --git a/libs/red-ui-http/src/lib/model/reportData.ts b/libs/red-ui-http/src/lib/model/reportData.ts index 472b9c63d..17174114e 100644 --- a/libs/red-ui-http/src/lib/model/reportData.ts +++ b/libs/red-ui-http/src/lib/model/reportData.ts @@ -14,33 +14,38 @@ export interface ReportData { addedDate?: Date; analysisCount?: number; deletedDate?: Date; + dossier?: string; fileName?: string; lastUpdatedDate?: Date; numberOfAnalyzedPages?: number; - dossier?: string; status?: ReportData.StatusEnum; } - export namespace ReportData { export type StatusEnum = - | 'UNPROCESSED' - | 'REPROCESS' - | 'PROCESSING' - | 'ERROR' + | 'APPROVED' | 'DELETED' + | 'ERROR' + | 'EXCLUDED' + | 'FULLREPROCESS' + | 'OCR_PROCESSING' + | 'PROCESSING' + | 'REPROCESS' | 'UNASSIGNED' - | 'UNDER_REVIEW' | 'UNDER_APPROVAL' - | 'APPROVED'; + | 'UNDER_REVIEW' + | 'UNPROCESSED'; export const StatusEnum = { - UNPROCESSED: 'UNPROCESSED' as StatusEnum, - REPROCESS: 'REPROCESS' as StatusEnum, - PROCESSING: 'PROCESSING' as StatusEnum, - ERROR: 'ERROR' as StatusEnum, + APPROVED: 'APPROVED' as StatusEnum, DELETED: 'DELETED' as StatusEnum, + ERROR: 'ERROR' as StatusEnum, + EXCLUDED: 'EXCLUDED' as StatusEnum, + FULLREPROCESS: 'FULLREPROCESS' as StatusEnum, + OCRPROCESSING: 'OCR_PROCESSING' as StatusEnum, + PROCESSING: 'PROCESSING' as StatusEnum, + REPROCESS: 'REPROCESS' as StatusEnum, UNASSIGNED: 'UNASSIGNED' as StatusEnum, - UNDERREVIEW: 'UNDER_REVIEW' as StatusEnum, UNDERAPPROVAL: 'UNDER_APPROVAL' as StatusEnum, - APPROVED: 'APPROVED' as StatusEnum + UNDERREVIEW: 'UNDER_REVIEW' as StatusEnum, + UNPROCESSED: 'UNPROCESSED' as StatusEnum }; } diff --git a/libs/red-ui-http/src/lib/model/downloadRequest.ts b/libs/red-ui-http/src/lib/model/reportTemplate.ts similarity index 69% rename from libs/red-ui-http/src/lib/model/downloadRequest.ts rename to libs/red-ui-http/src/lib/model/reportTemplate.ts index 5bd8b61ca..1490ce0b0 100644 --- a/libs/red-ui-http/src/lib/model/downloadRequest.ts +++ b/libs/red-ui-http/src/lib/model/reportTemplate.ts @@ -10,9 +10,10 @@ * Do not edit the class manually. */ -/** - * Object containing information on which prepared download should be downloaded. - */ -export interface DownloadRequest { +export interface ReportTemplate { + dossierTemplateId?: string; + fileName?: string; storageId?: string; + templateId?: string; + uploadDate?: string; } diff --git a/libs/red-ui-http/src/lib/model/rolesRequest.ts b/libs/red-ui-http/src/lib/model/rolesRequest.ts deleted file mode 100644 index 895132356..000000000 --- a/libs/red-ui-http/src/lib/model/rolesRequest.ts +++ /dev/null @@ -1,21 +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 roles request. - */ -export interface RolesRequest { - /** - * The users' ids to whom the request is applied. - */ - userIds?: Array; -} diff --git a/libs/red-ui-http/src/lib/model/rules.ts b/libs/red-ui-http/src/lib/model/rules.ts index 9898fc7a7..95f0514da 100644 --- a/libs/red-ui-http/src/lib/model/rules.ts +++ b/libs/red-ui-http/src/lib/model/rules.ts @@ -14,12 +14,12 @@ * Object containing a string of Drools rules. */ export interface Rules { + /** + * The DossierTemplate Id for these rules + */ + dossierTemplateId?: string; /** * The actual string of rules. */ rules?: string; - /** - * The dossierTemplateId for these rules - */ - dossierTemplateId?: string; } diff --git a/libs/red-ui-http/src/lib/model/typeValue.ts b/libs/red-ui-http/src/lib/model/typeValue.ts index e4c7a1655..d92d7db52 100644 --- a/libs/red-ui-http/src/lib/model/typeValue.ts +++ b/libs/red-ui-http/src/lib/model/typeValue.ts @@ -14,14 +14,22 @@ * Object containing entry type with an array of r-g-b colors. */ export interface TypeValue { + /** + * If true the ui will add a action to add values to dictionary + */ + addToDictionaryAction?: boolean; /** * True if the entries in this type should be matched case insensitively, default is false. */ caseInsensitive?: boolean; /** - * Can add to Dictionary + * The description of the dictionary type */ - addToDictionaryAction?: boolean; + description?: string; + /** + * The DossierTemplate Id for this type + */ + dossierTemplateId?: string; /** * The value of color must be a correct hex color */ @@ -42,18 +50,4 @@ export interface TypeValue { * The nonnull entry type. */ type?: string; - - /** - * The dossierTemplateId for this type - */ - dossierTemplateId?: string; - - /** - * The description of this dictionary - */ - description?: string; - - virtual?: boolean; - label?: string; - entries?: string[]; } diff --git a/libs/red-ui-http/src/lib/model/updateTypeValue.ts b/libs/red-ui-http/src/lib/model/updateTypeValue.ts index e2bf53f5b..4543aad5d 100644 --- a/libs/red-ui-http/src/lib/model/updateTypeValue.ts +++ b/libs/red-ui-http/src/lib/model/updateTypeValue.ts @@ -14,12 +14,18 @@ * Object containing information of type to be updated. */ export interface UpdateTypeValue { + /** + * If true the ui will add a action to add values to dictionary + */ + addToDictionaryAction?: boolean; /** * True if the entries in this type should be matched case insensitively, default is false. */ caseInsensitive?: boolean; - - addToDictionaryAction?: boolean; + /** + * The description of the dictionary type + */ + description?: string; /** * The value of color must be a correct hex color */ @@ -36,8 +42,4 @@ export interface UpdateTypeValue { * True if the type just for recommendations, not for redaction, default is false. */ recommendation?: boolean; - /** - * The description of this dictionary - */ - description?: string; } diff --git a/libs/red-ui-http/src/lib/model/userRequest.ts b/libs/red-ui-http/src/lib/model/userRequest.ts deleted file mode 100644 index 1e32876d6..000000000 --- a/libs/red-ui-http/src/lib/model/userRequest.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 UserRequest { - search?: string; - requestId?: string; -} diff --git a/libs/red-ui-http/src/lib/model/userResponse.ts b/libs/red-ui-http/src/lib/model/userResponse.ts deleted file mode 100644 index c7ed565b3..000000000 --- a/libs/red-ui-http/src/lib/model/userResponse.ts +++ /dev/null @@ -1,34 +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 { User } from './user'; - -/** - * Object containing a list of values of user. - */ -export interface UserResponse { - /** - * True if there is next page. - */ - hasNextPage?: boolean; - /** - * The requestId generated by server. - */ - requestId?: string; - /** - * Total number of available users. - */ - total?: number; - /** - * The list of user, which includes all the important information about a user. - */ - users?: Array; -} diff --git a/libs/red-ui-http/src/lib/model/userSearchRequest.ts b/libs/red-ui-http/src/lib/model/userSearchRequest.ts deleted file mode 100644 index 731656408..000000000 --- a/libs/red-ui-http/src/lib/model/userSearchRequest.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 UserSearchRequest { - search?: string; - requestId?: string; -} diff --git a/libs/red-ui-http/src/lib/model/userSearchResponse.ts b/libs/red-ui-http/src/lib/model/userSearchResponse.ts deleted file mode 100644 index c3cd062d9..000000000 --- a/libs/red-ui-http/src/lib/model/userSearchResponse.ts +++ /dev/null @@ -1,34 +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 { User } from './user'; - -/** - * Object containing a list of values of user. - */ -export interface UserSearchResponse { - /** - * True if there is next page. - */ - hasNextPage?: boolean; - /** - * The requestId generated by server. - */ - requestId?: string; - /** - * Total number of available users. - */ - total?: number; - /** - * The list of user, which includes all the important information about a user. - */ - users?: Array; -} diff --git a/libs/red-ui-http/src/lib/model/watermarkModel.ts b/libs/red-ui-http/src/lib/model/watermarkModel.ts deleted file mode 100644 index 87726e44e..000000000 --- a/libs/red-ui-http/src/lib/model/watermarkModel.ts +++ /dev/null @@ -1,29 +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 WatermarkModel { - fontSize?: number; - hexColor?: string; - opacity?: number; - fontType?: string; - text?: string; - orientation?: WatermarkModel.WatermarkOrientationEnum; -} - -export namespace WatermarkModel { - export type WatermarkOrientationEnum = 'VERTICAL' | 'HORIZONTAL' | 'DIAGONAL'; - export const WatermarkOrientationEnum = { - VERTICAL: 'VERTICAL' as WatermarkOrientationEnum, - HORIZONTAL: 'HORIZONTAL' as WatermarkOrientationEnum, - DIAGONAL: 'DIAGONAL' as WatermarkOrientationEnum - }; -} diff --git a/libs/red-ui-http/src/lib/model/watermarkModelReq.ts b/libs/red-ui-http/src/lib/model/watermarkModelReq.ts new file mode 100644 index 000000000..114e58b57 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/watermarkModelReq.ts @@ -0,0 +1,28 @@ +/** + * 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 WatermarkModelReq { + fontSize?: number; + fontType?: string; + hexColor?: string; + opacity?: number; + orientation?: WatermarkModelReq.OrientationEnum; + text?: string; +} +export namespace WatermarkModelReq { + export type OrientationEnum = 'DIAGONAL' | 'HORIZONTAL' | 'VERTICAL'; + export const OrientationEnum = { + DIAGONAL: 'DIAGONAL' as OrientationEnum, + HORIZONTAL: 'HORIZONTAL' as OrientationEnum, + VERTICAL: 'VERTICAL' as OrientationEnum + }; +} diff --git a/libs/red-ui-http/src/lib/model/watermarkModelRes.ts b/libs/red-ui-http/src/lib/model/watermarkModelRes.ts new file mode 100644 index 000000000..c40a38d61 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/watermarkModelRes.ts @@ -0,0 +1,28 @@ +/** + * 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 WatermarkModelRes { + fontSize?: number; + fontType?: string; + hexColor?: string; + opacity?: number; + orientation?: WatermarkModelRes.OrientationEnum; + text?: string; +} +export namespace WatermarkModelRes { + export type OrientationEnum = 'DIAGONAL' | 'HORIZONTAL' | 'VERTICAL'; + export const OrientationEnum = { + DIAGONAL: 'DIAGONAL' as OrientationEnum, + HORIZONTAL: 'HORIZONTAL' as OrientationEnum, + VERTICAL: 'VERTICAL' as OrientationEnum + }; +}