@azure/web-pubsub-express 1.0.6-alpha.20240927.1 → 1.0.6-alpha.20241001.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.
- package/README.md +165 -0
- package/dist/commonjs/cloudEventsDispatcher.d.ts.map +1 -1
- package/dist/commonjs/cloudEventsDispatcher.js +143 -8
- package/dist/commonjs/cloudEventsDispatcher.js.map +1 -1
- package/dist/commonjs/cloudEventsProtocols.d.ts +174 -1
- package/dist/commonjs/cloudEventsProtocols.d.ts.map +1 -1
- package/dist/commonjs/cloudEventsProtocols.js.map +1 -1
- package/dist/commonjs/enum/MqttErrorCodes/mqttDisconnectReasonCode.d.ts +180 -0
- package/dist/commonjs/enum/MqttErrorCodes/mqttDisconnectReasonCode.d.ts.map +1 -0
- package/dist/commonjs/enum/MqttErrorCodes/mqttDisconnectReasonCode.js +186 -0
- package/dist/commonjs/enum/MqttErrorCodes/mqttDisconnectReasonCode.js.map +1 -0
- package/dist/commonjs/enum/MqttErrorCodes/mqttV311ConnectReturnCode.d.ts +31 -0
- package/dist/commonjs/enum/MqttErrorCodes/mqttV311ConnectReturnCode.d.ts.map +1 -0
- package/dist/commonjs/enum/MqttErrorCodes/mqttV311ConnectReturnCode.js +37 -0
- package/dist/commonjs/enum/MqttErrorCodes/mqttV311ConnectReturnCode.js.map +1 -0
- package/dist/commonjs/enum/MqttErrorCodes/mqttV500ConnectReasonCode.d.ts +112 -0
- package/dist/commonjs/enum/MqttErrorCodes/mqttV500ConnectReasonCode.d.ts.map +1 -0
- package/dist/commonjs/enum/MqttErrorCodes/mqttV500ConnectReasonCode.js +118 -0
- package/dist/commonjs/enum/MqttErrorCodes/mqttV500ConnectReasonCode.js.map +1 -0
- package/dist/commonjs/index.d.ts +3 -0
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +473 -8
- package/dist/commonjs/index.js.map +1 -1
- package/dist/esm/cloudEventsDispatcher.d.ts.map +1 -1
- package/dist/esm/cloudEventsDispatcher.js +143 -8
- package/dist/esm/cloudEventsDispatcher.js.map +1 -1
- package/dist/esm/cloudEventsProtocols.d.ts +174 -1
- package/dist/esm/cloudEventsProtocols.d.ts.map +1 -1
- package/dist/esm/cloudEventsProtocols.js.map +1 -1
- package/dist/esm/enum/MqttErrorCodes/mqttDisconnectReasonCode.d.ts +180 -0
- package/dist/esm/enum/MqttErrorCodes/mqttDisconnectReasonCode.d.ts.map +1 -0
- package/dist/esm/enum/MqttErrorCodes/mqttDisconnectReasonCode.js +183 -0
- package/dist/esm/enum/MqttErrorCodes/mqttDisconnectReasonCode.js.map +1 -0
- package/dist/esm/enum/MqttErrorCodes/mqttV311ConnectReturnCode.d.ts +31 -0
- package/dist/esm/enum/MqttErrorCodes/mqttV311ConnectReturnCode.d.ts.map +1 -0
- package/dist/esm/enum/MqttErrorCodes/mqttV311ConnectReturnCode.js +34 -0
- package/dist/esm/enum/MqttErrorCodes/mqttV311ConnectReturnCode.js.map +1 -0
- package/dist/esm/enum/MqttErrorCodes/mqttV500ConnectReasonCode.d.ts +112 -0
- package/dist/esm/enum/MqttErrorCodes/mqttV500ConnectReasonCode.d.ts.map +1 -0
- package/dist/esm/enum/MqttErrorCodes/mqttV500ConnectReasonCode.js +115 -0
- package/dist/esm/enum/MqttErrorCodes/mqttV500ConnectReasonCode.js.map +1 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/web-pubsub-express.d.ts +507 -1
- package/package.json +1 -1
|
@@ -20,10 +20,28 @@ export declare interface ConnectedRequest {
|
|
|
20
20
|
context: ConnectionContext;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Response of a failed connect event.
|
|
25
|
+
*/
|
|
26
|
+
export declare interface ConnectErrorResponse {
|
|
27
|
+
/**
|
|
28
|
+
* The error code.
|
|
29
|
+
*/
|
|
30
|
+
code: 400 | 401 | 500;
|
|
31
|
+
/**
|
|
32
|
+
* The error detail.
|
|
33
|
+
*/
|
|
34
|
+
detail?: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
23
37
|
/**
|
|
24
38
|
* The connection context representing the client WebSocket connection.
|
|
25
39
|
*/
|
|
26
40
|
export declare interface ConnectionContext {
|
|
41
|
+
/**
|
|
42
|
+
* The unique identifier generated by the service of the network connection.
|
|
43
|
+
*/
|
|
44
|
+
signature: string;
|
|
27
45
|
/**
|
|
28
46
|
* The hub the connection belongs to.
|
|
29
47
|
*/
|
|
@@ -52,6 +70,14 @@ export declare interface ConnectionContext {
|
|
|
52
70
|
* Get the additional states for the connection, such states are perserved throughout the lifetime of the connection.
|
|
53
71
|
*/
|
|
54
72
|
states: Record<string, any>;
|
|
73
|
+
/**
|
|
74
|
+
* The type of client protocol.
|
|
75
|
+
*/
|
|
76
|
+
clientProtocol: WebPubSubClientProtocol;
|
|
77
|
+
/**
|
|
78
|
+
* The MQTT properties that the client WebSocket connection has when it connects (For MQTT connection only).
|
|
79
|
+
*/
|
|
80
|
+
mqtt?: MqttConnectionContextProperties;
|
|
55
81
|
}
|
|
56
82
|
|
|
57
83
|
/**
|
|
@@ -125,13 +151,18 @@ export declare interface ConnectResponseHandler {
|
|
|
125
151
|
* Return success response to the service.
|
|
126
152
|
* @param response - The response for the connect event.
|
|
127
153
|
*/
|
|
128
|
-
success(response?: ConnectResponse): void;
|
|
154
|
+
success(response?: ConnectResponse | MqttConnectResponse): void;
|
|
129
155
|
/**
|
|
130
156
|
* Return failed response and the service will reject the client WebSocket connection.
|
|
131
157
|
* @param code - Code can be 400 user error, 401 unauthorized and 500 server error.
|
|
132
158
|
* @param detail - The detail of the error.
|
|
133
159
|
*/
|
|
134
160
|
fail(code: 400 | 401 | 500, detail?: string): void;
|
|
161
|
+
/**
|
|
162
|
+
* Return failed response with MQTT response properties and the service will reject the client WebSocket connection.
|
|
163
|
+
* @param response - The response for the connect event which contains either default WebPubSub or MQTT response properties.
|
|
164
|
+
*/
|
|
165
|
+
failWith(response: ConnectErrorResponse | MqttConnectErrorResponse): void;
|
|
135
166
|
}
|
|
136
167
|
|
|
137
168
|
/**
|
|
@@ -148,6 +179,476 @@ export declare interface DisconnectedRequest {
|
|
|
148
179
|
reason?: string;
|
|
149
180
|
}
|
|
150
181
|
|
|
182
|
+
/**
|
|
183
|
+
* Response of an MQTT connection failure.
|
|
184
|
+
*/
|
|
185
|
+
export declare interface MqttConnectErrorResponse {
|
|
186
|
+
/**
|
|
187
|
+
* The properties of the MQTT connection failure response.
|
|
188
|
+
*/
|
|
189
|
+
mqtt: MqttConnectErrorResponseProperties;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* The properties of an MQTT connection failure response.
|
|
194
|
+
*/
|
|
195
|
+
export declare interface MqttConnectErrorResponseProperties {
|
|
196
|
+
/**
|
|
197
|
+
* The MQTT connect return code.
|
|
198
|
+
*/
|
|
199
|
+
code: MqttV311ConnectReturnCode | MqttV500ConnectReasonCode;
|
|
200
|
+
/**
|
|
201
|
+
* The reason string for the connection failure.
|
|
202
|
+
*/
|
|
203
|
+
reason?: string;
|
|
204
|
+
/**
|
|
205
|
+
* The user properties in the response.
|
|
206
|
+
*/
|
|
207
|
+
userProperties?: MqttUserProperty[];
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* The connection context properties representing the MQTT client WebSocket connection.
|
|
212
|
+
*/
|
|
213
|
+
export declare interface MqttConnectionContextProperties {
|
|
214
|
+
/**
|
|
215
|
+
* The unique identifier generated by the service of the network connection.
|
|
216
|
+
*/
|
|
217
|
+
physicalConnectionId: string;
|
|
218
|
+
/**
|
|
219
|
+
* The unique identifier generated by the service of the MQTT session.
|
|
220
|
+
*/
|
|
221
|
+
sessionId?: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* The properties of the MQTT CONNECT packet.
|
|
226
|
+
*/
|
|
227
|
+
export declare interface MqttConnectProperties {
|
|
228
|
+
/**
|
|
229
|
+
* MQTT protocol version.
|
|
230
|
+
*/
|
|
231
|
+
protocolVersion: number;
|
|
232
|
+
/**
|
|
233
|
+
* The username field in the MQTT CONNECT packet.
|
|
234
|
+
*/
|
|
235
|
+
username?: string;
|
|
236
|
+
/**
|
|
237
|
+
* The password field in the MQTT CONNECT packet.
|
|
238
|
+
*/
|
|
239
|
+
password?: string;
|
|
240
|
+
/**
|
|
241
|
+
* The user properties in the MQTT CONNECT packet.
|
|
242
|
+
*/
|
|
243
|
+
userProperties?: MqttUserProperty[];
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Request for the MQTT connect event.
|
|
248
|
+
*/
|
|
249
|
+
export declare interface MqttConnectRequest extends ConnectRequest {
|
|
250
|
+
/**
|
|
251
|
+
* The MQTT specific properties in the MQTT connect event request.
|
|
252
|
+
*/
|
|
253
|
+
mqtt: MqttConnectProperties;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Success respones of the connect event.
|
|
258
|
+
*/
|
|
259
|
+
export declare interface MqttConnectResponse extends ConnectResponse {
|
|
260
|
+
/**
|
|
261
|
+
* The MQTT specific properties in a successful MQTT connection event response.
|
|
262
|
+
*/
|
|
263
|
+
mqtt?: MqttConnectResponseProperties;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* The properties of a successful MQTT connection event response
|
|
268
|
+
*/
|
|
269
|
+
export declare interface MqttConnectResponseProperties {
|
|
270
|
+
/**
|
|
271
|
+
* Additional diagnostic or other information provided by upstream server
|
|
272
|
+
* Now only MQTT 5.0 supports user properties
|
|
273
|
+
*/
|
|
274
|
+
userProperties?: MqttUserProperty[];
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* The properties of an MQTT disconnected event.
|
|
279
|
+
*/
|
|
280
|
+
export declare interface MqttDisconnectedProperties {
|
|
281
|
+
/**
|
|
282
|
+
* The MQTT disconnect packet.
|
|
283
|
+
*/
|
|
284
|
+
disconnectPacket: MqttDisconnectPacket;
|
|
285
|
+
/**
|
|
286
|
+
* Whether the disconnection is initiated by the client.
|
|
287
|
+
*/
|
|
288
|
+
initiatedByClient: boolean;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Request for the disconnected event.
|
|
293
|
+
*/
|
|
294
|
+
export declare interface MqttDisconnectedRequest extends DisconnectedRequest {
|
|
295
|
+
/**
|
|
296
|
+
* The MQTT specific properties in the MQTT disconnected event request.
|
|
297
|
+
*/
|
|
298
|
+
mqtt: MqttDisconnectedProperties;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* The properties of the MQTT DISCONNECT packet.
|
|
303
|
+
*/
|
|
304
|
+
export declare interface MqttDisconnectPacket {
|
|
305
|
+
/**
|
|
306
|
+
* The MQTT disconnect return code.
|
|
307
|
+
*/
|
|
308
|
+
code: MqttDisconnectReasonCode;
|
|
309
|
+
/**
|
|
310
|
+
* The user properties in the MQTT disconnect packet.
|
|
311
|
+
*/
|
|
312
|
+
userProperties?: MqttUserProperty[];
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* MQTT 5.0 Disconnect Reason Codes.
|
|
317
|
+
*/
|
|
318
|
+
export declare enum MqttDisconnectReasonCode {
|
|
319
|
+
/**
|
|
320
|
+
* 0x00 - Normal disconnection
|
|
321
|
+
* Sent by: Client or Server
|
|
322
|
+
* Description: Close the connection normally. Do not send the Will Message.
|
|
323
|
+
*/
|
|
324
|
+
NormalDisconnection = 0,
|
|
325
|
+
/**
|
|
326
|
+
* 0x04 - Disconnect with Will Message
|
|
327
|
+
* Sent by: Client
|
|
328
|
+
* Description: The Client wishes to disconnect but requires that the Server also publishes its Will Message.
|
|
329
|
+
*/
|
|
330
|
+
DisconnectWithWillMessage = 4,
|
|
331
|
+
/**
|
|
332
|
+
* 0x80 - Unspecified error
|
|
333
|
+
* Sent by: Client or Server
|
|
334
|
+
* Description: The Connection is closed but the sender either does not wish to reveal the reason, or none of the other Reason Codes apply.
|
|
335
|
+
*/
|
|
336
|
+
UnspecifiedError = 128,
|
|
337
|
+
/**
|
|
338
|
+
* 0x81 - Malformed Packet
|
|
339
|
+
* Sent by: Client or Server
|
|
340
|
+
* Description: The received packet does not conform to this specification.
|
|
341
|
+
*/
|
|
342
|
+
MalformedPacket = 129,
|
|
343
|
+
/**
|
|
344
|
+
* 0x82 - Protocol Error
|
|
345
|
+
* Sent by: Client or Server
|
|
346
|
+
* Description: An unexpected or out of order packet was received.
|
|
347
|
+
*/
|
|
348
|
+
ProtocolError = 130,
|
|
349
|
+
/**
|
|
350
|
+
* 0x83 - Implementation specific error
|
|
351
|
+
* Sent by: Client or Server
|
|
352
|
+
* Description: The packet received is valid but cannot be processed by this implementation.
|
|
353
|
+
*/
|
|
354
|
+
ImplementationSpecificError = 131,
|
|
355
|
+
/**
|
|
356
|
+
* 0x87 - Not authorized
|
|
357
|
+
* Sent by: Server
|
|
358
|
+
* Description: The request is not authorized.
|
|
359
|
+
*/
|
|
360
|
+
NotAuthorized = 135,
|
|
361
|
+
/**
|
|
362
|
+
* 0x89 - Server busy
|
|
363
|
+
* Sent by: Server
|
|
364
|
+
* Description: The Server is busy and cannot continue processing requests from this Client.
|
|
365
|
+
*/
|
|
366
|
+
ServerBusy = 137,
|
|
367
|
+
/**
|
|
368
|
+
* 0x8B - Server shutting down
|
|
369
|
+
* Sent by: Server
|
|
370
|
+
* Description: The Server is shutting down.
|
|
371
|
+
*/
|
|
372
|
+
ServerShuttingDown = 139,
|
|
373
|
+
/**
|
|
374
|
+
* 0x8D - Keep Alive timeout
|
|
375
|
+
* Sent by: Server
|
|
376
|
+
* Description: The Connection is closed because no packet has been received for 1.5 times the Keepalive time.
|
|
377
|
+
*/
|
|
378
|
+
KeepAliveTimeout = 141,
|
|
379
|
+
/**
|
|
380
|
+
* 0x8E - Session taken over
|
|
381
|
+
* Sent by: Server
|
|
382
|
+
* Description: Another Connection using the same ClientID has connected causing this Connection to be closed.
|
|
383
|
+
*/
|
|
384
|
+
SessionTakenOver = 142,
|
|
385
|
+
/**
|
|
386
|
+
* 0x8F - Topic Filter invalid
|
|
387
|
+
* Sent by: Server
|
|
388
|
+
* Description: The Topic Filter is correctly formed, but is not accepted by this Server.
|
|
389
|
+
*/
|
|
390
|
+
TopicFilterInvalid = 143,
|
|
391
|
+
/**
|
|
392
|
+
* 0x90 - Topic Name invalid
|
|
393
|
+
* Sent by: Client or Server
|
|
394
|
+
* Description: The Topic Name is correctly formed, but is not accepted by this Client or Server.
|
|
395
|
+
*/
|
|
396
|
+
TopicNameInvalid = 144,
|
|
397
|
+
/**
|
|
398
|
+
* 0x93 - Receive Maximum exceeded
|
|
399
|
+
* Sent by: Client or Server
|
|
400
|
+
* Description: The Client or Server has received more than Receive Maximum publication for which it has not sent PUBACK or PUBCOMP.
|
|
401
|
+
*/
|
|
402
|
+
ReceiveMaximumExceeded = 147,
|
|
403
|
+
/**
|
|
404
|
+
* 0x94 - Topic Alias invalid
|
|
405
|
+
* Sent by: Client or Server
|
|
406
|
+
* Description: The Client or Server has received a PUBLISH packet containing a Topic Alias which is greater than the Maximum Topic Alias it sent in the CONNECT or CONNACK packet.
|
|
407
|
+
*/
|
|
408
|
+
TopicAliasInvalid = 148,
|
|
409
|
+
/**
|
|
410
|
+
* 0x95 - Packet too large
|
|
411
|
+
* Sent by: Client or Server
|
|
412
|
+
* Description: The packet size is greater than Maximum Packet Size for this Client or Server.
|
|
413
|
+
*/
|
|
414
|
+
PacketTooLarge = 149,
|
|
415
|
+
/**
|
|
416
|
+
* 0x96 - Message rate too high
|
|
417
|
+
* Sent by: Client or Server
|
|
418
|
+
* Description: The received data rate is too high.
|
|
419
|
+
*/
|
|
420
|
+
MessageRateTooHigh = 150,
|
|
421
|
+
/**
|
|
422
|
+
* 0x97 - Quota exceeded
|
|
423
|
+
* Sent by: Client or Server
|
|
424
|
+
* Description: An implementation or administrative imposed limit has been exceeded.
|
|
425
|
+
*/
|
|
426
|
+
QuotaExceeded = 151,
|
|
427
|
+
/**
|
|
428
|
+
* 0x98 - Administrative action
|
|
429
|
+
* Sent by: Client or Server
|
|
430
|
+
* Description: The Connection is closed due to an administrative action.
|
|
431
|
+
*/
|
|
432
|
+
AdministrativeAction = 152,
|
|
433
|
+
/**
|
|
434
|
+
* 0x99 - Payload format invalid
|
|
435
|
+
* Sent by: Client or Server
|
|
436
|
+
* Description: The payload format does not match the one specified by the Payload Format Indicator.
|
|
437
|
+
*/
|
|
438
|
+
PayloadFormatInvalid = 153,
|
|
439
|
+
/**
|
|
440
|
+
* 0x9A - Retain not supported
|
|
441
|
+
* Sent by: Server
|
|
442
|
+
* Description: The Server does not support retained messages.
|
|
443
|
+
*/
|
|
444
|
+
RetainNotSupported = 154,
|
|
445
|
+
/**
|
|
446
|
+
* 0x9B - QoS not supported
|
|
447
|
+
* Sent by: Server
|
|
448
|
+
* Description: The Client specified a QoS greater than the QoS specified in a Maximum QoS in the CONNACK.
|
|
449
|
+
*/
|
|
450
|
+
QosNotSupported = 155,
|
|
451
|
+
/**
|
|
452
|
+
* 0x9C - Use another server
|
|
453
|
+
* Sent by: Server
|
|
454
|
+
* Description: The Client should temporarily change its Server.
|
|
455
|
+
*/
|
|
456
|
+
UseAnotherServer = 156,
|
|
457
|
+
/**
|
|
458
|
+
* 0x9D - Server moved
|
|
459
|
+
* Sent by: Server
|
|
460
|
+
* Description: The Server is moved and the Client should permanently change its server location.
|
|
461
|
+
*/
|
|
462
|
+
ServerMoved = 157,
|
|
463
|
+
/**
|
|
464
|
+
* 0x9E - Shared Subscriptions not supported
|
|
465
|
+
* Sent by: Server
|
|
466
|
+
* Description: The Server does not support Shared Subscriptions.
|
|
467
|
+
*/
|
|
468
|
+
SharedSubscriptionsNotSupported = 158,
|
|
469
|
+
/**
|
|
470
|
+
* 0x9F - Connection rate exceeded
|
|
471
|
+
* Sent by: Server
|
|
472
|
+
* Description: This connection is closed because the connection rate is too high.
|
|
473
|
+
*/
|
|
474
|
+
ConnectionRateExceeded = 159,
|
|
475
|
+
/**
|
|
476
|
+
* 0xA0 - Maximum connect time
|
|
477
|
+
* Sent by: Server
|
|
478
|
+
* Description: The maximum connection time authorized for this connection has been exceeded.
|
|
479
|
+
*/
|
|
480
|
+
MaximumConnectTime = 160,
|
|
481
|
+
/**
|
|
482
|
+
* 0xA1 - Subscription Identifiers not supported
|
|
483
|
+
* Sent by: Server
|
|
484
|
+
* Description: The Server does not support Subscription Identifiers; the subscription is not accepted.
|
|
485
|
+
*/
|
|
486
|
+
SubscriptionIdentifiersNotSupported = 161,
|
|
487
|
+
/**
|
|
488
|
+
* 0xA2 - Wildcard Subscriptions not supported
|
|
489
|
+
* Sent by: Server
|
|
490
|
+
* Description: The Server does not support Wildcard Subscriptions; the subscription is not accepted.
|
|
491
|
+
*/
|
|
492
|
+
WildcardSubscriptionsNotSupported = 162
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* The properties of a user in MQTT.
|
|
497
|
+
*/
|
|
498
|
+
export declare interface MqttUserProperty {
|
|
499
|
+
/**
|
|
500
|
+
* The name of the property.
|
|
501
|
+
*/
|
|
502
|
+
name: string;
|
|
503
|
+
/**
|
|
504
|
+
* The value of the property.
|
|
505
|
+
*/
|
|
506
|
+
value: string;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* MQTT 3.1.1 Connect Return Codes.
|
|
511
|
+
*/
|
|
512
|
+
export declare enum MqttV311ConnectReturnCode {
|
|
513
|
+
/**
|
|
514
|
+
* 0x01: Connection refused, unacceptable protocol version
|
|
515
|
+
* The Server does not support the level of the MQTT protocol requested by the Client.
|
|
516
|
+
*/
|
|
517
|
+
UnacceptableProtocolVersion = 1,
|
|
518
|
+
/**
|
|
519
|
+
* 0x02: Connection refused, identifier rejected
|
|
520
|
+
* The Client identifier is correct UTF-8 but not allowed by the Server.
|
|
521
|
+
*/
|
|
522
|
+
IdentifierRejected = 2,
|
|
523
|
+
/**
|
|
524
|
+
* 0x03: Connection refused, server unavailable
|
|
525
|
+
* The Network Connection has been made but the MQTT service is unavailable.
|
|
526
|
+
*/
|
|
527
|
+
ServerUnavailable = 3,
|
|
528
|
+
/**
|
|
529
|
+
* 0x04: Connection refused, bad user name or password
|
|
530
|
+
* The data in the user name or password is malformed.
|
|
531
|
+
*/
|
|
532
|
+
BadUsernameOrPassword = 4,
|
|
533
|
+
/**
|
|
534
|
+
* 0x05: Connection refused, not authorized
|
|
535
|
+
* The Client is not authorized to connect.
|
|
536
|
+
*/
|
|
537
|
+
NotAuthorized = 5
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* MQTT Connect Reason Codes
|
|
542
|
+
* These codes represent the reasons for the outcome of an MQTT CONNECT packet as per MQTT 5.0 specification.
|
|
543
|
+
*/
|
|
544
|
+
export declare enum MqttV500ConnectReasonCode {
|
|
545
|
+
/**
|
|
546
|
+
* 0x80 - Unspecified error
|
|
547
|
+
* Description: The Server does not wish to reveal the reason for the failure, or none of the other Reason Codes apply.
|
|
548
|
+
*/
|
|
549
|
+
UnspecifiedError = 128,
|
|
550
|
+
/**
|
|
551
|
+
* 0x81 - Malformed Packet
|
|
552
|
+
* Description: Data within the CONNECT packet could not be correctly parsed.
|
|
553
|
+
*/
|
|
554
|
+
MalformedPacket = 129,
|
|
555
|
+
/**
|
|
556
|
+
* 0x82 - Protocol Error
|
|
557
|
+
* Description: Data in the CONNECT packet does not conform to this specification.
|
|
558
|
+
*/
|
|
559
|
+
ProtocolError = 130,
|
|
560
|
+
/**
|
|
561
|
+
* 0x83 - Implementation specific error
|
|
562
|
+
* Description: The CONNECT is valid but is not accepted by this Server.
|
|
563
|
+
*/
|
|
564
|
+
ImplementationSpecificError = 131,
|
|
565
|
+
/**
|
|
566
|
+
* 0x84 - Unsupported Protocol Version
|
|
567
|
+
* Description: The Server does not support the version of the MQTT protocol requested by the Client.
|
|
568
|
+
*/
|
|
569
|
+
UnsupportedProtocolVersion = 132,
|
|
570
|
+
/**
|
|
571
|
+
* 0x85 - Client Identifier not valid
|
|
572
|
+
* Description: The Client Identifier is a valid string but is not allowed by the Server.
|
|
573
|
+
*/
|
|
574
|
+
ClientIdentifierNotValid = 133,
|
|
575
|
+
/**
|
|
576
|
+
* 0x86 - Bad User Name or Password
|
|
577
|
+
* Description: The Server does not accept the User Name or Password specified by the Client.
|
|
578
|
+
*/
|
|
579
|
+
BadUserNameOrPassword = 134,
|
|
580
|
+
/**
|
|
581
|
+
* 0x87 - Not authorized
|
|
582
|
+
* Description: The Client is not authorized to connect.
|
|
583
|
+
*/
|
|
584
|
+
NotAuthorized = 135,
|
|
585
|
+
/**
|
|
586
|
+
* 0x88 - Server unavailable
|
|
587
|
+
* Description: The MQTT Server is not available.
|
|
588
|
+
*/
|
|
589
|
+
ServerUnavailable = 136,
|
|
590
|
+
/**
|
|
591
|
+
* 0x89 - Server busy
|
|
592
|
+
* Description: The Server is busy. Try again later.
|
|
593
|
+
*/
|
|
594
|
+
ServerBusy = 137,
|
|
595
|
+
/**
|
|
596
|
+
* 0x8A - Banned
|
|
597
|
+
* Description: This Client has been banned by administrative action. Contact the server administrator.
|
|
598
|
+
*/
|
|
599
|
+
Banned = 138,
|
|
600
|
+
/**
|
|
601
|
+
* 0x8C - Bad authentication method
|
|
602
|
+
* Description: The authentication method is not supported or does not match the authentication method currently in use.
|
|
603
|
+
*/
|
|
604
|
+
BadAuthenticationMethod = 140,
|
|
605
|
+
/**
|
|
606
|
+
* 0x90 - Topic Name invalid
|
|
607
|
+
* Description: The Will Topic Name is not malformed, but is not accepted by this Server.
|
|
608
|
+
*/
|
|
609
|
+
TopicNameInvalid = 144,
|
|
610
|
+
/**
|
|
611
|
+
* 0x95 - Packet too large
|
|
612
|
+
* Description: The CONNECT packet exceeded the maximum permissible size.
|
|
613
|
+
*/
|
|
614
|
+
PacketTooLarge = 149,
|
|
615
|
+
/**
|
|
616
|
+
* 0x97 - Quota exceeded
|
|
617
|
+
* Description: An implementation or administrative imposed limit has been exceeded.
|
|
618
|
+
*/
|
|
619
|
+
QuotaExceeded = 151,
|
|
620
|
+
/**
|
|
621
|
+
* 0x99 - Payload format invalid
|
|
622
|
+
* Description: The Will Payload does not match the specified Payload Format Indicator.
|
|
623
|
+
*/
|
|
624
|
+
PayloadFormatInvalid = 153,
|
|
625
|
+
/**
|
|
626
|
+
* 0x9A - Retain not supported
|
|
627
|
+
* Description: The Server does not support retained messages, and Will Retain was set to 1.
|
|
628
|
+
*/
|
|
629
|
+
RetainNotSupported = 154,
|
|
630
|
+
/**
|
|
631
|
+
* 0x9B - QoS not supported
|
|
632
|
+
* Description: The Server does not support the QoS set in Will QoS.
|
|
633
|
+
*/
|
|
634
|
+
QosNotSupported = 155,
|
|
635
|
+
/**
|
|
636
|
+
* 0x9C - Use another server
|
|
637
|
+
* Description: The Client should temporarily use another server.
|
|
638
|
+
*/
|
|
639
|
+
UseAnotherServer = 156,
|
|
640
|
+
/**
|
|
641
|
+
* 0x9D - Server moved
|
|
642
|
+
* Description: The Client should permanently use another server.
|
|
643
|
+
*/
|
|
644
|
+
ServerMoved = 157,
|
|
645
|
+
/**
|
|
646
|
+
* 0x9F - Connection rate exceeded
|
|
647
|
+
* Description: The connection rate limit has been exceeded.
|
|
648
|
+
*/
|
|
649
|
+
ConnectionRateExceeded = 159
|
|
650
|
+
}
|
|
651
|
+
|
|
151
652
|
/**
|
|
152
653
|
* Request for the user event.
|
|
153
654
|
*/
|
|
@@ -216,6 +717,11 @@ export declare interface UserEventResponseHandler {
|
|
|
216
717
|
fail(code: 400 | 401 | 500, detail?: string): void;
|
|
217
718
|
}
|
|
218
719
|
|
|
720
|
+
/**
|
|
721
|
+
* The protocol of Web PubSub Client.
|
|
722
|
+
*/
|
|
723
|
+
export declare type WebPubSubClientProtocol = "default" | "mqtt";
|
|
724
|
+
|
|
219
725
|
/**
|
|
220
726
|
* The handler to handle incoming CloudEvents messages
|
|
221
727
|
*/
|