@ohos-ports/genesys-cloud-streaming-client 20.1.0-beta.1

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.
Files changed (176) hide show
  1. package/README.md +47 -0
  2. package/dist/cjs/alerting-leader.d.ts +29 -0
  3. package/dist/cjs/alerting-leader.js +163 -0
  4. package/dist/cjs/client.d.ts +84 -0
  5. package/dist/cjs/client.js +680 -0
  6. package/dist/cjs/connection-manager.d.ts +18 -0
  7. package/dist/cjs/connection-manager.js +120 -0
  8. package/dist/cjs/connection-transfer.d.ts +7 -0
  9. package/dist/cjs/connection-transfer.js +20 -0
  10. package/dist/cjs/http-client.d.ts +18 -0
  11. package/dist/cjs/http-client.js +230 -0
  12. package/dist/cjs/index.d.ts +10 -0
  13. package/dist/cjs/index.js +31 -0
  14. package/dist/cjs/messenger.d.ts +37 -0
  15. package/dist/cjs/messenger.js +54 -0
  16. package/dist/cjs/notifications.d.ts +94 -0
  17. package/dist/cjs/notifications.js +495 -0
  18. package/dist/cjs/ping.d.ts +21 -0
  19. package/dist/cjs/ping.js +60 -0
  20. package/dist/cjs/polyfills.d.ts +0 -0
  21. package/dist/cjs/polyfills.js +6 -0
  22. package/dist/cjs/server-monitor.d.ts +16 -0
  23. package/dist/cjs/server-monitor.js +44 -0
  24. package/dist/cjs/stanza-definitions/webrtc-signaling.d.ts +29 -0
  25. package/dist/cjs/stanza-definitions/webrtc-signaling.js +113 -0
  26. package/dist/cjs/stanza-definitions/xep0051.d.ts +19 -0
  27. package/dist/cjs/stanza-definitions/xep0051.js +28 -0
  28. package/dist/cjs/stats-formatter.d.ts +6 -0
  29. package/dist/cjs/stats-formatter.js +63 -0
  30. package/dist/cjs/types/genesys-cloud-media-session.d.ts +64 -0
  31. package/dist/cjs/types/genesys-cloud-media-session.js +353 -0
  32. package/dist/cjs/types/interfaces.d.ts +310 -0
  33. package/dist/cjs/types/interfaces.js +22 -0
  34. package/dist/cjs/types/libs.d.ts +32 -0
  35. package/dist/cjs/types/libs.js +1 -0
  36. package/dist/cjs/types/media-session.d.ts +76 -0
  37. package/dist/cjs/types/media-session.js +2 -0
  38. package/dist/cjs/types/named-agent.d.ts +13 -0
  39. package/dist/cjs/types/named-agent.js +2 -0
  40. package/dist/cjs/types/offline-error.d.ts +2 -0
  41. package/dist/cjs/types/offline-error.js +5 -0
  42. package/dist/cjs/types/sasl-error.d.ts +8 -0
  43. package/dist/cjs/types/sasl-error.js +12 -0
  44. package/dist/cjs/types/stanza-media-session.d.ts +56 -0
  45. package/dist/cjs/types/stanza-media-session.js +255 -0
  46. package/dist/cjs/types/streaming-client-extension.d.ts +14 -0
  47. package/dist/cjs/types/streaming-client-extension.js +2 -0
  48. package/dist/cjs/types/timeout-error.d.ts +3 -0
  49. package/dist/cjs/types/timeout-error.js +9 -0
  50. package/dist/cjs/types/user-cancelled-error.d.ts +2 -0
  51. package/dist/cjs/types/user-cancelled-error.js +5 -0
  52. package/dist/cjs/utils.d.ts +34 -0
  53. package/dist/cjs/utils.js +202 -0
  54. package/dist/cjs/webrtc.d.ts +126 -0
  55. package/dist/cjs/webrtc.js +891 -0
  56. package/dist/deploy-info.json +21 -0
  57. package/dist/es/alerting-leader.d.ts +29 -0
  58. package/dist/es/alerting-leader.js +177 -0
  59. package/dist/es/client.d.ts +84 -0
  60. package/dist/es/client.js +699 -0
  61. package/dist/es/connection-manager.d.ts +18 -0
  62. package/dist/es/connection-manager.js +124 -0
  63. package/dist/es/connection-transfer.d.ts +7 -0
  64. package/dist/es/connection-transfer.js +16 -0
  65. package/dist/es/http-client.d.ts +18 -0
  66. package/dist/es/http-client.js +194 -0
  67. package/dist/es/index.bundle.js +39629 -0
  68. package/dist/es/index.d.ts +10 -0
  69. package/dist/es/index.js +10 -0
  70. package/dist/es/messenger.d.ts +37 -0
  71. package/dist/es/messenger.js +62 -0
  72. package/dist/es/notifications.d.ts +94 -0
  73. package/dist/es/notifications.js +507 -0
  74. package/dist/es/ping.d.ts +21 -0
  75. package/dist/es/ping.js +68 -0
  76. package/dist/es/polyfills.d.ts +0 -0
  77. package/dist/es/polyfills.js +6 -0
  78. package/dist/es/server-monitor.d.ts +16 -0
  79. package/dist/es/server-monitor.js +41 -0
  80. package/dist/es/stanza-definitions/webrtc-signaling.d.ts +29 -0
  81. package/dist/es/stanza-definitions/webrtc-signaling.js +110 -0
  82. package/dist/es/stanza-definitions/xep0051.d.ts +19 -0
  83. package/dist/es/stanza-definitions/xep0051.js +25 -0
  84. package/dist/es/stats-formatter.d.ts +6 -0
  85. package/dist/es/stats-formatter.js +54 -0
  86. package/dist/es/types/genesys-cloud-media-session.d.ts +64 -0
  87. package/dist/es/types/genesys-cloud-media-session.js +379 -0
  88. package/dist/es/types/interfaces.d.ts +310 -0
  89. package/dist/es/types/interfaces.js +19 -0
  90. package/dist/es/types/libs.d.ts +32 -0
  91. package/dist/es/types/libs.js +1 -0
  92. package/dist/es/types/media-session.d.ts +76 -0
  93. package/dist/es/types/media-session.js +1 -0
  94. package/dist/es/types/named-agent.d.ts +13 -0
  95. package/dist/es/types/named-agent.js +1 -0
  96. package/dist/es/types/offline-error.d.ts +2 -0
  97. package/dist/es/types/offline-error.js +2 -0
  98. package/dist/es/types/sasl-error.d.ts +8 -0
  99. package/dist/es/types/sasl-error.js +9 -0
  100. package/dist/es/types/stanza-media-session.d.ts +56 -0
  101. package/dist/es/types/stanza-media-session.js +264 -0
  102. package/dist/es/types/streaming-client-extension.d.ts +14 -0
  103. package/dist/es/types/streaming-client-extension.js +1 -0
  104. package/dist/es/types/timeout-error.d.ts +3 -0
  105. package/dist/es/types/timeout-error.js +5 -0
  106. package/dist/es/types/user-cancelled-error.d.ts +2 -0
  107. package/dist/es/types/user-cancelled-error.js +2 -0
  108. package/dist/es/utils.d.ts +34 -0
  109. package/dist/es/utils.js +192 -0
  110. package/dist/es/webrtc.d.ts +126 -0
  111. package/dist/es/webrtc.js +917 -0
  112. package/dist/manifest.json +19 -0
  113. package/dist/npm/CHANGELOG.md +637 -0
  114. package/dist/npm/README.md +47 -0
  115. package/dist/npm/alerting-leader.d.ts +29 -0
  116. package/dist/npm/alerting-leader.js +163 -0
  117. package/dist/npm/client.d.ts +84 -0
  118. package/dist/npm/client.js +680 -0
  119. package/dist/npm/connection-manager.d.ts +18 -0
  120. package/dist/npm/connection-manager.js +120 -0
  121. package/dist/npm/connection-transfer.d.ts +7 -0
  122. package/dist/npm/connection-transfer.js +20 -0
  123. package/dist/npm/http-client.d.ts +18 -0
  124. package/dist/npm/http-client.js +230 -0
  125. package/dist/npm/index.d.ts +10 -0
  126. package/dist/npm/index.js +31 -0
  127. package/dist/npm/messenger.d.ts +37 -0
  128. package/dist/npm/messenger.js +54 -0
  129. package/dist/npm/module.js +10 -0
  130. package/dist/npm/notifications.d.ts +94 -0
  131. package/dist/npm/notifications.js +495 -0
  132. package/dist/npm/ping.d.ts +21 -0
  133. package/dist/npm/ping.js +60 -0
  134. package/dist/npm/polyfills.d.ts +0 -0
  135. package/dist/npm/polyfills.js +6 -0
  136. package/dist/npm/server-monitor.d.ts +16 -0
  137. package/dist/npm/server-monitor.js +44 -0
  138. package/dist/npm/stanza-definitions/webrtc-signaling.d.ts +29 -0
  139. package/dist/npm/stanza-definitions/webrtc-signaling.js +113 -0
  140. package/dist/npm/stanza-definitions/xep0051.d.ts +19 -0
  141. package/dist/npm/stanza-definitions/xep0051.js +28 -0
  142. package/dist/npm/stats-formatter.d.ts +6 -0
  143. package/dist/npm/stats-formatter.js +63 -0
  144. package/dist/npm/types/genesys-cloud-media-session.d.ts +64 -0
  145. package/dist/npm/types/genesys-cloud-media-session.js +353 -0
  146. package/dist/npm/types/interfaces.d.ts +310 -0
  147. package/dist/npm/types/interfaces.js +22 -0
  148. package/dist/npm/types/libs.d.ts +32 -0
  149. package/dist/npm/types/libs.js +1 -0
  150. package/dist/npm/types/media-session.d.ts +76 -0
  151. package/dist/npm/types/media-session.js +2 -0
  152. package/dist/npm/types/named-agent.d.ts +13 -0
  153. package/dist/npm/types/named-agent.js +2 -0
  154. package/dist/npm/types/offline-error.d.ts +2 -0
  155. package/dist/npm/types/offline-error.js +5 -0
  156. package/dist/npm/types/sasl-error.d.ts +8 -0
  157. package/dist/npm/types/sasl-error.js +12 -0
  158. package/dist/npm/types/stanza-media-session.d.ts +56 -0
  159. package/dist/npm/types/stanza-media-session.js +255 -0
  160. package/dist/npm/types/streaming-client-extension.d.ts +14 -0
  161. package/dist/npm/types/streaming-client-extension.js +2 -0
  162. package/dist/npm/types/timeout-error.d.ts +3 -0
  163. package/dist/npm/types/timeout-error.js +9 -0
  164. package/dist/npm/types/user-cancelled-error.d.ts +2 -0
  165. package/dist/npm/types/user-cancelled-error.js +5 -0
  166. package/dist/npm/utils.d.ts +34 -0
  167. package/dist/npm/utils.js +207 -0
  168. package/dist/npm/webrtc.d.ts +126 -0
  169. package/dist/npm/webrtc.js +893 -0
  170. package/dist/streaming-client.browser.js +2 -0
  171. package/dist/streaming-client.browser.js.LICENSE.txt +12 -0
  172. package/dist/v20/streaming-client.browser.js +2 -0
  173. package/dist/v20/streaming-client.browser.js.LICENSE.txt +12 -0
  174. package/dist/v20.1.0/streaming-client.browser.js +2 -0
  175. package/dist/v20.1.0/streaming-client.browser.js.LICENSE.txt +12 -0
  176. package/package.json +132 -0
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ ## Streaming Client
2
+ [![Test Matrix](https://github.com/purecloudlabs/genesys-cloud-streaming-client/actions/workflows/matrix.yml/badge.svg)](https://github.com/purecloudlabs/genesys-cloud-streaming-client/actions/workflows/matrix.yml)
3
+
4
+ ### Overview
5
+ Client library for Genesys Cloud streaming services (websocket/XMPP interface).
6
+
7
+ ### Installation
8
+ ```bash
9
+ npm install genesys-cloud-streaming-client
10
+ ```
11
+
12
+ ### Quick Start
13
+ ```ts
14
+ import StreamingClient from 'genesys-cloud-streaming-client';
15
+
16
+ const client = new StreamingClient({
17
+ host: 'wss://streaming.mypurecloud.com',
18
+ authToken: 'your-access-token',
19
+ });
20
+
21
+ await client.connect();
22
+ ```
23
+
24
+ > If you're using this in a browser with a bundler like Vite or Webpack 5, you'll
25
+ > need polyfills for `global`, `events`, and possibly `process`. See the
26
+ > [full documentation](doc/documentation.md#browser-usage--polyfills) for details.
27
+
28
+ ### Documentation
29
+ See [doc/documentation.md](doc/documentation.md) for the full API reference,
30
+ browser polyfill setup, and known issues.
31
+
32
+ ### Development
33
+
34
+ Run `npm install` to install dependencies.
35
+
36
+ ### Testing
37
+ Run the tests using `npm test` in the command line.
38
+
39
+ ### Build for Local Use
40
+ Run `npm run build`
41
+
42
+ ### Linting and Style
43
+ ESLint with the semistandard config has been added and you can run linting through the command line via `npm run lint`
44
+
45
+ To fix minor styling errors, run `npm run lint:fix`
46
+
47
+ **If you can configure your editor to run linting while typing or on save, this is preferable.**
@@ -0,0 +1,29 @@
1
+ /// <reference types="node" />
2
+ import { IClientOptions, ILeaderStatus, StreamingClientExtension } from './types/interfaces';
3
+ import { Client } from './client';
4
+ import { EventEmitter } from 'events';
5
+ import { NamedAgent } from './types/named-agent';
6
+ export declare class AlertingLeaderExtension extends EventEmitter implements StreamingClientExtension {
7
+ private client;
8
+ private connectionId?;
9
+ private alertableInteractionTypes;
10
+ private getLeaderAbortController?;
11
+ private leaderStatus;
12
+ private debouncedClaimAlertingLeader;
13
+ constructor(client: Client, options: IClientOptions);
14
+ handleStanzaInstanceChange(stanzaInstance: NamedAgent): void;
15
+ private setupAlertingLeader;
16
+ private subscribeToAlertingLeader;
17
+ private markAsAlertable;
18
+ private getAlertingLeaderEarly;
19
+ private getAlertingLeader;
20
+ private claimAlertingLeader;
21
+ get expose(): AlertingLeaderApi;
22
+ }
23
+ export interface AlertingLeaderApi {
24
+ on: (event: string, handler: (...args: any) => void) => void;
25
+ off: (event: string, handler: (...args: any) => void) => void;
26
+ claimAlertingLeader(): Promise<void>;
27
+ getLeaderStatus(): ILeaderStatus;
28
+ leaderStatus: ILeaderStatus;
29
+ }
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AlertingLeaderExtension = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ const debounce_promise_1 = __importDefault(require("debounce-promise"));
9
+ const interfaces_1 = require("./types/interfaces");
10
+ const events_1 = require("events");
11
+ const utils_1 = require("./utils");
12
+ class AlertingLeaderExtension extends events_1.EventEmitter {
13
+ constructor(client, options) {
14
+ var _a;
15
+ super();
16
+ this.client = client;
17
+ this.leaderStatus = {};
18
+ this.alertableInteractionTypes = (_a = options.alertableInteractionTypes) !== null && _a !== void 0 ? _a : [];
19
+ this.debouncedClaimAlertingLeader = (0, debounce_promise_1.default)(this.claimAlertingLeader.bind(this), 300);
20
+ }
21
+ handleStanzaInstanceChange(stanzaInstance) {
22
+ var _a, _b;
23
+ this.connectionId = (_b = (_a = stanzaInstance.transport) === null || _a === void 0 ? void 0 : _a.stream) === null || _b === void 0 ? void 0 : _b.id;
24
+ this.setupAlertingLeader();
25
+ }
26
+ async setupAlertingLeader() {
27
+ if (this.alertableInteractionTypes.length !== 0) {
28
+ try {
29
+ this.getAlertingLeaderEarly();
30
+ await this.subscribeToAlertingLeader();
31
+ await this.markAsAlertable();
32
+ await this.getAlertingLeader();
33
+ }
34
+ catch (err) {
35
+ this.client.logger.warn('Failed to setup alerting leader; falling back to acting as the leader');
36
+ // Fail 'open' so users don't miss calls
37
+ this.leaderStatus = { voice: { alerting: true, configured: false } };
38
+ this.emit('alertingLeaderChanged', this.leaderStatus);
39
+ }
40
+ }
41
+ }
42
+ async subscribeToAlertingLeader() {
43
+ const topic = `v2.users.${this.client.config.userId}.alertingleader`;
44
+ this.client.on(`notify:${topic}`, (event) => {
45
+ var _a, _b;
46
+ (_a = this.getLeaderAbortController) === null || _a === void 0 ? void 0 : _a.abort();
47
+ if ((_b = event.eventBody) === null || _b === void 0 ? void 0 : _b.connectionId) {
48
+ // The consuming client should be the one alerting if our connection is the current leader
49
+ const alerting = event.eventBody.connectionId === this.connectionId;
50
+ const clientType = event.eventBody.clientType;
51
+ let voice = { alerting, configured: true };
52
+ if (clientType) {
53
+ voice = { ...voice, clientType };
54
+ }
55
+ this.leaderStatus = { voice };
56
+ this.emit('alertingLeaderChanged', this.leaderStatus);
57
+ }
58
+ });
59
+ return this.client._notifications._subscribeInternal(topic);
60
+ }
61
+ async markAsAlertable() {
62
+ const userId = this.client.config.userId;
63
+ const connectionsRequestOptions = {
64
+ method: 'patch',
65
+ host: this.client.config.apiHost,
66
+ authToken: this.client.config.authToken,
67
+ logger: this.client.logger,
68
+ data: {
69
+ alertable: true
70
+ }
71
+ };
72
+ // STREAM-1204
73
+ // There's a race condition between the backend service knowing about the connection
74
+ // and us marking the connection as alertable. For now, we'll just retry with some delay.
75
+ const maxRetries = 16;
76
+ let retryCount = 0;
77
+ const retry = (0, utils_1.retryPromise)(() => this.client.http.requestApi(`apps/users/${userId}/connections/${this.connectionId}`, connectionsRequestOptions), () => {
78
+ retryCount++;
79
+ if (retryCount >= maxRetries) {
80
+ this.client.logger.info('Max retries reached for marking connection as alertable');
81
+ return false;
82
+ }
83
+ return true;
84
+ }, 500, this.client.logger);
85
+ return retry.promise
86
+ .catch(() => {
87
+ this.client.logger.warn('Could not mark this connection as alertable');
88
+ });
89
+ }
90
+ async getAlertingLeaderEarly() {
91
+ try {
92
+ await this.getAlertingLeader();
93
+ }
94
+ catch (error) {
95
+ if (axios_1.default.isAxiosError(error) && error.status === 400) {
96
+ this.client.logger.info('The org has not configured alerting leader functionality or there are not yet any active alertable connections; falling back to acting as the leader');
97
+ this.leaderStatus = { voice: { alerting: true, configured: false } };
98
+ this.emit('alertingLeaderChanged', this.leaderStatus);
99
+ }
100
+ }
101
+ }
102
+ async getAlertingLeader() {
103
+ var _a;
104
+ // If an early request is still in-flight, cancel it and get more recent data
105
+ (_a = this.getLeaderAbortController) === null || _a === void 0 ? void 0 : _a.abort();
106
+ this.getLeaderAbortController = new AbortController();
107
+ const leaderRequestOptions = {
108
+ method: 'get',
109
+ host: this.client.config.apiHost,
110
+ authToken: this.client.config.authToken,
111
+ logger: this.client.logger,
112
+ signal: this.getLeaderAbortController.signal
113
+ };
114
+ try {
115
+ const currentLeader = await this.client.http.requestApiWithRetry('users/alertingleader', leaderRequestOptions, 1000).promise;
116
+ // The consuming client should be the one alerting if our connection is the current leader
117
+ const alerting = currentLeader.data.connectionId === this.connectionId;
118
+ const clientType = currentLeader.data.clientType;
119
+ let voice = { alerting, configured: true };
120
+ if (clientType) {
121
+ voice = { ...voice, clientType };
122
+ }
123
+ this.leaderStatus = { voice };
124
+ this.emit('alertingLeaderChanged', this.leaderStatus);
125
+ }
126
+ catch (err) {
127
+ if (axios_1.default.isCancel(err)) {
128
+ return;
129
+ }
130
+ throw err;
131
+ }
132
+ }
133
+ async claimAlertingLeader() {
134
+ if (this.alertableInteractionTypes.length === 0) {
135
+ this.client.logger.info('This client is not configured for any alertable interactions and will not attempt to claim alerting leader');
136
+ throw new utils_1.StreamingClientError(interfaces_1.StreamingClientErrorTypes.generic, 'Unable to claim alerting leader; this client is not configured for any alertable interactions');
137
+ }
138
+ const leaderRequestOptions = {
139
+ method: 'put',
140
+ host: this.client.config.apiHost,
141
+ authToken: this.client.config.authToken,
142
+ logger: this.client.logger,
143
+ data: {
144
+ connectionId: this.connectionId
145
+ }
146
+ };
147
+ return this.client.http.requestApi('users/alertingleader', leaderRequestOptions)
148
+ .catch((err) => {
149
+ this.client.logger.warn('Unable to claim alerting leader; this client may not alert for incoming interactions');
150
+ throw new utils_1.StreamingClientError(interfaces_1.StreamingClientErrorTypes.generic, 'Unable to claim alerting leader', err);
151
+ });
152
+ }
153
+ get expose() {
154
+ return {
155
+ on: this.on.bind(this),
156
+ off: this.off.bind(this),
157
+ claimAlertingLeader: this.debouncedClaimAlertingLeader,
158
+ getLeaderStatus: () => { return this.leaderStatus; },
159
+ leaderStatus: this.leaderStatus
160
+ };
161
+ }
162
+ }
163
+ exports.AlertingLeaderExtension = AlertingLeaderExtension;
@@ -0,0 +1,84 @@
1
+ /// <reference types="node" />
2
+ import { Logger } from 'genesys-cloud-client-logger';
3
+ import './polyfills';
4
+ import { AlertingLeaderExtension, AlertingLeaderApi } from './alerting-leader';
5
+ import { Notifications, NotificationsAPI } from './notifications';
6
+ import { WebrtcExtension, WebrtcExtensionAPI } from './webrtc';
7
+ import { Ping } from './ping';
8
+ import { StreamingClientExtension } from './types/streaming-client-extension';
9
+ import { HttpClient } from './http-client';
10
+ import { IClientOptions, IClientConfig, StreamingClientConnectOptions } from './types/interfaces';
11
+ import { NamedAgent } from './types/named-agent';
12
+ import EventEmitter from 'events';
13
+ import { MessengerExtensionApi, MessengerExtension } from './messenger';
14
+ export declare class Client extends EventEmitter {
15
+ activeStanzaInstance?: NamedAgent;
16
+ connected: boolean;
17
+ connecting: boolean;
18
+ hardReconnectRequired: boolean;
19
+ reconnectOnNoLongerSubscribed: boolean;
20
+ useServerSidePings: boolean;
21
+ logger: Logger;
22
+ config: IClientConfig;
23
+ isGuest: boolean;
24
+ backgroundAssistantMode: boolean;
25
+ private autoReconnect;
26
+ private cancelConnectionAttempt;
27
+ private extensions;
28
+ private connectionManager;
29
+ private channelReuses;
30
+ private backoffReductionTimer;
31
+ private hasMadeInitialAttempt;
32
+ private jidResource;
33
+ private boundStanzaDisconnect?;
34
+ private boundStanzaNoLongerSubscribed?;
35
+ private boundStanzaDuplicateId?;
36
+ http: HttpClient;
37
+ notifications: NotificationsAPI;
38
+ _notifications: Notifications;
39
+ webrtcSessions: WebrtcExtensionAPI;
40
+ _webrtcSessions: WebrtcExtension;
41
+ messenger: MessengerExtension;
42
+ _messenger: MessengerExtensionApi;
43
+ alertingLeader: AlertingLeaderApi;
44
+ _alertingLeader: AlertingLeaderExtension;
45
+ _ping: Ping;
46
+ constructor(options: IClientOptions);
47
+ private handleSendEventFromExtension;
48
+ private checkIsBackgroundAssistant;
49
+ private addInateEventHandlers;
50
+ private removeStanzaBoundEventHandlers;
51
+ private proxyStanzaEvents;
52
+ private handleStanzaDisconnectedEvent;
53
+ private handleNoLongerSubscribed;
54
+ private handleDuplicateId;
55
+ disconnect(): Promise<any>;
56
+ private getSessionStoreKey;
57
+ private getConnectionData;
58
+ private setConnectionData;
59
+ private increaseBackoff;
60
+ private decreaseBackoff;
61
+ private getStartingDelay;
62
+ connect(connectOpts?: StreamingClientConnectOptions): Promise<void>;
63
+ private backoffConnectRetryHandler;
64
+ private networkErrorNeedsAuth;
65
+ private saslErrorIsRetryable;
66
+ /**
67
+ * Performs an active network connectivity check by querying the API.
68
+ * navigator.onLine is unreliable (VPNs, virtual adapters, etc.), so we
69
+ * actually reach out to verify we can talk to the server.
70
+ *
71
+ * Returns true if connectivity is confirmed, false otherwise.
72
+ * This is advisory only — it does not gate connection attempts.
73
+ */
74
+ checkNetworkConnectivity(): Promise<boolean>;
75
+ private makeConnectionAttempt;
76
+ private setupConnectionMonitoring;
77
+ private prepareForConnect;
78
+ stopServerLogging(): void;
79
+ startServerLogging(): void;
80
+ setAccessToken(token: string): void;
81
+ static extend(namespace: any, extension: StreamingClientExtension | ((client: Client) => void)): void;
82
+ get version(): string;
83
+ static get version(): string;
84
+ }