@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.
Files changed (47) hide show
  1. package/README.md +165 -0
  2. package/dist/commonjs/cloudEventsDispatcher.d.ts.map +1 -1
  3. package/dist/commonjs/cloudEventsDispatcher.js +143 -8
  4. package/dist/commonjs/cloudEventsDispatcher.js.map +1 -1
  5. package/dist/commonjs/cloudEventsProtocols.d.ts +174 -1
  6. package/dist/commonjs/cloudEventsProtocols.d.ts.map +1 -1
  7. package/dist/commonjs/cloudEventsProtocols.js.map +1 -1
  8. package/dist/commonjs/enum/MqttErrorCodes/mqttDisconnectReasonCode.d.ts +180 -0
  9. package/dist/commonjs/enum/MqttErrorCodes/mqttDisconnectReasonCode.d.ts.map +1 -0
  10. package/dist/commonjs/enum/MqttErrorCodes/mqttDisconnectReasonCode.js +186 -0
  11. package/dist/commonjs/enum/MqttErrorCodes/mqttDisconnectReasonCode.js.map +1 -0
  12. package/dist/commonjs/enum/MqttErrorCodes/mqttV311ConnectReturnCode.d.ts +31 -0
  13. package/dist/commonjs/enum/MqttErrorCodes/mqttV311ConnectReturnCode.d.ts.map +1 -0
  14. package/dist/commonjs/enum/MqttErrorCodes/mqttV311ConnectReturnCode.js +37 -0
  15. package/dist/commonjs/enum/MqttErrorCodes/mqttV311ConnectReturnCode.js.map +1 -0
  16. package/dist/commonjs/enum/MqttErrorCodes/mqttV500ConnectReasonCode.d.ts +112 -0
  17. package/dist/commonjs/enum/MqttErrorCodes/mqttV500ConnectReasonCode.d.ts.map +1 -0
  18. package/dist/commonjs/enum/MqttErrorCodes/mqttV500ConnectReasonCode.js +118 -0
  19. package/dist/commonjs/enum/MqttErrorCodes/mqttV500ConnectReasonCode.js.map +1 -0
  20. package/dist/commonjs/index.d.ts +3 -0
  21. package/dist/commonjs/index.d.ts.map +1 -1
  22. package/dist/commonjs/index.js +473 -8
  23. package/dist/commonjs/index.js.map +1 -1
  24. package/dist/esm/cloudEventsDispatcher.d.ts.map +1 -1
  25. package/dist/esm/cloudEventsDispatcher.js +143 -8
  26. package/dist/esm/cloudEventsDispatcher.js.map +1 -1
  27. package/dist/esm/cloudEventsProtocols.d.ts +174 -1
  28. package/dist/esm/cloudEventsProtocols.d.ts.map +1 -1
  29. package/dist/esm/cloudEventsProtocols.js.map +1 -1
  30. package/dist/esm/enum/MqttErrorCodes/mqttDisconnectReasonCode.d.ts +180 -0
  31. package/dist/esm/enum/MqttErrorCodes/mqttDisconnectReasonCode.d.ts.map +1 -0
  32. package/dist/esm/enum/MqttErrorCodes/mqttDisconnectReasonCode.js +183 -0
  33. package/dist/esm/enum/MqttErrorCodes/mqttDisconnectReasonCode.js.map +1 -0
  34. package/dist/esm/enum/MqttErrorCodes/mqttV311ConnectReturnCode.d.ts +31 -0
  35. package/dist/esm/enum/MqttErrorCodes/mqttV311ConnectReturnCode.d.ts.map +1 -0
  36. package/dist/esm/enum/MqttErrorCodes/mqttV311ConnectReturnCode.js +34 -0
  37. package/dist/esm/enum/MqttErrorCodes/mqttV311ConnectReturnCode.js.map +1 -0
  38. package/dist/esm/enum/MqttErrorCodes/mqttV500ConnectReasonCode.d.ts +112 -0
  39. package/dist/esm/enum/MqttErrorCodes/mqttV500ConnectReasonCode.d.ts.map +1 -0
  40. package/dist/esm/enum/MqttErrorCodes/mqttV500ConnectReasonCode.js +115 -0
  41. package/dist/esm/enum/MqttErrorCodes/mqttV500ConnectReasonCode.js.map +1 -0
  42. package/dist/esm/index.d.ts +3 -0
  43. package/dist/esm/index.d.ts.map +1 -1
  44. package/dist/esm/index.js +3 -0
  45. package/dist/esm/index.js.map +1 -1
  46. package/dist/web-pubsub-express.d.ts +507 -1
  47. package/package.json +1 -1
@@ -1,3 +1,6 @@
1
+ import { MqttDisconnectReasonCode } from "./enum/MqttErrorCodes/mqttDisconnectReasonCode.js";
2
+ import { MqttV311ConnectReturnCode } from "./enum/MqttErrorCodes/mqttV311ConnectReturnCode.js";
3
+ import { MqttV500ConnectReasonCode } from "./enum/MqttErrorCodes/mqttV500ConnectReasonCode.js";
1
4
  /**
2
5
  * Response of the connect event.
3
6
  */
@@ -19,10 +22,66 @@ export interface ConnectResponse {
19
22
  */
20
23
  subprotocol?: string;
21
24
  }
25
+ /**
26
+ * Success respones of the connect event.
27
+ */
28
+ export interface MqttConnectResponse extends ConnectResponse {
29
+ /**
30
+ * The MQTT specific properties in a successful MQTT connection event response.
31
+ */
32
+ mqtt?: MqttConnectResponseProperties;
33
+ }
34
+ /**
35
+ * Response of a failed connect event.
36
+ */
37
+ export interface ConnectErrorResponse {
38
+ /**
39
+ * The error code.
40
+ */
41
+ code: 400 | 401 | 500;
42
+ /**
43
+ * The error detail.
44
+ */
45
+ detail?: string;
46
+ }
47
+ /**
48
+ * Response of an MQTT connection failure.
49
+ */
50
+ export interface MqttConnectErrorResponse {
51
+ /**
52
+ * The properties of the MQTT connection failure response.
53
+ */
54
+ mqtt: MqttConnectErrorResponseProperties;
55
+ }
56
+ /**
57
+ * The properties of an MQTT connection failure response.
58
+ */
59
+ export interface MqttConnectErrorResponseProperties {
60
+ /**
61
+ * The MQTT connect return code.
62
+ */
63
+ code: MqttV311ConnectReturnCode | MqttV500ConnectReasonCode;
64
+ /**
65
+ * The reason string for the connection failure.
66
+ */
67
+ reason?: string;
68
+ /**
69
+ * The user properties in the response.
70
+ */
71
+ userProperties?: MqttUserProperty[];
72
+ }
73
+ /**
74
+ * The protocol of Web PubSub Client.
75
+ */
76
+ export type WebPubSubClientProtocol = "default" | "mqtt";
22
77
  /**
23
78
  * The connection context representing the client WebSocket connection.
24
79
  */
