@wireapp/api-client 27.90.1-beta.18.5ce5ca523 → 27.90.1-beta.22.f6fd03fe6
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/lib/cells/CellsAPI.d.ts +6 -3
- package/lib/cells/CellsAPI.d.ts.map +1 -1
- package/lib/cells/CellsAPI.js +10 -2
- package/lib/cells/CellsAPI.schema.d.ts +56 -0
- package/lib/cells/CellsAPI.schema.d.ts.map +1 -0
- package/lib/cells/CellsAPI.schema.js +51 -0
- package/lib/cells/index.d.ts +4 -0
- package/lib/cells/index.d.ts.map +1 -0
- package/lib/cells/index.js +35 -0
- package/lib/tcp/ReconnectingWebsocket.d.ts +7 -0
- package/lib/tcp/ReconnectingWebsocket.d.ts.map +1 -1
- package/lib/tcp/ReconnectingWebsocket.js +47 -13
- package/lib/tcp/WebSocketClient.d.ts +8 -0
- package/lib/tcp/WebSocketClient.d.ts.map +1 -1
- package/lib/tcp/WebSocketClient.js +10 -0
- package/package.json +7 -7
package/lib/cells/CellsAPI.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { RestCreateCheckResponse, RestDeleteVersionResponse, RestNode, RestNodeCollection, RestPerformActionResponse, RestPromoteVersionResponse, RestPublicLinkDeleteSuccess, RestShareLink, RestVersion, RestIncomingNode, RestNodeLocator, RestActionOptionsCopyMove, RestNamespaceValuesResponse } from 'cells-sdk-ts';
|
|
1
|
+
import { RestCreateCheckResponse, RestDeleteVersionResponse, RestNode, RestNodeCollection, RestPerformActionResponse, RestPromoteVersionResponse, RestPublicLinkDeleteSuccess, RestShareLink, RestVersion, RestIncomingNode, RestNodeLocator, RestActionOptionsCopyMove, RestNamespaceValuesResponse, GetByUuidFlagsEnum } from 'cells-sdk-ts';
|
|
2
|
+
import { Node } from './CellsAPI.schema';
|
|
2
3
|
import { CellsStorage } from './CellsStorage/CellsStorage';
|
|
3
4
|
import { AccessTokenStore } from '../auth';
|
|
4
5
|
import { HttpClient } from '../http';
|
|
@@ -17,6 +18,7 @@ interface CellsConfig {
|
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
20
|
export declare class CellsAPI {
|
|
21
|
+
private readonly logger;
|
|
20
22
|
private accessTokenStore;
|
|
21
23
|
private httpClientConfig;
|
|
22
24
|
private storageService;
|
|
@@ -72,9 +74,10 @@ export declare class CellsAPI {
|
|
|
72
74
|
getNodeVersions({ uuid }: {
|
|
73
75
|
uuid: string;
|
|
74
76
|
}): Promise<RestVersion[] | undefined>;
|
|
75
|
-
getNode({ id }: {
|
|
77
|
+
getNode({ id, flags }: {
|
|
76
78
|
id: string;
|
|
77
|
-
|
|
79
|
+
flags?: Array<GetByUuidFlagsEnum>;
|
|
80
|
+
}): Promise<Node>;
|
|
78
81
|
getAllNodes({ path, limit, offset, sortBy, sortDirection, type, deleted, }: {
|
|
79
82
|
path: string;
|
|
80
83
|
limit?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellsAPI.d.ts","sourceRoot":"","sources":["../../src/cells/CellsAPI.ts"],"names":[],"mappings":"AAmBA,OAAO,EAGL,uBAAuB,EACvB,yBAAyB,EACzB,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,2BAA2B,
|
|
1
|
+
{"version":3,"file":"CellsAPI.d.ts","sourceRoot":"","sources":["../../src/cells/CellsAPI.ts"],"names":[],"mappings":"AAmBA,OAAO,EAGL,uBAAuB,EACvB,yBAAyB,EACzB,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,yBAAyB,EACzB,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,cAAc,CAAC;AAKtB,OAAO,EAAC,IAAI,EAAiB,MAAM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AAM,EAAE,CAAA;KAAC,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiBlF,OAAO,CAAC,mBAAmB;CAG5B"}
|
package/lib/cells/CellsAPI.js
CHANGED
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.CellsAPI = void 0;
|
|
22
22
|
const cells_sdk_ts_1 = require("cells-sdk-ts");
|
|
23
|
+
const commons_1 = require("@wireapp/commons");
|
|
24
|
+
const CellsAPI_schema_1 = require("./CellsAPI.schema");
|
|
23
25
|
const S3Service_1 = require("./CellsStorage/S3Service");
|
|
24
26
|
const http_1 = require("../http");
|
|
25
27
|
const CONFIGURATION_ERROR = 'CellsAPI is not initialized. Call initialize() before using any methods.';
|
|
@@ -27,11 +29,13 @@ const DEFAULT_LIMIT = 10;
|
|
|
27
29
|
const DEFAULT_OFFSET = 0;
|
|
28
30
|
const USER_META_TAGS_NAMESPACE = 'usermeta-tags';
|
|
29
31
|
class CellsAPI {
|
|
32
|
+
logger;
|
|
30
33
|
accessTokenStore;
|
|
31
34
|
httpClientConfig;
|
|
32
35
|
storageService;
|
|
33
36
|
client;
|
|
34
37
|
constructor({ accessTokenStore, httpClientConfig, }) {
|
|
38
|
+
this.logger = commons_1.LogFactory.getLogger('@wireapp/api-client/CellsAPI');
|
|
35
39
|
this.accessTokenStore = accessTokenStore;
|
|
36
40
|
this.httpClientConfig = httpClientConfig;
|
|
37
41
|
this.storageService = null;
|
|
@@ -184,11 +188,15 @@ class CellsAPI {
|
|
|
184
188
|
const result = await this.client.nodeVersions(uuid, { FilterBy: 'VersionsAll' });
|
|
185
189
|
return result.data.Versions;
|
|
186
190
|
}
|
|
187
|
-
async getNode({ id }) {
|
|
191
|
+
async getNode({ id, flags }) {
|
|
188
192
|
if (!this.client || !this.storageService) {
|
|
189
193
|
throw new Error(CONFIGURATION_ERROR);
|
|
190
194
|
}
|
|
191
|
-
const result = await this.client.getByUuid(id);
|
|
195
|
+
const result = await this.client.getByUuid(id, flags);
|
|
196
|
+
const validation = CellsAPI_schema_1.RestNodeSchema.safeParse(result.data);
|
|
197
|
+
if (!validation.success) {
|
|
198
|
+
this.logger.warn('Get node response validation failed:', validation.error);
|
|
199
|
+
}
|
|
192
200
|
return result.data;
|
|
193
201
|
}
|
|
194
202
|
async getAllNodes({ path, limit = DEFAULT_LIMIT, offset = DEFAULT_OFFSET, sortBy, sortDirection, type, deleted = false, }) {
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for REST node
|
|
4
|
+
* Used for validating API responses from getNode and similar endpoints
|
|
5
|
+
* Fields are optional to handle various response scenarios
|
|
6
|
+
*/
|
|
7
|
+
export declare const RestNodeSchema: z.ZodObject<{
|
|
8
|
+
/** Node UUID */
|
|
9
|
+
Uuid: z.ZodOptional<z.ZodString>;
|
|
10
|
+
/** Node path */
|
|
11
|
+
Path: z.ZodOptional<z.ZodString>;
|
|
12
|
+
/** Node type (LEAF for file, COLLECTION for folder) */
|
|
13
|
+
Type: z.ZodOptional<z.ZodString>;
|
|
14
|
+
/** Node size in bytes */
|
|
15
|
+
Size: z.ZodOptional<z.ZodString>;
|
|
16
|
+
/** Modification timestamp */
|
|
17
|
+
MTime: z.ZodOptional<z.ZodString>;
|
|
18
|
+
/** Node mode/permissions */
|
|
19
|
+
Mode: z.ZodOptional<z.ZodString>;
|
|
20
|
+
/** Node ETag */
|
|
21
|
+
Etag: z.ZodOptional<z.ZodString>;
|
|
22
|
+
/** User metadata */
|
|
23
|
+
MetaStore: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
24
|
+
/** Pre-signed URL for direct access */
|
|
25
|
+
PresignedUrl: z.ZodOptional<z.ZodString>;
|
|
26
|
+
/** Resource UUID */
|
|
27
|
+
ResourceUuid: z.ZodOptional<z.ZodString>;
|
|
28
|
+
/** Version ID */
|
|
29
|
+
VersionId: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
Uuid?: string | undefined;
|
|
32
|
+
Path?: string | undefined;
|
|
33
|
+
Type?: string | undefined;
|
|
34
|
+
Size?: string | undefined;
|
|
35
|
+
MTime?: string | undefined;
|
|
36
|
+
Mode?: string | undefined;
|
|
37
|
+
Etag?: string | undefined;
|
|
38
|
+
MetaStore?: Record<string, string> | undefined;
|
|
39
|
+
PresignedUrl?: string | undefined;
|
|
40
|
+
ResourceUuid?: string | undefined;
|
|
41
|
+
VersionId?: string | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
Uuid?: string | undefined;
|
|
44
|
+
Path?: string | undefined;
|
|
45
|
+
Type?: string | undefined;
|
|
46
|
+
Size?: string | undefined;
|
|
47
|
+
MTime?: string | undefined;
|
|
48
|
+
Mode?: string | undefined;
|
|
49
|
+
Etag?: string | undefined;
|
|
50
|
+
MetaStore?: Record<string, string> | undefined;
|
|
51
|
+
PresignedUrl?: string | undefined;
|
|
52
|
+
ResourceUuid?: string | undefined;
|
|
53
|
+
VersionId?: string | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
export type Node = z.infer<typeof RestNodeSchema>;
|
|
56
|
+
//# sourceMappingURL=CellsAPI.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CellsAPI.schema.d.ts","sourceRoot":"","sources":["../../src/cells/CellsAPI.schema.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB;;;;GAIG;AACH,eAAO,MAAM,cAAc;IACzB,gBAAgB;;IAEhB,gBAAgB;;IAEhB,uDAAuD;;IAEvD,yBAAyB;;IAEzB,6BAA6B;;IAE7B,4BAA4B;;IAE5B,gBAAgB;;IAEhB,oBAAoB;;IAEpB,uCAAuC;;IAEvC,oBAAoB;;IAEpB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;EAEjB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Wire
|
|
4
|
+
* Copyright (C) 2025 Wire Swiss GmbH
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* This program is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.RestNodeSchema = void 0;
|
|
22
|
+
const zod_1 = require("zod");
|
|
23
|
+
/**
|
|
24
|
+
* Zod schema for REST node
|
|
25
|
+
* Used for validating API responses from getNode and similar endpoints
|
|
26
|
+
* Fields are optional to handle various response scenarios
|
|
27
|
+
*/
|
|
28
|
+
exports.RestNodeSchema = zod_1.z.object({
|
|
29
|
+
/** Node UUID */
|
|
30
|
+
Uuid: zod_1.z.string().optional(),
|
|
31
|
+
/** Node path */
|
|
32
|
+
Path: zod_1.z.string().optional(),
|
|
33
|
+
/** Node type (LEAF for file, COLLECTION for folder) */
|
|
34
|
+
Type: zod_1.z.string().optional(),
|
|
35
|
+
/** Node size in bytes */
|
|
36
|
+
Size: zod_1.z.string().optional(),
|
|
37
|
+
/** Modification timestamp */
|
|
38
|
+
MTime: zod_1.z.string().optional(),
|
|
39
|
+
/** Node mode/permissions */
|
|
40
|
+
Mode: zod_1.z.string().optional(),
|
|
41
|
+
/** Node ETag */
|
|
42
|
+
Etag: zod_1.z.string().optional(),
|
|
43
|
+
/** User metadata */
|
|
44
|
+
MetaStore: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
|
|
45
|
+
/** Pre-signed URL for direct access */
|
|
46
|
+
PresignedUrl: zod_1.z.string().optional(),
|
|
47
|
+
/** Resource UUID */
|
|
48
|
+
ResourceUuid: zod_1.z.string().optional(),
|
|
49
|
+
/** Version ID */
|
|
50
|
+
VersionId: zod_1.z.string().optional(),
|
|
51
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cells/index.ts"],"names":[],"mappings":"AAmBA,cAAc,YAAY,CAAC;AAC3B,YAAY,EAAC,kBAAkB,IAAI,SAAS,EAAC,MAAM,cAAc,CAAC;AAClE,YAAY,EAAC,IAAI,EAAC,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Wire
|
|
4
|
+
* Copyright (C) 2018 Wire Swiss GmbH
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
* (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* This program is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
* GNU General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU General Public License
|
|
17
|
+
* along with this program. If not, see http://www.gnu.org/licenses/.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
23
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
24
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
25
|
+
}
|
|
26
|
+
Object.defineProperty(o, k2, desc);
|
|
27
|
+
}) : (function(o, m, k, k2) {
|
|
28
|
+
if (k2 === undefined) k2 = k;
|
|
29
|
+
o[k2] = m[k];
|
|
30
|
+
}));
|
|
31
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
32
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
33
|
+
};
|
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
+
__exportStar(require("./CellsAPI"), exports);
|
|
@@ -33,6 +33,7 @@ export declare class ReconnectingWebsocket {
|
|
|
33
33
|
*/
|
|
34
34
|
private readonly stopBackFromSleepHandler?;
|
|
35
35
|
private isPingingEnabled;
|
|
36
|
+
private readonly pendingHealthChecks;
|
|
36
37
|
constructor(onReconnect: () => Promise<string>, options?: {
|
|
37
38
|
pingInterval?: number;
|
|
38
39
|
});
|
|
@@ -47,6 +48,11 @@ export declare class ReconnectingWebsocket {
|
|
|
47
48
|
connect(): void;
|
|
48
49
|
send(message: any): void;
|
|
49
50
|
getState(): WEBSOCKET_STATE;
|
|
51
|
+
/**
|
|
52
|
+
* Lightweight health probe that sends a single ping and resolves with whether a pong was received in time.
|
|
53
|
+
* Does not close or reconnect the socket; callers can decide how to react to failures.
|
|
54
|
+
*/
|
|
55
|
+
checkHealth(timeoutMs?: number): Promise<boolean>;
|
|
50
56
|
disconnect(reason?: string): void;
|
|
51
57
|
/**
|
|
52
58
|
* Cleans up all active intervals and timers to prevent memory leaks.
|
|
@@ -58,6 +64,7 @@ export declare class ReconnectingWebsocket {
|
|
|
58
64
|
*/
|
|
59
65
|
private cleanup;
|
|
60
66
|
private getReconnectingWebsocket;
|
|
67
|
+
private resolvePendingHealthChecks;
|
|
61
68
|
setOnOpen(onOpen: (event: Event) => void): void;
|
|
62
69
|
setOnMessage(onMessage: (data: string) => void): void;
|
|
63
70
|
setOnError(onError: (error: ErrorEvent) => void): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReconnectingWebsocket.d.ts","sourceRoot":"","sources":["../../src/tcp/ReconnectingWebsocket.ts"],"names":[],"mappings":"AAoBA,OAAY,EAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAU,MAAM,wBAAwB,CAAC;AAQnF,oBAAY,cAAc;IACxB,cAAc,OAAO;IACrB,UAAU,OAAO;IACjB,cAAc,OAAO;IACrB,gBAAgB,OAAO;CACxB;AAED,oBAAY,eAAe;IACzB,UAAU,IAAI;IACd,IAAI,IAAI;IACR,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAED,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,qBAAa,qBAAqB;
|
|
1
|
+
{"version":3,"file":"ReconnectingWebsocket.d.ts","sourceRoot":"","sources":["../../src/tcp/ReconnectingWebsocket.ts"],"names":[],"mappings":"AAoBA,OAAY,EAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAU,MAAM,wBAAwB,CAAC;AAQnF,oBAAY,cAAc;IACxB,cAAc,OAAO;IACrB,UAAU,OAAO;IACjB,cAAc,OAAO;IACrB,gBAAgB,OAAO;CACxB;AAED,oBAAY,eAAe;IACzB,UAAU,IAAI;IACd,IAAI,IAAI;IACR,OAAO,IAAI;IACX,MAAM,IAAI;CACX;AAED,oBAAY,WAAW;IACrB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,qBAAa,qBAAqB;IA8B9B,OAAO,CAAC,QAAQ,CAAC,WAAW;IA7B9B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAQ1C;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,CAAC,0BAA0B;IAK3B,SAAS,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI;IAI/C,YAAY,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI;IAIrD,UAAU,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI;IAItD,UAAU,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,GAAG,IAAI;IAItD,cAAc,IAAI,IAAI;CAI9B"}
|
|
@@ -95,6 +95,7 @@ class ReconnectingWebsocket {
|
|
|
95
95
|
*/
|
|
96
96
|
stopBackFromSleepHandler;
|
|
97
97
|
isPingingEnabled = true;
|
|
98
|
+
pendingHealthChecks = new Set();
|
|
98
99
|
constructor(onReconnect, options = {}) {
|
|
99
100
|
this.onReconnect = onReconnect;
|
|
100
101
|
this.logger = commons_1.LogFactory.getLogger('@wireapp/api-client/tcp/ReconnectingWebsocket');
|
|
@@ -113,12 +114,14 @@ class ReconnectingWebsocket {
|
|
|
113
114
|
* **/
|
|
114
115
|
this.stopBackFromSleepHandler = (0, BackFromSleepHandler_1.onBackFromSleep)({
|
|
115
116
|
callback: () => {
|
|
116
|
-
if (this.socket) {
|
|
117
|
-
this.logger.debug('
|
|
118
|
-
|
|
117
|
+
if (!this.socket) {
|
|
118
|
+
this.logger.debug('WebSocket instance does not exist, skipping reconnect after sleep');
|
|
119
|
+
return;
|
|
119
120
|
}
|
|
121
|
+
this.logger.debug('Back from sleep, reconnecting WebSocket');
|
|
122
|
+
// Force reconnect even if the browser keeps the socket in OPEN state after sleep.
|
|
123
|
+
this.socket.reconnect();
|
|
120
124
|
},
|
|
121
|
-
isDisconnected: () => this.getState() === WEBSOCKET_STATE.CLOSED,
|
|
122
125
|
});
|
|
123
126
|
}
|
|
124
127
|
internalOnError = (error) => {
|
|
@@ -133,6 +136,7 @@ class ReconnectingWebsocket {
|
|
|
133
136
|
if (data === PingMessage.PONG) {
|
|
134
137
|
this.logger.debug('Received pong from WebSocket');
|
|
135
138
|
this.hasUnansweredPing = false;
|
|
139
|
+
this.resolvePendingHealthChecks(true);
|
|
136
140
|
return;
|
|
137
141
|
}
|
|
138
142
|
this.onMessage?.(data);
|
|
@@ -158,6 +162,7 @@ class ReconnectingWebsocket {
|
|
|
158
162
|
internalOnClose = (event) => {
|
|
159
163
|
this.logger.debug(`WebSocket closed with code: ${event?.code}${event?.reason ? `Reason: ${event?.reason}` : ''}`);
|
|
160
164
|
this.stopPinging();
|
|
165
|
+
this.resolvePendingHealthChecks(false);
|
|
161
166
|
if (this.onClose) {
|
|
162
167
|
this.onClose(event);
|
|
163
168
|
}
|
|
@@ -173,16 +178,20 @@ class ReconnectingWebsocket {
|
|
|
173
178
|
}
|
|
174
179
|
}
|
|
175
180
|
sendPing = () => {
|
|
176
|
-
if (this.socket) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
181
|
+
if (!this.socket) {
|
|
182
|
+
this.logger.debug('WebSocket instance does not exist, skipping ping');
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
if (this.hasUnansweredPing) {
|
|
186
|
+
this.logger.warn('Ping interval check failed');
|
|
187
|
+
this.stopPinging();
|
|
188
|
+
// Closing here intentionally triggers reconnecting-websocket's retry loop; it will call
|
|
189
|
+
// internalOnReconnect to build a fresh URL and re-open the socket.
|
|
190
|
+
this.socket.close(CloseEventCode.NORMAL_CLOSURE, 'Ping timeout');
|
|
191
|
+
return;
|
|
185
192
|
}
|
|
193
|
+
this.hasUnansweredPing = true;
|
|
194
|
+
this.send(PingMessage.PING);
|
|
186
195
|
};
|
|
187
196
|
connect() {
|
|
188
197
|
this.socket = this.getReconnectingWebsocket();
|
|
@@ -197,6 +206,27 @@ class ReconnectingWebsocket {
|
|
|
197
206
|
getState() {
|
|
198
207
|
return this.socket ? this.socket.readyState : WEBSOCKET_STATE.CLOSED;
|
|
199
208
|
}
|
|
209
|
+
/**
|
|
210
|
+
* Lightweight health probe that sends a single ping and resolves with whether a pong was received in time.
|
|
211
|
+
* Does not close or reconnect the socket; callers can decide how to react to failures.
|
|
212
|
+
*/
|
|
213
|
+
checkHealth(timeoutMs = commons_1.TimeUtil.TimeInMillis.SECOND * 5) {
|
|
214
|
+
if (!this.socket || this.getState() !== WEBSOCKET_STATE.OPEN) {
|
|
215
|
+
return Promise.resolve(false);
|
|
216
|
+
}
|
|
217
|
+
return new Promise(resolve => {
|
|
218
|
+
const timeoutId = setTimeout(() => {
|
|
219
|
+
this.pendingHealthChecks.delete(resolveHealthCheck);
|
|
220
|
+
resolve(false);
|
|
221
|
+
}, timeoutMs);
|
|
222
|
+
const resolveHealthCheck = (isHealthy) => {
|
|
223
|
+
clearTimeout(timeoutId);
|
|
224
|
+
resolve(isHealthy);
|
|
225
|
+
};
|
|
226
|
+
this.pendingHealthChecks.add(resolveHealthCheck);
|
|
227
|
+
this.send(PingMessage.PING);
|
|
228
|
+
});
|
|
229
|
+
}
|
|
200
230
|
disconnect(reason = 'Closed by client') {
|
|
201
231
|
if (this.socket) {
|
|
202
232
|
this.logger.info(`Disconnecting from WebSocket (reason: "${reason}")`);
|
|
@@ -221,6 +251,10 @@ class ReconnectingWebsocket {
|
|
|
221
251
|
getReconnectingWebsocket() {
|
|
222
252
|
return new reconnecting_websocket_1.default(this.internalOnReconnect, undefined, ReconnectingWebsocket.RECONNECTING_OPTIONS);
|
|
223
253
|
}
|
|
254
|
+
resolvePendingHealthChecks(isHealthy) {
|
|
255
|
+
this.pendingHealthChecks.forEach(resolve => resolve(isHealthy));
|
|
256
|
+
this.pendingHealthChecks.clear();
|
|
257
|
+
}
|
|
224
258
|
setOnOpen(onOpen) {
|
|
225
259
|
this.onOpen = onOpen;
|
|
226
260
|
}
|
|
@@ -74,6 +74,14 @@ export declare class WebSocketClient extends EventEmitter {
|
|
|
74
74
|
acknowledgeMissedNotification(): void;
|
|
75
75
|
acknowledgeConsumableNotificationSynchronization(notification: ConsumableNotificationSynchronization): void;
|
|
76
76
|
acknowledgeNotification(notification: ConsumableNotificationEvent): void;
|
|
77
|
+
/**
|
|
78
|
+
* Performs a lightweight health check on the WebSocket connection.
|
|
79
|
+
* Sends a ping and waits for a pong response without closing or reconnecting the socket.
|
|
80
|
+
* The default timeout is 5 seconds; this may be configurable depending on the socket implementation.
|
|
81
|
+
* This method does not disrupt the existing connection.
|
|
82
|
+
* @returns A promise that resolves to true if a pong is received within the timeout, false otherwise.
|
|
83
|
+
*/
|
|
84
|
+
checkHealth(): Promise<boolean>;
|
|
77
85
|
}
|
|
78
86
|
export {};
|
|
79
87
|
//# sourceMappingURL=WebSocketClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebSocketClient.d.ts","sourceRoot":"","sources":["../../src/tcp/WebSocketClient.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAElD,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AAKpC,OAAO,EAAwB,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAE/E,OAAO,EAAC,iBAAiB,EAA8B,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAE3F,OAAO,EAAC,UAAU,EAAe,MAAM,UAAU,CAAC;AAClD,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAE3B,qCAAqC,EACtC,MAAM,wCAAwC,CAAC;AAEhD,aAAK,KAAK;IACR,QAAQ,mCAAmC;IAC3C,gBAAgB,2CAA2C;IAC3D,UAAU,qCAAqC;IAC/C,eAAe,0CAA0C;CAC1D;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,K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,QAAQ,CAAC,SAAS,CAcxB;IAEF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAItB;IAEF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAM1B;IAEF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAErB;IAEF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAItB;IAEF;;;;;;;;;;;OAWG;IACI,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,eAAe;YAmB3D,kBAAkB;IA8BzB,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAMxC;;;;OAIG;IACH,SAAgB,MAAM,aAOpB;IAEF;;;;;OAKG;IACH,SAAgB,IAAI,aAGlB;IAEK,QAAQ,IAAI,OAAO;IAInB,iBAAiB,IAAI,MAAM;IA0C3B,2BAA2B;IAM3B,6BAA6B;IAQ7B,gDAAgD,CAAC,YAAY,EAAE,qCAAqC;IAYpG,uBAAuB,CAAC,YAAY,EAAE,2BAA2B;IAiBxE;;;;;;OAMG;IACI,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;CAGvC"}
|
|
@@ -257,5 +257,15 @@ class WebSocketClient extends events_1.EventEmitter {
|
|
|
257
257
|
});
|
|
258
258
|
this.socket.send(jsonEvent);
|
|
259
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* Performs a lightweight health check on the WebSocket connection.
|
|
262
|
+
* Sends a ping and waits for a pong response without closing or reconnecting the socket.
|
|
263
|
+
* The default timeout is 5 seconds; this may be configurable depending on the socket implementation.
|
|
264
|
+
* This method does not disrupt the existing connection.
|
|
265
|
+
* @returns A promise that resolves to true if a pong is received within the timeout, false otherwise.
|
|
266
|
+
*/
|
|
267
|
+
checkHealth() {
|
|
268
|
+
return this.socket.checkHealth();
|
|
269
|
+
}
|
|
260
270
|
}
|
|
261
271
|
exports.WebSocketClient = WebSocketClient;
|
package/package.json
CHANGED
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@aws-sdk/client-s3": "3.908.0",
|
|
17
17
|
"@aws-sdk/lib-storage": "3.908.0",
|
|
18
|
-
"@wireapp/commons": "^5.4.
|
|
19
|
-
"@wireapp/priority-queue": "^2.1.
|
|
18
|
+
"@wireapp/commons": "^5.4.9",
|
|
19
|
+
"@wireapp/priority-queue": "^2.1.16",
|
|
20
20
|
"@wireapp/protocol-messaging": "1.53.0",
|
|
21
21
|
"axios": "1.12.2",
|
|
22
22
|
"axios-retry": "4.5.0",
|
|
23
|
-
"cells-sdk-ts": "0.1.1-
|
|
23
|
+
"cells-sdk-ts": "0.1.1-alpha17",
|
|
24
24
|
"http-status-codes": "2.3.0",
|
|
25
25
|
"logdown": "3.3.1",
|
|
26
26
|
"pako": "2.1.0",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"@types/spark-md5": "3.0.5",
|
|
42
42
|
"@types/tough-cookie": "4.0.5",
|
|
43
43
|
"@types/ws": "8.5.14",
|
|
44
|
-
"@wireapp/store-engine": "^5.1.
|
|
45
|
-
"@wireapp/store-engine-fs": "^3.1.
|
|
44
|
+
"@wireapp/store-engine": "^5.1.16",
|
|
45
|
+
"@wireapp/store-engine-fs": "^3.1.18",
|
|
46
46
|
"browser-sync": "3.0.4",
|
|
47
47
|
"concurrently": "9.2.1",
|
|
48
48
|
"cross-env": "10.1.0",
|
|
@@ -70,6 +70,6 @@
|
|
|
70
70
|
"watch": "webpack serve --config webpack.browser.js",
|
|
71
71
|
"prepare": "yarn dist"
|
|
72
72
|
},
|
|
73
|
-
"version": "27.90.1-beta.
|
|
74
|
-
"gitHead": "
|
|
73
|
+
"version": "27.90.1-beta.22.f6fd03fe6",
|
|
74
|
+
"gitHead": "f6fd03fe61d83ba1f03786f6d202e1e19478c743"
|
|
75
75
|
}
|