@stomp/stompjs 7.0.0-beta1 → 7.0.0-beta3
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/README.md +11 -18
- package/bundles/package.json +6 -0
- package/bundles/stomp.umd.js +1728 -2044
- package/bundles/stomp.umd.js.map +1 -0
- package/bundles/stomp.umd.min.js +1 -1
- package/bundles/tcp-wrapper.cjs +84 -0
- package/bundles/tcp-wrapper.cjs.map +1 -0
- package/esm6/augment-websocket.d.ts +1 -1
- package/esm6/augment-websocket.js +1 -1
- package/esm6/augment-websocket.js.map +1 -1
- package/esm6/client.d.ts +51 -47
- package/esm6/client.js +160 -172
- package/esm6/client.js.map +1 -1
- package/esm6/compatibility/compat-client.d.ts +4 -4
- package/esm6/compatibility/compat-client.js +3 -3
- package/esm6/compatibility/compat-client.js.map +1 -1
- package/esm6/compatibility/heartbeat-info.d.ts +1 -1
- package/esm6/compatibility/stomp.d.ts +1 -1
- package/esm6/compatibility/stomp.js +2 -2
- package/esm6/compatibility/stomp.js.map +1 -1
- package/esm6/frame-impl.d.ts +3 -3
- package/esm6/frame-impl.js +1 -1
- package/esm6/frame-impl.js.map +1 -1
- package/esm6/i-frame.d.ts +1 -1
- package/esm6/i-message.d.ts +4 -4
- package/esm6/index-web.d.ts +13 -0
- package/esm6/index-web.js +15 -0
- package/esm6/index-web.js.map +1 -0
- package/esm6/index.d.ts +2 -13
- package/esm6/index.js +2 -14
- package/esm6/index.js.map +1 -1
- package/esm6/parser.d.ts +1 -1
- package/esm6/parser.js +3 -3
- package/esm6/parser.js.map +1 -1
- package/esm6/stomp-config.d.ts +4 -7
- package/esm6/stomp-config.js +0 -3
- package/esm6/stomp-config.js.map +1 -1
- package/esm6/stomp-handler.d.ts +6 -6
- package/esm6/stomp-handler.js +12 -12
- package/esm6/stomp-handler.js.map +1 -1
- package/esm6/stomp-subscription.d.ts +1 -1
- package/esm6/tcp-wrapper.d.ts +18 -0
- package/esm6/tcp-wrapper.js +61 -0
- package/esm6/tcp-wrapper.js.map +1 -0
- package/esm6/types.d.ts +14 -13
- package/esm6/types.js +2 -2
- package/esm6/types.js.map +1 -1
- package/esm6/versions.d.ts +3 -3
- package/esm6/versions.js +3 -3
- package/index.d.ts +1 -1
- package/package.json +11 -7
- package/src/augment-websocket.ts +1 -1
- package/src/client.ts +53 -49
- package/src/compatibility/compat-client.ts +5 -5
- package/src/compatibility/heartbeat-info.ts +1 -1
- package/src/compatibility/stomp.ts +3 -3
- package/src/frame-impl.ts +4 -4
- package/src/i-frame.ts +1 -1
- package/src/i-message.ts +4 -4
- package/src/index-web.ts +15 -0
- package/src/index.ts +2 -15
- package/src/parser.ts +4 -4
- package/src/stomp-config.ts +4 -7
- package/src/stomp-handler.ts +17 -17
- package/src/stomp-subscription.ts +1 -1
- package/src/tcp-wrapper.ts +83 -0
- package/src/types.ts +14 -13
- package/src/versions.ts +3 -3
package/esm6/client.js
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { StompHandler } from './stomp-handler';
|
|
11
|
-
import { ActivationState, StompSocketState, } from './types';
|
|
12
|
-
import { Versions } from './versions';
|
|
1
|
+
import { StompHandler } from './stomp-handler.js';
|
|
2
|
+
import { ActivationState, StompSocketState, } from './types.js';
|
|
3
|
+
import { Versions } from './versions.js';
|
|
13
4
|
/**
|
|
14
5
|
* STOMP Client Class.
|
|
15
6
|
*
|
|
@@ -21,18 +12,18 @@ export class Client {
|
|
|
21
12
|
*/
|
|
22
13
|
constructor(conf = {}) {
|
|
23
14
|
/**
|
|
24
|
-
* STOMP versions to attempt during STOMP handshake. By default versions `1.
|
|
15
|
+
* STOMP versions to attempt during STOMP handshake. By default, versions `1.2`, `1.1`, and `1.0` are attempted.
|
|
25
16
|
*
|
|
26
17
|
* Example:
|
|
27
18
|
* ```javascript
|
|
28
|
-
* // Try only versions 1.
|
|
29
|
-
* client.stompVersions = new Versions(['1.
|
|
19
|
+
* // Try only versions 1.1 and 1.0
|
|
20
|
+
* client.stompVersions = new Versions(['1.1', '1.0'])
|
|
30
21
|
* ```
|
|
31
22
|
*/
|
|
32
23
|
this.stompVersions = Versions.default;
|
|
33
24
|
/**
|
|
34
25
|
* Will retry if Stomp connection is not established in specified milliseconds.
|
|
35
|
-
* Default 0, which
|
|
26
|
+
* Default 0, which switches off automatic reconnection.
|
|
36
27
|
*/
|
|
37
28
|
this.connectionTimeout = 0;
|
|
38
29
|
/**
|
|
@@ -48,13 +39,13 @@ export class Client {
|
|
|
48
39
|
*/
|
|
49
40
|
this.heartbeatOutgoing = 10000;
|
|
50
41
|
/**
|
|
51
|
-
* This switches on a non
|
|
42
|
+
* This switches on a non-standard behavior while sending WebSocket packets.
|
|
52
43
|
* It splits larger (text) packets into chunks of [maxWebSocketChunkSize]{@link Client#maxWebSocketChunkSize}.
|
|
53
|
-
* Only Java Spring brokers
|
|
44
|
+
* Only Java Spring brokers seem to support this mode.
|
|
54
45
|
*
|
|
55
46
|
* WebSockets, by itself, split large (text) packets,
|
|
56
47
|
* so it is not needed with a truly compliant STOMP/WebSocket broker.
|
|
57
|
-
*
|
|
48
|
+
* Setting it for such a broker will cause large messages to fail.
|
|
58
49
|
*
|
|
59
50
|
* `false` by default.
|
|
60
51
|
*
|
|
@@ -88,19 +79,21 @@ export class Client {
|
|
|
88
79
|
this.appendMissingNULLonIncoming = false;
|
|
89
80
|
/**
|
|
90
81
|
* Browsers do not immediately close WebSockets when `.close` is issued.
|
|
91
|
-
* This may cause reconnection to take a
|
|
92
|
-
*
|
|
93
|
-
*
|
|
82
|
+
* This may cause reconnection to take a significantly long time in case
|
|
83
|
+
* of some types of failures.
|
|
84
|
+
* In case of incoming heartbeat failure, this experimental flag instructs
|
|
85
|
+
* the library to discard the socket immediately
|
|
86
|
+
* (even before it is actually closed).
|
|
94
87
|
*/
|
|
95
88
|
this.discardWebsocketOnCommFailure = false;
|
|
96
89
|
/**
|
|
97
90
|
* Activation state.
|
|
98
91
|
*
|
|
99
92
|
* It will usually be ACTIVE or INACTIVE.
|
|
100
|
-
* When deactivating it may go from ACTIVE to INACTIVE without entering DEACTIVATING.
|
|
93
|
+
* When deactivating, it may go from ACTIVE to INACTIVE without entering DEACTIVATING.
|
|
101
94
|
*/
|
|
102
95
|
this.state = ActivationState.INACTIVE;
|
|
103
|
-
//
|
|
96
|
+
// No op callbacks
|
|
104
97
|
const noOp = () => { };
|
|
105
98
|
this.debug = noOp;
|
|
106
99
|
this.beforeConnect = noOp;
|
|
@@ -124,8 +117,7 @@ export class Client {
|
|
|
124
117
|
* Underlying WebSocket instance, READONLY.
|
|
125
118
|
*/
|
|
126
119
|
get webSocket() {
|
|
127
|
-
|
|
128
|
-
return (_a = this._stompHandler) === null || _a === void 0 ? void 0 : _a._webSocket;
|
|
120
|
+
return this._stompHandler?._webSocket;
|
|
129
121
|
}
|
|
130
122
|
/**
|
|
131
123
|
* Disconnection headers.
|
|
@@ -140,7 +132,7 @@ export class Client {
|
|
|
140
132
|
}
|
|
141
133
|
}
|
|
142
134
|
/**
|
|
143
|
-
* `true` if there is
|
|
135
|
+
* `true` if there is an active connection to STOMP Broker
|
|
144
136
|
*/
|
|
145
137
|
get connected() {
|
|
146
138
|
return !!this._stompHandler && this._stompHandler.connected;
|
|
@@ -187,96 +179,94 @@ export class Client {
|
|
|
187
179
|
this._changeState(ActivationState.ACTIVE);
|
|
188
180
|
this._connect();
|
|
189
181
|
}
|
|
190
|
-
_connect() {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
182
|
+
async _connect() {
|
|
183
|
+
if (this.connected) {
|
|
184
|
+
this.debug('STOMP: already connected, nothing to do');
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
await this.beforeConnect();
|
|
188
|
+
if (!this.active) {
|
|
189
|
+
this.debug('Client has been marked inactive, will not attempt to connect');
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
// setup connection watcher
|
|
193
|
+
if (this.connectionTimeout > 0) {
|
|
194
|
+
// clear first
|
|
195
|
+
if (this._connectionWatcher) {
|
|
196
|
+
clearTimeout(this._connectionWatcher);
|
|
200
197
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
198
|
+
this._connectionWatcher = setTimeout(() => {
|
|
199
|
+
if (this.connected) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
// Connection not established, close the underlying socket
|
|
203
|
+
// a reconnection will be attempted
|
|
204
|
+
this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`);
|
|
205
|
+
this.forceDisconnect();
|
|
206
|
+
}, this.connectionTimeout);
|
|
207
|
+
}
|
|
208
|
+
this.debug('Opening Web Socket...');
|
|
209
|
+
// Get the actual WebSocket (or a similar object)
|
|
210
|
+
const webSocket = this._createWebSocket();
|
|
211
|
+
this._stompHandler = new StompHandler(this, webSocket, {
|
|
212
|
+
debug: this.debug,
|
|
213
|
+
stompVersions: this.stompVersions,
|
|
214
|
+
connectHeaders: this.connectHeaders,
|
|
215
|
+
disconnectHeaders: this._disconnectHeaders,
|
|
216
|
+
heartbeatIncoming: this.heartbeatIncoming,
|
|
217
|
+
heartbeatOutgoing: this.heartbeatOutgoing,
|
|
218
|
+
splitLargeFrames: this.splitLargeFrames,
|
|
219
|
+
maxWebSocketChunkSize: this.maxWebSocketChunkSize,
|
|
220
|
+
forceBinaryWSFrames: this.forceBinaryWSFrames,
|
|
221
|
+
logRawCommunication: this.logRawCommunication,
|
|
222
|
+
appendMissingNULLonIncoming: this.appendMissingNULLonIncoming,
|
|
223
|
+
discardWebsocketOnCommFailure: this.discardWebsocketOnCommFailure,
|
|
224
|
+
onConnect: frame => {
|
|
225
|
+
// Successfully connected, stop the connection watcher
|
|
204
226
|
if (this._connectionWatcher) {
|
|
205
227
|
clearTimeout(this._connectionWatcher);
|
|
228
|
+
this._connectionWatcher = undefined;
|
|
206
229
|
}
|
|
207
|
-
this.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
},
|
|
246
|
-
onDisconnect: frame => {
|
|
247
|
-
this.onDisconnect(frame);
|
|
248
|
-
},
|
|
249
|
-
onStompError: frame => {
|
|
250
|
-
this.onStompError(frame);
|
|
251
|
-
},
|
|
252
|
-
onWebSocketClose: evt => {
|
|
253
|
-
this._stompHandler = undefined; // a new one will be created in case of a reconnect
|
|
254
|
-
if (this.state === ActivationState.DEACTIVATING) {
|
|
255
|
-
// Mark deactivation complete
|
|
256
|
-
this._changeState(ActivationState.INACTIVE);
|
|
257
|
-
}
|
|
258
|
-
// The callback is called before attempting to reconnect, this would allow the client
|
|
259
|
-
// to be `deactivated` in the callback.
|
|
260
|
-
this.onWebSocketClose(evt);
|
|
261
|
-
if (this.active) {
|
|
262
|
-
this._schedule_reconnect();
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
onWebSocketError: evt => {
|
|
266
|
-
this.onWebSocketError(evt);
|
|
267
|
-
},
|
|
268
|
-
onUnhandledMessage: message => {
|
|
269
|
-
this.onUnhandledMessage(message);
|
|
270
|
-
},
|
|
271
|
-
onUnhandledReceipt: frame => {
|
|
272
|
-
this.onUnhandledReceipt(frame);
|
|
273
|
-
},
|
|
274
|
-
onUnhandledFrame: frame => {
|
|
275
|
-
this.onUnhandledFrame(frame);
|
|
276
|
-
},
|
|
277
|
-
});
|
|
278
|
-
this._stompHandler.start();
|
|
230
|
+
if (!this.active) {
|
|
231
|
+
this.debug('STOMP got connected while deactivate was issued, will disconnect now');
|
|
232
|
+
this._disposeStompHandler();
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
this.onConnect(frame);
|
|
236
|
+
},
|
|
237
|
+
onDisconnect: frame => {
|
|
238
|
+
this.onDisconnect(frame);
|
|
239
|
+
},
|
|
240
|
+
onStompError: frame => {
|
|
241
|
+
this.onStompError(frame);
|
|
242
|
+
},
|
|
243
|
+
onWebSocketClose: evt => {
|
|
244
|
+
this._stompHandler = undefined; // a new one will be created in case of a reconnect
|
|
245
|
+
if (this.state === ActivationState.DEACTIVATING) {
|
|
246
|
+
// Mark deactivation complete
|
|
247
|
+
this._changeState(ActivationState.INACTIVE);
|
|
248
|
+
}
|
|
249
|
+
// The callback is called before attempting to reconnect, this would allow the client
|
|
250
|
+
// to be `deactivated` in the callback.
|
|
251
|
+
this.onWebSocketClose(evt);
|
|
252
|
+
if (this.active) {
|
|
253
|
+
this._schedule_reconnect();
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
onWebSocketError: evt => {
|
|
257
|
+
this.onWebSocketError(evt);
|
|
258
|
+
},
|
|
259
|
+
onUnhandledMessage: message => {
|
|
260
|
+
this.onUnhandledMessage(message);
|
|
261
|
+
},
|
|
262
|
+
onUnhandledReceipt: frame => {
|
|
263
|
+
this.onUnhandledReceipt(frame);
|
|
264
|
+
},
|
|
265
|
+
onUnhandledFrame: frame => {
|
|
266
|
+
this.onUnhandledFrame(frame);
|
|
267
|
+
},
|
|
279
268
|
});
|
|
269
|
+
this._stompHandler.start();
|
|
280
270
|
}
|
|
281
271
|
_createWebSocket() {
|
|
282
272
|
let webSocket;
|
|
@@ -314,7 +304,8 @@ export class Client {
|
|
|
314
304
|
*
|
|
315
305
|
* Experimental: pass `force: true` to immediately discard the underlying connection.
|
|
316
306
|
* This mode will skip both the STOMP and the Websocket shutdown sequences.
|
|
317
|
-
* In some cases, browsers take a long time in the Websocket shutdown
|
|
307
|
+
* In some cases, browsers take a long time in the Websocket shutdown
|
|
308
|
+
* if the underlying connection had gone stale.
|
|
318
309
|
* Using this mode can speed up.
|
|
319
310
|
* When this mode is used, the actual Websocket may linger for a while
|
|
320
311
|
* and the broker may not realize that the connection is no longer in use.
|
|
@@ -322,52 +313,49 @@ export class Client {
|
|
|
322
313
|
* It is possible to invoke this method initially without the `force` option
|
|
323
314
|
* and subsequently, say after a wait, with the `force` option.
|
|
324
315
|
*/
|
|
325
|
-
deactivate(options = {}) {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
//
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
}
|
|
365
|
-
return retPromise;
|
|
366
|
-
});
|
|
316
|
+
async deactivate(options = {}) {
|
|
317
|
+
const force = options.force || false;
|
|
318
|
+
const needToDispose = this.active;
|
|
319
|
+
let retPromise;
|
|
320
|
+
if (this.state === ActivationState.INACTIVE) {
|
|
321
|
+
this.debug(`Already INACTIVE, nothing more to do`);
|
|
322
|
+
return Promise.resolve();
|
|
323
|
+
}
|
|
324
|
+
this._changeState(ActivationState.DEACTIVATING);
|
|
325
|
+
// Clear if a reconnection was scheduled
|
|
326
|
+
if (this._reconnector) {
|
|
327
|
+
clearTimeout(this._reconnector);
|
|
328
|
+
this._reconnector = undefined;
|
|
329
|
+
}
|
|
330
|
+
if (this._stompHandler &&
|
|
331
|
+
// @ts-ignore - if there is a _stompHandler, there is the webSocket
|
|
332
|
+
this.webSocket.readyState !== StompSocketState.CLOSED) {
|
|
333
|
+
const origOnWebSocketClose = this._stompHandler.onWebSocketClose;
|
|
334
|
+
// we need to wait for the underlying websocket to close
|
|
335
|
+
retPromise = new Promise((resolve, reject) => {
|
|
336
|
+
// @ts-ignore - there is a _stompHandler
|
|
337
|
+
this._stompHandler.onWebSocketClose = evt => {
|
|
338
|
+
origOnWebSocketClose(evt);
|
|
339
|
+
resolve();
|
|
340
|
+
};
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
// indicate that auto reconnect loop should terminate
|
|
345
|
+
this._changeState(ActivationState.INACTIVE);
|
|
346
|
+
return Promise.resolve();
|
|
347
|
+
}
|
|
348
|
+
if (force) {
|
|
349
|
+
this._stompHandler?.discardWebsocket();
|
|
350
|
+
}
|
|
351
|
+
else if (needToDispose) {
|
|
352
|
+
this._disposeStompHandler();
|
|
353
|
+
}
|
|
354
|
+
return retPromise;
|
|
367
355
|
}
|
|
368
356
|
/**
|
|
369
357
|
* Force disconnect if there is an active connection by directly closing the underlying WebSocket.
|
|
370
|
-
* This is different
|
|
358
|
+
* This is different from a normal disconnect where a DISCONNECT sequence is carried out with the broker.
|
|
371
359
|
* After forcing disconnect, automatic reconnect will be attempted.
|
|
372
360
|
* To stop further reconnects call [Client#deactivate]{@link Client#deactivate} as well.
|
|
373
361
|
*/
|
|
@@ -386,22 +374,22 @@ export class Client {
|
|
|
386
374
|
* Send a message to a named destination. Refer to your STOMP broker documentation for types
|
|
387
375
|
* and naming of destinations.
|
|
388
376
|
*
|
|
389
|
-
* STOMP protocol specifies and suggests some headers and also allows broker
|
|
377
|
+
* STOMP protocol specifies and suggests some headers and also allows broker-specific headers.
|
|
390
378
|
*
|
|
391
379
|
* `body` must be String.
|
|
392
380
|
* You will need to covert the payload to string in case it is not string (e.g. JSON).
|
|
393
381
|
*
|
|
394
|
-
* To send a binary message body use binaryBody parameter. It should be a
|
|
382
|
+
* To send a binary message body, use `binaryBody` parameter. It should be a
|
|
395
383
|
* [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array).
|
|
396
384
|
* Sometimes brokers may not support binary frames out of the box.
|
|
397
385
|
* Please check your broker documentation.
|
|
398
386
|
*
|
|
399
387
|
* `content-length` header is automatically added to the STOMP Frame sent to the broker.
|
|
400
388
|
* Set `skipContentLengthHeader` to indicate that `content-length` header should not be added.
|
|
401
|
-
* For binary messages `content-length` header is always added.
|
|
389
|
+
* For binary messages, `content-length` header is always added.
|
|
402
390
|
*
|
|
403
|
-
* Caution: The broker will, most likely, report an error and disconnect
|
|
404
|
-
* and `content-length` header is missing.
|
|
391
|
+
* Caution: The broker will, most likely, report an error and disconnect
|
|
392
|
+
* if the message body has NULL octet(s) and `content-length` header is missing.
|
|
405
393
|
*
|
|
406
394
|
* ```javascript
|
|
407
395
|
* client.publish({destination: "/queue/test", headers: {priority: 9}, body: "Hello, STOMP"});
|
|
@@ -431,16 +419,16 @@ export class Client {
|
|
|
431
419
|
/**
|
|
432
420
|
* STOMP brokers may carry out operation asynchronously and allow requesting for acknowledgement.
|
|
433
421
|
* To request an acknowledgement, a `receipt` header needs to be sent with the actual request.
|
|
434
|
-
* The value (say receipt-id) for this header needs to be unique for each use.
|
|
435
|
-
* random number or a combination may be used.
|
|
422
|
+
* The value (say receipt-id) for this header needs to be unique for each use.
|
|
423
|
+
* Typically, a sequence, a UUID, a random number or a combination may be used.
|
|
436
424
|
*
|
|
437
425
|
* A complaint broker will send a RECEIPT frame when an operation has actually been completed.
|
|
438
|
-
* The operation needs to be matched based
|
|
426
|
+
* The operation needs to be matched based on the value of the receipt-id.
|
|
439
427
|
*
|
|
440
|
-
* This method
|
|
441
|
-
*
|
|
428
|
+
* This method allows watching for a receipt and invoking the callback
|
|
429
|
+
* when the corresponding receipt has been received.
|
|
442
430
|
*
|
|
443
|
-
* The actual {@link
|
|
431
|
+
* The actual {@link IFrame} will be passed as parameter to the callback.
|
|
444
432
|
*
|
|
445
433
|
* Example:
|
|
446
434
|
* ```javascript
|
|
@@ -469,11 +457,11 @@ export class Client {
|
|
|
469
457
|
this._stompHandler.watchForReceipt(receiptId, callback);
|
|
470
458
|
}
|
|
471
459
|
/**
|
|
472
|
-
* Subscribe to a STOMP Broker location. The callback will be invoked for each
|
|
473
|
-
* the {@link IMessage} as argument.
|
|
460
|
+
* Subscribe to a STOMP Broker location. The callback will be invoked for each
|
|
461
|
+
* received message with the {@link IMessage} as argument.
|
|
474
462
|
*
|
|
475
|
-
* Note: The library will generate
|
|
476
|
-
* To use your own ID, pass it using the headers argument.
|
|
463
|
+
* Note: The library will generate a unique ID if there is none provided in the headers.
|
|
464
|
+
* To use your own ID, pass it using the `headers` argument.
|
|
477
465
|
*
|
|
478
466
|
* ```javascript
|
|
479
467
|
* callback = function(message) {
|
|
@@ -507,7 +495,7 @@ export class Client {
|
|
|
507
495
|
* subscription.unsubscribe();
|
|
508
496
|
* ```
|
|
509
497
|
*
|
|
510
|
-
* See:
|
|
498
|
+
* See: https://stomp.github.com/stomp-specification-1.2.html#UNSUBSCRIBE UNSUBSCRIBE Frame
|
|
511
499
|
*/
|
|
512
500
|
unsubscribe(id, headers = {}) {
|
|
513
501
|
this._checkConnection();
|
package/esm6/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,EACL,eAAe,EAOf,gBAAgB,GAEjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAUzC;;;;GAIG;AACH,MAAM,OAAO,MAAM;IAyTjB;;OAEG;IACH,YAAY,OAAoB,EAAE;QA/SlC;;;;;;;;WAQG;QACI,kBAAa,GAAG,QAAQ,CAAC,OAAO,CAAC;QAyBxC;;;WAGG;QACI,sBAAiB,GAAW,CAAC,CAAC;QAKrC;;WAEG;QACI,mBAAc,GAAW,IAAI,CAAC;QAErC;;WAEG;QACI,sBAAiB,GAAW,KAAK,CAAC;QAEzC;;WAEG;QACI,sBAAiB,GAAW,KAAK,CAAC;QAEzC;;;;;;;;;;;;WAYG;QACI,qBAAgB,GAAY,KAAK,CAAC;QAEzC;;;WAGG;QACI,0BAAqB,GAAW,CAAC,GAAG,IAAI,CAAC;QAEhD;;;;;;;WAOG;QACI,wBAAmB,GAAY,KAAK,CAAC;QAE5C;;;;;;;;;WASG;QACI,gCAA2B,GAAY,KAAK,CAAC;QAyJpD;;;;;;;WAOG;QACI,kCAA6B,GAAY,KAAK,CAAC;QA8BtD;;;;;WAKG;QACI,UAAK,GAAoB,eAAe,CAAC,QAAQ,CAAC;QAQvD,kBAAkB;QAClB,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC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KAAK,CAAC,aAAqB;QAChC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,qFAAqF;QACrF,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAC1C,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,GAAG,CACR,SAAiB,EACjB,cAAsB,EACtB,UAAwB,EAAE;QAE1B,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,qFAAqF;QACrF,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,IAAI,CACT,SAAiB,EACjB,cAAsB,EACtB,UAAwB,EAAE;QAE1B,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,qFAAqF;QACrF,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Client } from '../client';
|
|
2
|
-
import { StompHeaders } from '../stomp-headers';
|
|
3
|
-
import { frameCallbackType, messageCallbackType } from '../types';
|
|
1
|
+
import { Client } from '../client.js';
|
|
2
|
+
import { StompHeaders } from '../stomp-headers.js';
|
|
3
|
+
import { frameCallbackType, messageCallbackType } from '../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Available for backward compatibility, please shift to using {@link Client}.
|
|
6
6
|
*
|
|
@@ -8,7 +8,7 @@ import { frameCallbackType, messageCallbackType } from '../types';
|
|
|
8
8
|
*
|
|
9
9
|
* Part of `@stomp/stompjs`.
|
|
10
10
|
*
|
|
11
|
-
* To upgrade, please follow the [Upgrade Guide](
|
|
11
|
+
* To upgrade, please follow the [Upgrade Guide](https://stomp-js.github.io/guide/stompjs/upgrading-stompjs.html)
|
|
12
12
|
*/
|
|
13
13
|
export declare class CompatClient extends Client {
|
|
14
14
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Client } from '../client';
|
|
2
|
-
import { HeartbeatInfo } from './heartbeat-info';
|
|
1
|
+
import { Client } from '../client.js';
|
|
2
|
+
import { HeartbeatInfo } from './heartbeat-info.js';
|
|
3
3
|
/**
|
|
4
4
|
* Available for backward compatibility, please shift to using {@link Client}.
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@ import { HeartbeatInfo } from './heartbeat-info';
|
|
|
7
7
|
*
|
|
8
8
|
* Part of `@stomp/stompjs`.
|
|
9
9
|
*
|
|
10
|
-
* To upgrade, please follow the [Upgrade Guide](
|
|
10
|
+
* To upgrade, please follow the [Upgrade Guide](https://stomp-js.github.io/guide/stompjs/upgrading-stompjs.html)
|
|
11
11
|
*/
|
|
12
12
|
export class CompatClient extends Client {
|
|
13
13
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compat-client.js","sourceRoot":"","sources":["../../src/compatibility/compat-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"compat-client.js","sourceRoot":"","sources":["../../src/compatibility/compat-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAM;IAMtC;;;;;;;OAOG;IACH,YAAY,gBAA2B;QACrC,KAAK,EAAE,CAAC;QAdV;;WAEG;QACI,0BAAqB,GAAW,EAAE,GAAG,IAAI,CAAC;QAoOzC,mBAAc,GAAkB,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;QAxN9D,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,gCAAgC;QAChC,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,OAAc,EAAE,EA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AC;IAC/B,CAAC;IAED;;;;OAIG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,IAAI,SAAS,CAAC,KAA0B;QACtC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;IAClC,CAAC;IAED;;;;;OAKG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED;;;;OAIG;IACH,IAAI,SAAS,CAAC,KAAwB;QACpC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;IAClC,CAAC;IAID;;;;;OAKG;IACH,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAED;;;;;OAKG;IACH,IAAI,SAAS,CAAC,KAA6C;QACzD,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,QAAQ,CAAC;QACxC,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC,QAAQ,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stomp.js","sourceRoot":"","sources":["../../src/compatibility/stomp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"stomp.js","sourceRoot":"","sources":["../../src/compatibility/stomp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAWlD;;;;;;;;GAQG;AACH,MAAM,OAAO,KAAK;IAqBhB;;;;;;;;;;;;;OAaG;IACI,MAAM,CAAC,MAAM,CAAC,GAAW,EAAE,SAAoB;QACpD,mEAAmE;QACnE,yBAAyB;QACzB,EAAE;QACF,iDAAiD;QACjD,EAAE;QACF,0CAA0C;QAC1C,EAAE;QACF,oCAAoC;QACpC,EAAE;QACF,mEAAmE;QACnE,WAAW;QAEX,yCAAyC;QACzC,IAAI,SAAS,IAAI,IAAI,EAAE;YACrB,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;SACjD;QACD,MAAM,IAAI,GAAG,GAAG,EAAE;YAChB,MAAM,KAAK,GAAG,KAAK,CAAC,cAAc,IAAI,SAAS,CAAC;YAChD,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QACnC,CAAC,CAAC;QAEF,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACI,MAAM,CAAC,IAAI,CAAC,EAAO;QACxB,IAAI,IAAe,CAAC;QAEpB,IAAI,OAAO,EAAE,KAAK,UAAU,EAAE;YAC5B,IAAI,GAAG,EAAE,CAAC;SACX;aAAM;YACL,OAAO,CAAC,IAAI,CACV,sEAAsE;gBACpE,+EAA+E,CAClF,CAAC;YACF,IAAI,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC;SACjB;QAED,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;;AA9FD;;;;;;;;;;;;;;;;GAgBG;AACH,yCAAyC;AAC3B,oBAAc,GAAQ,IAAI,CAAC"}
|
package/esm6/frame-impl.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IFrame } from './i-frame';
|
|
2
|
-
import { StompHeaders } from './stomp-headers';
|
|
3
|
-
import { IRawFrameType } from './types';
|
|
1
|
+
import { IFrame } from './i-frame.js';
|
|
2
|
+
import { StompHeaders } from './stomp-headers.js';
|
|
3
|
+
import { IRawFrameType } from './types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Frame class represents a STOMP frame.
|
|
6
6
|
*
|
package/esm6/frame-impl.js
CHANGED