25
80
  export interface ConnectionContext {
81
+ /**
82
+ * The unique identifier generated by the service of the network connection.
83
+ */
84
+ signature: string;
26
85
  /**
27
86
  * The hub the connection belongs to.
28
87
  */
@@ -51,6 +110,27 @@ export interface ConnectionContext {
51
110
  * Get the additional states for the connection, such states are perserved throughout the lifetime of the connection.
52
111
  */
53
112
  states: Record<string, any>;
113
+ /**
114
+ * The type of client protocol.
115
+ */
116
+ clientProtocol: WebPubSubClientProtocol;
117
+ /**
118
+ * The MQTT properties that the client WebSocket connection has when it connects (For MQTT connection only).
119
+ */
120
+ mqtt?: MqttConnectionContextProperties;
121
+ }
122
+ /**
123
+ * The connection context properties representing the MQTT client WebSocket connection.
124
+ */
125
+ export interface MqttConnectionContextProperties {
126
+ /**
127
+ * The unique identifier generated by the service of the network connection.
128
+ */
129
+ physicalConnectionId: string;
130
+ /**
131
+ * The unique identifier generated by the service of the MQTT session.
132
+ */
133
+ sessionId?: string;
54
134
  }
55
135
  /**
56
136
  * Request for the connect event.
@@ -86,6 +166,59 @@ export interface ConnectRequest {
86
166
  */
87
167
  clientCertificates?: Certificate[];
88
168
  }
169
+ /**
170
+ * Request for the MQTT connect event.
171
+ */
172
+ export interface MqttConnectRequest extends ConnectRequest {
173
+ /**
174
+ * The MQTT specific properties in the MQTT connect event request.
175
+ */
176
+ mqtt: MqttConnectProperties;
177
+ }
178
+ /**
179
+ * The properties of the MQTT CONNECT packet.
180
+ */
181
+ export interface MqttConnectProperties {
182
+ /**
183
+ * MQTT protocol version.
184
+ */
185
+ protocolVersion: number;
186
+ /**
187
+ * The username field in the MQTT CONNECT packet.
188
+ */
189
+ username?: string;
190
+ /**
191
+ * The password field in the MQTT CONNECT packet.
192
+ */
193
+ password?: string;
194
+ /**
195
+ * The user properties in the MQTT CONNECT packet.
196
+ */
197
+ userProperties?: MqttUserProperty[];
198
+ }
199
+ /**
200
+ * The properties of a successful MQTT connection event response
201
+ */
202
+ export interface MqttConnectResponseProperties {
203
+ /**
204
+ * Additional diagnostic or other information provided by upstream server
205
+ * Now only MQTT 5.0 supports user properties
206
+ */
207
+ userProperties?: MqttUserProperty[];
208
+ }
209
+ /**
210
+ * The properties of a user in MQTT.
211
+ */
212
+ export interface MqttUserProperty {
213
+ /**
214
+ * The name of the property.
215
+ */
216
+ name: string;
217
+ /**
218
+ * The value of the property.
219
+ */
220
+ value: string;
221
+ }
89
222
  /**
90
223
  * The client certificate.
91
224
  */
@@ -160,6 +293,41 @@ export interface DisconnectedRequest {
160
293
  */
161
294
  reason?: string;
162
295
  }
296
+ /**
297
+ * Request for the disconnected event.
298
+ */
299
+ export interface MqttDisconnectedRequest extends DisconnectedRequest {
300
+ /**
301
+ * The MQTT specific properties in the MQTT disconnected event request.
302
+ */
303
+ mqtt: MqttDisconnectedProperties;
304
+ }
305
+ /**
306
+ * The properties of an MQTT disconnected event.
307
+ */
308
+ export interface MqttDisconnectedProperties {
309
+ /**
310
+ * The MQTT disconnect packet.
311
+ */
312
+ disconnectPacket: MqttDisconnectPacket;
313
+ /**
314
+ * Whether the disconnection is initiated by the client.
315
+ */
316
+ initiatedByClient: boolean;
317
+ }
318
+ /**
319
+ * The properties of the MQTT DISCONNECT packet.
320
+ */
321
+ export interface MqttDisconnectPacket {
322
+ /**
323
+ * The MQTT disconnect return code.
324
+ */
325
+ code: MqttDisconnectReasonCode;
326
+ /**
327
+ * The user properties in the MQTT disconnect packet.
328
+ */
329
+ userProperties?: MqttUserProperty[];
330
+ }
163
331
  /**
164
332
  * The handler to set connect event response
165
333
  */
@@ -174,13 +342,18 @@ export interface ConnectResponseHandler {
174
342
  * Return success response to the service.
175
343
  * @param response - The response for the connect event.
176
344
  */
177
- success(response?: ConnectResponse): void;
345
+ success(response?: ConnectResponse | MqttConnectResponse): void;
178
346
  /**
179
347
  * Return failed response and the service will reject the client WebSocket connection.
180
348
  * @param code - Code can be 400 user error, 401 unauthorized and 500 server error.
181
349
  * @param detail - The detail of the error.
182
350
  */
183
351
  fail(code: 400 | 401 | 500, detail?: string): void;
352
+ /**
353
+ * Return failed response with MQTT response properties and the service will reject the client WebSocket connection.
354
+ * @param response - The response for the connect event which contains either default WebPubSub or MQTT response properties.
355
+ */
356
+ failWith(response: ConnectErrorResponse | MqttConnectErrorResponse): void;
184
357
  }
