@milaboratories/pl-client 2.4.19 → 2.4.21
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/dist/core/client.d.ts +1 -1
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/config.d.ts +2 -2
- package/dist/core/ll_client.d.ts +1 -1
- package/dist/core/ll_client.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/client.ts +2 -2
- package/src/core/config.ts +2 -2
- package/src/core/ll_client.ts +11 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-client",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.21",
|
|
4
4
|
"description": "New TS/JS client for Platform API",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "~5.5.4",
|
|
36
36
|
"vite": "^5.4.8",
|
|
37
|
-
"@types/node": "~20.16.
|
|
37
|
+
"@types/node": "~20.16.10",
|
|
38
38
|
"@protobuf-ts/plugin": "^2.9.4",
|
|
39
39
|
"@types/http-proxy": "^1.17.15",
|
|
40
40
|
"@types/jest": "^29.5.13",
|
|
41
41
|
"jest": "^29.7.0",
|
|
42
42
|
"@jest/globals": "^29.7.0",
|
|
43
43
|
"ts-jest": "^29.2.5",
|
|
44
|
-
"@milaboratories/platforma-build-configs": "1.0.
|
|
44
|
+
"@milaboratories/platforma-build-configs": "1.0.2"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"type-check": "tsc --noEmit --composite false",
|
package/src/core/client.ts
CHANGED
package/src/core/config.ts
CHANGED
|
@@ -66,8 +66,8 @@ export interface PlClientConfig {
|
|
|
66
66
|
retryJitter: number;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
export const DEFAULT_REQUEST_TIMEOUT =
|
|
70
|
-
export const DEFAULT_TX_TIMEOUT =
|
|
69
|
+
export const DEFAULT_REQUEST_TIMEOUT = 2000;
|
|
70
|
+
export const DEFAULT_TX_TIMEOUT = 30_000;
|
|
71
71
|
export const DEFAULT_TOKEN_TTL_SECONDS = 31 * 24 * 60 * 60;
|
|
72
72
|
export const DEFAULT_AUTH_MAX_REFRESH = 12 * 24 * 60 * 60;
|
|
73
73
|
|
package/src/core/ll_client.ts
CHANGED
|
@@ -76,7 +76,14 @@ export class LLPlClient {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
grpcInterceptors.push(this.createErrorInterceptor());
|
|
79
|
-
|
|
79
|
+
|
|
80
|
+
//
|
|
81
|
+
// Leaving it here for now
|
|
82
|
+
// https://github.com/grpc/grpc-node/issues/2788
|
|
83
|
+
//
|
|
84
|
+
// We should implement message pooling algorithm to overcome hardcoded NO_DELAY behaviour
|
|
85
|
+
// of HTTP/2 and allow our small messages to batch together.
|
|
86
|
+
//
|
|
80
87
|
const grpcOptions: GrpcOptions = {
|
|
81
88
|
host: this.conf.hostAndPort,
|
|
82
89
|
timeout: this.conf.defaultRequestTimeout,
|
|
@@ -84,7 +91,7 @@ export class LLPlClient {
|
|
|
84
91
|
? ChannelCredentials.createSsl()
|
|
85
92
|
: ChannelCredentials.createInsecure(),
|
|
86
93
|
clientOptions: {
|
|
87
|
-
'grpc.
|
|
94
|
+
'grpc.keepalive_time_ms': 3000,
|
|
88
95
|
interceptors: grpcInterceptors
|
|
89
96
|
}
|
|
90
97
|
};
|
|
@@ -238,7 +245,8 @@ export class LLPlClient {
|
|
|
238
245
|
}
|
|
239
246
|
|
|
240
247
|
/** Closes underlying transport */
|
|
241
|
-
public close() {
|
|
248
|
+
public async close() {
|
|
242
249
|
this.grpcTransport.close();
|
|
250
|
+
await this.httpDispatcher.destroy();
|
|
243
251
|
}
|
|
244
252
|
}
|