@azure/web-pubsub-express 1.0.6-alpha.20250224.1 → 1.0.6

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 (86) hide show
  1. package/README.md +53 -46
  2. package/dist/browser/cloudEventsDispatcher.d.ts +15 -0
  3. package/dist/browser/cloudEventsDispatcher.d.ts.map +1 -0
  4. package/dist/browser/cloudEventsDispatcher.js +411 -0
  5. package/dist/browser/cloudEventsDispatcher.js.map +1 -0
  6. package/dist/browser/cloudEventsProtocols.d.ts +411 -0
  7. package/dist/browser/cloudEventsProtocols.d.ts.map +1 -0
  8. package/dist/browser/cloudEventsProtocols.js +4 -0
  9. package/dist/browser/cloudEventsProtocols.js.map +1 -0
  10. package/dist/browser/enum/MqttErrorCodes/mqttDisconnectReasonCode.d.ts +180 -0
  11. package/dist/browser/enum/MqttErrorCodes/mqttDisconnectReasonCode.d.ts.map +1 -0
  12. package/dist/browser/enum/MqttErrorCodes/mqttDisconnectReasonCode.js +183 -0
  13. package/dist/browser/enum/MqttErrorCodes/mqttDisconnectReasonCode.js.map +1 -0
  14. package/dist/browser/enum/MqttErrorCodes/mqttV311ConnectReturnCode.d.ts +31 -0
  15. package/dist/browser/enum/MqttErrorCodes/mqttV311ConnectReturnCode.d.ts.map +1 -0
  16. package/dist/browser/enum/MqttErrorCodes/mqttV311ConnectReturnCode.js +34 -0
  17. package/dist/browser/enum/MqttErrorCodes/mqttV311ConnectReturnCode.js.map +1 -0
  18. package/dist/browser/enum/MqttErrorCodes/mqttV500ConnectReasonCode.d.ts +112 -0
  19. package/dist/browser/enum/MqttErrorCodes/mqttV500ConnectReasonCode.d.ts.map +1 -0
  20. package/dist/browser/enum/MqttErrorCodes/mqttV500ConnectReasonCode.js +115 -0
  21. package/dist/browser/enum/MqttErrorCodes/mqttV500ConnectReasonCode.js.map +1 -0
  22. package/dist/browser/index.d.ts +6 -0
  23. package/dist/browser/index.d.ts.map +1 -0
  24. package/dist/browser/index.js +8 -0
  25. package/dist/browser/index.js.map +1 -0
  26. package/dist/browser/logger.d.ts +7 -0
  27. package/dist/browser/logger.d.ts.map +1 -0
  28. package/dist/browser/logger.js +10 -0
  29. package/dist/browser/logger.js.map +1 -0
  30. package/dist/browser/package.json +3 -0
  31. package/dist/browser/utils.d.ts +6 -0
  32. package/dist/browser/utils.d.ts.map +1 -0
  33. package/dist/browser/utils.js +53 -0
  34. package/dist/browser/utils.js.map +1 -0
  35. package/dist/browser/webPubSubEventHandler.d.ts +46 -0
  36. package/dist/browser/webPubSubEventHandler.d.ts.map +1 -0
  37. package/dist/browser/webPubSubEventHandler.js +73 -0
  38. package/dist/browser/webPubSubEventHandler.js.map +1 -0
  39. package/dist/commonjs/index.js +14 -880
  40. package/dist/commonjs/index.js.map +1 -1
  41. package/dist/commonjs/webPubSubEventHandler.d.ts +7 -8
  42. package/dist/commonjs/webPubSubEventHandler.d.ts.map +1 -1
  43. package/dist/commonjs/webPubSubEventHandler.js +7 -8
  44. package/dist/commonjs/webPubSubEventHandler.js.map +1 -1
  45. package/dist/esm/webPubSubEventHandler.d.ts +7 -8
  46. package/dist/esm/webPubSubEventHandler.d.ts.map +1 -1
  47. package/dist/esm/webPubSubEventHandler.js +7 -8
  48. package/dist/esm/webPubSubEventHandler.js.map +1 -1
  49. package/dist/react-native/cloudEventsDispatcher.d.ts +15 -0
  50. package/dist/react-native/cloudEventsDispatcher.d.ts.map +1 -0
  51. package/dist/react-native/cloudEventsDispatcher.js +411 -0
  52. package/dist/react-native/cloudEventsDispatcher.js.map +1 -0
  53. package/dist/react-native/cloudEventsProtocols.d.ts +411 -0
  54. package/dist/react-native/cloudEventsProtocols.d.ts.map +1 -0
  55. package/dist/react-native/cloudEventsProtocols.js +4 -0
  56. package/dist/react-native/cloudEventsProtocols.js.map +1 -0
  57. package/dist/react-native/enum/MqttErrorCodes/mqttDisconnectReasonCode.d.ts +180 -0
  58. package/dist/react-native/enum/MqttErrorCodes/mqttDisconnectReasonCode.d.ts.map +1 -0
  59. package/dist/react-native/enum/MqttErrorCodes/mqttDisconnectReasonCode.js +183 -0
  60. package/dist/react-native/enum/MqttErrorCodes/mqttDisconnectReasonCode.js.map +1 -0
  61. package/dist/react-native/enum/MqttErrorCodes/mqttV311ConnectReturnCode.d.ts +31 -0
  62. package/dist/react-native/enum/MqttErrorCodes/mqttV311ConnectReturnCode.d.ts.map +1 -0
  63. package/dist/react-native/enum/MqttErrorCodes/mqttV311ConnectReturnCode.js +34 -0
  64. package/dist/react-native/enum/MqttErrorCodes/mqttV311ConnectReturnCode.js.map +1 -0
  65. package/dist/react-native/enum/MqttErrorCodes/mqttV500ConnectReasonCode.d.ts +112 -0
  66. package/dist/react-native/enum/MqttErrorCodes/mqttV500ConnectReasonCode.d.ts.map +1 -0
  67. package/dist/react-native/enum/MqttErrorCodes/mqttV500ConnectReasonCode.js +115 -0
  68. package/dist/react-native/enum/MqttErrorCodes/mqttV500ConnectReasonCode.js.map +1 -0
  69. package/dist/react-native/index.d.ts +6 -0
  70. package/dist/react-native/index.d.ts.map +1 -0
  71. package/dist/react-native/index.js +8 -0
  72. package/dist/react-native/index.js.map +1 -0
  73. package/dist/react-native/logger.d.ts +7 -0
  74. package/dist/react-native/logger.d.ts.map +1 -0
  75. package/dist/react-native/logger.js +10 -0
  76. package/dist/react-native/logger.js.map +1 -0
  77. package/dist/react-native/package.json +3 -0
  78. package/dist/react-native/utils.d.ts +6 -0
  79. package/dist/react-native/utils.d.ts.map +1 -0
  80. package/dist/react-native/utils.js +53 -0
  81. package/dist/react-native/utils.js.map +1 -0
  82. package/dist/react-native/webPubSubEventHandler.d.ts +46 -0
  83. package/dist/react-native/webPubSubEventHandler.d.ts.map +1 -0
  84. package/dist/react-native/webPubSubEventHandler.js +73 -0
  85. package/dist/react-native/webPubSubEventHandler.js.map +1 -0
  86. package/package.json +33 -17
