From c5ebbd2eac74d09506bd791e2d2109e526703dfe Mon Sep 17 00:00:00 2001 From: Timo Date: Wed, 24 Mar 2021 08:40:36 +0200 Subject: [PATCH] fixed typo --- apps/red-ui/src/assets/i18n/en.json | 2 +- .../src/lib/api/downloadController.service.ts | 47 +++++++++++++++++++ libs/red-ui-http/src/lib/model/models.ts | 1 + .../src/lib/model/removeDownloadRequest.ts | 15 ++++++ 4 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 libs/red-ui-http/src/lib/model/removeDownloadRequest.ts diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 1f94de8db..41b19fe90 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -864,7 +864,7 @@ }, "digital-signature-screen": { "title": "Digital Signature", - "no-key": "No Digital Signature certificate is configured. For signing redacted documents please upload an PCKS.12 certificate.", + "no-key": "No Digital Signature certificate is configured. For signing redacted documents please upload a PCKS.12 certificate.", "upload-key": "Upload Certificate", "reason": { "label": "Reason", diff --git a/libs/red-ui-http/src/lib/api/downloadController.service.ts b/libs/red-ui-http/src/lib/api/downloadController.service.ts index 6926e9026..108e878f6 100644 --- a/libs/red-ui-http/src/lib/api/downloadController.service.ts +++ b/libs/red-ui-http/src/lib/api/downloadController.service.ts @@ -21,6 +21,7 @@ import { PrepareDownloadRequest } from '../model/prepareDownloadRequest'; import { BASE_PATH } from '../variables'; import { Configuration } from '../configuration'; +import { RemoveDownloadRequest } from '../model/removeDownloadRequest'; @Injectable() export class DownloadControllerService { @@ -138,6 +139,52 @@ export class DownloadControllerService { }); } + /** + * Removes a previously created download status + * None + * @param body removeDownloadRequest + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteDownload(body: RemoveDownloadRequest, observe?: 'body', reportProgress?: boolean): Observable; + public deleteDownload(body: RemoveDownloadRequest, observe?: 'response', reportProgress?: boolean): Observable>; + public deleteDownload(body: RemoveDownloadRequest, observe?: 'events', reportProgress?: boolean): Observable>; + public deleteDownload(body: RemoveDownloadRequest, observe: any = 'body', reportProgress: boolean = false): Observable { + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling prepareDownload.'); + } + + let headers = this.defaultHeaders; + + // authentication (RED-OAUTH) required + if (this.configuration.accessToken) { + const accessToken = typeof this.configuration.accessToken === 'function' ? this.configuration.accessToken() : this.configuration.accessToken; + headers = headers.set('Authorization', 'Bearer ' + accessToken); + } + + // to determine the Accept header + const httpHeaderAccepts: string[] = []; + const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts); + if (httpHeaderAcceptSelected !== undefined) { + headers = headers.set('Accept', httpHeaderAcceptSelected); + } + + // to determine the Content-Type header + const consumes: string[] = ['application/json']; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.request('post', `${this.basePath}/async/download/delete`, { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + }); + } + /** * Prepares a download for given fileIds and types * None diff --git a/libs/red-ui-http/src/lib/model/models.ts b/libs/red-ui-http/src/lib/model/models.ts index 18d94c6cb..322adcbdd 100644 --- a/libs/red-ui-http/src/lib/model/models.ts +++ b/libs/red-ui-http/src/lib/model/models.ts @@ -65,3 +65,4 @@ export * from './importCsvRequest'; export * from './importCsvResponse'; export * from './fileAttributeConfig'; export * from './fileAttributesBaseConfigRequest'; +export * from './removeDownloadRequest'; diff --git a/libs/red-ui-http/src/lib/model/removeDownloadRequest.ts b/libs/red-ui-http/src/lib/model/removeDownloadRequest.ts new file mode 100644 index 000000000..11be360b1 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/removeDownloadRequest.ts @@ -0,0 +1,15 @@ +/** + * 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 RemoveDownloadRequest { + storageId?: string; +}