mirror of
https://github.com/valitydev/control-center.git
synced 2024-11-06 02:25:17 +00:00
Bump to valitydev/dominant-cache-proto@9001474 (#181)
This commit is contained in:
parent
39ecc08edf
commit
327ea29e7b
11
package-lock.json
generated
11
package-lock.json
generated
@ -30,7 +30,7 @@
|
||||
"@s-libs/rxjs-core": "15.0.0",
|
||||
"@vality/deanonimus-proto": "2.0.1-03a2143.0",
|
||||
"@vality/domain-proto": "2.0.1-b8cfba3.0",
|
||||
"@vality/dominant-cache-proto": "1.0.1-5b29d81.0",
|
||||
"@vality/dominant-cache-proto": "2.0.1-9001474.0",
|
||||
"@vality/file-storage-proto": "1.0.1-447212b.0",
|
||||
"@vality/fistful-proto": "1.0.1-9c78e89.0",
|
||||
"@vality/machinegun-proto": "1.0.1-277f06e.0",
|
||||
@ -5163,8 +5163,9 @@
|
||||
"integrity": "sha512-6Wu/SnDo5UEWGmY4U0c7hyDg/mN1+x/J2gcdzMY4q+dZb5TWXxsExJ16vqkLChbHKt6HzbsyCIeewYimv0gPOg=="
|
||||
},
|
||||
"node_modules/@vality/dominant-cache-proto": {
|
||||
"version": "1.0.1-5b29d81.0",
|
||||
"license": "Apache-2.0"
|
||||
"version": "2.0.1-9001474.0",
|
||||
"resolved": "https://registry.npmjs.org/@vality/dominant-cache-proto/-/dominant-cache-proto-2.0.1-9001474.0.tgz",
|
||||
"integrity": "sha512-QBRGI45jciKII9sEefzoULyAWXmTnLIetdaLu1s1B5UK2DVd3ju5TSqYCwTVxInt+jZ7Q8ACTb3pYHDuDI5uig=="
|
||||
},
|
||||
"node_modules/@vality/file-storage-proto": {
|
||||
"version": "1.0.1-447212b.0",
|
||||
@ -22876,7 +22877,9 @@
|
||||
"integrity": "sha512-6Wu/SnDo5UEWGmY4U0c7hyDg/mN1+x/J2gcdzMY4q+dZb5TWXxsExJ16vqkLChbHKt6HzbsyCIeewYimv0gPOg=="
|
||||
},
|
||||
"@vality/dominant-cache-proto": {
|
||||
"version": "1.0.1-5b29d81.0"
|
||||
"version": "2.0.1-9001474.0",
|
||||
"resolved": "https://registry.npmjs.org/@vality/dominant-cache-proto/-/dominant-cache-proto-2.0.1-9001474.0.tgz",
|
||||
"integrity": "sha512-QBRGI45jciKII9sEefzoULyAWXmTnLIetdaLu1s1B5UK2DVd3ju5TSqYCwTVxInt+jZ7Q8ACTb3pYHDuDI5uig=="
|
||||
},
|
||||
"@vality/file-storage-proto": {
|
||||
"version": "1.0.1-447212b.0"
|
||||
|
@ -44,7 +44,7 @@
|
||||
"@s-libs/rxjs-core": "15.0.0",
|
||||
"@vality/deanonimus-proto": "2.0.1-03a2143.0",
|
||||
"@vality/domain-proto": "2.0.1-b8cfba3.0",
|
||||
"@vality/dominant-cache-proto": "1.0.1-5b29d81.0",
|
||||
"@vality/dominant-cache-proto": "2.0.1-9001474.0",
|
||||
"@vality/file-storage-proto": "1.0.1-447212b.0",
|
||||
"@vality/fistful-proto": "1.0.1-9c78e89.0",
|
||||
"@vality/machinegun-proto": "1.0.1-277f06e.0",
|
||||
|
@ -1,23 +1,47 @@
|
||||
import { Injectable, Injector } from '@angular/core';
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
codegenClientConfig,
|
||||
CodegenClient,
|
||||
} from '@vality/dominant-cache-proto/lib/dominant_cache-DominantCache';
|
||||
import context from '@vality/dominant-cache-proto/lib/dominant_cache/context';
|
||||
import * as DominantCache from '@vality/dominant-cache-proto/lib/dominant_cache/gen-nodejs/DominantCache';
|
||||
ThriftAstMetadata,
|
||||
DominantCacheCodegenClient,
|
||||
DominantCache,
|
||||
} from '@vality/dominant-cache-proto';
|
||||
import { Category, ContractTemplate } from '@vality/dominant-cache-proto/dominant_cache';
|
||||
import { combineLatest, from, map, Observable, switchMap } from 'rxjs';
|
||||
|
||||
import { createThriftApi } from '@cc/app/api/utils';
|
||||
import { KeycloakTokenInfoService, toWachterHeaders } from '@cc/app/shared/services';
|
||||
import { environment } from '@cc/environments/environment';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class DominantCacheService extends createThriftApi<CodegenClient>() {
|
||||
constructor(injector: Injector) {
|
||||
super(injector, {
|
||||
service: DominantCache,
|
||||
wachterServiceName: 'DominantCache',
|
||||
metadata: () =>
|
||||
import('@vality/dominant-cache-proto/lib/metadata.json').then((m) => m.default),
|
||||
context,
|
||||
...codegenClientConfig,
|
||||
});
|
||||
export class DominantCacheService {
|
||||
private client$: Observable<DominantCacheCodegenClient>;
|
||||
|
||||
constructor(private keycloakTokenInfoService: KeycloakTokenInfoService) {
|
||||
const headers$ = this.keycloakTokenInfoService.decoded$.pipe(
|
||||
map(toWachterHeaders('DominantCache'))
|
||||
);
|
||||
const metadata$ = from(
|
||||
import('@vality/dominant-cache-proto/metadata.json').then(
|
||||
(m) => m.default as ThriftAstMetadata[]
|
||||
)
|
||||
);
|
||||
this.client$ = combineLatest([metadata$, headers$]).pipe(
|
||||
switchMap(([metadata, headers]) =>
|
||||
DominantCache({
|
||||
metadata,
|
||||
headers,
|
||||
logging: environment.logging.requests,
|
||||
path: '/wachter',
|
||||
})
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
GetCategories(): Observable<Category[]> {
|
||||
return this.client$.pipe(switchMap((c) => c.GetCategories()));
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
GetContractTemplates(): Observable<ContractTemplate[]> {
|
||||
return this.client$.pipe(switchMap((c) => c.GetContractTemplates()));
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
|
||||
import { ContractTemplateRef } from '@vality/domain-proto/domain';
|
||||
import { ContractTemplate } from '@vality/dominant-cache-proto';
|
||||
import { ContractTemplate } from '@vality/dominant-cache-proto/dominant_cache';
|
||||
import isNil from 'lodash-es/isNil';
|
||||
import sortBy from 'lodash-es/sortBy';
|
||||
import { Observable } from 'rxjs';
|
||||
|
@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { MatLegacySnackBar as MatSnackBar } from '@angular/material/legacy-snack-bar';
|
||||
import { CategoryRef } from '@vality/domain-proto/domain';
|
||||
import { Category } from '@vality/dominant-cache-proto';
|
||||
import { Category } from '@vality/dominant-cache-proto/dominant_cache';
|
||||
import isNil from 'lodash-es/isNil';
|
||||
import sortBy from 'lodash-es/sortBy';
|
||||
import { Observable } from 'rxjs';
|
||||
|
Loading…
Reference in New Issue
Block a user