@biorate/nestjs-tools 1.124.1 → 1.124.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,27 +1,17 @@
1
1
  import {
2
2
  ArgumentsHost,
3
- Body,
4
3
  CallHandler,
5
4
  CanActivate,
6
5
  ExceptionFilter,
7
6
  ExecutionContext,
8
- Get,
9
- Header,
10
7
  NestInterceptor,
11
8
  NestMiddleware,
12
- Param,
13
- Post,
14
9
  } from '@nestjs/common';
15
10
  import { Request, Response, NextFunction } from 'express';
16
11
  import { Observable } from 'rxjs';
17
12
  import { Options, RequestHandler } from 'http-proxy-middleware/dist/types';
18
- import { mkdirSync, promises as fs, readFileSync, writeFileSync } from 'fs';
19
- import { path } from '@biorate/tools';
20
- import { ApiOperation } from '@nestjs/swagger';
21
- import { merge } from 'lodash';
22
- import { inject, Types } from '@biorate/inversion';
23
13
  import { IPrometheus } from '@biorate/prometheus';
24
- import { ILocalesDTO } from './interfaces';
14
+ import { ClientProviderPort, ILocalesDTO, MetricsProviderPort } from './interfaces';
25
15
 
26
16
  export * from './interfaces';
27
17
 
@@ -113,4 +103,43 @@ declare module '@biorate/nestjs-tools' {
113
103
 
114
104
  protected healthz(): number;
115
105
  }
106
+
107
+ export class GetLocaleUseCase {
108
+ public async execute(
109
+ lang: string,
110
+ namespace: string,
111
+ ): Promise<Record<string, string>>;
112
+ }
113
+
114
+ export class SetLocaleUseCase {
115
+ public async execute(lang: string, namespace: string): Promise<void>;
116
+ }
117
+
118
+ export class GetMetricsUseCase {
119
+ public async execute(): Promise<string>;
120
+ }
121
+
122
+ export class ClientRepositoryAdapter implements ClientProviderPort {
123
+ getLang(lang: string, namespace: string): Record<string, string>;
124
+
125
+ setLang(data: Record<string, string>, lang: string, namespace: string): void;
126
+ }
127
+
128
+ export class MetricsRepositoryAdapter implements MetricsProviderPort {
129
+ get(): Promise<string>;
130
+ }
131
+
132
+ export class ClientController {
133
+ public constructor(
134
+ protected readonly getLoc: GetLocaleUseCase,
135
+ protected readonly setLoc: SetLocaleUseCase,
136
+ ) {}
137
+
138
+ protected getLocale(param: GetLocalesDTO): Promise<Record<string, string>>;
139
+
140
+ protected postLocale(
141
+ param: PostLocalesDTO,
142
+ body: Record<string, string>,
143
+ ): Promise<void>;
144
+ }
116
145
  }
package/interfaces.ts CHANGED
@@ -7,3 +7,13 @@ export interface ILocalesDTO {
7
7
  lang: string;
8
8
  namespace: string;
9
9
  }
10
+
11
+ export interface ClientProviderPort {
12
+ getLang(lang: string, namespace: string): Record<string, string>;
13
+
14
+ setLang(data: Record<string, string>, lang: string, namespace: string): void;
15
+ }
16
+
17
+ export interface MetricsProviderPort {
18
+ get(): Promise<string>;
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biorate/nestjs-tools",
3
- "version": "1.124.1",
3
+ "version": "1.124.3",
4
4
  "description": "NestJS tools",
5
5
  "main": "dist",
6
6
  "scripts": {
@@ -42,5 +42,5 @@
42
42
  "http-proxy-middleware": "2.0.6",
43
43
  "on-headers": "1.0.2"
44
44
  },
45
- "gitHead": "acd295eddac05300576f94fbc072103b73b677de"
45
+ "gitHead": "0e793af90b96b0f8ea53dab412a1695664e75011"
46
46
  }