audit service

This commit is contained in:
Timo 2021-03-05 00:00:26 +02:00
parent 49d0b35902
commit daa1031519
9 changed files with 227 additions and 1 deletions

View File

@ -2,7 +2,9 @@
## Swagger Generated Code
To regnerate http rune swaagger
To re-generate http rune swagger
YOu need swagger-codegen installed `brew install swagger-codegen`
```
BASE=https://redapi-staging.iqser.cloud/

View File

@ -26,6 +26,7 @@ import { DigitalSignatureControllerService } from './api/digitalSignatureControl
declarations: [],
exports: [],
providers: [
AuditControllerService,
DebugControllerService,
DictionaryControllerService,
FileManagementControllerService,

View File

@ -1,3 +1,4 @@
import { AuditControllerService } from './auditController.service';
import { DebugControllerService } from './debugController.service';
import { DictionaryControllerService } from './dictionaryController.service';
import { FileManagementControllerService } from './fileManagementController.service';
@ -19,6 +20,8 @@ import { WatermarkControllerService } from './watermarkController.service';
import { DownloadControllerService } from './downloadController.service';
import { DigitalSignatureControllerService } from './digitalSignatureController.service';
export * from './auditController.service';
export * from './dictionaryController.service';
export * from './fileManagementController.service';
@ -60,6 +63,7 @@ export * from './digitalSignatureController.service';
export * from './debugController.service';
export const APIS = [
AuditControllerService,
DebugControllerService,
DictionaryControllerService,
FileManagementControllerService,

View File

@ -0,0 +1,136 @@
/**
* API Documentation for Redaction Gateway
* Description for redaction
*
* OpenAPI spec version: 1.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/ /* tslint:disable:no-unused-variable member-ordering */
import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpEvent, HttpHeaders, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { AuditResponse } from '../model/auditResponse';
import { AuditSearchRequest } from '../model/auditSearchRequest';
import { CategoryModel } from '../model/categoryModel';
import { BASE_PATH } from '../variables';
import { Configuration } from '../configuration';
@Injectable()
export class AuditControllerService {
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;
}
/**
* Get a list of available categories for the audit-log
* None
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getAuditCategories(observe?: 'body', reportProgress?: boolean): Observable<Array<CategoryModel>>;
public getAuditCategories(observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Array<CategoryModel>>>;
public getAuditCategories(observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Array<CategoryModel>>>;
public getAuditCategories(observe: any = 'body', reportProgress: boolean = false): Observable<any> {
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[] = [];
return this.httpClient.request<Array<CategoryModel>>('get', `${this.basePath}/audit/categories`, {
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
/**
* Search the audit-log based on some entries the digital signature used to sign PDF&#x27;s
* None
* @param body auditSearchRequest
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public searchAuditLog(body: AuditSearchRequest, observe?: 'body', reportProgress?: boolean): Observable<AuditResponse>;
public searchAuditLog(body: AuditSearchRequest, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<AuditResponse>>;
public searchAuditLog(body: AuditSearchRequest, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<AuditResponse>>;
public searchAuditLog(body: AuditSearchRequest, 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 searchAuditLog.');
}
let headers = this.defaultHeaders;
// authentication (RED-OAUTH) required
if (this.configuration.accessToken) {
const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken;
headers = headers.set('Authorization', 'Bearer ' + accessToken);
}
// to determine the Accept header
const httpHeaderAccepts: string[] = ['application/json'];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
}
// to determine the Content-Type header
const consumes: string[] = ['application/json'];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
headers = headers.set('Content-Type', httpContentTypeSelected);
}
return this.httpClient.request<AuditResponse>('post', `${this.basePath}/audit/search`, {
body: body,
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
});
}
}

View File

@ -0,0 +1,21 @@
/**
* 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 AuditModel {
category?: string;
details?: any;
message?: string;
objectId?: string;
recordDate?: string;
recordId?: string;
userId?: string;
}

View File

@ -0,0 +1,19 @@
/**
* 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 { AuditModel } from './auditModel';
export interface AuditResponse {
data?: Array<AuditModel>;
page?: number;
pageSize?: number;
totalHits?: number;
}

View File

@ -0,0 +1,23 @@
/**
* 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 AuditSearchRequest {
category?: string;
from?: string;
objectId?: string;
page?: number;
pageSize?: number;
requestingUserId?: string;
to?: string;
userId?: string;
withTotalHits?: boolean;
}

View File

@ -0,0 +1,16 @@
/**
* 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 CategoryModel {
category?: string;
recordCount?: number;
}

View File

@ -54,3 +54,7 @@ export * from './redactionChangeLog';
export * from './redactionChangeLogEntry';
export * from './forceRedactionRequest';
export * from './manualForceRedaction';
export * from './auditModel';
export * from './auditResponse';
export * from './auditSearchRequest';
export * from './categoryModel';