185
358
  /**
186
359
  * The handler to set user event response
@@ -1 +1 @@
1
- {"version":3,"file":"cloudEventsProtocols.d.ts","sourceRoot":"","sources":["../../src/cloudEventsProtocols.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,OAAO,EAAE,iBAAiB,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACjC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACnC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACnC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;OAEG;IACH,kBAAkB,CAAC,EAA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H,cAAc,CAAC,EAAE,CAAC,mBAAmB,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAEpE;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"cloudEventsProtocols.js","sourceRoot":"","sources":["../../src/cloudEventsProtocols.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Response of the connect event.\n */\nexport interface ConnectResponse {\n /**\n * Set the groups the connection would like to join.\n */\n groups?: string[];\n /**\n * Set the roles the connection belongs to.\n */\n roles?: string[];\n /**\n * Set the userId for the connection.\n */\n userId?: string;\n /**\n * Set the subprotocol for the connection to complete WebSocket handshake.\n */\n subprotocol?: string;\n}\n\n/**\n * The connection context representing the client WebSocket connection.\n */\nexport interface ConnectionContext {\n /**\n * The hub the connection belongs to.\n */\n hub: string;\n /**\n * The Id of the connection.\n */\n connectionId: string;\n /**\n * The event name of this CloudEvents request.\n */\n eventName: string;\n /**\n * The origin this CloudEvents request comes from.\n */\n origin: string;\n /**\n * The user id of the connection.\n */\n userId?: string;\n /**\n * The subprotocol of this connection.\n */\n subprotocol?: string;\n /**\n * Get the additional states for the connection, such states are perserved throughout the lifetime of the connection.\n */\n states: Record<string, any>;\n}\n\n/**\n * Request for the connect event.\n */\nexport interface ConnectRequest {\n /**\n * The context of current CloudEvents request.\n */\n context: ConnectionContext;\n /**\n * The claims that the client WebSocket connection has when it connects.\n */\n claims?: Record<string, string[]>;\n /**\n * The query that the client WebSocket connection has when it connects.\n * @deprecated Please use queries instead.\n */\n query?: Record<string, string[]>;\n /**\n * The queries that the client WebSocket connection has when it connects.\n */\n queries?: Record<string, string[]>;\n /**\n * The headers that the client WebSocket connection has when it connects.\n */\n headers?: Record<string, string[]>;\n /**\n * The subprotocols that the client WebSocket connection uses to do handshake.\n */\n subprotocols?: string[];\n /**\n * The client certificate info that the client WebSocket connection uses to connect.\n */\n clientCertificates?: Certificate[];\n}\n\n/**\n * The client certificate.\n */\nexport interface Certificate {\n /**\n * The thumbprint of the certificate.\n */\n thumbprint: string;\n}\n\n/**\n * Request for the connected event.\n */\nexport interface ConnectedRequest {\n /**\n * The context of current CloudEvents request.\n */\n context: ConnectionContext;\n}\n\n/**\n * Request for the user event.\n */\nexport type UserEventRequest =\n | {\n /**\n * The context of current CloudEvents request.\n */\n context: ConnectionContext;\n\n /**\n * The content data.\n */\n data: string;\n /**\n * The type of the data.\n */\n dataType: \"text\";\n }\n | {\n /**\n * The context of current CloudEvents request.\n */\n context: ConnectionContext;\n\n /**\n * The content data, when data type is `json`, the data is the result of JSON.parse, so the type of the data depends on user scenarios\n */\n data: unknown;\n\n /**\n * The type of the data.\n */\n dataType: \"json\";\n }\n | {\n /**\n * The context of current CloudEvents request.\n */\n context: ConnectionContext;\n\n /**\n * The content data.\n */\n data: ArrayBuffer;\n /**\n * The type of the data.\n */\n dataType: \"binary\";\n };\n\n/**\n * Request for the disconnected event.\n */\nexport interface DisconnectedRequest {\n /**\n * The context of current CloudEvents request.\n */\n context: ConnectionContext;\n /**\n * The reason that the connection disconnects.\n */\n reason?: string;\n}\n\n/**\n * The handler to set connect event response\n */\nexport interface ConnectResponseHandler {\n /**\n * Set the state of the connection\n * @param name - The name of the state\n * @param value - The value of the state\n */\n setState(name: string, value: unknown): void;\n /**\n * Return success response to the service.\n * @param response - The response for the connect event.\n */\n success(response?: ConnectResponse): void;\n /**\n * Return failed response and the service will reject the client WebSocket connection.\n * @param code - Code can be 400 user error, 401 unauthorized and 500 server error.\n * @param detail - The detail of the error.\n */\n fail(code: 400 | 401 | 500, detail?: string): void;\n}\n\n/**\n * The handler to set user event response\n */\nexport interface UserEventResponseHandler {\n /**\n * Set the state of the connection\n * @param name - The name of the state\n * @param value - The value of the state\n */\n setState(name: string, value: unknown): void;\n /**\n * Return success response with data to be delivered to the client WebSocket connection.\n * @param data - The payload data to be returned to the client. Stringify the message if it is a JSON object.\n * @param dataType - The type of the payload data.\n */\n success(data?: string | ArrayBuffer, dataType?: \"binary\" | \"text\" | \"json\"): void;\n /**\n * Return failed response and the service will close the client WebSocket connection.\n * @param code - Code can be 400 user error, 401 unauthorized and 500 server error.\n * @param detail - The detail of the error.\n */\n fail(code: 400 | 401 | 500, detail?: string): void;\n}\n\n/**\n * The options for the CloudEvents handler.\n */\nexport interface WebPubSubEventHandlerOptions {\n /**\n * Custom serving path for the path of the CloudEvents handler.\n */\n path?: string;\n\n /**\n * Handle 'connect' event, the service waits for the response to proceed.\n */\n handleConnect?: (connectRequest: ConnectRequest, connectResponse: ConnectResponseHandler) => void;\n\n /**\n * Handle user events, the service waits for the response to proceed.\n */\n handleUserEvent?: (\n userEventRequest: UserEventRequest,\n userEventResponse: UserEventResponseHandler,\n ) => void;\n\n /**\n * Event trigger for \"connected\" unblocking event. This is an unblocking event and the service does not wait for the response.\n */\n onConnected?: (connectedRequest: ConnectedRequest) => void;\n\n /**\n *\n * Event triggers for \"disconnected\" unblocking event. This is an unblocking event and the service does not wait for the response.\n */\n onDisconnected?: (disconnectedRequest: DisconnectedRequest) => void;\n\n /**\n * If not specified, by default allow all the endpoints, otherwise only allow specified endpoints\n */\n allowedEndpoints?: string[];\n}\n"]}
1
+ {"version":3,"file":"cloudEventsProtocols.js","sourceRoot":"","sources":["../../src/cloudEventsProtocols.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { MqttDisconnectReasonCode } from \"./enum/MqttErrorCodes/mqttDisconnectReasonCode.js\";\nimport { MqttV311ConnectReturnCode } from \"./enum/MqttErrorCodes/mqttV311ConnectReturnCode.js\";\nimport { MqttV500ConnectReasonCode } from \"./enum/MqttErrorCodes/mqttV500ConnectReasonCode.js\";\n\n/**\n * Response of the connect event.\n */\nexport interface ConnectResponse {\n /**\n * Set the groups the connection would like to join.\n */\n groups?: string[];\n /**\n * Set the roles the connection belongs to.\n */\n roles?: string[];\n /**\n * Set the userId for the connection.\n */\n userId?: string;\n /**\n * Set the subprotocol for the connection to complete WebSocket handshake.\n */\n subprotocol?: string;\n}\n\n/**\n * Success respones of the connect event.\n */\nexport interface MqttConnectResponse extends ConnectResponse {\n /**\n * The MQTT specific properties in a successful MQTT connection event response.\n */\n mqtt?: MqttConnectResponseProperties;\n}\n\n/**\n * Response of a failed connect event.\n */\nexport interface ConnectErrorResponse {\n /**\n * The error code.\n */\n code: 400 | 401 | 500;\n /**\n * The error detail.\n */\n detail?: string;\n}\n\n/**\n * Response of an MQTT connection failure.\n */\nexport interface MqttConnectErrorResponse {\n /**\n * The properties of the MQTT connection failure response.\n */\n mqtt: MqttConnectErrorResponseProperties;\n}\n\n/**\n * The properties of an MQTT connection failure response.\n */\nexport interface MqttConnectErrorResponseProperties {\n /**\n * The MQTT connect return code.\n */\n code: MqttV311ConnectReturnCode | MqttV500ConnectReasonCode;\n /**\n * The reason string for the connection failure.\n */\n reason?: string;\n /**\n * The user properties in the response.\n */\n userProperties?: MqttUserProperty[];\n}\n\n/**\n * The protocol of Web PubSub Client.\n */\nexport type WebPubSubClientProtocol = \"default\" | \"mqtt\";\n\n/**\n * The connection context representing the client WebSocket connection.\n */\nexport interface ConnectionContext {\n /**\n * The unique identifier generated by the service of the network connection.\n */\n signature: string;\n /**\n * The hub the connection belongs to.\n */\n hub: string;\n /**\n * The Id of the connection.\n */\n connectionId: string;\n /**\n * The event name of this CloudEvents request.\n */\n eventName: string;\n /**\n * The origin this CloudEvents request comes from.\n */\n origin: string;\n /**\n * The user id of the connection.\n */\n userId?: string;\n /**\n * The subprotocol of this connection.\n */\n subprotocol?: string;\n /**\n * Get the additional states for the connection, such states are perserved throughout the lifetime of the connection.\n */\n states: Record<string, any>;\n /**\n * The type of client protocol.\n */\n clientProtocol: WebPubSubClientProtocol;\n /**\n * The MQTT properties that the client WebSocket connection has when it connects (For MQTT connection only).\n */\n mqtt?: MqttConnectionContextProperties;\n}\n\n/**\n * The connection context properties representing the MQTT client WebSocket connection.\n */\nexport interface MqttConnectionContextProperties {\n /**\n * The unique identifier generated by the service of the network connection.\n */\n physicalConnectionId: string;\n /**\n * The unique identifier generated by the service of the MQTT session.\n */\n sessionId?: string;\n}\n\n/**\n * Request for the connect event.\n */\nexport interface ConnectRequest {\n /**\n * The context of current CloudEvents request.\n */\n context: ConnectionContext;\n /**\n * The claims that the client WebSocket connection has when it connects.\n */\n claims?: Record<string, string[]>;\n /**\n * The query that the client WebSocket connection has when it connects.\n * @deprecated Please use queries instead.\n */\n query?: Record<string, string[]>;\n /**\n * The queries that the client WebSocket connection has when it connects.\n */\n queries?: Record<string, string[]>;\n /**\n * The headers that the client WebSocket connection has when it connects.\n */\n headers?: Record<string, string[]>;\n /**\n * The subprotocols that the client WebSocket connection uses to do handshake.\n */\n subprotocols?: string[];\n /**\n * The client certificate info that the client WebSocket connection uses to connect.\n */\n clientCertificates?: Certificate[];\n}\n\n/**\n * Request for the MQTT connect event.\n */\nexport interface MqttConnectRequest extends ConnectRequest {\n /**\n * The MQTT specific properties in the MQTT connect event request.\n */\n mqtt: MqttConnectProperties;\n}\n\n/**\n * The properties of the MQTT CONNECT packet.\n */\nexport interface MqttConnectProperties {\n /**\n * MQTT protocol version.\n */\n protocolVersion: number;\n /**\n * The username field in the MQTT CONNECT packet.\n */\n username?: string;\n /**\n * The password field in the MQTT CONNECT packet.\n */\n password?: string;\n /**\n * The user properties in the MQTT CONNECT packet.\n */\n userProperties?: MqttUserProperty[];\n}\n\n/**\n * The properties of a successful MQTT connection event response\n */\nexport interface MqttConnectResponseProperties {\n /**\n * Additional diagnostic or other information provided by upstream server\n * Now only MQTT 5.0 supports user properties\n */\n userProperties?: MqttUserProperty[];\n}\n\n/**\n * The properties of a user in MQTT.\n */\nexport interface MqttUserProperty {\n /**\n * The name of the property.\n */\n name: string;\n /**\n * The value of the property.\n */\n value: string;\n}\n\n/**\n * The client certificate.\n */\nexport interface Certificate {\n /**\n * The thumbprint of the certificate.\n */\n thumbprint: string;\n}\n\n/**\n * Request for the connected event.\n */\nexport interface ConnectedRequest {\n /**\n * The context of current CloudEvents request.\n */\n context: ConnectionContext;\n}\n\n/**\n * Request for the user event.\n */\nexport type UserEventRequest =\n | {\n /**\n * The context of current CloudEvents request.\n */\n context: ConnectionContext;\n\n /**\n * The content data.\n */\n data: string;\n /**\n * The type of the data.\n */\n dataType: \"text\";\n }\n | {\n /**\n * The context of current CloudEvents request.\n */\n context: ConnectionContext;\n\n /**\n * The content data, when data type is `json`, the data is the result of JSON.parse, so the type of the data depends on user scenarios\n */\n data: unknown;\n\n /**\n * The type of the data.\n */\n dataType: \"json\";\n }\n | {\n /**\n * The context of current CloudEvents request.\n */\n context: ConnectionContext;\n\n /**\n * The content data.\n */\n data: ArrayBuffer;\n /**\n * The type of the data.\n */\n dataType: \"binary\";\n };\n\n/**\n * Request for the disconnected event.\n */\nexport interface DisconnectedRequest {\n /**\n * The context of current CloudEvents request.\n */\n context: ConnectionContext;\n /**\n * The reason that the connection disconnects.\n */\n reason?: string;\n}\n\n/**\n * Request for the disconnected event.\n */\nexport interface MqttDisconnectedRequest extends DisconnectedRequest {\n /**\n * The MQTT specific properties in the MQTT disconnected event request.\n */\n mqtt: MqttDisconnectedProperties;\n}\n\n/**\n * The properties of an MQTT disconnected event.\n */\nexport interface MqttDisconnectedProperties {\n /**\n * The MQTT disconnect packet.\n */\n disconnectPacket: MqttDisconnectPacket;\n /**\n * Whether the disconnection is initiated by the client.\n */\n initiatedByClient: boolean;\n}\n\n/**\n * The properties of the MQTT DISCONNECT packet.\n */\nexport interface MqttDisconnectPacket {\n /**\n * The MQTT disconnect return code.\n */\n code: MqttDisconnectReasonCode;\n /**\n * The user properties in the MQTT disconnect packet.\n */\n userProperties?: MqttUserProperty[];\n}\n\n/**\n * The handler to set connect event response\n */\nexport interface ConnectResponseHandler {\n /**\n * Set the state of the connection\n * @param name - The name of the state\n * @param value - The value of the state\n */\n setState(name: string, value: unknown): void;\n /**\n * Return success response to the service.\n * @param response - The response for the connect event.\n */\n success(response?: ConnectResponse | MqttConnectResponse): void;\n /**\n * Return failed response and the service will reject the client WebSocket connection.\n * @param code - Code can be 400 user error, 401 unauthorized and 500 server error.\n * @param detail - The detail of the error.\n */\n fail(code: 400 | 401 | 500, detail?: string): void;\n /**\n * Return failed response with MQTT response properties and the service will reject the client WebSocket connection.\n * @param response - The response for the connect event which contains either default WebPubSub or MQTT response properties.\n */\n failWith(response: ConnectErrorResponse | MqttConnectErrorResponse): void;\n}\n\n/**\n * The handler to set user event response\n */\nexport interface UserEventResponseHandler {\n /**\n * Set the state of the connection\n * @param name - The name of the state\n * @param value - The value of the state\n */\n setState(name: string, value: unknown): void;\n /**\n * Return success response with data to be delivered to the client WebSocket connection.\n * @param data - The payload data to be returned to the client. Stringify the message if it is a JSON object.\n * @param dataType - The type of the payload data.\n */\n success(data?: string | ArrayBuffer, dataType?: \"binary\" | \"text\" | \"json\"): void;\n /**\n * Return failed response and the service will close the client WebSocket connection.\n * @param code - Code can be 400 user error, 401 unauthorized and 500 server error.\n * @param detail - The detail of the error.\n */\n fail(code: 400 | 401 | 500, detail?: string): void;\n}\n\n/**\n * The options for the CloudEvents handler.\n */\nexport interface WebPubSubEventHandlerOptions {\n /**\n * Custom serving path for the path of the CloudEvents handler.\n */\n path?: string;\n\n /**\n * Handle 'connect' event, the service waits for the response to proceed.\n */\n handleConnect?: (connectRequest: ConnectRequest, connectResponse: ConnectResponseHandler) => void;\n\n /**\n * Handle user events, the service waits for the response to proceed.\n */\n handleUserEvent?: (\n userEventRequest: UserEventRequest,\n userEventResponse: UserEventResponseHandler,\n ) => void;\n\n /**\n * Event trigger for \"connected\" unblocking event. This is an unblocking event and the service does not wait for the response.\n */\n onConnected?: (connectedRequest: ConnectedRequest) => void;\n\n /**\n *\n * Event triggers for \"disconnected\" unblocking event. This is an unblocking event and the service does not wait for the response.\n */\n onDisconnected?: (disconnectedRequest: DisconnectedRequest) => void;\n\n /**\n * If not specified, by default allow all the endpoints, otherwise only allow specified endpoints\n */\n allowedEndpoints?: string[];\n}\n"]}
@@ -0,0 +1,180 @@
1
+ /**
2
+ * MQTT 5.0 Disconnect Reason Codes.
3
+ */
4
+ export declare enum MqttDisconnectReasonCode {
5
+ /**
6
+ * 0x00 - Normal disconnection
7
+ * Sent by: Client or Server
8
+ * Description: Close the connection normally. Do not send the Will Message.
9
+ */
10
+ NormalDisconnection = 0,
11
+ /**
12
+ * 0x04 - Disconnect with Will Message
13
+ * Sent by: Client
14
+ * Description: The Client wishes to disconnect but requires that the Server also publishes its Will Message.
15
+ */
16
+ DisconnectWithWillMessage = 4,
17
+ /**
18
+ * 0x80 - Unspecified error
19
+ * Sent by: Client or Server
20
+ * Description: The Connection is closed but the sender either does not wish to reveal the reason, or none of the other Reason Codes apply.
21
+ */
22
+ UnspecifiedError = 128,
23
+ /**
24
+ * 0x81 - Malformed Packet
25
+ * Sent by: Client or Server
26
+ * Description: The received packet does not conform to this specification.
27
+ */
28
+ MalformedPacket = 129,
29
+ /**
30
+ * 0x82 - Protocol Error
31
+ * Sent by: Client or Server
32
+ * Description: An unexpected or out of order packet was received.
33
+ */
34
+ ProtocolError = 130,
35
+ /**
36
+ * 0x83 - Implementation specific error
37
+ * Sent by: Client or Server
38
+ * Description: The packet received is valid but cannot be processed by this implementation.
39
+ */
40
+ ImplementationSpecificError = 131,
41
+ /**
42
+ * 0x87 - Not authorized
43
+ * Sent by: Server
44
+ * Description: The request is not authorized.
45
+ */
46
+ NotAuthorized = 135,
47
+ /**
48
+ * 0x89 - Server busy
49
+ * Sent by: Server
50
+ * Description: The Server is busy and cannot continue processing requests from this Client.
51
+ */
52
+ ServerBusy = 137,
53
+ /**
54
+ * 0x8B - Server shutting down
55
+ * Sent by: Server
56
+ * Description: The Server is shutting down.
57
+ */
58
+ ServerShuttingDown = 139,
59
+ /**
60
+ * 0x8D - Keep Alive timeout
61
+ * Sent by: Server
62
+ * Description: The Connection is closed because no packet has been received for 1.5 times the Keepalive time.
63
+ */
64
+ KeepAliveTimeout = 141,
65
+ /**
66
+ * 0x8E - Session taken over
67
+ * Sent by: Server
68
+ * Description: Another Connection using the same ClientID has connected causing this Connection to be closed.
69
+ */
70
+ SessionTakenOver = 142,
71
+ /**
72
+ * 0x8F - Topic Filter invalid
73
+ * Sent by: Server
74
+ * Description: The Topic Filter is correctly formed, but is not accepted by this Server.
75
+ */
76
+ TopicFilterInvalid = 143,
77
+ /**
78
+ * 0x90 - Topic Name invalid
79
+ * Sent by: Client or Server
80
+ * Description: The Topic Name is correctly formed, but is not accepted by this Client or Server.
81
+ */
82
+ TopicNameInvalid = 144,
83
+ /**
84
+ * 0x93 - Receive Maximum exceeded
85
+ * Sent by: Client or Server
86
+ * Description: The Client or Server has received more than Receive Maximum publication for which it has not sent PUBACK or PUBCOMP.
87
+ */
88
+ ReceiveMaximumExceeded = 147,
89
+ /**
90
+ * 0x94 - Topic Alias invalid
91
+ * Sent by: Client or Server
92
+ * 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.
93
+ */
94
+ TopicAliasInvalid = 148,
95
+ /**
96
+ * 0x95 - Packet too large
97
+ * Sent by: Client or Server
98
+ * Description: The packet size is greater than Maximum Packet Size for this Client or Server.
99
+ */
100
+ PacketTooLarge = 149,
101
+ /**
102
+ * 0x96 - Message rate too high
103
+ * Sent by: Client or Server
104
+ * Description: The received data rate is too high.
105
+ */
106
+ MessageRateTooHigh = 150,
107
+ /**
108
+ * 0x97 - Quota exceeded
109
+ * Sent by: Client or Server
110
+ * Description: An implementation or administrative imposed limit has been exceeded.
111
+ */
112
+ QuotaExceeded = 151,
113
+ /**
114
+ * 0x98 - Administrative action
115
+ * Sent by: Client or Server
116
+ * Description: The Connection is closed due to an administrative action.
117
+ */
118
+ AdministrativeAction = 152,
119
+ /**
120
+ * 0x99 - Payload format invalid
121
+ * Sent by: Client or Server
122
+ * Description: The payload format does not match the one specified by the Payload Format Indicator.
123
+ */
124
+ PayloadFormatInvalid = 153,
125
+ /**
126
+ * 0x9A - Retain not supported
127
+ * Sent by: Server
128
+ * Description: The Server does not support retained messages.
129
+ */
130
+ RetainNotSupported = 154,
131
+ /**
132
+ * 0x9B - QoS not supported
133
+ * Sent by: Server
134
+ * Description: The Client specified a QoS greater than the QoS specified in a Maximum QoS in the CONNACK.
135
+ */
136
+ QosNotSupported = 155,
137
+ /**
138
+ * 0x9C - Use another server
139
+ * Sent by: Server
140
+ * Description: The Client should temporarily change its Server.
141
+ */
142
+ UseAnotherServer = 156,
143
+ /**
144
+ * 0x9D - Server moved
145
+ * Sent by: Server
146
+ * Description: The Server is moved and the Client should permanently change its server location.
147
+ */
148
+ ServerMoved = 157,
149
+ /**
150
+ * 0x9E - Shared Subscriptions not supported
151
+ * Sent by: Server
152
+ * Description: The Server does not support Shared Subscriptions.
153
+ */
154
+ SharedSubscriptionsNotSupported = 158,
155
+ /**
156
+ * 0x9F - Connection rate exceeded
157
+ * Sent by: Server
158
+ * Description: This connection is closed because the connection rate is too high.
159
+ */
160
+ ConnectionRateExceeded = 159,
161
+ /**
162
+ * 0xA0 - Maximum connect time
163
+ * Sent by: Server
164
+ * Description: The maximum connection time authorized for this connection has been exceeded.
165
+ */
166
+ MaximumConnectTime = 160,
167
+ /**
168
+ * 0xA1 - Subscription Identifiers not supported
169
+ * Sent by: Server
170
+ * Description: The Server does not support Subscription Identifiers; the subscription is not accepted.
171
+ */
172
+ SubscriptionIdentifiersNotSupported = 161,
173
+ /**
174
+ * 0xA2 - Wildcard Subscriptions not supported
175
+ * Sent by: Server
176
+ * Description: The Server does not support Wildcard Subscriptions; the subscription is not accepted.
177
+ */
178
+ WildcardSubscriptionsNotSupported = 162
179
+ }
180
+ //# sourceMappingURL=mqttDisconnectReasonCode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mqttDisconnectReasonCode.d.ts","sourceRoot":"","sources":["../../../../src/enum/MqttErrorCodes/mqttDisconnectReasonCode.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,wBAAwB;IAClC;;;;OAIG;IACH,mBAAmB,IAAO;IAE1B;;;;OAIG;IACH,yBAAyB,IAAO;IAEhC;;;;OAIG;IACH,gBAAgB,MAAO;IAEvB;;;;OAIG;IACH,eAAe,MAAO;IAEtB;;;;OAIG;IACH,aAAa,MAAO;IAEpB;;;;OAIG;IACH,2BAA2B,MAAO;IAElC;;;;OAIG;IACH,aAAa,MAAO;IAEpB;;;;OAIG;IACH,UAAU,MAAO;IAEjB;;;;OAIG;IACH,kBAAkB,MAAO;IAEzB;;;;OAIG;IACH,gBAAgB,MAAO;IAEvB;;;;OAIG;IACH,gBAAgB,MAAO;IAEvB;;;;OAIG;IACH,kBAAkB,MAAO;IAEzB;;;;OAIG;IACH,gBAAgB,MAAO;IAEvB;;;;OAIG;IACH,sBAAsB,MAAO;IAE7B;;;;OAIG;IACH,iBAAiB,MAAO;IAExB;;;;OAIG;IACH,cAAc,MAAO;IAErB;;;;OAIG;IACH,kBAAkB,MAAO;IAEzB;;;;OAIG;IACH,aAAa,MAAO;IAEpB;;;;OAIG;IACH,oBAAoB,MAAO;IAE3B;;;;OAIG;IACH,oBAAoB,MAAO;IAE3B;;;;OAIG;IACH,kBAAkB,MAAO;IAEzB;;;;OAIG;IACH,eAAe,MAAO;IAEtB;;;;OAIG;IACH,gBAAgB,MAAO;IAEvB;;;;OAIG;IACH,WAAW,MAAO;IAElB;;;;OAIG;IACH,+BAA+B,MAAO;IAEtC;;;;OAIG;IACH,sBAAsB,MAAO;IAE7B;;;;OAIG;IACH,kBAAkB,MAAO;IAEzB;;;;OAIG;IACH,mCAAmC,MAAO;IAE1C;;;;OAIG;IACH,iCAAiC,MAAO;CACzC"}
@@ -0,0 +1,183 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ /**
4
+ * MQTT 5.0 Disconnect Reason Codes.
5
+ */
6
+ export var MqttDisconnectReasonCode;
7
+ (function (MqttDisconnectReasonCode) {
8
+ /**
9
+ * 0x00 - Normal disconnection
10
+ * Sent by: Client or Server
11
+ * Description: Close the connection normally. Do not send the Will Message.
12
+ */
13
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["NormalDisconnection"] = 0] = "NormalDisconnection";
14
+ /**
15
+ * 0x04 - Disconnect with Will Message
16
+ * Sent by: Client
17
+ * Description: The Client wishes to disconnect but requires that the Server also publishes its Will Message.
18
+ */
19
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["DisconnectWithWillMessage"] = 4] = "DisconnectWithWillMessage";
20
+ /**
21
+ * 0x80 - Unspecified error
22
+ * Sent by: Client or Server
23
+ * Description: The Connection is closed but the sender either does not wish to reveal the reason, or none of the other Reason Codes apply.
24
+ */
25
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["UnspecifiedError"] = 128] = "UnspecifiedError";
26
+ /**
27
+ * 0x81 - Malformed Packet
28
+ * Sent by: Client or Server
29
+ * Description: The received packet does not conform to this specification.
30
+ */
31
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["MalformedPacket"] = 129] = "MalformedPacket";
32
+ /**
33
+ * 0x82 - Protocol Error
34
+ * Sent by: Client or Server
35
+ * Description: An unexpected or out of order packet was received.
36
+ */
37
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["ProtocolError"] = 130] = "ProtocolError";
38
+ /**
39
+ * 0x83 - Implementation specific error
40
+ * Sent by: Client or Server
41
+ * Description: The packet received is valid but cannot be processed by this implementation.
42
+ */
43
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["ImplementationSpecificError"] = 131] = "ImplementationSpecificError";
44
+ /**
45
+ * 0x87 - Not authorized
46
+ * Sent by: Server
47
+ * Description: The request is not authorized.
48
+ */
49
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["NotAuthorized"] = 135] = "NotAuthorized";
50
+ /**
51
+ * 0x89 - Server busy
52
+ * Sent by: Server
53
+ * Description: The Server is busy and cannot continue processing requests from this Client.
54
+ */
55
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["ServerBusy"] = 137] = "ServerBusy";
56
+ /**
57
+ * 0x8B - Server shutting down
58
+ * Sent by: Server
59
+ * Description: The Server is shutting down.
60
+ */
61
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["ServerShuttingDown"] = 139] = "ServerShuttingDown";
62
+ /**
63
+ * 0x8D - Keep Alive timeout
64
+ * Sent by: Server
65
+ * Description: The Connection is closed because no packet has been received for 1.5 times the Keepalive time.
66
+ */
67
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["KeepAliveTimeout"] = 141] = "KeepAliveTimeout";
68
+ /**
69
+ * 0x8E - Session taken over
70
+ * Sent by: Server
71
+ * Description: Another Connection using the same ClientID has connected causing this Connection to be closed.
72
+ */
73
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["SessionTakenOver"] = 142] = "SessionTakenOver";
74
+ /**
75
+ * 0x8F - Topic Filter invalid
76
+ * Sent by: Server
77
+ * Description: The Topic Filter is correctly formed, but is not accepted by this Server.
78
+ */
79
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["TopicFilterInvalid"] = 143] = "TopicFilterInvalid";
80
+ /**
81
+ * 0x90 - Topic Name invalid
82
+ * Sent by: Client or Server
83
+ * Description: The Topic Name is correctly formed, but is not accepted by this Client or Server.
84
+ */
85
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["TopicNameInvalid"] = 144] = "TopicNameInvalid";
86
+ /**
87
+ * 0x93 - Receive Maximum exceeded
88
+ * Sent by: Client or Server
89
+ * Description: The Client or Server has received more than Receive Maximum publication for which it has not sent PUBACK or PUBCOMP.
90
+ */
91
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["ReceiveMaximumExceeded"] = 147] = "ReceiveMaximumExceeded";
92
+ /**
93
+ * 0x94 - Topic Alias invalid
94
+ * Sent by: Client or Server
95
+ * 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.
96
+ */
97
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["TopicAliasInvalid"] = 148] = "TopicAliasInvalid";
98
+ /**
99
+ * 0x95 - Packet too large
100
+ * Sent by: Client or Server
101
+ * Description: The packet size is greater than Maximum Packet Size for this Client or Server.
102
+ */
103
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["PacketTooLarge"] = 149] = "PacketTooLarge";
104
+ /**
105
+ * 0x96 - Message rate too high
106
+ * Sent by: Client or Server
107
+ * Description: The received data rate is too high.
108
+ */
109
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["MessageRateTooHigh"] = 150] = "MessageRateTooHigh";
110
+ /**
111
+ * 0x97 - Quota exceeded
112
+ * Sent by: Client or Server
113
+ * Description: An implementation or administrative imposed limit has been exceeded.
114
+ */
115
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["QuotaExceeded"] = 151] = "QuotaExceeded";
116
+ /**
117
+ * 0x98 - Administrative action
118
+ * Sent by: Client or Server
119
+ * Description: The Connection is closed due to an administrative action.
120
+ */
121
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["AdministrativeAction"] = 152] = "AdministrativeAction";
122
+ /**
123
+ * 0x99 - Payload format invalid
124
+ * Sent by: Client or Server
125
+ * Description: The payload format does not match the one specified by the Payload Format Indicator.
126
+ */
127
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["PayloadFormatInvalid"] = 153] = "PayloadFormatInvalid";
128
+ /**
129
+ * 0x9A - Retain not supported
130
+ * Sent by: Server
131
+ * Description: The Server does not support retained messages.
132
+ */
133
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["RetainNotSupported"] = 154] = "RetainNotSupported";
134
+ /**
135
+ * 0x9B - QoS not supported
136
+ * Sent by: Server
137
+ * Description: The Client specified a QoS greater than the QoS specified in a Maximum QoS in the CONNACK.
138
+ */
139
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["QosNotSupported"] = 155] = "QosNotSupported";
140
+ /**
141
+ * 0x9C - Use another server
142
+ * Sent by: Server
143
+ * Description: The Client should temporarily change its Server.
144
+ */
145
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["UseAnotherServer"] = 156] = "UseAnotherServer";
146
+ /**
147
+ * 0x9D - Server moved
148
+ * Sent by: Server
149
+ * Description: The Server is moved and the Client should permanently change its server location.
150
+ */
151
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["ServerMoved"] = 157] = "ServerMoved";
152
+ /**
153
+ * 0x9E - Shared Subscriptions not supported
154
+ * Sent by: Server
155
+ * Description: The Server does not support Shared Subscriptions.
156
+ */
157
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["SharedSubscriptionsNotSupported"] = 158] = "SharedSubscriptionsNotSupported";
158
+ /**
159
+ * 0x9F - Connection rate exceeded
160
+ * Sent by: Server
161
+ * Description: This connection is closed because the connection rate is too high.
162
+ */
163
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["ConnectionRateExceeded"] = 159] = "ConnectionRateExceeded";
164
+ /**
165
+ * 0xA0 - Maximum connect time
166
+ * Sent by: Server
167
+ * Description: The maximum connection time authorized for this connection has been exceeded.
168
+ */
169
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["MaximumConnectTime"] = 160] = "MaximumConnectTime";
170
+ /**
171
+ * 0xA1 - Subscription Identifiers not supported
172
+ * Sent by: Server
173
+ * Description: The Server does not support Subscription Identifiers; the subscription is not accepted.
174
+ */
175
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["SubscriptionIdentifiersNotSupported"] = 161] = "SubscriptionIdentifiersNotSupported";
176
+ /**
177
+ * 0xA2 - Wildcard Subscriptions not supported
178
+ * Sent by: Server
179
+ * Description: The Server does not support Wildcard Subscriptions; the subscription is not accepted.
180
+ */
181
+ MqttDisconnectReasonCode[MqttDisconnectReasonCode["WildcardSubscriptionsNotSupported"] = 162] = "WildcardSubscriptionsNotSupported";
182
+ })(MqttDisconnectReasonCode || (MqttDisconnectReasonCode = {}));
183
+ //# sourceMappingURL=mqttDisconnectReasonCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mqttDisconnectReasonCode.js","sourceRoot":"","sources":["../../../../src/enum/MqttErrorCodes/mqttDisconnectReasonCode.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAN,IAAY,wBA2MX;AA3MD,WAAY,wBAAwB;IAClC;;;;OAIG;IACH,qGAA0B,CAAA;IAE1B;;;;OAIG;IACH,iHAAgC,CAAA;IAEhC;;;;OAIG;IACH,iGAAuB,CAAA;IAEvB;;;;OAIG;IACH,+FAAsB,CAAA;IAEtB;;;;OAIG;IACH,2FAAoB,CAAA;IAEpB;;;;OAIG;IACH,uHAAkC,CAAA;IAElC;;;;OAIG;IACH,2FAAoB,CAAA;IAEpB;;;;OAIG;IACH,qFAAiB,CAAA;IAEjB;;;;OAIG;IACH,qGAAyB,CAAA;IAEzB;;;;OAIG;IACH,iGAAuB,CAAA;IAEvB;;;;OAIG;IACH,iGAAuB,CAAA;IAEvB;;;;OAIG;IACH,qGAAyB,CAAA;IAEzB;;;;OAIG;IACH,iGAAuB,CAAA;IAEvB;;;;OAIG;IACH,6GAA6B,CAAA;IAE7B;;;;OAIG;IACH,mGAAwB,CAAA;IAExB;;;;OAIG;IACH,6FAAqB,CAAA;IAErB;;;;OAIG;IACH,qGAAyB,CAAA;IAEzB;;;;OAIG;IACH,2FAAoB,CAAA;IAEpB;;;;OAIG;IACH,yGAA2B,CAAA;IAE3B;;;;OAIG;IACH,yGAA2B,CAAA;IAE3B;;;;OAIG;IACH,qGAAyB,CAAA;IAEzB;;;;OAIG;IACH,+FAAsB,CAAA;IAEtB;;;;OAIG;IACH,iGAAuB,CAAA;IAEvB;;;;OAIG;IACH,uFAAkB,CAAA;IAElB;;;;OAIG;IACH,+HAAsC,CAAA;IAEtC;;;;OAIG;IACH,6GAA6B,CAAA;IAE7B;;;;OAIG;IACH,qGAAyB,CAAA;IAEzB;;;;OAIG;IACH,uIAA0C,CAAA;IAE1C;;;;OAIG;IACH,mIAAwC,CAAA;AAC1C,CAAC,EA3MW,wBAAwB,KAAxB,wBAAwB,QA2MnC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * MQTT 5.0 Disconnect Reason Codes.\n */\nexport enum MqttDisconnectReasonCode {\n /**\n * 0x00 - Normal disconnection\n * Sent by: Client or Server\n * Description: Close the connection normally. Do not send the Will Message.\n */\n NormalDisconnection = 0x00,\n\n /**\n * 0x04 - Disconnect with Will Message\n * Sent by: Client\n * Description: The Client wishes to disconnect but requires that the Server also publishes its Will Message.\n */\n DisconnectWithWillMessage = 0x04,\n\n /**\n * 0x80 - Unspecified error\n * Sent by: Client or Server\n * Description: The Connection is closed but the sender either does not wish to reveal the reason, or none of the other Reason Codes apply.\n */\n UnspecifiedError = 0x80,\n\n /**\n * 0x81 - Malformed Packet\n * Sent by: Client or Server\n * Description: The received packet does not conform to this specification.\n */\n MalformedPacket = 0x81,\n\n /**\n * 0x82 - Protocol Error\n * Sent by: Client or Server\n * Description: An unexpected or out of order packet was received.\n */\n ProtocolError = 0x82,\n\n /**\n * 0x83 - Implementation specific error\n * Sent by: Client or Server\n * Description: The packet received is valid but cannot be processed by this implementation.\n */\n ImplementationSpecificError = 0x83,\n\n /**\n * 0x87 - Not authorized\n * Sent by: Server\n * Description: The request is not authorized.\n */\n NotAuthorized = 0x87,\n\n /**\n * 0x89 - Server busy\n * Sent by: Server\n * Description: The Server is busy and cannot continue processing requests from this Client.\n */\n ServerBusy = 0x89,\n\n /**\n * 0x8B - Server shutting down\n * Sent by: Server\n * Description: The Server is shutting down.\n */\n ServerShuttingDown = 0x8b,\n\n /**\n * 0x8D - Keep Alive timeout\n * Sent by: Server\n * Description: The Connection is closed because no packet has been received for 1.5 times the Keepalive time.\n */\n KeepAliveTimeout = 0x8d,\n\n /**\n * 0x8E - Session taken over\n * Sent by: Server\n * Description: Another Connection using the same ClientID has connected causing this Connection to be closed.\n */\n SessionTakenOver = 0x8e,\n\n /**\n * 0x8F - Topic Filter invalid\n * Sent by: Server\n * Description: The Topic Filter is correctly formed, but is not accepted by this Server.\n */\n TopicFilterInvalid = 0x8f,\n\n /**\n * 0x90 - Topic Name invalid\n * Sent by: Client or Server\n * Description: The Topic Name is correctly formed, but is not accepted by this Client or Server.\n */\n TopicNameInvalid = 0x90,\n\n /**\n * 0x93 - Receive Maximum exceeded\n * Sent by: Client or Server\n * Description: The Client or Server has received more than Receive Maximum publication for which it has not sent PUBACK or PUBCOMP.\n */\n ReceiveMaximumExceeded = 0x93,\n\n /**\n * 0x94 - Topic Alias invalid\n * Sent by: Client or Server\n * 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.\n */\n TopicAliasInvalid = 0x94,\n\n /**\n * 0x95 - Packet too large\n * Sent by: Client or Server\n * Description: The packet size is greater than Maximum Packet Size for this Client or Server.\n */\n PacketTooLarge = 0x95,\n\n /**\n * 0x96 - Message rate too high\n * Sent by: Client or Server\n * Description: The received data rate is too high.\n */\n MessageRateTooHigh = 0x96,\n\n /**\n * 0x97 - Quota exceeded\n * Sent by: Client or Server\n * Description: An implementation or administrative imposed limit has been exceeded.\n */\n QuotaExceeded = 0x97,\n\n /**\n * 0x98 - Administrative action\n * Sent by: Client or Server\n * Description: The Connection is closed due to an administrative action.\n */\n AdministrativeAction = 0x98,\n\n /**\n * 0x99 - Payload format invalid\n * Sent by: Client or Server\n * Description: The payload format does not match the one specified by the Payload Format Indicator.\n */\n PayloadFormatInvalid = 0x99,\n\n /**\n * 0x9A - Retain not supported\n * Sent by: Server\n * Description: The Server does not support retained messages.\n */\n RetainNotSupported = 0x9a,\n\n /**\n * 0x9B - QoS not supported\n * Sent by: Server\n * Description: The Client specified a QoS greater than the QoS specified in a Maximum QoS in the CONNACK.\n */\n QosNotSupported = 0x9b,\n\n /**\n * 0x9C - Use another server\n * Sent by: Server\n * Description: The Client should temporarily change its Server.\n */\n UseAnotherServer = 0x9c,\n\n /**\n * 0x9D - Server moved\n * Sent by: Server\n * Description: The Server is moved and the Client should permanently change its server location.\n */\n ServerMoved = 0x9d,\n\n /**\n * 0x9E - Shared Subscriptions not supported\n * Sent by: Server\n * Description: The Server does not support Shared Subscriptions.\n */\n SharedSubscriptionsNotSupported = 0x9e,\n\n /**\n * 0x9F - Connection rate exceeded\n * Sent by: Server\n * Description: This connection is closed because the connection rate is too high.\n */\n ConnectionRateExceeded = 0x9f,\n\n /**\n * 0xA0 - Maximum connect time\n * Sent by: Server\n * Description: The maximum connection time authorized for this connection has been exceeded.\n */\n MaximumConnectTime = 0xa0,\n\n /**\n * 0xA1 - Subscription Identifiers not supported\n * Sent by: Server\n * Description: The Server does not support Subscription Identifiers; the subscription is not accepted.\n */\n SubscriptionIdentifiersNotSupported = 0xa1,\n\n /**\n * 0xA2 - Wildcard Subscriptions not supported\n * Sent by: Server\n * Description: The Server does not support Wildcard Subscriptions; the subscription is not accepted.\n */\n WildcardSubscriptionsNotSupported = 0xa2,\n}\n"]}