@rsdk/grpc.clients 5.7.0-next.1 → 5.7.0-next.2
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.
|
@@ -7,11 +7,11 @@ import { GrpcClientsOptions } from '../options/types';
|
|
|
7
7
|
* Простое кеш хранилище внутри DI для кеширования на замену статике
|
|
8
8
|
*/
|
|
9
9
|
export declare class GrpcClientRepository {
|
|
10
|
-
private readonly grpcClientsConfig
|
|
10
|
+
private readonly grpcClientsConfig?;
|
|
11
11
|
private readonly factory;
|
|
12
12
|
private readonly channels;
|
|
13
13
|
private readonly clients;
|
|
14
|
-
constructor(grpcClientsConfig
|
|
14
|
+
constructor(grpcClientsConfig?: GrpcClientsConfig | undefined, options?: GrpcClientsOptions);
|
|
15
15
|
resolveChannel(address: string, channelToken: string): ChannelImplementation;
|
|
16
16
|
resolveClient(definition: CompatServiceDefinition, channel: ChannelImplementation, clientToken: string): Client<CompatServiceDefinition>;
|
|
17
17
|
}
|
|
@@ -47,7 +47,7 @@ let GrpcClientRepository = class GrpcClientRepository {
|
|
|
47
47
|
(0, nice_grpc_1.createChannel)(address, nice_grpc_1.ChannelCredentials.createInsecure(), {
|
|
48
48
|
// unlimited
|
|
49
49
|
'grpc.max_receive_message_length': -1,
|
|
50
|
-
...this.grpcClientsConfig
|
|
50
|
+
...this.grpcClientsConfig?.channelOptions,
|
|
51
51
|
});
|
|
52
52
|
this.channels.set(channelToken, channel);
|
|
53
53
|
return channel;
|
|
@@ -61,6 +61,7 @@ let GrpcClientRepository = class GrpcClientRepository {
|
|
|
61
61
|
exports.GrpcClientRepository = GrpcClientRepository;
|
|
62
62
|
exports.GrpcClientRepository = GrpcClientRepository = __decorate([
|
|
63
63
|
(0, common_1.Injectable)(),
|
|
64
|
+
__param(0, (0, common_1.Optional)()),
|
|
64
65
|
__param(1, (0, common_1.Optional)()),
|
|
65
66
|
__param(1, (0, common_1.Inject)(di_1.GRPC_CLIENTS_OPTIONS)),
|
|
66
67
|
__metadata("design:paramtypes", [grpc_clients_config_1.GrpcClientsConfig, Object])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grpc-client.repository.js","sourceRoot":"","sources":["../../src/repository/grpc-client.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2CAA8D;AAE9D,yCAImB;AAGnB,gEAA2D;AAC3D,2FAAsF;AACtF,yEAAqE;AACrE,sCAAqD;AAGrD;;GAEG;AAGI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;
|
|
1
|
+
{"version":3,"file":"grpc-client.repository.js","sourceRoot":"","sources":["../../src/repository/grpc-client.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,2CAA8D;AAE9D,yCAImB;AAGnB,gEAA2D;AAC3D,2FAAsF;AACtF,yEAAqE;AACrE,sCAAqD;AAGrD;;GAEG;AAGI,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAQA;IAPd,OAAO,CAAgB;IAExC,SAAS;IACQ,QAAQ,GAAG,IAAI,GAAG,EAAmB,CAAC;IACtC,OAAO,GAAG,IAAI,GAAG,EAA2C,CAAC;IAE9E,YAC+B,iBAAqC,EACxB,OAA4B;QADzC,sBAAiB,GAAjB,iBAAiB,CAAoB;QAGlE,IAAI,CAAC,OAAO,GAAG,IAAA,+BAAmB,GAAE;aACjC,GAAG,CAAC,IAAA,uDAAyB,GAAE,CAAC;aAChC,GAAG,CAAC,IAAA,sCAAiB,GAAE,CAAC,CAAC;QAE5B,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QAErC,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,MAAM,CAAC,IAAI,UAAU;gBAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;IAED,cAAc,CAAC,OAAe,EAAE,YAAoB;QAClD,uFAAuF;QACvF,sFAAsF;QACtF,kFAAkF;QAElF,MAAM,OAAO,GACX,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC;YAC/B,IAAA,yBAAa,EAAC,OAAO,EAAE,8BAAkB,CAAC,cAAc,EAAE,EAAE;gBAC1D,YAAY;gBACZ,iCAAiC,EAAE,CAAC,CAAC;gBACrC,GAAG,IAAI,CAAC,iBAAiB,EAAE,cAAc;aAC1C,CAAC,CAAC;QAEL,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAEzC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,aAAa,CACX,UAAmC,EACnC,OAA8B,EAC9B,WAAmB;QAEnB,MAAM,OAAO,GACX,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QAE5E,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAEvC,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAA;AApDY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IASR,WAAA,IAAA,iBAAQ,GAAE,CAAA;IACV,WAAA,IAAA,iBAAQ,GAAE,CAAA;IAAE,WAAA,IAAA,eAAM,EAAC,yBAAoB,CAAC,CAAA;qCADQ,uCAAiB;GARzD,oBAAoB,CAoDhC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdk/grpc.clients",
|
|
3
|
-
"version": "5.7.0-next.
|
|
3
|
+
"version": "5.7.0-next.2",
|
|
4
4
|
"description": "Grpc clients infrastructure",
|
|
5
5
|
"license": "Apache License 2.0",
|
|
6
6
|
"publishConfig": {
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"reflect-metadata": "^0.1.12 || ^0.2.0",
|
|
27
27
|
"rxjs": "^7.8.1"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "c85fca0b594a2ea168d06f1d2941a4fb05b59440"
|
|
30
30
|
}
|
|
@@ -27,7 +27,7 @@ export class GrpcClientRepository {
|
|
|
27
27
|
private readonly clients = new Map<string, Client<CompatServiceDefinition>>();
|
|
28
28
|
|
|
29
29
|
constructor(
|
|
30
|
-
private readonly grpcClientsConfig
|
|
30
|
+
@Optional() private readonly grpcClientsConfig?: GrpcClientsConfig,
|
|
31
31
|
@Optional() @Inject(GRPC_CLIENTS_OPTIONS) options?: GrpcClientsOptions,
|
|
32
32
|
) {
|
|
33
33
|
this.factory = createClientFactory()
|
|
@@ -51,7 +51,7 @@ export class GrpcClientRepository {
|
|
|
51
51
|
createChannel(address, ChannelCredentials.createInsecure(), {
|
|
52
52
|
// unlimited
|
|
53
53
|
'grpc.max_receive_message_length': -1,
|
|
54
|
-
...this.grpcClientsConfig
|
|
54
|
+
...this.grpcClientsConfig?.channelOptions,
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
this.channels.set(channelToken, channel);
|