@rsdk/grpc.clients 2.5.0 → 2.6.0-next.0
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/CHANGELOG.md +6 -0
- package/dist/decorators/inject-client.decorator.d.ts +1 -2
- package/dist/decorators/inject-client.decorator.js.map +1 -1
- package/dist/servers/types.d.ts +3 -3
- package/package.json +2 -2
- package/src/decorators/inject-client.decorator.ts +1 -4
- package/src/servers/types.ts +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [2.6.0-next.0](https://github.com/R-Vision/rsdk/compare/v2.5.0...v2.6.0-next.0) (2023-07-03)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **grpc-clients:** remove verbose generic type for normalize compile (exceeds the maximum length...) ([e58fee8](https://github.com/R-Vision/rsdk/commit/e58fee8b1e8780deef49fa77ac40c8c0e79d82e5))
|
|
11
|
+
|
|
6
12
|
# [2.5.0](https://github.com/R-Vision/rsdk/compare/v2.4.4-next.0...v2.5.0) (2023-06-23)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @rsdk/grpc.clients
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { CompatServiceDefinition } from 'nice-grpc/lib/service-definitions';
|
|
2
1
|
import type { GrpcServerDeclarationValue } from '../servers/types';
|
|
3
2
|
/**
|
|
4
3
|
* Injects ready to use client for particular grpc-service
|
|
@@ -8,4 +7,4 @@ import type { GrpcServerDeclarationValue } from '../servers/types';
|
|
|
8
7
|
* @returns ParameterDecorator
|
|
9
8
|
* @param grpcServerDeclarationValue
|
|
10
9
|
*/
|
|
11
|
-
export declare const InjectGrpcClient: <TServerName extends string, TServiceName extends string
|
|
10
|
+
export declare const InjectGrpcClient: <TServerName extends string, TServiceName extends string>(grpcServerDeclarationValue: GrpcServerDeclarationValue<TServerName, TServiceName>) => ParameterDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inject-client.decorator.js","sourceRoot":"","sources":["../../src/decorators/inject-client.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AACxC,uEAA6F;AAC7F,6CAA8C;
|
|
1
|
+
{"version":3,"file":"inject-client.decorator.js","sourceRoot":"","sources":["../../src/decorators/inject-client.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AACxC,uEAA6F;AAC7F,6CAA8C;AAE9C,0DAAsD;AAEtD,wDAAoD;AAEpD;;;;;;;GAOG;AACI,MAAM,gBAAgB,GAAG,CAI9B,0BAGC,EACmB,EAAE;IACtB,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,EAAE;QAC7C,IAAA,eAAM,EAAC,IAAA,gCAAc,EAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC,CAC3D,MAAM,EACN,WAAW,EACX,cAAc,CACf,CAAC;QACF,uBAAY,CAAC,YAAY,CACvB,MAAM,EACN,8CAAkC,EAClC,GAAG,0BAA0B,CAAC,UAAU,IAAI,0BAA0B,CAAC,WAAW,EAAE,EACpF,kCAAe,CAAC,sBAAsB,CACpC,0BAA0B,CAAC,UAAU,EACrC,0BAA0B,CAAC,UAAU,CACtC,EACD,IAAI,CACL,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AA1BW,QAAA,gBAAgB,oBA0B3B"}
|
package/dist/servers/types.d.ts
CHANGED
|
@@ -6,13 +6,13 @@ export type GrpcServiceDeclaration = {
|
|
|
6
6
|
export interface GrpcServerDeclaration {
|
|
7
7
|
[serverName: string]: GrpcServiceDeclaration;
|
|
8
8
|
}
|
|
9
|
-
export type GrpcServerDeclarationValue<TServerName extends string, TServiceName extends string
|
|
9
|
+
export type GrpcServerDeclarationValue<TServerName extends string, TServiceName extends string> = Opaque<{
|
|
10
10
|
serverName: TServerName;
|
|
11
11
|
serviceName: TServiceName;
|
|
12
|
-
definition:
|
|
12
|
+
definition: CompatServiceDefinition;
|
|
13
13
|
}>;
|
|
14
14
|
export type GrpcServiceMap<serverName extends string, T extends GrpcServiceDeclaration> = {
|
|
15
|
-
[serviceName in keyof T]: serverName extends string ? serviceName extends string ? GrpcServerDeclarationValue<serverName, serviceName
|
|
15
|
+
[serviceName in keyof T]: serverName extends string ? serviceName extends string ? GrpcServerDeclarationValue<serverName, serviceName> : never : never;
|
|
16
16
|
};
|
|
17
17
|
export type GrpcServerMap<T extends GrpcServerDeclaration> = {
|
|
18
18
|
[serverName in keyof T]: serverName extends string ? GrpcServiceMap<serverName, T[serverName]> : never;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdk/grpc.clients",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0-next.0",
|
|
4
4
|
"description": "Grpc clients infrastructure",
|
|
5
5
|
"license": "Apache License 2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"nice-grpc-opentelemetry": "^0.1.2",
|
|
28
28
|
"rxjs": "^7.0.0"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "0b5c41c482784db44ab35ef3b8990d10f9978645"
|
|
31
31
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Inject } from '@nestjs/common';
|
|
2
2
|
import { PLATFORM_RAW_GLOBAL_METADATA_SCOPE } from '@rsdk/core/dist/rsdk-metadata/constants';
|
|
3
3
|
import { RsdkMetadata } from '@rsdk/metadata';
|
|
4
|
-
import type { CompatServiceDefinition } from 'nice-grpc/lib/service-definitions';
|
|
5
4
|
|
|
6
5
|
import { ModuleGenerator } from '../module.generator';
|
|
7
6
|
import type { GrpcServerDeclarationValue } from '../servers/types';
|
|
@@ -18,12 +17,10 @@ import { getClientToken } from '../token.factories';
|
|
|
18
17
|
export const InjectGrpcClient = <
|
|
19
18
|
TServerName extends string,
|
|
20
19
|
TServiceName extends string,
|
|
21
|
-
TServiceDefinition extends CompatServiceDefinition,
|
|
22
20
|
>(
|
|
23
21
|
grpcServerDeclarationValue: GrpcServerDeclarationValue<
|
|
24
22
|
TServerName,
|
|
25
|
-
TServiceName
|
|
26
|
-
TServiceDefinition
|
|
23
|
+
TServiceName
|
|
27
24
|
>,
|
|
28
25
|
): ParameterDecorator => {
|
|
29
26
|
return (target, propertyKey, parameterIndex) => {
|
package/src/servers/types.ts
CHANGED
|
@@ -12,11 +12,10 @@ export interface GrpcServerDeclaration {
|
|
|
12
12
|
export type GrpcServerDeclarationValue<
|
|
13
13
|
TServerName extends string,
|
|
14
14
|
TServiceName extends string,
|
|
15
|
-
TServiceDefinition extends CompatServiceDefinition,
|
|
16
15
|
> = Opaque<{
|
|
17
16
|
serverName: TServerName;
|
|
18
17
|
serviceName: TServiceName;
|
|
19
|
-
definition:
|
|
18
|
+
definition: CompatServiceDefinition;
|
|
20
19
|
}>;
|
|
21
20
|
|
|
22
21
|
export type GrpcServiceMap<
|
|
@@ -25,7 +24,7 @@ export type GrpcServiceMap<
|
|
|
25
24
|
> = {
|
|
26
25
|
[serviceName in keyof T]: serverName extends string
|
|
27
26
|
? serviceName extends string
|
|
28
|
-
? GrpcServerDeclarationValue<serverName, serviceName
|
|
27
|
+
? GrpcServerDeclarationValue<serverName, serviceName>
|
|
29
28
|
: never
|
|
30
29
|
: never;
|
|
31
30
|
};
|