@@ -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"]}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * MQTT 3.1.1 Connect Return Codes.
3
+ */
4
+ export declare enum MqttV311ConnectReturnCode {
5
+ /**
6
+ * 0x01: Connection refused, unacceptable protocol version
7
+ * The Server does not support the level of the MQTT protocol requested by the Client.
8
+ */
9
+ UnacceptableProtocolVersion = 1,
10
+ /**
11
+ * 0x02: Connection refused, identifier rejected
12
+ * The Client identifier is correct UTF-8 but not allowed by the Server.
13
+ */
14
+ IdentifierRejected = 2,
15
+ /**
16
+ * 0x03: Connection refused, server unavailable
17
+ * The Network Connection has been made but the MQTT service is unavailable.
18
+ */
19
+ ServerUnavailable = 3,
20
+ /**
21
+ * 0x04: Connection refused, bad user name or password
22
+ * The data in the user name or password is malformed.
23
+ */
24
+ BadUsernameOrPassword = 4,
25
+ /**
26
+ * 0x05: Connection refused, not authorized
27
+ * The Client is not authorized to connect.
28
+ */
29
+ NotAuthorized = 5
30
+ }
31
+ //# sourceMappingURL=mqttV311ConnectReturnCode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mqttV311ConnectReturnCode.d.ts","sourceRoot":"","sources":["../../../../src/enum/MqttErrorCodes/mqttV311ConnectReturnCode.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,oBAAY,yBAAyB;IACnC;;;OAGG;IACH,2BAA2B,IAAO;IAElC;;;OAGG;IACH,kBAAkB,IAAO;IAEzB;;;OAGG;IACH,iBAAiB,IAAO;IAExB;;;OAGG;IACH,qBAAqB,IAAO;IAE5B;;;OAGG;IACH,aAAa,IAAO;CACrB"}
@@ -0,0 +1,34 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ /**
4
+ * MQTT 3.1.1 Connect Return Codes.
5
+ */
6
+ export var MqttV311ConnectReturnCode;
7
+ (function (MqttV311ConnectReturnCode) {
8
+ /**
9
+ * 0x01: Connection refused, unacceptable protocol version
10
+ * The Server does not support the level of the MQTT protocol requested by the Client.
11
+ */
12
+ MqttV311ConnectReturnCode[MqttV311ConnectReturnCode["UnacceptableProtocolVersion"] = 1] = "UnacceptableProtocolVersion";
13
+ /**
14
+ * 0x02: Connection refused, identifier rejected
15
+ * The Client identifier is correct UTF-8 but not allowed by the Server.
16
+ */
17
+ MqttV311ConnectReturnCode[MqttV311ConnectReturnCode["IdentifierRejected"] = 2] = "IdentifierRejected";
18
+ /**
19
+ * 0x03: Connection refused, server unavailable
20
+ * The Network Connection has been made but the MQTT service is unavailable.
21
+ */
22
+ MqttV311ConnectReturnCode[MqttV311ConnectReturnCode["ServerUnavailable"] = 3] = "ServerUnavailable";
23
+ /**
24
+ * 0x04: Connection refused, bad user name or password
25
+ * The data in the user name or password is malformed.
26
+ */
27
+ MqttV311ConnectReturnCode[MqttV311ConnectReturnCode["BadUsernameOrPassword"] = 4] = "BadUsernameOrPassword";
28
+ /**
29
+ * 0x05: Connection refused, not authorized
30
+ * The Client is not authorized to connect.
31
+ */
32
+ MqttV311ConnectReturnCode[MqttV311ConnectReturnCode["NotAuthorized"] = 5] = "NotAuthorized";
33
+ })(MqttV311ConnectReturnCode || (MqttV311ConnectReturnCode = {}));
34
+ //# sourceMappingURL=mqttV311ConnectReturnCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mqttV311ConnectReturnCode.js","sourceRoot":"","sources":["../../../../src/enum/MqttErrorCodes/mqttV311ConnectReturnCode.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;GAEG;AACH,MAAM,CAAN,IAAY,yBA8BX;AA9BD,WAAY,yBAAyB;IACnC;;;OAGG;IACH,uHAAkC,CAAA;IAElC;;;OAGG;IACH,qGAAyB,CAAA;IAEzB;;;OAGG;IACH,mGAAwB,CAAA;IAExB;;;OAGG;IACH,2GAA4B,CAAA;IAE5B;;;OAGG;IACH,2FAAoB,CAAA;AACtB,CAAC,EA9BW,yBAAyB,KAAzB,yBAAyB,QA8BpC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * MQTT 3.1.1 Connect Return Codes.\n */\nexport enum MqttV311ConnectReturnCode {\n /**\n * 0x01: Connection refused, unacceptable protocol version\n * The Server does not support the level of the MQTT protocol requested by the Client.\n */\n UnacceptableProtocolVersion = 0x01,\n\n /**\n * 0x02: Connection refused, identifier rejected\n * The Client identifier is correct UTF-8 but not allowed by the Server.\n */\n IdentifierRejected = 0x02,\n\n /**\n * 0x03: Connection refused, server unavailable\n * The Network Connection has been made but the MQTT service is unavailable.\n */\n ServerUnavailable = 0x03,\n\n /**\n * 0x04: Connection refused, bad user name or password\n * The data in the user name or password is malformed.\n */\n BadUsernameOrPassword = 0x04,\n\n /**\n * 0x05: Connection refused, not authorized\n * The Client is not authorized to connect.\n */\n NotAuthorized = 0x05,\n}\n"]}
@@ -0,0 +1,112 @@
1
+ /**
2
+ * MQTT Connect Reason Codes
3
+ * These codes represent the reasons for the outcome of an MQTT CONNECT packet as per MQTT 5.0 specification.
4
+ */
5
+ export declare enum MqttV500ConnectReasonCode {
6
+ /**
7
+ * 0x80 - Unspecified error
8
+ * Description: The Server does not wish to reveal the reason for the failure, or none of the other Reason Codes apply.
9
+ */
10
+ UnspecifiedError = 128,
11
+ /**
12
+ * 0x81 - Malformed Packet
13
+ * Description: Data within the CONNECT packet could not be correctly parsed.
14
+ */
15
+ MalformedPacket = 129,
16
+ /**
17
+ * 0x82 - Protocol Error
18
+ * Description: Data in the CONNECT packet does not conform to this specification.
19
+ */
20
+ ProtocolError = 130,
21
+ /**
22
+ * 0x83 - Implementation specific error
23
+ * Description: The CONNECT is valid but is not accepted by this Server.
24
+ */
25
+ ImplementationSpecificError = 131,
26
+ /**
27
+ * 0x84 - Unsupported Protocol Version
28
+ * Description: The Server does not support the version of the MQTT protocol requested by the Client.
29
+ */
30
+ UnsupportedProtocolVersion = 132,
31
+ /**
32
+ * 0x85 - Client Identifier not valid
33
+ * Description: The Client Identifier is a valid string but is not allowed by the Server.
34
+ */
35
+ ClientIdentifierNotValid = 133,
36
+ /**
37
+ * 0x86 - Bad User Name or Password
38
+ * Description: The Server does not accept the User Name or Password specified by the Client.
39
+ */
40
+ BadUserNameOrPassword = 134,
41
+ /**
42
+ * 0x87 - Not authorized
43
+ * Description: The Client is not authorized to connect.
44
+ */
45
+ NotAuthorized = 135,
46
+ /**
47
+ * 0x88 - Server unavailable
48
+ * Description: The MQTT Server is not available.
49
+ */
50
+ ServerUnavailable = 136,
51
+ /**
52
+ * 0x89 - Server busy
53
+ * Description: The Server is busy. Try again later.
54
+ */
55
+ ServerBusy = 137,
56
+ /**
57
+ * 0x8A - Banned
58
+ * Description: This Client has been banned by administrative action. Contact the server administrator.
59
+ */
60
+ Banned = 138,
61
+ /**
62
+ * 0x8C - Bad authentication method
63
+ * Description: The authentication method is not supported or does not match the authentication method currently in use.
64
+ */
65
+ BadAuthenticationMethod = 140,
66
+ /**
67
+ * 0x90 - Topic Name invalid
68
+ * Description: The Will Topic Name is not malformed, but is not accepted by this Server.
69
+ */
70
+ TopicNameInvalid = 144,
71
+ /**
72
+ * 0x95 - Packet too large
73
+ * Description: The CONNECT packet exceeded the maximum permissible size.
74
+ */
75
+ PacketTooLarge = 149,
76
+ /**
77
+ * 0x97 - Quota exceeded
78
+ * Description: An implementation or administrative imposed limit has been exceeded.
79
+ */
80
+ QuotaExceeded = 151,
81
+ /**
82
+ * 0x99 - Payload format invalid
83
+ * Description: The Will Payload does not match the specified Payload Format Indicator.
84
+ */
85
+ PayloadFormatInvalid = 153,
86
+ /**
87
+ * 0x9A - Retain not supported
88
+ * Description: The Server does not support retained messages, and Will Retain was set to 1.
89
+ */
90
+ RetainNotSupported = 154,
91
+ /**
92
+ * 0x9B - QoS not supported
93
+ * Description: The Server does not support the QoS set in Will QoS.
94
+ */
95
+ QosNotSupported = 155,
96
+ /**
97
+ * 0x9C - Use another server
98
+ * Description: The Client should temporarily use another server.
99
+ */
100
+ UseAnotherServer = 156,
101
+ /**
102
+ * 0x9D - Server moved
103
+ * Description: The Client should permanently use another server.
104
+ */
105
+ ServerMoved = 157,
106
+ /**
107
+ * 0x9F - Connection rate exceeded
108
+ * Description: The connection rate limit has been exceeded.
109
+ */
110
+ ConnectionRateExceeded = 159
111
+ }
112
+ //# sourceMappingURL=mqttV500ConnectReasonCode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mqttV500ConnectReasonCode.d.ts","sourceRoot":"","sources":["../../../../src/enum/MqttErrorCodes/mqttV500ConnectReasonCode.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,oBAAY,yBAAyB;IACnC;;;OAGG;IACH,gBAAgB,MAAO;IAEvB;;;OAGG;IACH,eAAe,MAAO;IAEtB;;;OAGG;IACH,aAAa,MAAO;IAEpB;;;OAGG;IACH,2BAA2B,MAAO;IAElC;;;OAGG;IACH,0BAA0B,MAAO;IAEjC;;;OAGG;IACH,wBAAwB,MAAO;IAE/B;;;OAGG;IACH,qBAAqB,MAAO;IAE5B;;;OAGG;IACH,aAAa,MAAO;IAEpB;;;OAGG;IACH,iBAAiB,MAAO;IAExB;;;OAGG;IACH,UAAU,MAAO;IAEjB;;;OAGG;IACH,MAAM,MAAO;IAEb;;;OAGG;IACH,uBAAuB,MAAO;IAE9B;;;OAGG;IACH,gBAAgB,MAAO;IAEvB;;;OAGG;IACH,cAAc,MAAO;IAErB;;;OAGG;IACH,aAAa,MAAO;IAEpB;;;OAGG;IACH,oBAAoB,MAAO;IAE3B;;;OAGG;IACH,kBAAkB,MAAO;IAEzB;;;OAGG;IACH,eAAe,MAAO;IAEtB;;;OAGG;IACH,gBAAgB,MAAO;IAEvB;;;OAGG;IACH,WAAW,MAAO;IAElB;;;OAGG;IACH,sBAAsB,MAAO;CAC9B"}
@@ -0,0 +1,115 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ /**
4
+ * MQTT Connect Reason Codes
5
+ * These codes represent the reasons for the outcome of an MQTT CONNECT packet as per MQTT 5.0 specification.
6
+ */
7
+ export var MqttV500ConnectReasonCode;
8
+ (function (MqttV500ConnectReasonCode) {
9
+ /**
10
+ * 0x80 - Unspecified error
11
+ * Description: The Server does not wish to reveal the reason for the failure, or none of the other Reason Codes apply.
12
+ */
13
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["UnspecifiedError"] = 128] = "UnspecifiedError";
14
+ /**
15
+ * 0x81 - Malformed Packet
16
+ * Description: Data within the CONNECT packet could not be correctly parsed.
17
+ */
18
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["MalformedPacket"] = 129] = "MalformedPacket";
19
+ /**
20
+ * 0x82 - Protocol Error
21
+ * Description: Data in the CONNECT packet does not conform to this specification.
22
+ */
23
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["ProtocolError"] = 130] = "ProtocolError";
24
+ /**
25
+ * 0x83 - Implementation specific error
26
+ * Description: The CONNECT is valid but is not accepted by this Server.
27
+ */
28
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["ImplementationSpecificError"] = 131] = "ImplementationSpecificError";
29
+ /**
30
+ * 0x84 - Unsupported Protocol Version
31
+ * Description: The Server does not support the version of the MQTT protocol requested by the Client.
32
+ */
33
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["UnsupportedProtocolVersion"] = 132] = "UnsupportedProtocolVersion";
34
+ /**
35
+ * 0x85 - Client Identifier not valid
36
+ * Description: The Client Identifier is a valid string but is not allowed by the Server.
37
+ */
38
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["ClientIdentifierNotValid"] = 133] = "ClientIdentifierNotValid";
39
+ /**
40
+ * 0x86 - Bad User Name or Password
41
+ * Description: The Server does not accept the User Name or Password specified by the Client.
42
+ */
43
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["BadUserNameOrPassword"] = 134] = "BadUserNameOrPassword";
44
+ /**
45
+ * 0x87 - Not authorized
46
+ * Description: The Client is not authorized to connect.
47
+ */
48
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["NotAuthorized"] = 135] = "NotAuthorized";
49
+ /**
50
+ * 0x88 - Server unavailable
51
+ * Description: The MQTT Server is not available.
52
+ */
53
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["ServerUnavailable"] = 136] = "ServerUnavailable";
54
+ /**
55
+ * 0x89 - Server busy
56
+ * Description: The Server is busy. Try again later.
57
+ */
58
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["ServerBusy"] = 137] = "ServerBusy";
59
+ /**
60
+ * 0x8A - Banned
61
+ * Description: This Client has been banned by administrative action. Contact the server administrator.
62
+ */
63
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["Banned"] = 138] = "Banned";
64
+ /**
65
+ * 0x8C - Bad authentication method
66
+ * Description: The authentication method is not supported or does not match the authentication method currently in use.
67
+ */
68
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["BadAuthenticationMethod"] = 140] = "BadAuthenticationMethod";
69
+ /**
70
+ * 0x90 - Topic Name invalid
71
+ * Description: The Will Topic Name is not malformed, but is not accepted by this Server.
72
+ */
73
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["TopicNameInvalid"] = 144] = "TopicNameInvalid";
74
+ /**
75
+ * 0x95 - Packet too large
76
+ * Description: The CONNECT packet exceeded the maximum permissible size.
77
+ */
78
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["PacketTooLarge"] = 149] = "PacketTooLarge";
79
+ /**
80
+ * 0x97 - Quota exceeded
81
+ * Description: An implementation or administrative imposed limit has been exceeded.
82
+ */
83
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["QuotaExceeded"] = 151] = "QuotaExceeded";
84
+ /**
85
+ * 0x99 - Payload format invalid
86
+ * Description: The Will Payload does not match the specified Payload Format Indicator.
87
+ */
88
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["PayloadFormatInvalid"] = 153] = "PayloadFormatInvalid";
89
+ /**
90
+ * 0x9A - Retain not supported
91
+ * Description: The Server does not support retained messages, and Will Retain was set to 1.
92
+ */
93
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["RetainNotSupported"] = 154] = "RetainNotSupported";
94
+ /**
95
+ * 0x9B - QoS not supported
96
+ * Description: The Server does not support the QoS set in Will QoS.
97
+ */
98
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["QosNotSupported"] = 155] = "QosNotSupported";
99
+ /**
100
+ * 0x9C - Use another server
101
+ * Description: The Client should temporarily use another server.
102
+ */
103
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["UseAnotherServer"] = 156] = "UseAnotherServer";
104
+ /**
105
+ * 0x9D - Server moved
106
+ * Description: The Client should permanently use another server.
107
+ */
108
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["ServerMoved"] = 157] = "ServerMoved";
109
+ /**
110
+ * 0x9F - Connection rate exceeded
111
+ * Description: The connection rate limit has been exceeded.
112
+ */
113
+ MqttV500ConnectReasonCode[MqttV500ConnectReasonCode["ConnectionRateExceeded"] = 159] = "ConnectionRateExceeded";
114
+ })(MqttV500ConnectReasonCode || (MqttV500ConnectReasonCode = {}));
115
+ //# sourceMappingURL=mqttV500ConnectReasonCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mqttV500ConnectReasonCode.js","sourceRoot":"","sources":["../../../../src/enum/MqttErrorCodes/mqttV500ConnectReasonCode.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AACH,MAAM,CAAN,IAAY,yBA8HX;AA9HD,WAAY,yBAAyB;IACnC;;;OAGG;IACH,mGAAuB,CAAA;IAEvB;;;OAGG;IACH,iGAAsB,CAAA;IAEtB;;;OAGG;IACH,6FAAoB,CAAA;IAEpB;;;OAGG;IACH,yHAAkC,CAAA;IAElC;;;OAGG;IACH,uHAAiC,CAAA;IAEjC;;;OAGG;IACH,mHAA+B,CAAA;IAE/B;;;OAGG;IACH,6GAA4B,CAAA;IAE5B;;;OAGG;IACH,6FAAoB,CAAA;IAEpB;;;OAGG;IACH,qGAAwB,CAAA;IAExB;;;OAGG;IACH,uFAAiB,CAAA;IAEjB;;;OAGG;IACH,+EAAa,CAAA;IAEb;;;OAGG;IACH,iHAA8B,CAAA;IAE9B;;;OAGG;IACH,mGAAuB,CAAA;IAEvB;;;OAGG;IACH,+FAAqB,CAAA;IAErB;;;OAGG;IACH,6FAAoB,CAAA;IAEpB;;;OAGG;IACH,2GAA2B,CAAA;IAE3B;;;OAGG;IACH,uGAAyB,CAAA;IAEzB;;;OAGG;IACH,iGAAsB,CAAA;IAEtB;;;OAGG;IACH,mGAAuB,CAAA;IAEvB;;;OAGG;IACH,yFAAkB,CAAA;IAElB;;;OAGG;IACH,+GAA6B,CAAA;AAC/B,CAAC,EA9HW,yBAAyB,KAAzB,yBAAyB,QA8HpC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * MQTT Connect Reason Codes\n * These codes represent the reasons for the outcome of an MQTT CONNECT packet as per MQTT 5.0 specification.\n */\nexport enum MqttV500ConnectReasonCode {\n /**\n * 0x80 - Unspecified error\n * Description: The Server does not wish to reveal the reason for the failure, or none of the other Reason Codes apply.\n */\n UnspecifiedError = 0x80,\n\n /**\n * 0x81 - Malformed Packet\n * Description: Data within the CONNECT packet could not be correctly parsed.\n */\n MalformedPacket = 0x81,\n\n /**\n * 0x82 - Protocol Error\n * Description: Data in the CONNECT packet does not conform to this specification.\n */\n ProtocolError = 0x82,\n\n /**\n * 0x83 - Implementation specific error\n * Description: The CONNECT is valid but is not accepted by this Server.\n */\n ImplementationSpecificError = 0x83,\n\n /**\n * 0x84 - Unsupported Protocol Version\n * Description: The Server does not support the version of the MQTT protocol requested by the Client.\n */\n UnsupportedProtocolVersion = 0x84,\n\n /**\n * 0x85 - Client Identifier not valid\n * Description: The Client Identifier is a valid string but is not allowed by the Server.\n */\n ClientIdentifierNotValid = 0x85,\n\n /**\n * 0x86 - Bad User Name or Password\n * Description: The Server does not accept the User Name or Password specified by the Client.\n */\n BadUserNameOrPassword = 0x86,\n\n /**\n * 0x87 - Not authorized\n * Description: The Client is not authorized to connect.\n */\n NotAuthorized = 0x87,\n\n /**\n * 0x88 - Server unavailable\n * Description: The MQTT Server is not available.\n */\n ServerUnavailable = 0x88,\n\n /**\n * 0x89 - Server busy\n * Description: The Server is busy. Try again later.\n */\n ServerBusy = 0x89,\n\n /**\n * 0x8A - Banned\n * Description: This Client has been banned by administrative action. Contact the server administrator.\n */\n Banned = 0x8a,\n\n /**\n * 0x8C - Bad authentication method\n * Description: The authentication method is not supported or does not match the authentication method currently in use.\n */\n BadAuthenticationMethod = 0x8c,\n\n /**\n * 0x90 - Topic Name invalid\n * Description: The Will Topic Name is not malformed, but is not accepted by this Server.\n */\n TopicNameInvalid = 0x90,\n\n /**\n * 0x95 - Packet too large\n * Description: The CONNECT packet exceeded the maximum permissible size.\n */\n PacketTooLarge = 0x95,\n\n /**\n * 0x97 - Quota exceeded\n * Description: An implementation or administrative imposed limit has been exceeded.\n */\n QuotaExceeded = 0x97,\n\n /**\n * 0x99 - Payload format invalid\n * Description: The Will Payload does not match the specified Payload Format Indicator.\n */\n PayloadFormatInvalid = 0x99,\n\n /**\n * 0x9A - Retain not supported\n * Description: The Server does not support retained messages, and Will Retain was set to 1.\n */\n RetainNotSupported = 0x9a,\n\n /**\n * 0x9B - QoS not supported\n * Description: The Server does not support the QoS set in Will QoS.\n */\n QosNotSupported = 0x9b,\n\n /**\n * 0x9C - Use another server\n * Description: The Client should temporarily use another server.\n */\n UseAnotherServer = 0x9c,\n\n /**\n * 0x9D - Server moved\n * Description: The Client should permanently use another server.\n */\n ServerMoved = 0x9d,\n\n /**\n * 0x9F - Connection rate exceeded\n * Description: The connection rate limit has been exceeded.\n */\n ConnectionRateExceeded = 0x9f,\n}\n"]}
@@ -0,0 +1,6 @@
1
+ export { WebPubSubEventHandler } from "./webPubSubEventHandler.js";
2
+ export * from "./cloudEventsProtocols.js";
3
+ export { MqttV311ConnectReturnCode } from "./enum/MqttErrorCodes/mqttV311ConnectReturnCode.js";
4
+ export { MqttV500ConnectReasonCode } from "./enum/MqttErrorCodes/mqttV500ConnectReasonCode.js";
5
+ export { MqttDisconnectReasonCode } from "./enum/MqttErrorCodes/mqttDisconnectReasonCode.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,cAAc,2BAA2B,CAAC;AAE1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC"}
@@ -0,0 +1,8 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export { WebPubSubEventHandler } from "./webPubSubEventHandler.js";
4
+ export * from "./cloudEventsProtocols.js";
5
+ export { MqttV311ConnectReturnCode } from "./enum/MqttErrorCodes/mqttV311ConnectReturnCode.js";
6
+ export { MqttV500ConnectReasonCode } from "./enum/MqttErrorCodes/mqttV500ConnectReasonCode.js";
7
+ export { MqttDisconnectReasonCode } from "./enum/MqttErrorCodes/mqttDisconnectReasonCode.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,cAAc,2BAA2B,CAAC;AAE1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nexport { WebPubSubEventHandler } from \"./webPubSubEventHandler.js\";\n\nexport * from \"./cloudEventsProtocols.js\";\n\nexport { MqttV311ConnectReturnCode } from \"./enum/MqttErrorCodes/mqttV311ConnectReturnCode.js\";\nexport { MqttV500ConnectReasonCode } from \"./enum/MqttErrorCodes/mqttV500ConnectReasonCode.js\";\nexport { MqttDisconnectReasonCode } from \"./enum/MqttErrorCodes/mqttDisconnectReasonCode.js\";\n"]}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The \@azure/logger configuration for this package.
3
+ *
4
+ * @internal
5
+ */
6
+ export declare const logger: import("@azure/logger").AzureLogger;
7
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,MAAM,qCAA2C,CAAC"}
@@ -0,0 +1,10 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { createClientLogger } from "@azure/logger";
4
+ /**
5
+ * The \@azure/logger configuration for this package.
6
+ *
7
+ * @internal
8
+ */
9
+ export const logger = createClientLogger("web-pubsub-express");
10
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,oBAAoB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\n\n/**\n * The \\@azure/logger configuration for this package.\n *\n * @internal\n */\nexport const logger = createClientLogger(\"web-pubsub-express\");\n"]}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,6 @@
1
+ import type { IncomingMessage } from "node:http";
2
+ export declare function toBase64JsonString(obj: Record<string, any>): string;
3
+ export declare function fromBase64JsonString(base64String: string | undefined): Record<string, any>;
4
+ export declare function getHttpHeader(req: IncomingMessage, key: string): string | undefined;
5
+ export declare function readRequestBody(req: IncomingMessage): Promise<Buffer>;
6
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAMjD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAEnE;AAED,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAa1F;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAcnF;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAgBrE"}
@@ -0,0 +1,53 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ function isJsonObject(obj) {
4
+ return obj && typeof obj === "object" && !Array.isArray(obj);
5
+ }
6
+ export function toBase64JsonString(obj) {
7
+ return Buffer.from(JSON.stringify(obj)).toString("base64");
8
+ }
9
+ export function fromBase64JsonString(base64String) {
10
+ if (base64String === undefined) {
11
+ return {};
12
+ }
13
+ try {
14
+ const buf = Buffer.from(base64String, "base64").toString();
15
+ const parsed = JSON.parse(buf);
16
+ return isJsonObject(parsed) ? parsed : {};
17
+ }
18
+ catch (e) {
19
+ console.warn("Unexpected state format:" + e);
20
+ return {};
21
+ }
22
+ }
23
+ export function getHttpHeader(req, key) {
24
+ if (!key)
25
+ return undefined;
26
+ // According to https://nodejs.org/api/http.html#http_class_http_incomingmessage, header names are always lower-cased
27
+ const value = req.headers[key.toLowerCase()];
28
+ if (value === undefined) {
29
+ return undefined;
30
+ }
31
+ if (typeof value === "string") {
32
+ return value;
33
+ }
34
+ return value[0];
35
+ }
36
+ export function readRequestBody(req) {
37
+ return new Promise(function (resolve, reject) {
38
+ const chunks = [];
39
+ req.on("data", function (chunk) {
40
+ chunks.push(chunk);
41
+ });
42
+ req.on("end", function () {
43
+ const buffer = Buffer.concat(chunks);
44
+ resolve(buffer);
45
+ });
46
+ // reject on request error
47
+ req.on("error", function (err) {
48
+ // This is not a "Second reject", just a different sort of failure
49
+ reject(err);
50
+ });
51
+ });
52
+ }
53
+ //# sourceMappingURL=utils.js.map