From 5caea6e34fbbce0056c325aebc06bd5d7ffba347 Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Fri, 18 Sep 2020 16:26:13 +0300 Subject: [PATCH] projects work in progress --- .../src/app/app-config/app-config.service.ts | 35 + apps/red-ui/src/app/app.component.html | 119 ---- apps/red-ui/src/app/app.component.scss | 133 ---- apps/red-ui/src/app/app.component.spec.ts | 33 - apps/red-ui/src/app/app.module.ts | 99 ++- .../src/app/i18n/language.initializer.ts | 5 + apps/red-ui/src/app/i18n/language.service.ts | 36 + apps/red-ui/src/app/icons/icons.module.ts | 30 + .../api-path-interceptor.service.ts | 24 + .../app/keycloak-auth/keycloak-auth.module.ts | 25 + .../app/keycloak-auth/keycloak.initializer.ts | 25 + .../keycloak-auth/red-keycloak-auth.guard.ts | 31 + .../app/notification/notification.service.ts | 18 + .../base-screen/base-screen.component.html | 20 + .../base-screen/base-screen.component.scss | 40 ++ .../base-screen/base-screen.component.ts | 20 + .../add-edit-project-dialog.component.html | 30 + .../add-edit-project-dialog.component.scss | 0 .../add-edit-project-dialog.component.ts | 57 ++ .../project-listing-screen.component.html | 20 + .../project-listing-screen.component.scss | 57 ++ .../project-listing-screen.component.ts | 39 ++ .../project-overview-screen.component.html | 1 + .../project-overview-screen.component.scss | 0 .../project-overview-screen.component.ts | 15 + apps/red-ui/src/app/user/user.service.ts | 17 + apps/red-ui/src/assets/config/config.json | 6 + apps/red-ui/src/assets/i18n/de.json | 0 apps/red-ui/src/assets/i18n/en.json | 49 ++ .../src/assets/icons/general/close_icon.svg | 10 + .../src/assets/icons/general/plus_icon.svg | 14 + .../src/assets/keycloak/silent-check-sso.html | 7 + apps/red-ui/src/index.html | 2 +- apps/red-ui/src/styles.scss | 1 + assets/styles/page-layout.scss | 13 + assets/styles/red-dialog.scss | 28 + assets/styles/red-input.scss | 37 + assets/styles/red-material-theme.scss | 54 ++ assets/styles/red-mixins.scss | 9 + assets/styles/red-text-styles.scss | 27 + assets/styles/red-theme.scss | 7 + assets/styles/red-variables.scss | 12 + libs/red-ui-http/README.md | 7 + libs/red-ui-http/src/index.ts | 1 + libs/red-ui-http/src/lib/api.module.ts | 53 ++ libs/red-ui-http/src/lib/api/api.ts | 23 + .../src/lib/api/debugController.service.ts | 370 ++++++++++ .../lib/api/dictionaryController.service.ts | 653 ++++++++++++++++++ .../lib/api/fileUploadController.service.ts | 476 +++++++++++++ .../api/licenseReportController.service.ts | 127 ++++ .../api/manualRedactionController.service.ts | 176 +++++ ...MetaDataConfigurationController.service.ts | 156 +++++ .../src/lib/api/projectController.service.ts | 315 +++++++++ .../lib/api/reanalysisController.service.ts | 158 +++++ .../lib/api/redactionLogController.service.ts | 107 +++ .../src/lib/api/rulesController.service.ts | 268 +++++++ .../src/lib/api/statusController.service.ts | 107 +++ libs/red-ui-http/src/lib/configuration.ts | 79 +++ libs/red-ui-http/src/lib/encoder.ts | 18 + libs/red-ui-http/src/lib/index.ts | 5 + libs/red-ui-http/src/lib/model/body.ts | 18 + libs/red-ui-http/src/lib/model/body1.ts | 18 + libs/red-ui-http/src/lib/model/body2.ts | 18 + libs/red-ui-http/src/lib/model/body3.ts | 18 + libs/red-ui-http/src/lib/model/body4.ts | 18 + libs/red-ui-http/src/lib/model/body5.ts | 18 + libs/red-ui-http/src/lib/model/body6.ts | 18 + .../red-ui-http/src/lib/model/defaultColor.ts | 15 + libs/red-ui-http/src/lib/model/dictionary.ts | 33 + libs/red-ui-http/src/lib/model/fileIds.ts | 15 + libs/red-ui-http/src/lib/model/fileStatus.ts | 35 + libs/red-ui-http/src/lib/model/inputStream.ts | 14 + .../src/lib/model/licenseReport.ts | 25 + .../src/lib/model/licenseReportRequest.ts | 18 + .../src/lib/model/manualRedactionEntry.ts | 19 + .../src/lib/model/manualRedactions.ts | 17 + libs/red-ui-http/src/lib/model/modelFile.ts | 33 + libs/red-ui-http/src/lib/model/models.ts | 32 + libs/red-ui-http/src/lib/model/pdfMetaData.ts | 22 + libs/red-ui-http/src/lib/model/point.ts | 16 + libs/red-ui-http/src/lib/model/project.ts | 26 + .../src/lib/model/projectRequest.ts | 16 + libs/red-ui-http/src/lib/model/rectangle.ts | 19 + .../red-ui-http/src/lib/model/redactionLog.ts | 19 + .../src/lib/model/redactionLogEntry.ts | 26 + libs/red-ui-http/src/lib/model/reportData.ts | 34 + libs/red-ui-http/src/lib/model/resource.ts | 25 + libs/red-ui-http/src/lib/model/rules.ts | 21 + .../red-ui-http/src/lib/model/typeResponse.ts | 22 + libs/red-ui-http/src/lib/model/typeValue.ts | 33 + libs/red-ui-http/src/lib/model/uRI.ts | 31 + libs/red-ui-http/src/lib/model/uRL.ts | 28 + .../src/lib/model/uRLStreamHandler.ts | 14 + libs/red-ui-http/src/lib/variables.ts | 9 + libs/red-ui-http/tsconfig.json | 13 + libs/red-ui-http/tsconfig.lib.json | 18 + libs/red-ui-http/tslint.json | 10 + nx.json | 3 + package.json | 37 +- tsconfig.base.json | 4 +- workspace.json | 32 +- yarn.lock | 59 +- 102 files changed, 4910 insertions(+), 313 deletions(-) create mode 100644 apps/red-ui/src/app/app-config/app-config.service.ts delete mode 100644 apps/red-ui/src/app/app.component.spec.ts create mode 100644 apps/red-ui/src/app/i18n/language.initializer.ts create mode 100644 apps/red-ui/src/app/i18n/language.service.ts create mode 100644 apps/red-ui/src/app/icons/icons.module.ts create mode 100644 apps/red-ui/src/app/interceptor/api-path-interceptor.service.ts create mode 100644 apps/red-ui/src/app/keycloak-auth/keycloak-auth.module.ts create mode 100644 apps/red-ui/src/app/keycloak-auth/keycloak.initializer.ts create mode 100644 apps/red-ui/src/app/keycloak-auth/red-keycloak-auth.guard.ts create mode 100644 apps/red-ui/src/app/notification/notification.service.ts create mode 100644 apps/red-ui/src/app/screens/base-screen/base-screen.component.html create mode 100644 apps/red-ui/src/app/screens/base-screen/base-screen.component.scss create mode 100644 apps/red-ui/src/app/screens/base-screen/base-screen.component.ts create mode 100644 apps/red-ui/src/app/screens/project-listing-screen/add-edit-project-dialog/add-edit-project-dialog.component.html create mode 100644 apps/red-ui/src/app/screens/project-listing-screen/add-edit-project-dialog/add-edit-project-dialog.component.scss create mode 100644 apps/red-ui/src/app/screens/project-listing-screen/add-edit-project-dialog/add-edit-project-dialog.component.ts create mode 100644 apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html create mode 100644 apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.scss create mode 100644 apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts create mode 100644 apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html create mode 100644 apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.scss create mode 100644 apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.ts create mode 100644 apps/red-ui/src/app/user/user.service.ts create mode 100644 apps/red-ui/src/assets/config/config.json create mode 100644 apps/red-ui/src/assets/i18n/de.json create mode 100644 apps/red-ui/src/assets/i18n/en.json create mode 100755 apps/red-ui/src/assets/icons/general/close_icon.svg create mode 100644 apps/red-ui/src/assets/icons/general/plus_icon.svg create mode 100644 apps/red-ui/src/assets/keycloak/silent-check-sso.html create mode 100644 assets/styles/page-layout.scss create mode 100644 assets/styles/red-dialog.scss create mode 100644 assets/styles/red-input.scss create mode 100644 assets/styles/red-material-theme.scss create mode 100644 assets/styles/red-mixins.scss create mode 100644 assets/styles/red-text-styles.scss create mode 100644 assets/styles/red-theme.scss create mode 100644 assets/styles/red-variables.scss create mode 100644 libs/red-ui-http/README.md create mode 100644 libs/red-ui-http/src/index.ts create mode 100644 libs/red-ui-http/src/lib/api.module.ts create mode 100644 libs/red-ui-http/src/lib/api/api.ts create mode 100644 libs/red-ui-http/src/lib/api/debugController.service.ts create mode 100644 libs/red-ui-http/src/lib/api/dictionaryController.service.ts create mode 100644 libs/red-ui-http/src/lib/api/fileUploadController.service.ts create mode 100644 libs/red-ui-http/src/lib/api/licenseReportController.service.ts create mode 100644 libs/red-ui-http/src/lib/api/manualRedactionController.service.ts create mode 100644 libs/red-ui-http/src/lib/api/pdfMetaDataConfigurationController.service.ts create mode 100644 libs/red-ui-http/src/lib/api/projectController.service.ts create mode 100644 libs/red-ui-http/src/lib/api/reanalysisController.service.ts create mode 100644 libs/red-ui-http/src/lib/api/redactionLogController.service.ts create mode 100644 libs/red-ui-http/src/lib/api/rulesController.service.ts create mode 100644 libs/red-ui-http/src/lib/api/statusController.service.ts create mode 100644 libs/red-ui-http/src/lib/configuration.ts create mode 100644 libs/red-ui-http/src/lib/encoder.ts create mode 100644 libs/red-ui-http/src/lib/index.ts create mode 100644 libs/red-ui-http/src/lib/model/body.ts create mode 100644 libs/red-ui-http/src/lib/model/body1.ts create mode 100644 libs/red-ui-http/src/lib/model/body2.ts create mode 100644 libs/red-ui-http/src/lib/model/body3.ts create mode 100644 libs/red-ui-http/src/lib/model/body4.ts create mode 100644 libs/red-ui-http/src/lib/model/body5.ts create mode 100644 libs/red-ui-http/src/lib/model/body6.ts create mode 100644 libs/red-ui-http/src/lib/model/defaultColor.ts create mode 100644 libs/red-ui-http/src/lib/model/dictionary.ts create mode 100644 libs/red-ui-http/src/lib/model/fileIds.ts create mode 100644 libs/red-ui-http/src/lib/model/fileStatus.ts create mode 100644 libs/red-ui-http/src/lib/model/inputStream.ts create mode 100644 libs/red-ui-http/src/lib/model/licenseReport.ts create mode 100644 libs/red-ui-http/src/lib/model/licenseReportRequest.ts create mode 100644 libs/red-ui-http/src/lib/model/manualRedactionEntry.ts create mode 100644 libs/red-ui-http/src/lib/model/manualRedactions.ts create mode 100644 libs/red-ui-http/src/lib/model/modelFile.ts create mode 100644 libs/red-ui-http/src/lib/model/models.ts create mode 100644 libs/red-ui-http/src/lib/model/pdfMetaData.ts create mode 100644 libs/red-ui-http/src/lib/model/point.ts create mode 100644 libs/red-ui-http/src/lib/model/project.ts create mode 100644 libs/red-ui-http/src/lib/model/projectRequest.ts create mode 100644 libs/red-ui-http/src/lib/model/rectangle.ts create mode 100644 libs/red-ui-http/src/lib/model/redactionLog.ts create mode 100644 libs/red-ui-http/src/lib/model/redactionLogEntry.ts create mode 100644 libs/red-ui-http/src/lib/model/reportData.ts create mode 100644 libs/red-ui-http/src/lib/model/resource.ts create mode 100644 libs/red-ui-http/src/lib/model/rules.ts create mode 100644 libs/red-ui-http/src/lib/model/typeResponse.ts create mode 100644 libs/red-ui-http/src/lib/model/typeValue.ts create mode 100644 libs/red-ui-http/src/lib/model/uRI.ts create mode 100644 libs/red-ui-http/src/lib/model/uRL.ts create mode 100644 libs/red-ui-http/src/lib/model/uRLStreamHandler.ts create mode 100644 libs/red-ui-http/src/lib/variables.ts create mode 100644 libs/red-ui-http/tsconfig.json create mode 100644 libs/red-ui-http/tsconfig.lib.json create mode 100644 libs/red-ui-http/tslint.json diff --git a/apps/red-ui/src/app/app-config/app-config.service.ts b/apps/red-ui/src/app/app-config/app-config.service.ts new file mode 100644 index 000000000..3228fa25b --- /dev/null +++ b/apps/red-ui/src/app/app-config/app-config.service.ts @@ -0,0 +1,35 @@ +import {Injectable} from "@angular/core"; +import {HttpClient} from "@angular/common/http"; +import {tap} from "rxjs/operators"; +import {Observable} from "rxjs"; + + +export enum AppConfigKey { + KEYCLOAK_URL = "KEYCLOAK_URL", + KEYCLOAK_REALM = "KEYCLOAK_REALM", + KEYCLOAK_CLIENT_ID = "KEYCLOAK_CLIENT_ID", + API_URL = "API_URL", +} + +@Injectable({ + providedIn: 'root' +}) +export class AppConfigService { + + private _config: { [key in AppConfigKey]?: any } = {}; + + constructor(private readonly _httpClient: HttpClient) { + } + + loadAppConfig(): Observable { + return this._httpClient.get("/assets/config/config.json").pipe(tap(config => { + this._config = config; + })); + } + + + getConfig(key: AppConfigKey, defaultValue?: any) { + return this._config[key] ? this._config[key] : defaultValue; + } + +} diff --git a/apps/red-ui/src/app/app.component.html b/apps/red-ui/src/app/app.component.html index ac4cb6ef3..0680b43f9 100644 --- a/apps/red-ui/src/app/app.component.html +++ b/apps/red-ui/src/app/app.component.html @@ -1,120 +1 @@ -
- Nx logo -

