added new exclusion flow, now using backend based file requires analysys flag
This commit is contained in:
parent
718001efef
commit
381f8f2970
@ -29,10 +29,6 @@ export class FileStatusWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
get dossierDictionaryVersion() {
|
||||
return this.fileStatus.dossierDictionaryVersion;
|
||||
}
|
||||
|
||||
get analysisDuration() {
|
||||
return this.fileStatus.analysisDuration;
|
||||
}
|
||||
@ -69,10 +65,6 @@ export class FileStatusWrapper {
|
||||
this.fileStatus.currentReviewer = value;
|
||||
}
|
||||
|
||||
get dictionaryVersion() {
|
||||
return this.fileStatus.dictionaryVersion;
|
||||
}
|
||||
|
||||
get fileId() {
|
||||
return this.fileStatus.fileId;
|
||||
}
|
||||
@ -123,12 +115,8 @@ export class FileStatusWrapper {
|
||||
return this.fileStatus.projectId;
|
||||
}
|
||||
|
||||
get rulesVersion() {
|
||||
return this.fileStatus.rulesVersion;
|
||||
}
|
||||
|
||||
get isExcluded() {
|
||||
return this.fileStatus.status === 'EXCLUDED';
|
||||
return this.fileStatus.excluded;
|
||||
}
|
||||
|
||||
get status() {
|
||||
@ -158,6 +146,10 @@ export class FileStatusWrapper {
|
||||
].includes(this.status);
|
||||
}
|
||||
|
||||
get analysisRequired() {
|
||||
return this.fileStatus.analysisRequired && !this.fileStatus.excluded;
|
||||
}
|
||||
|
||||
get statusSort() {
|
||||
return StatusSorter[this.status];
|
||||
}
|
||||
|
||||
@ -132,8 +132,12 @@ export class FileActionsComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
assignToMe($event: MouseEvent) {
|
||||
async assignToMe($event: MouseEvent) {
|
||||
$event.stopPropagation();
|
||||
|
||||
await this._fileActionService.assignToMe(this.fileStatus, () => {
|
||||
this.reloadProjects('reanalyse');
|
||||
});
|
||||
}
|
||||
|
||||
reanalyseFile($event: MouseEvent, priority = -1) {
|
||||
|
||||
@ -38,7 +38,7 @@ export class DossierDictionaryDialogComponent {
|
||||
this.project.projectId
|
||||
)
|
||||
.subscribe(async () => {
|
||||
await this._appStateService.updateProjectDictionaryVersion(this.project);
|
||||
await this._appStateService.reloadActiveProjectFiles();
|
||||
this._appStateService.updateProjectDictionary(
|
||||
this.project.ruleSetId,
|
||||
this.project.projectId
|
||||
|
||||
@ -38,9 +38,9 @@ export class FileActionService {
|
||||
fileStatusWrapper = this._appStateService.activeFile;
|
||||
}
|
||||
return this._reanalysisControllerService.toggleAnalysis(
|
||||
fileStatusWrapper.projectId,
|
||||
fileStatusWrapper.fileId,
|
||||
fileStatusWrapper.isExcluded
|
||||
fileStatusWrapper.projectId,
|
||||
!fileStatusWrapper.isExcluded
|
||||
);
|
||||
}
|
||||
|
||||
@ -161,6 +161,7 @@ export class FileActionService {
|
||||
}
|
||||
|
||||
private async _assignReviewerToCurrentUser(file?: FileStatus, callback?: Function) {
|
||||
console.log('assign here');
|
||||
await this._statusControllerService
|
||||
.setFileReviewer(
|
||||
this._appStateService.activeProjectId,
|
||||
|
||||
@ -46,14 +46,7 @@ export class PermissionsService {
|
||||
if (!fileStatus) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
((fileStatus.status === 'UNASSIGNED' ||
|
||||
fileStatus.status === 'UNDER_REVIEW' ||
|
||||
fileStatus.status === 'UNDER_APPROVAL') &&
|
||||
(!this._appStateService.fileIsUpToDateWithLatestVersions(fileStatus) ||
|
||||
fileStatus.hasUnappliedSuggestions)) ||
|
||||
fileStatus.isError
|
||||
);
|
||||
return fileStatus.analysisRequired;
|
||||
}
|
||||
|
||||
displayReanalyseBtn(project?: ProjectWrapper) {
|
||||
@ -119,10 +112,15 @@ export class PermissionsService {
|
||||
this.isProjectMember() &&
|
||||
!fileStatus.isProcessing &&
|
||||
!fileStatus.isError &&
|
||||
!fileStatus.isExcluded &&
|
||||
!fileStatus.isApproved;
|
||||
|
||||
if (precondition) {
|
||||
if ((fileStatus.isUnassigned || fileStatus.isUnderReview) && !this.isApprover()) {
|
||||
if (
|
||||
(fileStatus.isUnassigned || fileStatus.isUnderReview) &&
|
||||
(!this.isApprover() ||
|
||||
!this._appStateService.activeProject.hasMoreThanOneReviewer) &&
|
||||
fileStatus.currentReviewer !== this._userService.userId
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -141,7 +139,6 @@ export class PermissionsService {
|
||||
this.isProjectMember() &&
|
||||
!fileStatus.isProcessing &&
|
||||
!fileStatus.isError &&
|
||||
!fileStatus.isExcluded &&
|
||||
!fileStatus.isApproved &&
|
||||
this.isApprover();
|
||||
|
||||
@ -190,11 +187,7 @@ export class PermissionsService {
|
||||
if (!fileStatus) {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
!fileStatus.hasRequests &&
|
||||
!fileStatus.hasUnappliedSuggestions &&
|
||||
this._appStateService.fileIsUpToDateWithLatestVersions(fileStatus)
|
||||
);
|
||||
return !fileStatus.analysisRequired;
|
||||
}
|
||||
|
||||
canSetUnderApproval(fileStatus?: FileStatusWrapper) {
|
||||
@ -364,6 +357,7 @@ export class PermissionsService {
|
||||
return false;
|
||||
}
|
||||
return (
|
||||
!fileStatus.isExcluded &&
|
||||
!fileStatus.ocrTime &&
|
||||
(fileStatus.status === 'UNASSIGNED' ||
|
||||
fileStatus.status === 'UNDER_REVIEW' ||
|
||||
|
||||
@ -22,7 +22,6 @@ export class AppStateGuard implements CanActivate {
|
||||
await this._userService.loadAllUsersIfNecessary();
|
||||
await this._appStateService.loadRuleSetsIfNecessary();
|
||||
await this._appStateService.loadDictionaryDataIfNecessary();
|
||||
await this._appStateService.updateDictionaryVersion();
|
||||
}
|
||||
|
||||
if (this._userService.isUser()) {
|
||||
|
||||
@ -10,8 +10,7 @@ import {
|
||||
RuleSetControllerService,
|
||||
RuleSetModel,
|
||||
StatusControllerService,
|
||||
TypeValue,
|
||||
VersionsControllerService
|
||||
TypeValue
|
||||
} from '@redaction/red-ui-http';
|
||||
import { NotificationService, NotificationType } from '@services/notification.service';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
@ -34,7 +33,6 @@ export interface AppState {
|
||||
totalAnalysedPages?: number;
|
||||
totalDocuments?: number;
|
||||
totalPeople?: number;
|
||||
versions: { [key: string]: { dictionaryVersion?: number; rulesVersion?: number } };
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
@ -55,7 +53,6 @@ export class AppStateService {
|
||||
private readonly _dictionaryControllerService: DictionaryControllerService,
|
||||
private readonly _ruleSetControllerService: RuleSetControllerService,
|
||||
private readonly _statusControllerService: StatusControllerService,
|
||||
private readonly _versionsControllerService: VersionsControllerService,
|
||||
private readonly _fileAttributesService: FileAttributesControllerService
|
||||
) {
|
||||
this._appState = {
|
||||
@ -65,8 +62,7 @@ export class AppStateService {
|
||||
activeProjectId: null,
|
||||
activeFileId: null,
|
||||
activeRuleSetId: null,
|
||||
activeDictionaryType: null,
|
||||
versions: {}
|
||||
activeDictionaryType: null
|
||||
};
|
||||
|
||||
this._router.events.subscribe((event: Event) => {
|
||||
@ -190,27 +186,9 @@ export class AppStateService {
|
||||
async reloadActiveProjectFilesIfNecessary() {
|
||||
if (this.activeProject?.hasPendingOrProcessing) {
|
||||
await this.reloadActiveProjectFiles();
|
||||
await this.updateDictionaryVersion();
|
||||
await this.updateProjectDictionaryVersion(this.activeProject);
|
||||
}
|
||||
}
|
||||
|
||||
fileIsUpToDateWithLatestVersions(fileStatus?: FileStatusWrapper) {
|
||||
if (!fileStatus) {
|
||||
fileStatus = this.activeFile;
|
||||
}
|
||||
|
||||
const project = this.getProjectById(fileStatus.projectId);
|
||||
const ruleSetId = project.ruleSetId;
|
||||
|
||||
return (
|
||||
fileStatus.dictionaryVersion === this._dictionaryVersion(ruleSetId) &&
|
||||
fileStatus.rulesVersion === this._rulesVersion(ruleSetId) &&
|
||||
(!project.dictionaryVersion ||
|
||||
fileStatus.dossierDictionaryVersion === project.dictionaryVersion)
|
||||
);
|
||||
}
|
||||
|
||||
getDictionaryColor(type?: string, ruleSetId?: string) {
|
||||
if (!ruleSetId && this.activeProject) {
|
||||
ruleSetId = this.activeProject.ruleSetId;
|
||||
@ -225,19 +203,6 @@ export class AppStateService {
|
||||
return color ? color : this._dictionaryData[ruleSetId]['default'].hexColor;
|
||||
}
|
||||
|
||||
getDictionaryLabel(type: string, ruleSetId?: string) {
|
||||
if (!ruleSetId && this.activeProject) {
|
||||
ruleSetId = this.activeProject.ruleSetId;
|
||||
}
|
||||
if (!ruleSetId) {
|
||||
ruleSetId = this.ruleSets.length > 0 ? this.ruleSets[0].ruleSetId : undefined;
|
||||
}
|
||||
if (!ruleSetId) {
|
||||
return undefined;
|
||||
}
|
||||
return this._dictionaryData[ruleSetId][type]?.label;
|
||||
}
|
||||
|
||||
getRuleSetById(id: string): RuleSetModel {
|
||||
return this.ruleSets.find((rs) => rs.ruleSetId === id);
|
||||
}
|
||||
@ -284,8 +249,6 @@ export class AppStateService {
|
||||
|
||||
this._appState.projects = mappedProjects;
|
||||
this._computeStats();
|
||||
|
||||
this.updateProjectDictionaryVersions();
|
||||
}
|
||||
}
|
||||
|
||||
@ -308,7 +271,6 @@ export class AppStateService {
|
||||
file.fileId === activeFileWrapper.fileId ? activeFileWrapper : file
|
||||
);
|
||||
|
||||
await this.updateDictionaryVersion();
|
||||
this._computeStats();
|
||||
if (activeFileWrapper.lastProcessed !== oldProcessedDate) {
|
||||
this.fileReanalysed.emit(activeFileWrapper);
|
||||
@ -650,40 +612,6 @@ export class AppStateService {
|
||||
this._dictionaryData = obj;
|
||||
}
|
||||
|
||||
async updateDictionaryVersion() {
|
||||
const ruleSetIds = this.ruleSets.map((rs) => rs.ruleSetId);
|
||||
this._appState.versions = await this._versionsControllerService
|
||||
.getVersions(ruleSetIds)
|
||||
.toPromise();
|
||||
}
|
||||
|
||||
updateProjectDictionaryVersions() {
|
||||
for (const project of this.allProjects) {
|
||||
// don't wait / block
|
||||
this.updateProjectDictionaryVersion(project);
|
||||
}
|
||||
}
|
||||
|
||||
async updateProjectDictionaryVersion(project: ProjectWrapper) {
|
||||
project.dictionaryVersion = await this._versionsControllerService
|
||||
.getDossierDictionaryVersion(project.projectId, project.ruleSetId)
|
||||
.toPromise();
|
||||
}
|
||||
|
||||
private _dictionaryVersion(ruleSetId?: string) {
|
||||
if (!ruleSetId) {
|
||||
ruleSetId = this.activeProject.ruleSetId;
|
||||
}
|
||||
return this._appState.versions[ruleSetId].dictionaryVersion;
|
||||
}
|
||||
|
||||
private _rulesVersion(ruleSetId?: string) {
|
||||
if (!ruleSetId) {
|
||||
ruleSetId = this.activeProject.ruleSetId;
|
||||
}
|
||||
return this._appState.versions[ruleSetId].rulesVersion;
|
||||
}
|
||||
|
||||
private _getExistingFiles(projectId: string) {
|
||||
const found = this._appState.projects.find((p) => p.project.projectId === projectId);
|
||||
return found ? found.files : [];
|
||||
|
||||
@ -25,7 +25,11 @@ export class ReanalysisControllerService {
|
||||
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;
|
||||
}
|
||||
@ -57,29 +61,57 @@ export class ReanalysisControllerService {
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public ocrFile(projectId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public ocrFile(projectId: string, fileId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public ocrFile(projectId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public ocrFile(projectId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
public ocrFile(
|
||||
projectId: string,
|
||||
fileId: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
public ocrFile(
|
||||
projectId: string,
|
||||
fileId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public ocrFile(
|
||||
projectId: string,
|
||||
fileId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public ocrFile(
|
||||
projectId: string,
|
||||
fileId: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
if (projectId === null || projectId === undefined) {
|
||||
throw new Error('Required parameter projectId was null or undefined when calling ocrFile.');
|
||||
throw new Error(
|
||||
'Required parameter projectId was null or undefined when calling ocrFile.'
|
||||
);
|
||||
}
|
||||
|
||||
if (fileId === null || fileId === undefined) {
|
||||
throw new Error('Required parameter fileId was null or undefined when calling ocrFile.');
|
||||
throw new Error(
|
||||
'Required parameter fileId was null or undefined when calling ocrFile.'
|
||||
);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@ -89,7 +121,9 @@ export class ReanalysisControllerService {
|
||||
|
||||
return this.httpClient.request<any>(
|
||||
'post',
|
||||
`${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`,
|
||||
`${this.basePath}/ocr/reanalyze/${encodeURIComponent(
|
||||
String(projectId)
|
||||
)}/${encodeURIComponent(String(fileId))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
@ -107,47 +141,78 @@ export class ReanalysisControllerService {
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public ocrFiles(body: Array<string>, projectId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public ocrFiles(body: Array<string>, projectId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public ocrFiles(body: Array<string>, projectId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public ocrFiles(body: Array<string>, projectId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
public ocrFiles(
|
||||
body: Array<string>,
|
||||
projectId: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
public ocrFiles(
|
||||
body: Array<string>,
|
||||
projectId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public ocrFiles(
|
||||
body: Array<string>,
|
||||
projectId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public ocrFiles(
|
||||
body: Array<string>,
|
||||
projectId: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling ocrFiles.');
|
||||
}
|
||||
|
||||
if (projectId === null || projectId === undefined) {
|
||||
throw new Error('Required parameter projectId was null or undefined when calling ocrFiles.');
|
||||
throw new Error(
|
||||
'Required parameter projectId was null or undefined when calling ocrFiles.'
|
||||
);
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
|
||||
// authentication (RED-OAUTH) required
|
||||
if (this.configuration.accessToken) {
|
||||
const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken;
|
||||
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[] = ['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<any>('post', `${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(projectId))}/bulk`, {
|
||||
body: body,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
reportProgress: reportProgress
|
||||
});
|
||||
return this.httpClient.request<any>(
|
||||
'post',
|
||||
`${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(projectId))}/bulk`,
|
||||
{
|
||||
body: body,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -157,25 +222,47 @@ export class ReanalysisControllerService {
|
||||
* @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 ocrProject(projectId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public ocrProject(projectId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public ocrProject(projectId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public ocrProject(projectId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
public ocrProject(
|
||||
projectId: string,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
public ocrProject(
|
||||
projectId: string,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public ocrProject(
|
||||
projectId: string,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public ocrProject(
|
||||
projectId: string,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
if (projectId === null || projectId === undefined) {
|
||||
throw new Error('Required parameter projectId was null or undefined when calling ocrProject.');
|
||||
throw new Error(
|
||||
'Required parameter projectId was null or undefined when calling ocrProject.'
|
||||
);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@ -183,12 +270,16 @@ export class ReanalysisControllerService {
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [];
|
||||
|
||||
return this.httpClient.request<any>('post', `${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(projectId))}`, {
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
reportProgress: reportProgress
|
||||
});
|
||||
return this.httpClient.request<any>(
|
||||
'post',
|
||||
`${this.basePath}/ocr/reanalyze/${encodeURIComponent(String(projectId))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -200,19 +291,47 @@ export class ReanalysisControllerService {
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public reanalyzeFile(projectId: string, fileId: string, priority?: number, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public reanalyzeFile(
|
||||
projectId: string,
|
||||
fileId: string,
|
||||
priority?: number,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
|
||||
public reanalyzeFile(projectId: string, fileId: string, priority?: number, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public reanalyzeFile(
|
||||
projectId: string,
|
||||
fileId: string,
|
||||
priority?: number,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
|
||||
public reanalyzeFile(projectId: string, fileId: string, priority?: number, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public reanalyzeFile(
|
||||
projectId: string,
|
||||
fileId: string,
|
||||
priority?: number,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
|
||||
public reanalyzeFile(projectId: string, fileId: string, priority?: number, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
public reanalyzeFile(
|
||||
projectId: string,
|
||||
fileId: string,
|
||||
priority?: number,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
if (projectId === null || projectId === undefined) {
|
||||
throw new Error('Required parameter projectId was null or undefined when calling reanalyzeFile.');
|
||||
throw new Error(
|
||||
'Required parameter projectId was null or undefined when calling reanalyzeFile.'
|
||||
);
|
||||
}
|
||||
|
||||
if (fileId === null || fileId === undefined) {
|
||||
throw new Error('Required parameter fileId was null or undefined when calling reanalyzeFile.');
|
||||
throw new Error(
|
||||
'Required parameter fileId was null or undefined when calling reanalyzeFile.'
|
||||
);
|
||||
}
|
||||
|
||||
let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
|
||||
@ -224,13 +343,17 @@ export class ReanalysisControllerService {
|
||||
|
||||
// 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);
|
||||
}
|
||||
@ -240,7 +363,9 @@ export class ReanalysisControllerService {
|
||||
|
||||
return this.httpClient.request<any>(
|
||||
'post',
|
||||
`${this.basePath}/reanalyze/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`,
|
||||
`${this.basePath}/reanalyze/${encodeURIComponent(
|
||||
String(projectId)
|
||||
)}/${encodeURIComponent(String(fileId))}`,
|
||||
{
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
@ -260,7 +385,13 @@ export class ReanalysisControllerService {
|
||||
* @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 reanalyzeFilesForProject(body: Array<string>, projectId: string, force?: boolean, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public reanalyzeFilesForProject(
|
||||
body: Array<string>,
|
||||
projectId: string,
|
||||
force?: boolean,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
public reanalyzeFilesForProject(
|
||||
body: Array<string>,
|
||||
projectId: string,
|
||||
@ -283,11 +414,15 @@ export class ReanalysisControllerService {
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling reanalyzeFilesForProject.');
|
||||
throw new Error(
|
||||
'Required parameter body was null or undefined when calling reanalyzeFilesForProject.'
|
||||
);
|
||||
}
|
||||
|
||||
if (projectId === null || projectId === undefined) {
|
||||
throw new Error('Required parameter projectId was null or undefined when calling reanalyzeFilesForProject.');
|
||||
throw new Error(
|
||||
'Required parameter projectId was null or undefined when calling reanalyzeFilesForProject.'
|
||||
);
|
||||
}
|
||||
|
||||
let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
|
||||
@ -299,32 +434,41 @@ export class ReanalysisControllerService {
|
||||
|
||||
// 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[] = ['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<any>('post', `${this.basePath}/reanalyze/${encodeURIComponent(String(projectId))}/bulk`, {
|
||||
body: body,
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
reportProgress: reportProgress
|
||||
});
|
||||
return this.httpClient.request<any>(
|
||||
'post',
|
||||
`${this.basePath}/reanalyze/${encodeURIComponent(String(projectId))}/bulk`,
|
||||
{
|
||||
body: body,
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -335,12 +479,34 @@ export class ReanalysisControllerService {
|
||||
* @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 reanalyzeProject(projectId: string, force?: boolean, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public reanalyzeProject(projectId: string, force?: boolean, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public reanalyzeProject(projectId: string, force?: boolean, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public reanalyzeProject(projectId: string, force?: boolean, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
public reanalyzeProject(
|
||||
projectId: string,
|
||||
force?: boolean,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
public reanalyzeProject(
|
||||
projectId: string,
|
||||
force?: boolean,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public reanalyzeProject(
|
||||
projectId: string,
|
||||
force?: boolean,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public reanalyzeProject(
|
||||
projectId: string,
|
||||
force?: boolean,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
if (projectId === null || projectId === undefined) {
|
||||
throw new Error('Required parameter projectId was null or undefined when calling reanalyzeProject.');
|
||||
throw new Error(
|
||||
'Required parameter projectId was null or undefined when calling reanalyzeProject.'
|
||||
);
|
||||
}
|
||||
|
||||
let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
|
||||
@ -352,84 +518,17 @@ export class ReanalysisControllerService {
|
||||
|
||||
// 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);
|
||||
if (httpHeaderAcceptSelected !== undefined) {
|
||||
headers = headers.set('Accept', httpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [];
|
||||
|
||||
return this.httpClient.request<any>('post', `${this.basePath}/reanalyze/${encodeURIComponent(String(projectId))}`, {
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
reportProgress: reportProgress
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude or re-include a file to analysis
|
||||
* None
|
||||
* @param projectId projectId
|
||||
* @param fileId fileId
|
||||
* @param analysisStatus analysisStatus
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public toggleAnalysis(projectId: string, fileId: string, analysisStatus?: boolean, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public toggleAnalysis(
|
||||
projectId: string,
|
||||
fileId: string,
|
||||
analysisStatus?: boolean,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public toggleAnalysis(
|
||||
projectId: string,
|
||||
fileId: string,
|
||||
analysisStatus?: boolean,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public toggleAnalysis(
|
||||
projectId: string,
|
||||
fileId: string,
|
||||
analysisStatus?: boolean,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
if (projectId === null || projectId === undefined) {
|
||||
throw new Error('Required parameter projectId was null or undefined when calling toggleAnalysis.');
|
||||
}
|
||||
|
||||
if (fileId === null || fileId === undefined) {
|
||||
throw new Error('Required parameter fileId was null or undefined when calling toggleAnalysis.');
|
||||
}
|
||||
|
||||
let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
|
||||
if (analysisStatus !== undefined && analysisStatus !== null) {
|
||||
queryParameters = queryParameters.set('analysisStatus', <any>analysisStatus);
|
||||
}
|
||||
|
||||
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);
|
||||
const httpHeaderAcceptSelected: string | undefined =
|
||||
this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected !== undefined) {
|
||||
headers = headers.set('Accept', httpHeaderAcceptSelected);
|
||||
}
|
||||
@ -439,7 +538,95 @@ export class ReanalysisControllerService {
|
||||
|
||||
return this.httpClient.request<any>(
|
||||
'post',
|
||||
`${this.basePath}/toggle-analysis/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`,
|
||||
`${this.basePath}/reanalyze/${encodeURIComponent(String(projectId))}`,
|
||||
{
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude or re-include a file to analysis
|
||||
* None
|
||||
* @param fileId fileId
|
||||
* @param projectId projectId
|
||||
* @param excluded excluded
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public toggleAnalysis(
|
||||
fileId: string,
|
||||
projectId: string,
|
||||
excluded?: boolean,
|
||||
observe?: 'body',
|
||||
reportProgress?: boolean
|
||||
): Observable<any>;
|
||||
public toggleAnalysis(
|
||||
fileId: string,
|
||||
projectId: string,
|
||||
excluded?: boolean,
|
||||
observe?: 'response',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpResponse<any>>;
|
||||
public toggleAnalysis(
|
||||
fileId: string,
|
||||
projectId: string,
|
||||
excluded?: boolean,
|
||||
observe?: 'events',
|
||||
reportProgress?: boolean
|
||||
): Observable<HttpEvent<any>>;
|
||||
public toggleAnalysis(
|
||||
fileId: string,
|
||||
projectId: string,
|
||||
excluded?: boolean,
|
||||
observe: any = 'body',
|
||||
reportProgress: boolean = false
|
||||
): Observable<any> {
|
||||
if (fileId === null || fileId === undefined) {
|
||||
throw new Error(
|
||||
'Required parameter fileId was null or undefined when calling toggleAnalysis.'
|
||||
);
|
||||
}
|
||||
|
||||
if (projectId === null || projectId === undefined) {
|
||||
throw new Error(
|
||||
'Required parameter projectId was null or undefined when calling toggleAnalysis.'
|
||||
);
|
||||
}
|
||||
|
||||
let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() });
|
||||
if (excluded !== undefined && excluded !== null) {
|
||||
queryParameters = queryParameters.set('excluded', <any>excluded);
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
|
||||
// authentication (RED-OAUTH) required
|
||||
if (this.configuration.accessToken) {
|
||||
const accessToken =
|
||||
typeof this.configuration.accessToken === 'function'
|
||||
? this.configuration.accessToken()
|
||||
: this.configuration.accessToken;
|
||||
headers = headers.set('Authorization', 'Bearer ' + accessToken);
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
const httpHeaderAccepts: string[] = [];
|
||||
const httpHeaderAcceptSelected: string | undefined =
|
||||
this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected !== undefined) {
|
||||
headers = headers.set('Accept', httpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
return this.httpClient.request<any>(
|
||||
'post',
|
||||
`${this.basePath}/toggle-analysis/${encodeURIComponent(
|
||||
String(projectId)
|
||||
)}/${encodeURIComponent(String(fileId))}`,
|
||||
{
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
|
||||
@ -27,6 +27,10 @@ export interface FileStatus {
|
||||
* Shows how long the last analysis took
|
||||
*/
|
||||
analysisDuration?: number;
|
||||
/**
|
||||
* Shows if the file requires reanalysis.
|
||||
*/
|
||||
analysisRequired?: boolean;
|
||||
/**
|
||||
* Shows the date of approval, if approved.
|
||||
*/
|
||||
@ -40,12 +44,13 @@ export interface FileStatus {
|
||||
*/
|
||||
dictionaryVersion?: number;
|
||||
/**
|
||||
* dossier dictionary version
|
||||
* Shows which dossier dictionary versions was used during the analysis.
|
||||
*/
|
||||
dossierDictionaryVersion?: number;
|
||||
/**
|
||||
* File Attributes;
|
||||
* Shows if the file was excluded from analysis.
|
||||
*/
|
||||
excluded?: boolean;
|
||||
fileAttributes?: FileAttributes;
|
||||
/**
|
||||
* The ID of the file.
|
||||
@ -99,6 +104,10 @@ export interface FileStatus {
|
||||
* Shows last date the document was uploaded.
|
||||
*/
|
||||
lastUploaded?: string;
|
||||
/**
|
||||
* Shows which legal basis versions was used during the analysis.
|
||||
*/
|
||||
legalBasisVersion?: number;
|
||||
/**
|
||||
* The number of times the file has been analyzed.
|
||||
*/
|
||||
@ -111,6 +120,10 @@ export interface FileStatus {
|
||||
* The ID of the project the file belongs to.
|
||||
*/
|
||||
projectId?: string;
|
||||
/**
|
||||
* The ruleSetId for this file.
|
||||
*/
|
||||
ruleSetId?: string;
|
||||
/**
|
||||
* Shows which rules versions was used during the analysis.
|
||||
*/
|
||||
@ -124,30 +137,29 @@ export interface FileStatus {
|
||||
*/
|
||||
uploader?: string;
|
||||
}
|
||||
|
||||
export namespace FileStatus {
|
||||
export type StatusEnum =
|
||||
| 'UNPROCESSED'
|
||||
| 'REPROCESS'
|
||||
| 'PROCESSING'
|
||||
| 'ERROR'
|
||||
| 'UNASSIGNED'
|
||||
| 'UNDER_REVIEW'
|
||||
| 'UNDER_APPROVAL'
|
||||
| 'APPROVED'
|
||||
| 'ERROR'
|
||||
| 'FULLREPROCESS'
|
||||
| 'OCR_PROCESSING'
|
||||
| 'EXCLUDED';
|
||||
| 'PROCESSING'
|
||||
| 'REPROCESS'
|
||||
| 'UNASSIGNED'
|
||||
| 'UNDER_APPROVAL'
|
||||
| 'UNDER_REVIEW'
|
||||
| 'UNPROCESSED';
|
||||
export const StatusEnum = {
|
||||
UNPROCESSED: 'UNPROCESSED' as StatusEnum,
|
||||
REPROCESS: 'REPROCESS' as StatusEnum,
|
||||
PROCESSING: 'PROCESSING' as StatusEnum,
|
||||
ERROR: 'ERROR' as StatusEnum,
|
||||
UNASSIGNED: 'UNASSIGNED' as StatusEnum,
|
||||
UNDERREVIEW: 'UNDER_REVIEW' as StatusEnum,
|
||||
UNDERAPPROVAL: 'UNDER_APPROVAL' as StatusEnum,
|
||||
APPROVED: 'APPROVED' as StatusEnum,
|
||||
ERROR: 'ERROR' as StatusEnum,
|
||||
FULLREPROCESS: 'FULLREPROCESS' as StatusEnum,
|
||||
OCR_PROCESSING: 'OCR_PROCESSING' as StatusEnum,
|
||||
EXCLUDED: 'EXCLUDED' as StatusEnum
|
||||
PROCESSING: 'PROCESSING' as StatusEnum,
|
||||
REPROCESS: 'REPROCESS' as StatusEnum,
|
||||
UNASSIGNED: 'UNASSIGNED' as StatusEnum,
|
||||
UNDERAPPROVAL: 'UNDER_APPROVAL' as StatusEnum,
|
||||
UNDERREVIEW: 'UNDER_REVIEW' as StatusEnum,
|
||||
UNPROCESSED: 'UNPROCESSED' as StatusEnum
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user