Welcome to {{ title }}!

-
-
-

Resources & Tools

-

- Thank you for using and showing some ♥ for Nx. -

- -

- Here are some links to help you get started. -

- -

Next Steps

-

Here are some things you can do with Nx.

-
- Add UI library -
-# Generate UI lib
-ng g @nrwl/angular:lib ui
-
-# Add a component
-ng g @nrwl/angular:component xyz --project ui
-
-
- View dependency graph -
nx dep-graph
-
-
- Run affected commands -
-# see what's been affected by changes
-ng affected:dep-graph
-
-# run tests for current changes
-ng affected:test
-
-# run e2e tests for current changes
-ng affected:e2e
-
-
-
- diff --git a/apps/red-ui/src/app/app.component.scss b/apps/red-ui/src/app/app.component.scss index f222adffa..e69de29bb 100644 --- a/apps/red-ui/src/app/app.component.scss +++ b/apps/red-ui/src/app/app.component.scss @@ -1,133 +0,0 @@ -/* - * Remove template code below - */ -:host { - display: block; - font-family: sans-serif; - min-width: 300px; - max-width: 600px; - margin: 50px auto; -} - -.gutter-left { - margin-left: 9px; -} - -.col-span-2 { - grid-column: span 2; -} - -.flex { - display: flex; - align-items: center; - justify-content: center; -} - -header { - background-color: #143055; - color: white; - padding: 5px; - border-radius: 3px; -} - -main { - padding: 0 36px; -} - -p { - text-align: center; -} - -h1 { - text-align: center; - margin-left: 18px; - font-size: 24px; -} - -h2 { - text-align: center; - font-size: 20px; - margin: 40px 0 10px 0; -} - -.resources { - text-align: center; - list-style: none; - padding: 0; - display: grid; - grid-gap: 9px; - grid-template-columns: 1fr 1fr; -} - -.resource { - color: #0094ba; - height: 36px; - background-color: rgba(0, 0, 0, 0); - border: 1px solid rgba(0, 0, 0, 0.12); - border-radius: 4px; - padding: 3px 9px; - text-decoration: none; -} - -.resource:hover { - background-color: rgba(68, 138, 255, 0.04); -} - -pre { - padding: 9px; - border-radius: 4px; - background-color: black; - color: #eee; -} - -details { - border-radius: 4px; - color: #333; - background-color: rgba(0, 0, 0, 0); - border: 1px solid rgba(0, 0, 0, 0.12); - padding: 3px 9px; - margin-bottom: 9px; -} - -summary { - cursor: pointer; - outline: none; - height: 36px; - line-height: 36px; -} - -.github-star-container { - margin-top: 12px; - line-height: 20px; -} - -.github-star-container a { - display: flex; - align-items: center; - text-decoration: none; - color: #333; -} - -.github-star-badge { - color: #24292e; - display: flex; - align-items: center; - font-size: 12px; - padding: 3px 10px; - border: 1px solid rgba(27, 31, 35, 0.2); - border-radius: 3px; - background-image: linear-gradient(-180deg, #fafbfc, #eff3f6 90%); - margin-left: 4px; - font-weight: 600; -} - -.github-star-badge:hover { - background-image: linear-gradient(-180deg, #f0f3f6, #e6ebf1 90%); - border-color: rgba(27, 31, 35, 0.35); - background-position: -0.5em; -} -.github-star-badge .material-icons { - height: 16px; - width: 16px; - margin-right: 4px; -} diff --git a/apps/red-ui/src/app/app.component.spec.ts b/apps/red-ui/src/app/app.component.spec.ts deleted file mode 100644 index 3d5eb42e6..000000000 --- a/apps/red-ui/src/app/app.component.spec.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { TestBed, async } from '@angular/core/testing'; -import { AppComponent } from './app.component'; -import { RouterTestingModule } from '@angular/router/testing'; - -describe('AppComponent', () => { - beforeEach(async(() => { - TestBed.configureTestingModule({ - imports: [RouterTestingModule], - declarations: [AppComponent], - }).compileComponents(); - })); - - it('should create the app', () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app).toBeTruthy(); - }); - - it(`should have as title 'red-ui'`, () => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.componentInstance; - expect(app.title).toEqual('red-ui'); - }); - - it('should render title', () => { - const fixture = TestBed.createComponent(AppComponent); - fixture.detectChanges(); - const compiled = fixture.nativeElement; - expect(compiled.querySelector('h1').textContent).toContain( - 'Welcome to red-ui!' - ); - }); -}); diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts index e79dff570..667488f85 100644 --- a/apps/red-ui/src/app/app.module.ts +++ b/apps/red-ui/src/app/app.module.ts @@ -1,16 +1,99 @@ -import { BrowserModule } from '@angular/platform-browser'; -import { NgModule } from '@angular/core'; +import {BrowserModule} from '@angular/platform-browser'; +import {APP_INITIALIZER, NgModule} from '@angular/core'; -import { AppComponent } from './app.component'; -import { RouterModule } from '@angular/router'; +import {AppComponent} from './app.component'; +import {RouterModule} from '@angular/router'; +import {BrowserAnimationsModule} from "@angular/platform-browser/animations"; +import {ReactiveFormsModule} from "@angular/forms"; +import {HTTP_INTERCEPTORS, HttpClient, HttpClientModule} from "@angular/common/http"; +import {KeycloakAuthModule} from "./keycloak-auth/keycloak-auth.module"; +import {BaseScreenComponent} from './screens/base-screen/base-screen.component'; +import {ProjectListingScreenComponent} from './screens/project-listing-screen/project-listing-screen.component'; +import {ProjectOverviewScreenComponent} from './screens/project-overview-screen/project-overview-screen.component'; +import {MatToolbarModule} from "@angular/material/toolbar"; +import {RedKeycloakAuthGuard} from "./keycloak-auth/red-keycloak-auth.guard"; +import {KeycloakService} from "keycloak-angular"; +import {ApiModule} from "@redaction/red-ui-http"; +import {ApiPathInterceptorService} from "./interceptor/api-path-interceptor.service"; +import {MatButtonModule} from "@angular/material/button"; +import {TranslateModule, TranslateLoader} from '@ngx-translate/core'; +import {TranslateHttpLoader} from '@ngx-translate/http-loader'; +import {MatMenuModule} from "@angular/material/menu"; +import {languageInitializer} from "./i18n/language.initializer"; +import {LanguageService} from "./i18n/language.service"; +import {MatIconModule} from "@angular/material/icon"; +import {IconsModule} from "./icons/icons.module"; +import {AddEditProjectDialogComponent} from './screens/project-listing-screen/add-edit-project-dialog/add-edit-project-dialog.component'; +import {MatDialogModule} from '@angular/material/dialog'; +import {MatSnackBarModule} from "@angular/material/snack-bar"; +import {MatTooltipModule} from "@angular/material/tooltip"; + +export function HttpLoaderFactory(httpClient: HttpClient) { + return new TranslateHttpLoader(httpClient, '/assets/i18n/', '.json'); +} @NgModule({ - declarations: [AppComponent], + declarations: [AppComponent, BaseScreenComponent, ProjectListingScreenComponent, ProjectOverviewScreenComponent, AddEditProjectDialogComponent], imports: [ BrowserModule, - RouterModule.forRoot([], { initialNavigation: 'enabled' }), + BrowserAnimationsModule, + ReactiveFormsModule, + HttpClientModule, + KeycloakAuthModule, + IconsModule, + ApiModule, + MatDialogModule, + TranslateModule.forRoot({ + loader: { + provide: TranslateLoader, + useFactory: HttpLoaderFactory, + deps: [HttpClient] + } + }), + RouterModule.forRoot([ + { + path: '', + redirectTo: 'ui/projects', + pathMatch: 'full', + }, + { + path: 'ui', + component: BaseScreenComponent, + children: [ + { + path: 'projects', + component: ProjectListingScreenComponent, + canActivate: [RedKeycloakAuthGuard] + }, + { + path: 'projects/:id', + component: ProjectOverviewScreenComponent, + canActivate: [RedKeycloakAuthGuard] + } + ] + } + + ]), + MatToolbarModule, + MatButtonModule, + MatMenuModule, + MatIconModule, + MatTooltipModule, + MatSnackBarModule ], - providers: [], + providers: [{ + provide: KeycloakService, + }, { + provide: HTTP_INTERCEPTORS, + multi: true, + useClass: ApiPathInterceptorService, + }, { + provide: APP_INITIALIZER, + multi: true, + useFactory: languageInitializer, + deps: [LanguageService] + }], bootstrap: [AppComponent], }) -export class AppModule {} +export class AppModule { +} diff --git a/apps/red-ui/src/app/i18n/language.initializer.ts b/apps/red-ui/src/app/i18n/language.initializer.ts new file mode 100644 index 000000000..3f780e549 --- /dev/null +++ b/apps/red-ui/src/app/i18n/language.initializer.ts @@ -0,0 +1,5 @@ +import {LanguageService} from "./language.service"; + +export function languageInitializer(languageService: LanguageService) { + return () => languageService.chooseAndSetInitialLanguage(); +} diff --git a/apps/red-ui/src/app/i18n/language.service.ts b/apps/red-ui/src/app/i18n/language.service.ts new file mode 100644 index 000000000..f806dbbc8 --- /dev/null +++ b/apps/red-ui/src/app/i18n/language.service.ts @@ -0,0 +1,36 @@ +import {Injectable} from '@angular/core'; +import {TranslateService} from '@ngx-translate/core'; + +@Injectable({ + providedIn: "root" +}) +export class LanguageService { + constructor( + private translateService: TranslateService + ) { + translateService.addLangs(['en', 'de']); + } + + chooseAndSetInitialLanguage() { + let defaultLang: string; + const localStorageLang = localStorage.getItem('redaction.language'); + const browserLang = this.translateService.getBrowserLang(); + // @ts-ignore + if (this.translateService.getLangs().includes(localStorageLang)) { + defaultLang = localStorageLang; + // @ts-ignore + } else if (this.translateService.getLangs().includes(browserLang)) { + defaultLang = browserLang; + } else { + defaultLang = 'en'; + } + document.documentElement.lang = defaultLang; + this.translateService.setDefaultLang(defaultLang); + this.translateService.use(defaultLang).subscribe(() => { + }); + } + + get currentLanguage() { + return this.translateService.currentLang; + } +} diff --git a/apps/red-ui/src/app/icons/icons.module.ts b/apps/red-ui/src/app/icons/icons.module.ts new file mode 100644 index 000000000..dd95c2bb9 --- /dev/null +++ b/apps/red-ui/src/app/icons/icons.module.ts @@ -0,0 +1,30 @@ +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {MatIconModule, MatIconRegistry} from '@angular/material/icon'; +import {DomSanitizer} from '@angular/platform-browser'; + +@NgModule({ + imports: [CommonModule, MatIconModule], + declarations: [], + exports: [MatIconModule] +}) +export class IconsModule { + constructor( + private iconRegistry: MatIconRegistry, + private sanitizer: DomSanitizer + ) { + iconRegistry.addSvgIconInNamespace( + 'red', + 'plus', + sanitizer.bypassSecurityTrustResourceUrl('/assets/icons/general/plus_icon.svg') + ); + iconRegistry.addSvgIconInNamespace( + 'red', + 'close', + sanitizer.bypassSecurityTrustResourceUrl('/assets/icons/general/close_icon.svg') + ); + + } + + +} diff --git a/apps/red-ui/src/app/interceptor/api-path-interceptor.service.ts b/apps/red-ui/src/app/interceptor/api-path-interceptor.service.ts new file mode 100644 index 000000000..d436ab4ac --- /dev/null +++ b/apps/red-ui/src/app/interceptor/api-path-interceptor.service.ts @@ -0,0 +1,24 @@ +import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http'; +import {Injectable} from '@angular/core'; +import {Observable} from 'rxjs'; +import {AppConfigKey, AppConfigService} from "../app-config/app-config.service"; + +@Injectable() +export class ApiPathInterceptorService implements HttpInterceptor { + + constructor(private readonly _appConfigService: AppConfigService) { + } + + intercept(req: HttpRequest, next: HttpHandler): Observable> { + + if (req.url.startsWith('/redaction-gateway-v1')) { + const updatedRequest = req.clone({ + url: this._appConfigService.getConfig(AppConfigKey.API_URL) + req.url + }) + + return next.handle(updatedRequest); + } else { + return next.handle(req); + } + } +} diff --git a/apps/red-ui/src/app/keycloak-auth/keycloak-auth.module.ts b/apps/red-ui/src/app/keycloak-auth/keycloak-auth.module.ts new file mode 100644 index 000000000..b2d087a1d --- /dev/null +++ b/apps/red-ui/src/app/keycloak-auth/keycloak-auth.module.ts @@ -0,0 +1,25 @@ +import {APP_INITIALIZER, NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {KeycloakAngularModule, KeycloakService} from "keycloak-angular"; +import {keycloakInitializer} from "./keycloak.initializer"; +import {AppConfigService} from "../app-config/app-config.service"; + + +@NgModule({ + declarations: [], + imports: [ + CommonModule, + KeycloakAngularModule + ], + providers: [ + AppConfigService, + { + provide: APP_INITIALIZER, + useFactory: keycloakInitializer, + multi: true, + deps: [KeycloakService, AppConfigService], + }, + ], +}) +export class KeycloakAuthModule { +} diff --git a/apps/red-ui/src/app/keycloak-auth/keycloak.initializer.ts b/apps/red-ui/src/app/keycloak-auth/keycloak.initializer.ts new file mode 100644 index 000000000..01f789634 --- /dev/null +++ b/apps/red-ui/src/app/keycloak-auth/keycloak.initializer.ts @@ -0,0 +1,25 @@ +import {KeycloakService} from "keycloak-angular"; +import {AppConfigKey, AppConfigService} from "../app-config/app-config.service"; + + +export function keycloakInitializer(keycloak: KeycloakService, appConfigService: AppConfigService) { + return () => { + return appConfigService.loadAppConfig().toPromise().then(() => { + return keycloak.init({ + config: { + url: appConfigService.getConfig(AppConfigKey.KEYCLOAK_URL), + realm: appConfigService.getConfig(AppConfigKey.KEYCLOAK_REALM), + clientId: appConfigService.getConfig(AppConfigKey.KEYCLOAK_CLIENT_ID) + }, + initOptions: { + checkLoginIframe: false, + onLoad: 'check-sso', + silentCheckSsoRedirectUri: + window.location.origin + '/assets/keycloak/silent-check-sso.html', + flow: 'standard' + }, + enableBearerInterceptor: true, + }) + }); + } +} diff --git a/apps/red-ui/src/app/keycloak-auth/red-keycloak-auth.guard.ts b/apps/red-ui/src/app/keycloak-auth/red-keycloak-auth.guard.ts new file mode 100644 index 000000000..4a56f31a6 --- /dev/null +++ b/apps/red-ui/src/app/keycloak-auth/red-keycloak-auth.guard.ts @@ -0,0 +1,31 @@ +import {KeycloakAuthGuard, KeycloakService} from "keycloak-angular"; +import {Injectable} from "@angular/core"; +import {ActivatedRouteSnapshot, Router, RouterStateSnapshot} from "@angular/router"; +import {of} from "rxjs"; +import {delay} from "rxjs/operators"; + +@Injectable({ + providedIn: 'root', +}) +export class RedKeycloakAuthGuard extends KeycloakAuthGuard { + constructor( + protected readonly _router: Router, + protected readonly _keycloak: KeycloakService + ) { + super(_router, _keycloak); + } + + public async isAccessAllowed( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot + ) { + + if (!this.authenticated) { + await this._keycloak.login({ + redirectUri: window.location.origin + state.url, + }); + } + + return true; + } +} diff --git a/apps/red-ui/src/app/notification/notification.service.ts b/apps/red-ui/src/app/notification/notification.service.ts new file mode 100644 index 000000000..d97ff9f80 --- /dev/null +++ b/apps/red-ui/src/app/notification/notification.service.ts @@ -0,0 +1,18 @@ +import {Injectable} from "@angular/core"; +import {MatSnackBar} from "@angular/material/snack-bar"; + + +@Injectable({ + providedIn: 'root' +}) +export class NotificationService { + constructor(private readonly _snackBar: MatSnackBar) { + } + + showToastNotification(message: string) { + this._snackBar.open(message, null, { + duration: 5000 + }); + } + +} diff --git a/apps/red-ui/src/app/screens/base-screen/base-screen.component.html b/apps/red-ui/src/app/screens/base-screen/base-screen.component.html new file mode 100644 index 000000000..19ca00af0 --- /dev/null +++ b/apps/red-ui/src/app/screens/base-screen/base-screen.component.html @@ -0,0 +1,20 @@ +
+
+ + +
+
+
+
+
+ +
+
diff --git a/apps/red-ui/src/app/screens/base-screen/base-screen.component.scss b/apps/red-ui/src/app/screens/base-screen/base-screen.component.scss new file mode 100644 index 000000000..e5cff8149 --- /dev/null +++ b/apps/red-ui/src/app/screens/base-screen/base-screen.component.scss @@ -0,0 +1,40 @@ +@import "../../../../../../assets/styles/red-variables"; + +.red-top-bar { + height: 61px; + width: 100%; + max-height: 61px; + display: flex; + flex-direction: column; + + .top-bar-row { + height: 60px; + display: flex; + justify-content: space-between; + padding-left: 60px; + padding-right: 60px; + + .menu { + display: flex; + align-items: center; + } + } + + .divider { + height: 1px; + opacity: 0.15; + background-color: $grey-1; + } +} + +.red-content { + width: 100vw; + height: calc(100vh - 61px); + overflow: auto; + max-width: 1100px; + margin: 0 auto; + + .red-content-inner { + padding: 40px 40px; + } +} diff --git a/apps/red-ui/src/app/screens/base-screen/base-screen.component.ts b/apps/red-ui/src/app/screens/base-screen/base-screen.component.ts new file mode 100644 index 000000000..6db3bbf98 --- /dev/null +++ b/apps/red-ui/src/app/screens/base-screen/base-screen.component.ts @@ -0,0 +1,20 @@ +import { Component, OnInit } from '@angular/core'; +import {UserService} from "../../user/user.service"; + +@Component({ + selector: 'redaction-base-screen', + templateUrl: './base-screen.component.html', + styleUrls: ['./base-screen.component.scss'] +}) +export class BaseScreenComponent implements OnInit { + + constructor(private readonly _userService: UserService) { } + + ngOnInit(): void { + } + + async logout() { + await this._userService.logout(); + } + +} diff --git a/apps/red-ui/src/app/screens/project-listing-screen/add-edit-project-dialog/add-edit-project-dialog.component.html b/apps/red-ui/src/app/screens/project-listing-screen/add-edit-project-dialog/add-edit-project-dialog.component.html new file mode 100644 index 000000000..edf406ad5 --- /dev/null +++ b/apps/red-ui/src/app/screens/project-listing-screen/add-edit-project-dialog/add-edit-project-dialog.component.html @@ -0,0 +1,30 @@ +
+ +
+ +
+ +
+ +
+
+ + +
+
+ + +
+
+ +
+ + +
+
+
diff --git a/apps/red-ui/src/app/screens/project-listing-screen/add-edit-project-dialog/add-edit-project-dialog.component.scss b/apps/red-ui/src/app/screens/project-listing-screen/add-edit-project-dialog/add-edit-project-dialog.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/apps/red-ui/src/app/screens/project-listing-screen/add-edit-project-dialog/add-edit-project-dialog.component.ts b/apps/red-ui/src/app/screens/project-listing-screen/add-edit-project-dialog/add-edit-project-dialog.component.ts new file mode 100644 index 000000000..d25ffd7b5 --- /dev/null +++ b/apps/red-ui/src/app/screens/project-listing-screen/add-edit-project-dialog/add-edit-project-dialog.component.ts @@ -0,0 +1,57 @@ +import {Component, Inject, OnInit} from '@angular/core'; +import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog"; +import {Project, ProjectControllerService} from "@redaction/red-ui-http"; +import {FormBuilder, FormGroup, Validators} from "@angular/forms"; +import {NotificationService} from "../../../notification/notification.service"; +import {TranslateService} from "@ngx-translate/core"; + +@Component({ + selector: 'redaction-add-edit-project-dialog', + templateUrl: './add-edit-project-dialog.component.html', + styleUrls: ['./add-edit-project-dialog.component.scss'] +}) +export class AddEditProjectDialogComponent implements OnInit { + + projectForm: FormGroup; + + constructor( + private readonly _projectControllerService: ProjectControllerService, + private readonly _translateService: TranslateService, + private readonly _notificationService: NotificationService, + private readonly _formBuilder: FormBuilder, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public project: Project) { + } + + ngOnInit(): void { + this.projectForm = this._formBuilder.group({ + projectName: [this.project?.projectName, Validators.required], + description: [this.project?.description] + }); + + } + + saveProject() { + const project: Project = this._formToObject(); + if (this.project?.projectId) { + this._projectControllerService.updateProject(project, this.project.projectId).subscribe(() => { + this.dialogRef.close(); + }, () => { + this._notificationService.showToastNotification(this._translateService.instant('projects.add-edit-dialog.errors.save')); + }) + } else { + this._projectControllerService.createProject(project).subscribe(() => { + this.dialogRef.close(); + }, () => { + this._notificationService.showToastNotification(this._translateService.instant('projects.add-edit-dialog.errors.save')); + }) + } + } + + private _formToObject(): Project { + return { + projectName: this.projectForm.get('projectName').value, + description: this.projectForm.get('description').value, + } + } +} diff --git a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html new file mode 100644 index 000000000..e79ffc9bd --- /dev/null +++ b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html @@ -0,0 +1,20 @@ + + + +
+
+
+
+ {{project.projectName}} +
+
+ {{project.description}} +
+
+
+ + + diff --git a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.scss b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.scss new file mode 100644 index 000000000..e43ff3dcf --- /dev/null +++ b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.scss @@ -0,0 +1,57 @@ +@import "../../../../../../assets/styles/red-mixins"; + + +.project-listing { + display: inline-flex; + + flex-wrap: wrap; + + .project { + box-sizing: border-box; + height: 122px; + width: 260px; + border: 1px solid $grey-1; + border-radius: 2px; + background-color: $white; + padding: 24px; + margin-right: 22px; + margin-bottom: 22px; + + transition: background-color 0.35s ease-in-out; + + &:hover { + background-color: $grey-1; + cursor: pointer; + * { + color: $white !important; + } + } + + .project-name { + height: 44px; + color: #283241; + font-family: Inter, sans-serf, serif; + font-size: 18px; + font-weight: bold; + letter-spacing: 0; + margin-bottom: 17px; + line-height: 22px; + @include line-clamp(2); + transition: color 0.35s ease-in-out; + + } + + .project-description { + height: 12px; + opacity: 0.7; + color: #283241; + font-family: Inconsolata, monospace, monospace; + font-size: 12px; + letter-spacing: 0; + line-height: 12px; + @include line-clamp(1); + transition: color 0.35s ease-in-out; + } + } + +} diff --git a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts new file mode 100644 index 000000000..465f6de15 --- /dev/null +++ b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.ts @@ -0,0 +1,39 @@ +import {Component, OnInit} from '@angular/core'; +import {Project, ProjectControllerService} from "@redaction/red-ui-http"; +import {Observable} from "rxjs"; +import {MatDialog} from "@angular/material/dialog"; +import {AddEditProjectDialogComponent} from "./add-edit-project-dialog/add-edit-project-dialog.component"; + +@Component({ + selector: 'redaction-project-listing-screen', + templateUrl: './project-listing-screen.component.html', + styleUrls: ['./project-listing-screen.component.scss'] +}) +export class ProjectListingScreenComponent implements OnInit { + + projects$: Observable; + + constructor(private readonly _projectControllerService: ProjectControllerService, private readonly _dialog: MatDialog) { + } + + ngOnInit(): void { + this._reloadProjects(); + } + + openAddProjectDialog(): void { + const dialogRef = this._dialog.open(AddEditProjectDialogComponent, { + width: '400px', + maxWidth: '90vw', + autoFocus: false + }); + + dialogRef.afterClosed().subscribe(result => { + this._reloadProjects(); + }); + } + + private _reloadProjects() { + this.projects$ = this._projectControllerService.getProjects(); + } + +} diff --git a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html b/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html new file mode 100644 index 000000000..fe70ac3ef --- /dev/null +++ b/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html @@ -0,0 +1 @@ +

project-overview-screen works!

diff --git a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.scss b/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.ts b/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.ts new file mode 100644 index 000000000..06eb44984 --- /dev/null +++ b/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'redaction-project-overview-screen', + templateUrl: './project-overview-screen.component.html', + styleUrls: ['./project-overview-screen.component.scss'] +}) +export class ProjectOverviewScreenComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/apps/red-ui/src/app/user/user.service.ts b/apps/red-ui/src/app/user/user.service.ts new file mode 100644 index 000000000..c05b3df70 --- /dev/null +++ b/apps/red-ui/src/app/user/user.service.ts @@ -0,0 +1,17 @@ +import {Injectable} from "@angular/core"; +import {KeycloakService} from "keycloak-angular"; + +@Injectable({ + providedIn: 'root' +}) +export class UserService { + + constructor(private _keycloakService: KeycloakService) { + } + + async logout() { + await this._keycloakService.logout(); + } + + +} diff --git a/apps/red-ui/src/assets/config/config.json b/apps/red-ui/src/assets/config/config.json new file mode 100644 index 000000000..6d9fccc45 --- /dev/null +++ b/apps/red-ui/src/assets/config/config.json @@ -0,0 +1,6 @@ +{ + "KEYCLOAK_URL": "https://keycloak-dev.iqser.cloud/auth", + "KEYCLOAK_REALM": "dev", + "KEYCLOAK_CLIENT_ID": "gin-client", + "API_URL": "http://ingress.redaction-timo.178.63.47.73.xip.io" +} diff --git a/apps/red-ui/src/assets/i18n/de.json b/apps/red-ui/src/assets/i18n/de.json new file mode 100644 index 000000000..e69de29bb diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json new file mode 100644 index 000000000..3d4d1f0f8 --- /dev/null +++ b/apps/red-ui/src/assets/i18n/en.json @@ -0,0 +1,49 @@ +{ + "top-bar": { + "navigation-items": { + "projects": { + "label": "Projects" + }, + "my-account": { + "label": "My Account", + "children": { + "logout": { + "label": "Logout" + } + } + } + } + }, + "projects": { + "add-edit-dialog": { + "header-new": { + "label": "New Project" + }, + "header-edit": { + "label": "New Project" + }, + "form": { + "description": { + "label": "Description" + }, + "name": { + "label": "Name" + } + }, + "actions": { + "save": { + "label": "Save Project" + } + } + }, + "header": { + "label": "Projects" + }, + "add-new": { + "label": "New Project" + }, + "no-projects": { + "label": "You currently have no projects. You can start your work by creating a new one!" + } + } +} diff --git a/apps/red-ui/src/assets/icons/general/close_icon.svg b/apps/red-ui/src/assets/icons/general/close_icon.svg new file mode 100755 index 000000000..ac4dfa8e6 --- /dev/null +++ b/apps/red-ui/src/assets/icons/general/close_icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/apps/red-ui/src/assets/icons/general/plus_icon.svg b/apps/red-ui/src/assets/icons/general/plus_icon.svg new file mode 100644 index 000000000..b1ed70906 --- /dev/null +++ b/apps/red-ui/src/assets/icons/general/plus_icon.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/apps/red-ui/src/assets/keycloak/silent-check-sso.html b/apps/red-ui/src/assets/keycloak/silent-check-sso.html new file mode 100644 index 000000000..9de338b30 --- /dev/null +++ b/apps/red-ui/src/assets/keycloak/silent-check-sso.html @@ -0,0 +1,7 @@ + + + + + diff --git a/apps/red-ui/src/index.html b/apps/red-ui/src/index.html index f484cbe50..b951bff9c 100644 --- a/apps/red-ui/src/index.html +++ b/apps/red-ui/src/index.html @@ -2,7 +2,7 @@ - RedUiApp + Redaction diff --git a/apps/red-ui/src/styles.scss b/apps/red-ui/src/styles.scss index 90d4ee007..23f4a6862 100644 --- a/apps/red-ui/src/styles.scss +++ b/apps/red-ui/src/styles.scss @@ -1 +1,2 @@ /* You can add global styles to this file, and also import other style files */ +@import "../../../assets/styles/red-theme"; diff --git a/assets/styles/page-layout.scss b/assets/styles/page-layout.scss new file mode 100644 index 000000000..17bc3f38f --- /dev/null +++ b/assets/styles/page-layout.scss @@ -0,0 +1,13 @@ +html, body { + margin: 0; + padding: 0; + height: 100vh; + font-family: 'Inter', sans-serif; +} + +.page-header{ + display: flex; + justify-content: space-between; + align-items: center; + padding-bottom: 40px; +} diff --git a/assets/styles/red-dialog.scss b/assets/styles/red-dialog.scss new file mode 100644 index 000000000..3fc5ed717 --- /dev/null +++ b/assets/styles/red-dialog.scss @@ -0,0 +1,28 @@ +.dialog { + position: relative; + min-height: 80px; + + .dialog-close { + position: absolute; + top: -15px; + right: -10px; + + mat-icon { + width: 12px; + height: 12px; + } + } + + .dialog-header { + padding-bottom: 12px; + } + + .dialog-content { + padding-top: 12px; + padding-bottom: 12px; + } + + .dialog-actions { + padding-top: 12px; + } +} diff --git a/assets/styles/red-input.scss b/assets/styles/red-input.scss new file mode 100644 index 000000000..520ab9bd0 --- /dev/null +++ b/assets/styles/red-input.scss @@ -0,0 +1,37 @@ +@import "red-variables"; + +.red-input-group { + + display: flex; + flex-direction: column; + margin-top: 5px; + margin-bottom: 8px; + + label { + height: 14px; + opacity: 0.6; + color: $grey-1; + font-size: 11px; + font-weight: 500; + letter-spacing: 0; + line-height: 14px; + margin-bottom: 5px; + } + + input { + box-sizing: border-box; + padding-left: 11px; + padding-right: 11px; + height: 34px; + width: 300px; + border: 1px solid $grey-3; + opacity: 0.4; + border-radius: 2px; + background-color: #FFFFFF; + outline: none; + + :focus { + border-color: $grey-1; + } + } +} diff --git a/assets/styles/red-material-theme.scss b/assets/styles/red-material-theme.scss new file mode 100644 index 000000000..58583c8b3 --- /dev/null +++ b/assets/styles/red-material-theme.scss @@ -0,0 +1,54 @@ +@import '~@angular/material/theming'; +@import 'red-variables'; + +@include mat-core(); + +$grey-1-palette: ( + default: $grey-1, + lighter: lighten($grey-1, 15%), + darker: darken($grey-1, 15%), + text: $grey-1, + contrast: ( + default: $white, + lighter: $white, + darker: $white + ) +); + +$grey-2-palette: ( + default: $grey-2, + lighter: lighten($grey-2, 15%), + darker: darken($grey-2, 15%), + text: $grey-2, + contrast: ( + default: $grey-1, + lighter: $grey-1, + darker: $grey-1 + ) +); + +$red-palette: ( + default: $red-1, + lighter: lighten($red-1, 15%), + darker: darken($red-1, 15%), + text: $red-1, + contrast: ( + default: $white, + lighter: $white, + darker: $white + ) +); + +$gn-next-primary: mat-palette($grey-1-palette, default, lighter, darker, text); +$gn-next-secondary: mat-palette($grey-2-palette, default, lighter, darker, text); +$gn-next-warning: mat-palette($red-palette, default, lighter, darker, text); + +$gn-next-mat-theme: mat-light-theme(( + color: ( + primary: $gn-next-primary, + accent: $gn-next-secondary, + warn: $gn-next-warning, + ) +)); + +@include angular-material-theme($gn-next-mat-theme); diff --git a/assets/styles/red-mixins.scss b/assets/styles/red-mixins.scss new file mode 100644 index 000000000..9a2460661 --- /dev/null +++ b/assets/styles/red-mixins.scss @@ -0,0 +1,9 @@ +@import 'red-variables'; + +@mixin line-clamp($lines) { + display: -webkit-box; + -webkit-line-clamp: $lines; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; +} diff --git a/assets/styles/red-text-styles.scss b/assets/styles/red-text-styles.scss new file mode 100644 index 000000000..e263b2d0a --- /dev/null +++ b/assets/styles/red-text-styles.scss @@ -0,0 +1,27 @@ +@import "red-variables"; + +button { + font-family: Inconsolata, monospace !important; + font-weight: 700 !important; +} + +.heading-xl { + height: 39px; + width: 130px; + color: $grey-1; + font-family: Inter, sans-serf; + font-size: 32px; + font-weight: bold; + letter-spacing: 0; + line-height: 39px; +} + +.heading-l{ + height: 22px; + color: #283241; + font-family: Inter, sans-serf; + font-size: 18px; + font-weight: bold; + letter-spacing: 0; + line-height: 22px; +} diff --git a/assets/styles/red-theme.scss b/assets/styles/red-theme.scss new file mode 100644 index 000000000..2c2861c5a --- /dev/null +++ b/assets/styles/red-theme.scss @@ -0,0 +1,7 @@ +@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@300;400;500;700&display=swap'); +@import "red-material-theme"; +@import "page-layout"; +@import "red-text-styles"; +@import "red-dialog"; +@import "red-input"; diff --git a/assets/styles/red-variables.scss b/assets/styles/red-variables.scss new file mode 100644 index 000000000..0f16efd88 --- /dev/null +++ b/assets/styles/red-variables.scss @@ -0,0 +1,12 @@ +$white: #FFF; +$black: #000; + +$grey-1: #283241; +$grey-2: #ECECEE; +$grey-3: #aaacb3; + +$blue-1: #4875F7; +$red-1: #F65757; +$yellow-1: #FFB83B; +$green-1: #46CE7D; + diff --git a/libs/red-ui-http/README.md b/libs/red-ui-http/README.md new file mode 100644 index 000000000..881159917 --- /dev/null +++ b/libs/red-ui-http/README.md @@ -0,0 +1,7 @@ +# red-ui-http + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test red-ui-http` to execute the unit tests. diff --git a/libs/red-ui-http/src/index.ts b/libs/red-ui-http/src/index.ts new file mode 100644 index 000000000..11aece60c --- /dev/null +++ b/libs/red-ui-http/src/index.ts @@ -0,0 +1 @@ +export * from './lib/index'; diff --git a/libs/red-ui-http/src/lib/api.module.ts b/libs/red-ui-http/src/lib/api.module.ts new file mode 100644 index 000000000..4655954f7 --- /dev/null +++ b/libs/red-ui-http/src/lib/api.module.ts @@ -0,0 +1,53 @@ +import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core'; +import { Configuration } from './configuration'; +import { HttpClient } from '@angular/common/http'; + + +import { DebugControllerService } from './api/debugController.service'; +import { DictionaryControllerService } from './api/dictionaryController.service'; +import { FileUploadControllerService } from './api/fileUploadController.service'; +import { LicenseReportControllerService } from './api/licenseReportController.service'; +import { ManualRedactionControllerService } from './api/manualRedactionController.service'; +import { PdfMetaDataConfigurationControllerService } from './api/pdfMetaDataConfigurationController.service'; +import { ProjectControllerService } from './api/projectController.service'; +import { ReanalysisControllerService } from './api/reanalysisController.service'; +import { RedactionLogControllerService } from './api/redactionLogController.service'; +import { RulesControllerService } from './api/rulesController.service'; +import { StatusControllerService } from './api/statusController.service'; + +@NgModule({ + imports: [], + declarations: [], + exports: [], + providers: [ + DebugControllerService, + DictionaryControllerService, + FileUploadControllerService, + LicenseReportControllerService, + ManualRedactionControllerService, + PdfMetaDataConfigurationControllerService, + ProjectControllerService, + ReanalysisControllerService, + RedactionLogControllerService, + RulesControllerService, + StatusControllerService ] +}) +export class ApiModule { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + return { + ngModule: ApiModule, + providers: [ { provide: Configuration, useFactory: configurationFactory } ] + }; + } + + constructor( @Optional() @SkipSelf() parentModule: ApiModule, + @Optional() http: HttpClient) { + if (parentModule) { + throw new Error('ApiModule is already loaded. Import in your base AppModule only.'); + } + if (!http) { + throw new Error('You need to import the HttpClientModule in your AppModule! \n' + + 'See also https://github.com/angular/angular/issues/20575'); + } + } +} diff --git a/libs/red-ui-http/src/lib/api/api.ts b/libs/red-ui-http/src/lib/api/api.ts new file mode 100644 index 000000000..b1a1c6188 --- /dev/null +++ b/libs/red-ui-http/src/lib/api/api.ts @@ -0,0 +1,23 @@ +export * from './debugController.service'; +import { DebugControllerService } from './debugController.service'; +export * from './dictionaryController.service'; +import { DictionaryControllerService } from './dictionaryController.service'; +export * from './fileUploadController.service'; +import { FileUploadControllerService } from './fileUploadController.service'; +export * from './licenseReportController.service'; +import { LicenseReportControllerService } from './licenseReportController.service'; +export * from './manualRedactionController.service'; +import { ManualRedactionControllerService } from './manualRedactionController.service'; +export * from './pdfMetaDataConfigurationController.service'; +import { PdfMetaDataConfigurationControllerService } from './pdfMetaDataConfigurationController.service'; +export * from './projectController.service'; +import { ProjectControllerService } from './projectController.service'; +export * from './reanalysisController.service'; +import { ReanalysisControllerService } from './reanalysisController.service'; +export * from './redactionLogController.service'; +import { RedactionLogControllerService } from './redactionLogController.service'; +export * from './rulesController.service'; +import { RulesControllerService } from './rulesController.service'; +export * from './statusController.service'; +import { StatusControllerService } from './statusController.service'; +export const APIS = [DebugControllerService, DictionaryControllerService, FileUploadControllerService, LicenseReportControllerService, ManualRedactionControllerService, PdfMetaDataConfigurationControllerService, ProjectControllerService, ReanalysisControllerService, RedactionLogControllerService, RulesControllerService, StatusControllerService]; diff --git a/libs/red-ui-http/src/lib/api/debugController.service.ts b/libs/red-ui-http/src/lib/api/debugController.service.ts new file mode 100644 index 000000000..95d758aa9 --- /dev/null +++ b/libs/red-ui-http/src/lib/api/debugController.service.ts @@ -0,0 +1,370 @@ +/** + * Api Documentation + * Api Documentation + * + * 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, HttpHeaders, HttpParams, + HttpResponse, HttpEvent } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; + +import { Observable } from 'rxjs'; + + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +@Injectable() +export class DebugControllerService { + + 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 it with its classified elements visualized for debugging. + * None + * @param file + * @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 debugClassificationsForm(file: Blob, inline?: boolean, observe?: 'body', reportProgress?: boolean): Observable; + public debugClassificationsForm(file: Blob, inline?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; + public debugClassificationsForm(file: Blob, inline?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; + public debugClassificationsForm(file: Blob, inline?: boolean, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (file === null || file === undefined) { + throw new Error('Required parameter file was null or undefined when calling debugClassifications.'); + } + + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (inline !== undefined && inline !== null) { + queryParameters = queryParameters.set('inline', inline); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let httpHeaderAccepts: string[] = [ + 'application/octet-stream' + ]; + 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; + let 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/debug/classification`, + { + body: convertFormParamsToString ? formParams.toString() : formParams, + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Receives an uploaded file and returns a html file with its extracted tables for debugging. + * None + * @param file + * @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 debugHtmlTablesForm(file: Blob, inline?: boolean, observe?: 'body', reportProgress?: boolean): Observable; + public debugHtmlTablesForm(file: Blob, inline?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; + public debugHtmlTablesForm(file: Blob, inline?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; + public debugHtmlTablesForm(file: Blob, inline?: boolean, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (file === null || file === undefined) { + throw new Error('Required parameter file was null or undefined when calling debugHtmlTables.'); + } + + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (inline !== undefined && inline !== null) { + queryParameters = queryParameters.set('inline', inline); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let httpHeaderAccepts: string[] = [ + 'application/octet-stream' + ]; + 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; + let 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/debug/htmlTables`, + { + body: convertFormParamsToString ? formParams.toString() : formParams, + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Receives an uploaded file and returns it with its sections visualized for debugging. + * None + * @param file + * @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 debugSectionsForm(file: Blob, inline?: boolean, observe?: 'body', reportProgress?: boolean): Observable; + public debugSectionsForm(file: Blob, inline?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; + public debugSectionsForm(file: Blob, inline?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; + public debugSectionsForm(file: Blob, inline?: boolean, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (file === null || file === undefined) { + throw new Error('Required parameter file was null or undefined when calling debugSections.'); + } + + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (inline !== undefined && inline !== null) { + queryParameters = queryParameters.set('inline', inline); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let httpHeaderAccepts: string[] = [ + 'application/octet-stream' + ]; + 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; + let 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/debug/sections`, + { + body: convertFormParamsToString ? formParams.toString() : formParams, + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Receives an uploaded file and returns it redacted. + * None + * @param file + * @param inline inline + * @param flatRedaction flatRedaction + * @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 redactionForm(file: Blob, inline?: boolean, flatRedaction?: boolean, observe?: 'body', reportProgress?: boolean): Observable; + public redactionForm(file: Blob, inline?: boolean, flatRedaction?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; + public redactionForm(file: Blob, inline?: boolean, flatRedaction?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; + public redactionForm(file: Blob, inline?: boolean, flatRedaction?: boolean, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (file === null || file === undefined) { + throw new Error('Required parameter file was null or undefined when calling redaction.'); + } + + + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (inline !== undefined && inline !== null) { + queryParameters = queryParameters.set('inline', inline); + } + if (flatRedaction !== undefined && flatRedaction !== null) { + queryParameters = queryParameters.set('flatRedaction', flatRedaction); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let httpHeaderAccepts: string[] = [ + 'application/octet-stream' + ]; + 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; + let 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/debug/redaction`, + { + body: convertFormParamsToString ? formParams.toString() : formParams, + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/libs/red-ui-http/src/lib/api/dictionaryController.service.ts b/libs/red-ui-http/src/lib/api/dictionaryController.service.ts new file mode 100644 index 000000000..3f8a04337 --- /dev/null +++ b/libs/red-ui-http/src/lib/api/dictionaryController.service.ts @@ -0,0 +1,653 @@ +/** + * Api Documentation + * Api Documentation + * + * 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, HttpHeaders, HttpParams, + HttpResponse, HttpEvent } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; + +import { Observable } from 'rxjs'; + +import { DefaultColor } from '../model/defaultColor'; +import { Dictionary } from '../model/dictionary'; +import { TypeResponse } from '../model/typeResponse'; +import { TypeValue } from '../model/typeValue'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +@Injectable() +export class DictionaryControllerService { + + 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; + } + + + /** + * Add dictionary entries with entry type. + * None + * @param body entries + * @param type type + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addEntry(body: Array, type: string, observe?: 'body', reportProgress?: boolean): Observable; + public addEntry(body: Array, type: string, observe?: 'response', reportProgress?: boolean): Observable>; + public addEntry(body: Array, type: string, observe?: 'events', reportProgress?: boolean): Observable>; + public addEntry(body: Array, type: 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 addEntry.'); + } + + if (type === null || type === undefined) { + throw new Error('Required parameter type was null or undefined when calling addEntry.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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}/redaction-gateway-v1/dictionary/${encodeURIComponent(String(type))}`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Creates entry type with colors, hint and caseInsensitive + * None + * @param body typeValue + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public addType(body: TypeValue, observe?: 'body', reportProgress?: boolean): Observable; + public addType(body: TypeValue, observe?: 'response', reportProgress?: boolean): Observable>; + public addType(body: TypeValue, observe?: 'events', reportProgress?: boolean): Observable>; + public addType(body: TypeValue, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling addType.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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}/redaction-gateway-v1/dictionary/type`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Delete dictionary entries with entry type. + * None + * @param body entries + * @param type type + * @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(body: Array, type: string, observe?: 'body', reportProgress?: boolean): Observable; + public deleteEntry(body: Array, type: string, observe?: 'response', reportProgress?: boolean): Observable>; + public deleteEntry(body: Array, type: string, observe?: 'events', reportProgress?: boolean): Observable>; + public deleteEntry(body: Array, type: 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 deleteEntry.'); + } + + if (type === null || type === undefined) { + throw new Error('Required parameter type was null or undefined when calling deleteEntry.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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[] = [ + '*/*' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected != undefined) { + headers = headers.set('Content-Type', httpContentTypeSelected); + } + + return this.httpClient.request('delete',`${this.basePath}/redaction-gateway-v1/dictionary/${encodeURIComponent(String(type))}`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes entry type + * None + * @param type type + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public deleteType(type: string, observe?: 'body', reportProgress?: boolean): Observable; + public deleteType(type: string, observe?: 'response', reportProgress?: boolean): Observable>; + public deleteType(type: string, observe?: 'events', reportProgress?: boolean): Observable>; + public deleteType(type: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (type === null || type === undefined) { + throw new Error('Required parameter type was null or undefined when calling deleteType.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('delete',`${this.basePath}/redaction-gateway-v1/dictionary/type/${encodeURIComponent(String(type))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns file containing the the dictionary entries for given type.. + * + * @param type type + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public downloadDictionaryFile(type: string, observe?: 'body', reportProgress?: boolean): Observable; + public downloadDictionaryFile(type: string, observe?: 'response', reportProgress?: boolean): Observable>; + public downloadDictionaryFile(type: string, observe?: 'events', reportProgress?: boolean): Observable>; + public downloadDictionaryFile(type: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (type === null || type === undefined) { + throw new Error('Required parameter type was null or undefined when calling downloadDictionaryFile.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let httpHeaderAccepts: string[] = [ + 'application/octet-stream' + ]; + 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}/redaction-gateway-v1/dictionary/download/${encodeURIComponent(String(type))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Retrieve all entry types + * 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 getAllTypes(observe?: 'body', reportProgress?: boolean): Observable; + public getAllTypes(observe?: 'response', reportProgress?: boolean): Observable>; + public getAllTypes(observe?: 'events', reportProgress?: boolean): Observable>; + public getAllTypes(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('get',`${this.basePath}/redaction-gateway-v1/dictionary/type`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Retrieves default color for redaction. + * 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 getDefaultColor(observe?: 'body', reportProgress?: boolean): Observable; + public getDefaultColor(observe?: 'response', reportProgress?: boolean): Observable>; + public getDefaultColor(observe?: 'events', reportProgress?: boolean): Observable>; + public getDefaultColor(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('get',`${this.basePath}/redaction-gateway-v1/color`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Retrieves all dictionary entries of an entry type + * None + * @param type type + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDictionaryForType(type: string, observe?: 'body', reportProgress?: boolean): Observable; + public getDictionaryForType(type: string, observe?: 'response', reportProgress?: boolean): Observable>; + public getDictionaryForType(type: string, observe?: 'events', reportProgress?: boolean): Observable>; + public getDictionaryForType(type: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (type === null || type === undefined) { + throw new Error('Required parameter type was null or undefined when calling getDictionaryForType.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('get',`${this.basePath}/redaction-gateway-v1/dictionary/${encodeURIComponent(String(type))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Set system default color for redaction + * + * @param body defaultColor + * @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 setDefaultColor(body: DefaultColor, observe?: 'body', reportProgress?: boolean): Observable; + public setDefaultColor(body: DefaultColor, observe?: 'response', reportProgress?: boolean): Observable>; + public setDefaultColor(body: DefaultColor, observe?: 'events', reportProgress?: boolean): Observable>; + public setDefaultColor(body: DefaultColor, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling setDefaultColor.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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}/redaction-gateway-v1/color`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates colors, hint and caseInsensitive of an entry type. + * None + * @param body typeValue + * @param type type + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public updateType(body: TypeValue, type: string, observe?: 'body', reportProgress?: boolean): Observable; + public updateType(body: TypeValue, type: string, observe?: 'response', reportProgress?: boolean): Observable>; + public updateType(body: TypeValue, type: string, observe?: 'events', reportProgress?: boolean): Observable>; + public updateType(body: TypeValue, type: 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 updateType.'); + } + + if (type === null || type === undefined) { + throw new Error('Required parameter type was null or undefined when calling updateType.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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}/redaction-gateway-v1/dictionary/type/${encodeURIComponent(String(type))}`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Takes object containing string or rules as argument, which will be used by the redaction service. + * + * @param file + * @param type type + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public uploadDictionaryFileForm(file: Blob, type: string, observe?: 'body', reportProgress?: boolean): Observable; + public uploadDictionaryFileForm(file: Blob, type: string, observe?: 'response', reportProgress?: boolean): Observable>; + public uploadDictionaryFileForm(file: Blob, type: string, observe?: 'events', reportProgress?: boolean): Observable>; + public uploadDictionaryFileForm(file: Blob, type: 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 uploadDictionaryFile.'); + } + + if (type === null || type === undefined) { + throw new Error('Required parameter type was null or undefined when calling uploadDictionaryFile.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; + let useForm = false; + let 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/dictionary/upload/${encodeURIComponent(String(type))}`, + { + 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/fileUploadController.service.ts b/libs/red-ui-http/src/lib/api/fileUploadController.service.ts new file mode 100644 index 000000000..c2b354c19 --- /dev/null +++ b/libs/red-ui-http/src/lib/api/fileUploadController.service.ts @@ -0,0 +1,476 @@ +/** + * Api Documentation + * Api Documentation + * + * 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, HttpHeaders, HttpParams, + HttpResponse, HttpEvent } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; + +import { Observable } from 'rxjs'; + +import { FileIds } from '../model/fileIds'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +@Injectable() +export class FileUploadControllerService { + + 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; + } + + + /** + * Deletes a file for a given projectId and FileId + * None + * @param projectId projectId + * @param fileId fileId + * @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 deleteFile(projectId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; + public deleteFile(projectId: string, fileId: string, observe?: 'response', reportProgress?: boolean): Observable>; + public deleteFile(projectId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public deleteFile(projectId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (projectId === null || projectId === undefined) { + throw new Error('Required parameter projectId was null or undefined when calling deleteFile.'); + } + + if (fileId === null || fileId === undefined) { + throw new Error('Required parameter fileId was null or undefined when calling deleteFile.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('delete',`${this.basePath}/redaction-gateway-v1/delete/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns a downloadable byte stream of the annotated file with the specified fileId + * Use the optional \"inline\" request parameter to select, if this downloadAnnotated will be opened in the browser. + * @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 downloadAnnotatedFile(fileId: string, inline?: boolean, observe?: 'body', reportProgress?: boolean): Observable; + public downloadAnnotatedFile(fileId: string, inline?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; + public downloadAnnotatedFile(fileId: string, inline?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; + public downloadAnnotatedFile(fileId: string, inline?: boolean, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (fileId === null || fileId === undefined) { + throw new Error('Required parameter fileId was null or undefined when calling downloadAnnotatedFile.'); + } + + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (inline !== undefined && inline !== null) { + queryParameters = queryParameters.set('inline', inline); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let httpHeaderAccepts: string[] = [ + 'application/octet-stream' + ]; + 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}/redaction-gateway-v1/download/annotated/${encodeURIComponent(String(fileId))}`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns a downloadable byte stream of the original file with the specified fileId + * Use the optional \"inline\" request parameter to select, if this downloadAnnotated will be opened in the browser. + * @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 downloadOriginalFile(fileId: string, inline?: boolean, observe?: 'body', reportProgress?: boolean): Observable; + public downloadOriginalFile(fileId: string, inline?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; + public downloadOriginalFile(fileId: string, inline?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; + public downloadOriginalFile(fileId: string, inline?: boolean, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (fileId === null || fileId === undefined) { + throw new Error('Required parameter fileId was null or undefined when calling downloadOriginalFile.'); + } + + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (inline !== undefined && inline !== null) { + queryParameters = queryParameters.set('inline', inline); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let httpHeaderAccepts: string[] = [ + 'application/octet-stream' + ]; + 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}/redaction-gateway-v1/download/original/${encodeURIComponent(String(fileId))}`, + { + 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 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(fileId: string, inline?: boolean, observe?: 'body', reportProgress?: boolean): Observable; + public downloadRedactedFile(fileId: string, inline?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; + public downloadRedactedFile(fileId: string, inline?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; + public downloadRedactedFile(fileId: string, inline?: boolean, observe: any = 'body', reportProgress: boolean = false ): Observable { + + 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); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let httpHeaderAccepts: string[] = [ + 'application/octet-stream' + ]; + 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}/redaction-gateway-v1/download/redacted/${encodeURIComponent(String(fileId))}`, + { + 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 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 downloadRedactionReport(body: FileIds, inline?: boolean, observe?: 'body', reportProgress?: boolean): Observable; + public downloadRedactionReport(body: FileIds, inline?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; + public downloadRedactionReport(body: FileIds, inline?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; + public downloadRedactionReport(body: FileIds, 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 downloadRedactionReport.'); + } + + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (inline !== undefined && inline !== null) { + queryParameters = queryParameters.set('inline', inline); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let httpHeaderAccepts: string[] = [ + 'application/octet-stream' + ]; + 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}/redaction-gateway-v1/download/report`, + { + 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 project + * Use the optional \"inline\" request parameter to select, if this report will be opened in the browser. + * @param projectId The projectId + * @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 downloadRedactionReportForProject(projectId: string, inline?: boolean, observe?: 'body', reportProgress?: boolean): Observable; + public downloadRedactionReportForProject(projectId: string, inline?: boolean, observe?: 'response', reportProgress?: boolean): Observable>; + public downloadRedactionReportForProject(projectId: string, inline?: boolean, observe?: 'events', reportProgress?: boolean): Observable>; + public downloadRedactionReportForProject(projectId: string, inline?: boolean, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (projectId === null || projectId === undefined) { + throw new Error('Required parameter projectId was null or undefined when calling downloadRedactionReportForProject.'); + } + + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (inline !== undefined && inline !== null) { + queryParameters = queryParameters.set('inline', inline); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let httpHeaderAccepts: string[] = [ + 'application/octet-stream' + ]; + 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}/redaction-gateway-v1/download/report/${encodeURIComponent(String(projectId))}`, + { + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Receives an uploaded file and returns its fileId. + * None + * @param file + * @param projectId The projectId, 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, projectId: string, observe?: 'body', reportProgress?: boolean): Observable; + public uploadFileForm(file: Blob, projectId: string, observe?: 'response', reportProgress?: boolean): Observable>; + public uploadFileForm(file: Blob, projectId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public uploadFileForm(file: Blob, projectId: 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 (projectId === null || projectId === undefined) { + throw new Error('Required parameter projectId was null or undefined when calling uploadFile.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; + let useForm = false; + let 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(projectId))}`, + { + 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/licenseReportController.service.ts b/libs/red-ui-http/src/lib/api/licenseReportController.service.ts new file mode 100644 index 000000000..a0171e25a --- /dev/null +++ b/libs/red-ui-http/src/lib/api/licenseReportController.service.ts @@ -0,0 +1,127 @@ +/** + * Api Documentation + * Api Documentation + * + * 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, HttpHeaders, HttpParams, + HttpResponse, HttpEvent } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; + +import { Observable } from 'rxjs'; + +import { LicenseReport } from '../model/licenseReport'; +import { LicenseReportRequest } from '../model/licenseReportRequest'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +@Injectable() +export class LicenseReportControllerService { + + 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; + } + + + /** + * Creates and serves license report. + * None + * @param body reportRequest + * @param offset offset + * @param limit limit + * @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 licenseReport(body: LicenseReportRequest, offset?: number, limit?: number, observe?: 'body', reportProgress?: boolean): Observable; + public licenseReport(body: LicenseReportRequest, offset?: number, limit?: number, observe?: 'response', reportProgress?: boolean): Observable>; + public licenseReport(body: LicenseReportRequest, offset?: number, limit?: number, observe?: 'events', reportProgress?: boolean): Observable>; + public licenseReport(body: LicenseReportRequest, offset?: number, limit?: number, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling licenseReport.'); + } + + + + let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()}); + if (offset !== undefined && offset !== null) { + queryParameters = queryParameters.set('offset', offset); + } + if (limit !== undefined && limit !== null) { + queryParameters = queryParameters.set('limit', limit); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('post',`${this.basePath}/redaction-gateway-v1/report/license`, + { + body: body, + params: queryParameters, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/libs/red-ui-http/src/lib/api/manualRedactionController.service.ts b/libs/red-ui-http/src/lib/api/manualRedactionController.service.ts new file mode 100644 index 000000000..dbd24cfc3 --- /dev/null +++ b/libs/red-ui-http/src/lib/api/manualRedactionController.service.ts @@ -0,0 +1,176 @@ +/** + * Api Documentation + * Api Documentation + * + * 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, HttpHeaders, HttpParams, + HttpResponse, HttpEvent } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; + +import { Observable } from 'rxjs'; + +import { ManualRedactions } from '../model/manualRedactions'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +@Injectable() +export class ManualRedactionControllerService { + + 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; + } + + + /** + * Returns the manual redactions + * None + * @param projectId projectId + * @param fileId fileId + * @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 getManualRedaction(projectId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; + public getManualRedaction(projectId: string, fileId: string, observe?: 'response', reportProgress?: boolean): Observable>; + public getManualRedaction(projectId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public getManualRedaction(projectId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (projectId === null || projectId === undefined) { + throw new Error('Required parameter projectId was null or undefined when calling getManualRedaction.'); + } + + if (fileId === null || fileId === undefined) { + throw new Error('Required parameter fileId was null or undefined when calling getManualRedaction.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('get',`${this.basePath}/redaction-gateway-v1/manualRedaction/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates the manual redactions + * None + * @param body manualRedactions + * @param projectId projectId + * @param fileId fileId + * @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 updateManualRedaction(body: ManualRedactions, projectId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; + public updateManualRedaction(body: ManualRedactions, projectId: string, fileId: string, observe?: 'response', reportProgress?: boolean): Observable>; + public updateManualRedaction(body: ManualRedactions, projectId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public updateManualRedaction(body: ManualRedactions, projectId: string, fileId: 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 updateManualRedaction.'); + } + + if (projectId === null || projectId === undefined) { + throw new Error('Required parameter projectId was null or undefined when calling updateManualRedaction.'); + } + + if (fileId === null || fileId === undefined) { + throw new Error('Required parameter fileId was null or undefined when calling updateManualRedaction.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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}/redaction-gateway-v1/manualRedaction/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/libs/red-ui-http/src/lib/api/pdfMetaDataConfigurationController.service.ts b/libs/red-ui-http/src/lib/api/pdfMetaDataConfigurationController.service.ts new file mode 100644 index 000000000..161ecf805 --- /dev/null +++ b/libs/red-ui-http/src/lib/api/pdfMetaDataConfigurationController.service.ts @@ -0,0 +1,156 @@ +/** + * Api Documentation + * Api Documentation + * + * 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, HttpHeaders, HttpParams, + HttpResponse, HttpEvent } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; + +import { Observable } from 'rxjs'; + +import { PdfMetaData } from '../model/pdfMetaData'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +@Injectable() +export class PdfMetaDataConfigurationControllerService { + + 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 the currently configured meta data that will be included in the redacted pdf. + * 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 getPdfMetaData(observe?: 'body', reportProgress?: boolean): Observable; + public getPdfMetaData(observe?: 'response', reportProgress?: boolean): Observable>; + public getPdfMetaData(observe?: 'events', reportProgress?: boolean): Observable>; + public getPdfMetaData(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('get',`${this.basePath}/redaction-gateway-v1/metaData`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Configured which meta data will be included in the redacted pdf. + * None + * @param body pdfMetaData + * @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 setPdfMetaData(body: PdfMetaData, observe?: 'body', reportProgress?: boolean): Observable; + public setPdfMetaData(body: PdfMetaData, observe?: 'response', reportProgress?: boolean): Observable>; + public setPdfMetaData(body: PdfMetaData, observe?: 'events', reportProgress?: boolean): Observable>; + public setPdfMetaData(body: PdfMetaData, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling setPdfMetaData.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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}/redaction-gateway-v1/metaData`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/libs/red-ui-http/src/lib/api/projectController.service.ts b/libs/red-ui-http/src/lib/api/projectController.service.ts new file mode 100644 index 000000000..d8fc7b4ab --- /dev/null +++ b/libs/red-ui-http/src/lib/api/projectController.service.ts @@ -0,0 +1,315 @@ +/** + * Api Documentation + * Api Documentation + * + * 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, HttpHeaders, HttpParams, + HttpResponse, HttpEvent } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; + +import { Observable } from 'rxjs'; + +import { Project } from '../model/project'; +import { ProjectRequest } from '../model/projectRequest'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +@Injectable() +export class ProjectControllerService { + + 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; + } + + + /** + * Creates a new project. + * None + * @param body projectRequest + * @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 createProject(body: ProjectRequest, observe?: 'body', reportProgress?: boolean): Observable; + public createProject(body: ProjectRequest, observe?: 'response', reportProgress?: boolean): Observable>; + public createProject(body: ProjectRequest, observe?: 'events', reportProgress?: boolean): Observable>; + public createProject(body: ProjectRequest, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling createProject.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('post',`${this.basePath}/redaction-gateway-v1/project`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Deletes an existing project. + * None + * @param projectId projectId + * @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 deleteProject(projectId: string, observe?: 'body', reportProgress?: boolean): Observable; + public deleteProject(projectId: string, observe?: 'response', reportProgress?: boolean): Observable>; + public deleteProject(projectId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public deleteProject(projectId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (projectId === null || projectId === undefined) { + throw new Error('Required parameter projectId was null or undefined when calling deleteProject.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('delete',`${this.basePath}/redaction-gateway-v1/project/${encodeURIComponent(String(projectId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Gets an existing project. + * None + * @param projectId projectId + * @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 getProject(projectId: string, observe?: 'body', reportProgress?: boolean): Observable; + public getProject(projectId: string, observe?: 'response', reportProgress?: boolean): Observable>; + public getProject(projectId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public getProject(projectId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (projectId === null || projectId === undefined) { + throw new Error('Required parameter projectId was null or undefined when calling getProject.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('get',`${this.basePath}/redaction-gateway-v1/project/${encodeURIComponent(String(projectId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Gets all existing projects. + * 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 getProjects(observe?: 'body', reportProgress?: boolean): Observable>; + public getProjects(observe?: 'response', reportProgress?: boolean): Observable>>; + public getProjects(observe?: 'events', reportProgress?: boolean): Observable>>; + public getProjects(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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>('get',`${this.basePath}/redaction-gateway-v1/project`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Updates an existing project. + * None + * @param body projectRequest + * @param projectId projectId + * @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 updateProject(body: ProjectRequest, projectId: string, observe?: 'body', reportProgress?: boolean): Observable; + public updateProject(body: ProjectRequest, projectId: string, observe?: 'response', reportProgress?: boolean): Observable>; + public updateProject(body: ProjectRequest, projectId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public updateProject(body: ProjectRequest, projectId: 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 updateProject.'); + } + + if (projectId === null || projectId === undefined) { + throw new Error('Required parameter projectId was null or undefined when calling updateProject.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('post',`${this.basePath}/redaction-gateway-v1/project/${encodeURIComponent(String(projectId))}`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/libs/red-ui-http/src/lib/api/reanalysisController.service.ts b/libs/red-ui-http/src/lib/api/reanalysisController.service.ts new file mode 100644 index 000000000..b5d49b807 --- /dev/null +++ b/libs/red-ui-http/src/lib/api/reanalysisController.service.ts @@ -0,0 +1,158 @@ +/** + * Api Documentation + * Api Documentation + * + * 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, HttpHeaders, HttpParams, + HttpResponse, HttpEvent } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; + +import { Observable } from 'rxjs'; + + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +@Injectable() +export class ReanalysisControllerService { + + 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; + } + + + /** + * Reanalyse a file + * None + * @param projectId projectId + * @param fileId fileId + * @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 reanalyseFile(projectId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable; + public reanalyseFile(projectId: string, fileId: string, observe?: 'response', reportProgress?: boolean): Observable>; + public reanalyseFile(projectId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public reanalyseFile(projectId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (projectId === null || projectId === undefined) { + throw new Error('Required parameter projectId was null or undefined when calling reanalyseFile.'); + } + + if (fileId === null || fileId === undefined) { + throw new Error('Required parameter fileId was null or undefined when calling reanalyseFile.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('post',`${this.basePath}/redaction-gateway-v1/reanalyse/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Reanalyse all files of the project. + * None + * @param projectId projectId + * @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 reanalyseProject(projectId: string, observe?: 'body', reportProgress?: boolean): Observable; + public reanalyseProject(projectId: string, observe?: 'response', reportProgress?: boolean): Observable>; + public reanalyseProject(projectId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public reanalyseProject(projectId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (projectId === null || projectId === undefined) { + throw new Error('Required parameter projectId was null or undefined when calling reanalyseProject.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('post',`${this.basePath}/redaction-gateway-v1/reanalyse/${encodeURIComponent(String(projectId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/libs/red-ui-http/src/lib/api/redactionLogController.service.ts b/libs/red-ui-http/src/lib/api/redactionLogController.service.ts new file mode 100644 index 000000000..f975e95ae --- /dev/null +++ b/libs/red-ui-http/src/lib/api/redactionLogController.service.ts @@ -0,0 +1,107 @@ +/** + * Api Documentation + * Api Documentation + * + * 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, HttpHeaders, HttpParams, + HttpResponse, HttpEvent } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; + +import { Observable } from 'rxjs'; + +import { RedactionLog } from '../model/redactionLog'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +@Injectable() +export class RedactionLogControllerService { + + 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; + } + + + /** + * Gets the redaction log for a fileId + * None + * @param fileId fileId + * @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 getRedactionLog(fileId: string, observe?: 'body', reportProgress?: boolean): Observable; + public getRedactionLog(fileId: string, observe?: 'response', reportProgress?: boolean): Observable>; + public getRedactionLog(fileId: string, observe?: 'events', reportProgress?: boolean): Observable>; + public getRedactionLog(fileId: 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 getRedactionLog.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('get',`${this.basePath}/redaction-gateway-v1/redactionLog/${encodeURIComponent(String(fileId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/libs/red-ui-http/src/lib/api/rulesController.service.ts b/libs/red-ui-http/src/lib/api/rulesController.service.ts new file mode 100644 index 000000000..13c7dfa38 --- /dev/null +++ b/libs/red-ui-http/src/lib/api/rulesController.service.ts @@ -0,0 +1,268 @@ +/** + * Api Documentation + * Api Documentation + * + * 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, HttpHeaders, HttpParams, + HttpResponse, HttpEvent } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; + +import { Observable } from 'rxjs'; + +import { Rules } from '../model/rules'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +@Injectable() +export class RulesControllerService { + + 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; + } + + + /** + * Returns object containing the currently used Drools rules. + * + * @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 downloadRules(observe?: 'body', reportProgress?: boolean): Observable; + public downloadRules(observe?: 'response', reportProgress?: boolean): Observable>; + public downloadRules(observe?: 'events', reportProgress?: boolean): Observable>; + public downloadRules(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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('get',`${this.basePath}/redaction-gateway-v1/rules`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Returns file containing the currently used Drools rules. + * + * @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 downloadRulesFile(observe?: 'body', reportProgress?: boolean): Observable; + public downloadRulesFile(observe?: 'response', reportProgress?: boolean): Observable>; + public downloadRulesFile(observe?: 'events', reportProgress?: boolean): Observable>; + public downloadRulesFile(observe: any = 'body', reportProgress: boolean = false ): Observable { + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let httpHeaderAccepts: string[] = [ + 'application/octet-stream' + ]; + 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}/redaction-gateway-v1/rules/download`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Takes object containing string or rules as argument, which will be used by the redaction service. + * + * @param body rules + * @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 uploadRules(body: Rules, observe?: 'body', reportProgress?: boolean): Observable; + public uploadRules(body: Rules, observe?: 'response', reportProgress?: boolean): Observable>; + public uploadRules(body: Rules, observe?: 'events', reportProgress?: boolean): Observable>; + public uploadRules(body: Rules, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (body === null || body === undefined) { + throw new Error('Required parameter body was null or undefined when calling uploadRules.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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}/redaction-gateway-v1/rules`, + { + body: body, + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + + /** + * Takes object containing string or rules as argument, which will be used by the redaction service. + * + * @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 uploadRulesFileForm(file: Blob, observe?: 'body', reportProgress?: boolean): Observable; + public uploadRulesFileForm(file: Blob, observe?: 'response', reportProgress?: boolean): Observable>; + public uploadRulesFileForm(file: Blob, observe?: 'events', reportProgress?: boolean): Observable>; + public uploadRulesFileForm(file: Blob, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (file === null || file === undefined) { + throw new Error('Required parameter file was null or undefined when calling uploadRulesFile.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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[] = [ + 'multipart/form-data' + ]; + + const canConsumeForm = this.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): void; }; + let useForm = false; + let 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/rules/upload`, + { + 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/statusController.service.ts b/libs/red-ui-http/src/lib/api/statusController.service.ts new file mode 100644 index 000000000..0b455e95c --- /dev/null +++ b/libs/red-ui-http/src/lib/api/statusController.service.ts @@ -0,0 +1,107 @@ +/** + * Api Documentation + * Api Documentation + * + * 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, HttpHeaders, HttpParams, + HttpResponse, HttpEvent } from '@angular/common/http'; +import { CustomHttpUrlEncodingCodec } from '../encoder'; + +import { Observable } from 'rxjs'; + +import { FileStatus } from '../model/fileStatus'; + +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; + + +@Injectable() +export class StatusControllerService { + + 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; + } + + + /** + * Gets the status for all files in a project. + * None + * @param projectId The id of the project you want the status for. + * @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 getProjectStatus(projectId: string, observe?: 'body', reportProgress?: boolean): Observable>; + public getProjectStatus(projectId: string, observe?: 'response', reportProgress?: boolean): Observable>>; + public getProjectStatus(projectId: string, observe?: 'events', reportProgress?: boolean): Observable>>; + public getProjectStatus(projectId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + + if (projectId === null || projectId === undefined) { + throw new Error('Required parameter projectId was null or undefined when calling getProjectStatus.'); + } + + let headers = this.defaultHeaders; + + // authentication (GIN-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 + let 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>('get',`${this.basePath}/redaction-gateway-v1/status/${encodeURIComponent(String(projectId))}`, + { + withCredentials: this.configuration.withCredentials, + headers: headers, + observe: observe, + reportProgress: reportProgress + } + ); + } + +} diff --git a/libs/red-ui-http/src/lib/configuration.ts b/libs/red-ui-http/src/lib/configuration.ts new file mode 100644 index 000000000..82e8458f3 --- /dev/null +++ b/libs/red-ui-http/src/lib/configuration.ts @@ -0,0 +1,79 @@ +export interface ConfigurationParameters { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; +} + +export class Configuration { + apiKeys?: {[ key: string ]: string}; + username?: string; + password?: string; + accessToken?: string | (() => string); + basePath?: string; + withCredentials?: boolean; + + constructor(configurationParameters: ConfigurationParameters = {}) { + this.apiKeys = configurationParameters.apiKeys; + this.username = configurationParameters.username; + this.password = configurationParameters.password; + this.accessToken = configurationParameters.accessToken; + this.basePath = configurationParameters.basePath; + this.withCredentials = configurationParameters.withCredentials; + } + + /** + * Select the correct content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param contentTypes - the array of content types that are available for selection + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderContentType (contentTypes: string[]): string | undefined { + if (contentTypes.length == 0) { + return undefined; + } + + let type = contentTypes.find(x => this.isJsonMime(x)); + if (type === undefined) { + return contentTypes[0]; + } + return type; + } + + /** + * Select the correct accept content-type to use for a request. + * Uses {@link Configuration#isJsonMime} to determine the correct accept content-type. + * If no content type is found return the first found type if the contentTypes is not empty + * @param accepts - the array of content types that are available for selection. + * @returns the selected content-type or undefined if no selection could be made. + */ + public selectHeaderAccept(accepts: string[]): string | undefined { + if (accepts.length == 0) { + return undefined; + } + + let type = accepts.find(x => this.isJsonMime(x)); + if (type === undefined) { + return accepts[0]; + } + return type; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime != null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/libs/red-ui-http/src/lib/encoder.ts b/libs/red-ui-http/src/lib/encoder.ts new file mode 100644 index 000000000..f1c6b78c9 --- /dev/null +++ b/libs/red-ui-http/src/lib/encoder.ts @@ -0,0 +1,18 @@ + import { HttpUrlEncodingCodec } from '@angular/common/http'; + +/** +* CustomHttpUrlEncodingCodec +* Fix plus sign (+) not encoding, so sent as blank space +* See: https://github.com/angular/angular/issues/11058#issuecomment-247367318 +*/ +export class CustomHttpUrlEncodingCodec extends HttpUrlEncodingCodec { + encodeKey(k: string): string { + k = super.encodeKey(k); + return k.replace(/\+/gi, '%2B'); + } + encodeValue(v: string): string { + v = super.encodeValue(v); + return v.replace(/\+/gi, '%2B'); + } +} + diff --git a/libs/red-ui-http/src/lib/index.ts b/libs/red-ui-http/src/lib/index.ts new file mode 100644 index 000000000..c312b70fa --- /dev/null +++ b/libs/red-ui-http/src/lib/index.ts @@ -0,0 +1,5 @@ +export * from './api/api'; +export * from './model/models'; +export * from './variables'; +export * from './configuration'; +export * from './api.module'; \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/body.ts b/libs/red-ui-http/src/lib/model/body.ts new file mode 100644 index 000000000..6e6a7c8d6 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/body.ts @@ -0,0 +1,18 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 Body { + /** + * file + */ + file: Blob; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/body1.ts b/libs/red-ui-http/src/lib/model/body1.ts new file mode 100644 index 000000000..39e4198c9 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/body1.ts @@ -0,0 +1,18 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 Body1 { + /** + * file + */ + file: Blob; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/body2.ts b/libs/red-ui-http/src/lib/model/body2.ts new file mode 100644 index 000000000..9edd11640 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/body2.ts @@ -0,0 +1,18 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 Body2 { + /** + * file + */ + file: Blob; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/body3.ts b/libs/red-ui-http/src/lib/model/body3.ts new file mode 100644 index 000000000..30bd39f21 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/body3.ts @@ -0,0 +1,18 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 Body3 { + /** + * file + */ + file: Blob; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/body4.ts b/libs/red-ui-http/src/lib/model/body4.ts new file mode 100644 index 000000000..ae9f969ba --- /dev/null +++ b/libs/red-ui-http/src/lib/model/body4.ts @@ -0,0 +1,18 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 Body4 { + /** + * file + */ + file: Blob; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/body5.ts b/libs/red-ui-http/src/lib/model/body5.ts new file mode 100644 index 000000000..54f8fb64c --- /dev/null +++ b/libs/red-ui-http/src/lib/model/body5.ts @@ -0,0 +1,18 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 Body5 { + /** + * file + */ + file: Blob; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/body6.ts b/libs/red-ui-http/src/lib/model/body6.ts new file mode 100644 index 000000000..4e0e63aa0 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/body6.ts @@ -0,0 +1,18 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 Body6 { + /** + * file + */ + file: Blob; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/defaultColor.ts b/libs/red-ui-http/src/lib/model/defaultColor.ts new file mode 100644 index 000000000..cd23e3f7c --- /dev/null +++ b/libs/red-ui-http/src/lib/model/defaultColor.ts @@ -0,0 +1,15 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 DefaultColor { + color?: Array; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/dictionary.ts b/libs/red-ui-http/src/lib/model/dictionary.ts new file mode 100644 index 000000000..5e544a1be --- /dev/null +++ b/libs/red-ui-http/src/lib/model/dictionary.ts @@ -0,0 +1,33 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 a list of dictionary entries and colors of an entry type. + */ +export interface Dictionary { + /** + * True if the entries in this type should be matched case insensitively, default is false. + */ + caseInsensitive?: boolean; + /** + * The value of color should be in range of [0, 1]. + */ + color?: Array; + /** + * The list of dictionary entries of an entry type. + */ + entries?: Array; + /** + * True if the type just for hint, not for redaction, default is false. + */ + hint?: boolean; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/fileIds.ts b/libs/red-ui-http/src/lib/model/fileIds.ts new file mode 100644 index 000000000..f73266da6 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/fileIds.ts @@ -0,0 +1,15 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 FileIds { + fileIds?: Array; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/fileStatus.ts b/libs/red-ui-http/src/lib/model/fileStatus.ts new file mode 100644 index 000000000..b7243c82e --- /dev/null +++ b/libs/red-ui-http/src/lib/model/fileStatus.ts @@ -0,0 +1,35 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 FileStatus { + added?: string; + deleted?: string; + fileId?: string; + filename?: string; + lastUpdated?: string; + numberOfAnalyses?: number; + numberOfPages?: number; + projectId?: string; + status?: FileStatus.StatusEnum; +} +export namespace FileStatus { + export type StatusEnum = 'PROCESSING' | 'PROCESSED' | 'ERROR' | 'UNPROCESSED' | 'REPROCESS' | 'REVIEWED' | 'DELETED'; + export const StatusEnum = { + PROCESSING: 'PROCESSING' as StatusEnum, + PROCESSED: 'PROCESSED' as StatusEnum, + ERROR: 'ERROR' as StatusEnum, + UNPROCESSED: 'UNPROCESSED' as StatusEnum, + REPROCESS: 'REPROCESS' as StatusEnum, + REVIEWED: 'REVIEWED' as StatusEnum, + DELETED: 'DELETED' as StatusEnum + }; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/inputStream.ts b/libs/red-ui-http/src/lib/model/inputStream.ts new file mode 100644 index 000000000..7b5252aac --- /dev/null +++ b/libs/red-ui-http/src/lib/model/inputStream.ts @@ -0,0 +1,14 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 InputStream { +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/licenseReport.ts b/libs/red-ui-http/src/lib/model/licenseReport.ts new file mode 100644 index 000000000..175617506 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/licenseReport.ts @@ -0,0 +1,25 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 { ReportData } from './reportData'; + +export interface LicenseReport { + data?: Array; + endDate?: Date; + limit?: number; + numberOfAnalyses?: number; + numberOfAnalyzedFiles?: number; + numberOfAnalyzedPages?: number; + numberOfProjects?: number; + offset?: number; + requestId?: string; + startDate?: Date; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/licenseReportRequest.ts b/libs/red-ui-http/src/lib/model/licenseReportRequest.ts new file mode 100644 index 000000000..e56fe77c4 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/licenseReportRequest.ts @@ -0,0 +1,18 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 LicenseReportRequest { + endDate?: Date; + projectIds?: Array; + requestId?: string; + startDate?: Date; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/manualRedactionEntry.ts b/libs/red-ui-http/src/lib/model/manualRedactionEntry.ts new file mode 100644 index 000000000..56ae850fe --- /dev/null +++ b/libs/red-ui-http/src/lib/model/manualRedactionEntry.ts @@ -0,0 +1,19 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 { Rectangle } from './rectangle'; + +export interface ManualRedactionEntry { + positions?: Array; + reason?: string; + type?: string; + value?: string; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/manualRedactions.ts b/libs/red-ui-http/src/lib/model/manualRedactions.ts new file mode 100644 index 000000000..3823f1b7d --- /dev/null +++ b/libs/red-ui-http/src/lib/model/manualRedactions.ts @@ -0,0 +1,17 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 { ManualRedactionEntry } from './manualRedactionEntry'; + +export interface ManualRedactions { + entriesToAdd?: Array; + idsToRemove?: Array; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/modelFile.ts b/libs/red-ui-http/src/lib/model/modelFile.ts new file mode 100644 index 000000000..07694bfbd --- /dev/null +++ b/libs/red-ui-http/src/lib/model/modelFile.ts @@ -0,0 +1,33 @@ +/** + * Api Documentation + * Api Documentation + * + * 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; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/models.ts b/libs/red-ui-http/src/lib/model/models.ts new file mode 100644 index 000000000..6b34b35f4 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/models.ts @@ -0,0 +1,32 @@ +export * from './body'; +export * from './body1'; +export * from './body2'; +export * from './body3'; +export * from './body4'; +export * from './body5'; +export * from './body6'; +export * from './defaultColor'; +export * from './dictionary'; +export * from './fileIds'; +export * from './fileStatus'; +export * from './inputStream'; +export * from './licenseReport'; +export * from './licenseReportRequest'; +export * from './manualRedactionEntry'; +export * from './manualRedactions'; +export * from './modelFile'; +export * from './pdfMetaData'; +export * from './point'; +export * from './project'; +export * from './projectRequest'; +export * from './rectangle'; +export * from './redactionLog'; +export * from './redactionLogEntry'; +export * from './reportData'; +export * from './resource'; +export * from './rules'; +export * from './typeResponse'; +export * from './typeValue'; +export * from './uRI'; +export * from './uRL'; +export * from './uRLStreamHandler'; diff --git a/libs/red-ui-http/src/lib/model/pdfMetaData.ts b/libs/red-ui-http/src/lib/model/pdfMetaData.ts new file mode 100644 index 000000000..57b0a6b40 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/pdfMetaData.ts @@ -0,0 +1,22 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 PdfMetaData { + author?: boolean; + creationDate?: boolean; + creator?: boolean; + keywords?: boolean; + modDate?: boolean; + producer?: boolean; + subject?: boolean; + title?: boolean; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/point.ts b/libs/red-ui-http/src/lib/model/point.ts new file mode 100644 index 000000000..6c8bdf24d --- /dev/null +++ b/libs/red-ui-http/src/lib/model/point.ts @@ -0,0 +1,16 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 Point { + x?: number; + y?: number; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/project.ts b/libs/red-ui-http/src/lib/model/project.ts new file mode 100644 index 000000000..4630bf5cf --- /dev/null +++ b/libs/red-ui-http/src/lib/model/project.ts @@ -0,0 +1,26 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 Project { + date?: string; + description?: string; + projectId?: string; + projectName?: string; + status?: Project.StatusEnum; +} +export namespace Project { + export type StatusEnum = 'ACTIVE' | 'DELETED'; + export const StatusEnum = { + ACTIVE: 'ACTIVE' as StatusEnum, + DELETED: 'DELETED' as StatusEnum + }; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/projectRequest.ts b/libs/red-ui-http/src/lib/model/projectRequest.ts new file mode 100644 index 000000000..3cf27e2e7 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/projectRequest.ts @@ -0,0 +1,16 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 ProjectRequest { + description?: string; + projectName?: string; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/rectangle.ts b/libs/red-ui-http/src/lib/model/rectangle.ts new file mode 100644 index 000000000..18953c42c --- /dev/null +++ b/libs/red-ui-http/src/lib/model/rectangle.ts @@ -0,0 +1,19 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 { Point } from './point'; + +export interface Rectangle { + height?: number; + page?: number; + topLeft?: Point; + width?: number; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/redactionLog.ts b/libs/red-ui-http/src/lib/model/redactionLog.ts new file mode 100644 index 000000000..2c0817ac9 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/redactionLog.ts @@ -0,0 +1,19 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 { RedactionLogEntry } from './redactionLogEntry'; + +export interface RedactionLog { + dictionaryVersion?: number; + filename?: string; + redactionLogEntry?: Array; + rulesVersion?: number; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/redactionLogEntry.ts b/libs/red-ui-http/src/lib/model/redactionLogEntry.ts new file mode 100644 index 000000000..99a680f04 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/redactionLogEntry.ts @@ -0,0 +1,26 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 { Rectangle } from './rectangle'; + +export interface RedactionLogEntry { + color?: Array; + hint?: boolean; + id?: string; + manual?: boolean; + positions?: Array; + reason?: string; + redacted?: boolean; + section?: string; + sectionNumber?: number; + type?: string; + value?: string; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/reportData.ts b/libs/red-ui-http/src/lib/model/reportData.ts new file mode 100644 index 000000000..448cbd9fe --- /dev/null +++ b/libs/red-ui-http/src/lib/model/reportData.ts @@ -0,0 +1,34 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 ReportData { + addedDate?: Date; + analysisCount?: number; + deletedDate?: Date; + fileName?: string; + lastUpdatedDate?: Date; + numberOfAnalyzedPages?: number; + project?: string; + status?: ReportData.StatusEnum; +} +export namespace ReportData { + export type StatusEnum = 'PROCESSING' | 'PROCESSED' | 'ERROR' | 'UNPROCESSED' | 'REPROCESS' | 'REVIEWED' | 'DELETED'; + export const StatusEnum = { + PROCESSING: 'PROCESSING' as StatusEnum, + PROCESSED: 'PROCESSED' as StatusEnum, + ERROR: 'ERROR' as StatusEnum, + UNPROCESSED: 'UNPROCESSED' as StatusEnum, + REPROCESS: 'REPROCESS' as StatusEnum, + REVIEWED: 'REVIEWED' as StatusEnum, + DELETED: 'DELETED' as StatusEnum + }; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/resource.ts b/libs/red-ui-http/src/lib/model/resource.ts new file mode 100644 index 000000000..2e9dae12c --- /dev/null +++ b/libs/red-ui-http/src/lib/model/resource.ts @@ -0,0 +1,25 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 { InputStream } from './inputStream'; +import { URI } from './uRI'; +import { URL } from './uRL'; + +export interface Resource { + description?: string; + file?: any; + filename?: string; + inputStream?: InputStream; + open?: boolean; + readable?: boolean; + uri?: URI; + url?: URL; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/rules.ts b/libs/red-ui-http/src/lib/model/rules.ts new file mode 100644 index 000000000..fc1ccc55b --- /dev/null +++ b/libs/red-ui-http/src/lib/model/rules.ts @@ -0,0 +1,21 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 a string of Drools rules. + */ +export interface Rules { + /** + * The actual string of rules. + */ + rules?: string; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/typeResponse.ts b/libs/red-ui-http/src/lib/model/typeResponse.ts new file mode 100644 index 000000000..2d1801781 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/typeResponse.ts @@ -0,0 +1,22 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 { TypeValue } from './typeValue'; + +/** + * Object containing a list of values of an entry type. + */ +export interface TypeResponse { + /** + * The list of values of an entry type, which include colors, hint and caseInsensitive. + */ + types?: Array; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/typeValue.ts b/libs/red-ui-http/src/lib/model/typeValue.ts new file mode 100644 index 000000000..a883d0d6a --- /dev/null +++ b/libs/red-ui-http/src/lib/model/typeValue.ts @@ -0,0 +1,33 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 entry type with an array of r-g-b colors. + */ +export interface TypeValue { + /** + * True if the entries in this type should be matched case insensitively, default is false. + */ + caseInsensitive?: boolean; + /** + * The value of color should be in range of [0, 1]. + */ + color?: Array; + /** + * True if the type just for hint, not for redaction, default is false. + */ + hint?: boolean; + /** + * The nonnull entry type. + */ + type?: string; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/uRI.ts b/libs/red-ui-http/src/lib/model/uRI.ts new file mode 100644 index 000000000..9462e9006 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/uRI.ts @@ -0,0 +1,31 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 URI { + absolute?: boolean; + authority?: string; + fragment?: string; + host?: string; + opaque?: boolean; + path?: string; + port?: number; + query?: string; + rawAuthority?: string; + rawFragment?: string; + rawPath?: string; + rawQuery?: string; + rawSchemeSpecificPart?: string; + rawUserInfo?: string; + scheme?: string; + schemeSpecificPart?: string; + userInfo?: string; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/uRL.ts b/libs/red-ui-http/src/lib/model/uRL.ts new file mode 100644 index 000000000..8215868c4 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/uRL.ts @@ -0,0 +1,28 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 { URLStreamHandler } from './uRLStreamHandler'; + +export interface URL { + authority?: string; + content?: any; + defaultPort?: number; + deserializedFields?: URLStreamHandler; + file?: string; + host?: string; + path?: string; + port?: number; + protocol?: string; + query?: string; + ref?: string; + serializedHashCode?: number; + userInfo?: string; +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/model/uRLStreamHandler.ts b/libs/red-ui-http/src/lib/model/uRLStreamHandler.ts new file mode 100644 index 000000000..cc520dbc4 --- /dev/null +++ b/libs/red-ui-http/src/lib/model/uRLStreamHandler.ts @@ -0,0 +1,14 @@ +/** + * Api Documentation + * Api Documentation + * + * 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 URLStreamHandler { +} \ No newline at end of file diff --git a/libs/red-ui-http/src/lib/variables.ts b/libs/red-ui-http/src/lib/variables.ts new file mode 100644 index 000000000..6fe58549f --- /dev/null +++ b/libs/red-ui-http/src/lib/variables.ts @@ -0,0 +1,9 @@ +import { InjectionToken } from '@angular/core'; + +export const BASE_PATH = new InjectionToken('basePath'); +export const COLLECTION_FORMATS = { + 'csv': ',', + 'tsv': ' ', + 'ssv': ' ', + 'pipes': '|' +} diff --git a/libs/red-ui-http/tsconfig.json b/libs/red-ui-http/tsconfig.json new file mode 100644 index 000000000..62ebbd946 --- /dev/null +++ b/libs/red-ui-http/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/libs/red-ui-http/tsconfig.lib.json b/libs/red-ui-http/tsconfig.lib.json new file mode 100644 index 000000000..6d38c126a --- /dev/null +++ b/libs/red-ui-http/tsconfig.lib.json @@ -0,0 +1,18 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "target": "es2015", + "declaration": true, + "inlineSources": true, + "types": [], + "lib": ["dom", "es2018"] + }, + "angularCompilerOptions": { + "skipTemplateCodegen": true, + "strictMetadataEmit": true, + "enableResourceInlining": true + }, + "exclude": ["src/test-setup.ts", "**/*.spec.ts"], + "include": ["**/*.ts"] +} diff --git a/libs/red-ui-http/tslint.json b/libs/red-ui-http/tslint.json new file mode 100644 index 000000000..3a82e7773 --- /dev/null +++ b/libs/red-ui-http/tslint.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tslint.json", + "rules": { + "directive-selector": [true, "attribute", "redaction", "camelCase"], + "component-selector": [true, "element", "redaction", "kebab-case"] + }, + "linterOptions": { + "exclude": ["!**/*"] + } +} diff --git a/nx.json b/nx.json index 044a3bdf8..daa79060c 100644 --- a/nx.json +++ b/nx.json @@ -24,6 +24,9 @@ "projects": { "red-ui": { "tags": [] + }, + "red-ui-http": { + "tags": [] } } } diff --git a/package.json b/package.json index 7b3665cd6..8361623a0 100644 --- a/package.json +++ b/package.json @@ -28,37 +28,44 @@ }, "private": true, "dependencies": { - "@nrwl/angular": "^10.2.0", "@angular/animations": "^10.0.0", + "@angular/cdk": "^10.2.1", "@angular/common": "^10.0.0", "@angular/compiler": "^10.0.0", "@angular/core": "^10.0.0", "@angular/forms": "^10.0.0", + "@angular/material": "^10.2.1", "@angular/platform-browser": "^10.0.0", "@angular/platform-browser-dynamic": "^10.0.0", "@angular/router": "^10.0.0", + "@ngx-translate/core": "^13.0.0", + "@ngx-translate/http-loader": "^6.0.0", + "@nrwl/angular": "^10.2.0", + "@pdftron/webviewer": "^7.0.1", + "keycloak-angular": "^8.0.1", + "keycloak-js": "10.0.2", "rxjs": "~6.5.5", "zone.js": "^0.10.2" }, "devDependencies": { - "@nrwl/workspace": "10.2.0", - "@types/node": "~8.9.4", - "dotenv": "6.2.0", - "eslint": "6.8.0", - "prettier": "2.0.4", - "ts-node": "~7.0.0", - "tslint": "~6.0.0", - "typescript": "~3.9.3", + "@angular-devkit/build-angular": "~0.1000.0", "@angular/compiler-cli": "^10.0.0", "@angular/language-service": "^10.0.0", - "@angular-devkit/build-angular": "~0.1000.0", - "codelyzer": "~5.0.1", - "jest-preset-angular": "8.2.1", + "@nrwl/cypress": "10.2.0", "@nrwl/jest": "10.2.0", - "jest": "26.2.2", + "@nrwl/workspace": "10.2.0", "@types/jest": "26.0.8", - "ts-jest": "26.1.4", + "@types/node": "~8.9.4", + "codelyzer": "~5.0.1", "cypress": "^4.1.0", - "@nrwl/cypress": "10.2.0" + "dotenv": "6.2.0", + "eslint": "6.8.0", + "jest": "26.2.2", + "jest-preset-angular": "8.2.1", + "prettier": "2.0.4", + "ts-jest": "26.1.4", + "ts-node": "~7.0.0", + "tslint": "~6.0.0", + "typescript": "~3.9.3" } } diff --git a/tsconfig.base.json b/tsconfig.base.json index a5099b580..36ec56aae 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -15,7 +15,9 @@ "skipLibCheck": true, "skipDefaultLibCheck": true, "baseUrl": ".", - "paths": {} + "paths": { + "@redaction/red-ui-http": ["libs/red-ui-http/src/index.ts"] + } }, "exclude": ["node_modules", "tmp"] } diff --git a/workspace.json b/workspace.json index cec5e6005..a3fa20529 100644 --- a/workspace.json +++ b/workspace.json @@ -23,7 +23,7 @@ "aot": true, "assets": [ "apps/red-ui/src/favicon.ico", - "apps/red-ui/src/assets" + { "glob": "**/*", "input": "apps/red-ui/src/assets/", "output": "/assets/" } ], "styles": ["apps/red-ui/src/styles.scss"], "scripts": [] @@ -94,6 +94,36 @@ } } } + }, + "red-ui-http": { + "projectType": "library", + "root": "libs/red-ui-http", + "sourceRoot": "libs/red-ui-http/src", + "prefix": "redaction", + "architect": { + "lint": { + "builder": "@angular-devkit/build-angular:tslint", + "options": { + "tsConfig": [ + "libs/red-ui-http/tsconfig.lib.json", + "libs/red-ui-http/tsconfig.spec.json" + ], + "exclude": ["**/node_modules/**", "!libs/red-ui-http/**/*"] + } + }, + "test": { + "builder": "@nrwl/jest:jest", + "options": { + "jestConfig": "libs/red-ui-http/jest.config.js", + "passWithNoTests": true + } + } + }, + "schematics": { + "@schematics/angular:component": { + "style": "scss" + } + } } }, "cli": { diff --git a/yarn.lock b/yarn.lock index ecbe23a3b..52638cac4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -127,6 +127,15 @@ dependencies: tslib "^2.0.0" +"@angular/cdk@^10.2.1": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@angular/cdk/-/cdk-10.2.1.tgz#7ca0fe7220ca97bdf8e73a40105212749427a88f" + integrity sha512-67nPfteerlGPlwBeKt+EEOgEo2zm3+U6FzwhXVqwEeBxCZ7PWelMDiartHC7zZnzIKkcNEO0Uptq7Bzl2gdU0w== + dependencies: + tslib "^2.0.0" + optionalDependencies: + parse5 "^5.0.0" + "@angular/common@^10.0.0": version "10.1.2" resolved "https://registry.yarnpkg.com/@angular/common/-/common-10.1.2.tgz#c075f9f9a192c301f5bc483cc490d17c86d62b15" @@ -179,6 +188,13 @@ resolved "https://registry.yarnpkg.com/@angular/language-service/-/language-service-10.1.2.tgz#569584307e712226c4b0091e3265d0756951f2c1" integrity sha512-NYAvbiqzj2cxIAFiqZQSEVqbKaRaJKEn/qRlzMbfELbJV3Vwzw6oDwV550LnX4ZXOdsfMvEV4zJLBjUMDbpevg== +"@angular/material@^10.2.1": + version "10.2.1" + resolved "https://registry.yarnpkg.com/@angular/material/-/material-10.2.1.tgz#d402d157edfe39963c917095a51ab26c6071dfa2" + integrity sha512-TSfjW4w3orzDtTstNcNR2zsfNcO/R7NNmDMQ11LO6+EfnbNF2yktsMS3FZl811GX6dXEE+R/GCdDgCnlvqv9Mw== + dependencies: + tslib "^2.0.0" + "@angular/platform-browser-dynamic@^10.0.0": version "10.1.2" resolved "https://registry.yarnpkg.com/@angular/platform-browser-dynamic/-/platform-browser-dynamic-10.1.2.tgz#af5fe1cccc6869f6f4f7b60c11aeb873b91b0fd4" @@ -1451,6 +1467,20 @@ rxjs "6.5.5" webpack-sources "1.4.3" +"@ngx-translate/core@^13.0.0": + version "13.0.0" + resolved "https://registry.yarnpkg.com/@ngx-translate/core/-/core-13.0.0.tgz#60547cb8a0845a2a0abfde6b0bf5ec6516a63fd6" + integrity sha512-+tzEp8wlqEnw0Gc7jtVRAJ6RteUjXw6JJR4O65KlnxOmJrCGPI0xjV/lKRnQeU0w4i96PQs/jtpL921Wrb7PWg== + dependencies: + tslib "^2.0.0" + +"@ngx-translate/http-loader@^6.0.0": + version "6.0.0" + resolved "https://registry.yarnpkg.com/@ngx-translate/http-loader/-/http-loader-6.0.0.tgz#041393ab5753f50ecf64262d624703046b8c7570" + integrity sha512-LCekn6qCbeXWlhESCxU1rAbZz33WzDG0lI7Ig0pYC1o5YxJWrkU9y3Y4tNi+jakQ7R6YhTR2D3ox6APxDtA0wA== + dependencies: + tslib "^2.0.0" + "@nodelib/fs.scandir@2.1.3": version "2.1.3" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz#3a582bdb53804c6ba6d146579c46e52130cf4a3b" @@ -1559,6 +1589,11 @@ tmp "0.0.33" yargs "15.4.1" +"@pdftron/webviewer@^7.0.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/@pdftron/webviewer/-/webviewer-7.0.1.tgz#0dcf6aad099adfce151a14e3ad7679865ceec038" + integrity sha512-yyN4f1HjMpPHrHrOZSlVLEbVLKJvaGBh476mkfFshI9FAVc5xGKi3ukpv0WPTa9T2S2xFYyclxbPfIBa46Uh8Q== + "@samverschueren/stream-to-observable@^0.3.0": version "0.3.1" resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.1.tgz#a21117b19ee9be70c379ec1877537ef2e1c63301" @@ -2396,7 +2431,7 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -base64-js@^1.0.2: +base64-js@1.3.1, base64-js@^1.0.2: version "1.3.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== @@ -6255,6 +6290,11 @@ jest@26.2.2: import-local "^3.0.2" jest-cli "^26.2.2" +js-sha256@0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" + integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -6393,6 +6433,21 @@ karma-source-map-support@1.4.0: dependencies: source-map-support "^0.5.5" +keycloak-angular@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/keycloak-angular/-/keycloak-angular-8.0.1.tgz#29851e7aded21925faa051c69dfa5872bda6661f" + integrity sha512-q68vcaFiSYNjbzPM1v+6LohMpWUyus9hcQBi2rNz06xOtWuRU4U6t5vQgoim6bDhtkhWpR5+a3SYl0lzUJKyrw== + dependencies: + tslib "^2.0.0" + +keycloak-js@10.0.2: + version "10.0.2" + resolved "https://registry.yarnpkg.com/keycloak-js/-/keycloak-js-10.0.2.tgz#f0cf5b942627c5221f1466552c40e4624503b77b" + integrity sha512-7nkg4Ob1khHGcNbuK36AMndKUEuIQFpNlWU9ygWs7nSBPCI9VZ8dJjjXfKJHm0ewgcqLFGPIJ6bxxRlfcQ6sLg== + dependencies: + base64-js "1.3.1" + js-sha256 "0.9.0" + killable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" @@ -7539,7 +7594,7 @@ parse5@4.0.0: resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== -parse5@5.1.1: +parse5@5.1.1, parse5@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==