matterbridge 3.5.0 → 3.5.1-dev-20260121-22e98b4

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 (328) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/bin/mb_coap.js +1 -1
  3. package/bin/mb_mdns.js +1 -1
  4. package/dist/broadcastServer.d.ts +0 -115
  5. package/dist/broadcastServer.js +1 -119
  6. package/dist/broadcastServerTypes.d.ts +0 -43
  7. package/dist/broadcastServerTypes.js +0 -24
  8. package/dist/cli.d.ts +1 -26
  9. package/dist/cli.js +2 -102
  10. package/dist/cliEmitter.d.ts +0 -36
  11. package/dist/cliEmitter.js +0 -37
  12. package/dist/cliHistory.d.ts +0 -42
  13. package/dist/cliHistory.js +1 -39
  14. package/dist/clusters/export.d.ts +0 -1
  15. package/dist/clusters/export.js +0 -2
  16. package/dist/deviceManager.d.ts +0 -108
  17. package/dist/deviceManager.js +2 -114
  18. package/dist/devices/airConditioner.d.ts +0 -75
  19. package/dist/devices/airConditioner.js +0 -57
  20. package/dist/devices/batteryStorage.d.ts +0 -43
  21. package/dist/devices/batteryStorage.js +1 -48
  22. package/dist/devices/cooktop.d.ts +0 -55
  23. package/dist/devices/cooktop.js +0 -56
  24. package/dist/devices/dishwasher.d.ts +0 -55
  25. package/dist/devices/dishwasher.js +0 -57
  26. package/dist/devices/evse.d.ts +0 -57
  27. package/dist/devices/evse.js +10 -74
  28. package/dist/devices/export.d.ts +0 -1
  29. package/dist/devices/export.js +0 -5
  30. package/dist/devices/extractorHood.d.ts +0 -41
  31. package/dist/devices/extractorHood.js +0 -43
  32. package/dist/devices/heatPump.d.ts +0 -43
  33. package/dist/devices/heatPump.js +2 -50
  34. package/dist/devices/laundryDryer.d.ts +0 -58
  35. package/dist/devices/laundryDryer.js +3 -62
  36. package/dist/devices/laundryWasher.d.ts +0 -64
  37. package/dist/devices/laundryWasher.js +4 -70
  38. package/dist/devices/microwaveOven.d.ts +1 -77
  39. package/dist/devices/microwaveOven.js +5 -88
  40. package/dist/devices/oven.d.ts +0 -82
  41. package/dist/devices/oven.js +0 -85
  42. package/dist/devices/refrigerator.d.ts +0 -100
  43. package/dist/devices/refrigerator.js +0 -102
  44. package/dist/devices/roboticVacuumCleaner.d.ts +0 -83
  45. package/dist/devices/roboticVacuumCleaner.js +9 -100
  46. package/dist/devices/solarPower.d.ts +0 -36
  47. package/dist/devices/solarPower.js +0 -38
  48. package/dist/devices/speaker.d.ts +0 -79
  49. package/dist/devices/speaker.js +0 -84
  50. package/dist/devices/temperatureControl.d.ts +0 -21
  51. package/dist/devices/temperatureControl.js +3 -24
  52. package/dist/devices/waterHeater.d.ts +0 -74
  53. package/dist/devices/waterHeater.js +2 -82
  54. package/dist/frontend.d.ts +0 -187
  55. package/dist/frontend.js +39 -505
  56. package/dist/frontendTypes.d.ts +0 -57
  57. package/dist/frontendTypes.js +0 -45
  58. package/dist/helpers.d.ts +0 -43
  59. package/dist/helpers.js +1 -54
  60. package/dist/index.d.ts +0 -23
  61. package/dist/index.js +0 -25
  62. package/dist/jestutils/export.d.ts +0 -1
  63. package/dist/jestutils/export.js +0 -1
  64. package/dist/jestutils/jestHelpers.d.ts +0 -255
  65. package/dist/jestutils/jestHelpers.js +14 -372
  66. package/dist/logger/export.d.ts +0 -1
  67. package/dist/logger/export.js +0 -1
  68. package/dist/matter/behaviors.d.ts +0 -1
  69. package/dist/matter/behaviors.js +0 -2
  70. package/dist/matter/clusters.d.ts +0 -1
  71. package/dist/matter/clusters.js +0 -2
  72. package/dist/matter/devices.d.ts +0 -1
  73. package/dist/matter/devices.js +0 -2
  74. package/dist/matter/endpoints.d.ts +0 -1
  75. package/dist/matter/endpoints.js +0 -2
  76. package/dist/matter/export.d.ts +0 -1
  77. package/dist/matter/export.js +0 -2
  78. package/dist/matter/types.d.ts +0 -1
  79. package/dist/matter/types.js +0 -2
  80. package/dist/matterNode.d.ts +0 -258
  81. package/dist/matterNode.js +9 -364
  82. package/dist/matterbridge.d.ts +0 -362
  83. package/dist/matterbridge.js +60 -860
  84. package/dist/matterbridgeAccessoryPlatform.d.ts +0 -36
  85. package/dist/matterbridgeAccessoryPlatform.js +0 -38
  86. package/dist/matterbridgeBehaviors.d.ts +0 -24
  87. package/dist/matterbridgeBehaviors.js +5 -68
  88. package/dist/matterbridgeDeviceTypes.d.ts +0 -649
  89. package/dist/matterbridgeDeviceTypes.js +6 -673
  90. package/dist/matterbridgeDynamicPlatform.d.ts +0 -36
  91. package/dist/matterbridgeDynamicPlatform.js +0 -38
  92. package/dist/matterbridgeEndpoint.d.ts +2 -1332
  93. package/dist/matterbridgeEndpoint.js +94 -1459
  94. package/dist/matterbridgeEndpointHelpers.d.ts +0 -425
  95. package/dist/matterbridgeEndpointHelpers.js +21 -486
  96. package/dist/matterbridgeEndpointTypes.d.ts +0 -70
  97. package/dist/matterbridgeEndpointTypes.js +0 -25
  98. package/dist/matterbridgePlatform.d.ts +0 -425
  99. package/dist/matterbridgePlatform.js +2 -453
  100. package/dist/matterbridgeTypes.d.ts +0 -46
  101. package/dist/matterbridgeTypes.js +0 -26
  102. package/dist/mb_coap.d.ts +1 -0
  103. package/dist/{dgram/mb_coap.js → mb_coap.js} +3 -41
  104. package/dist/mb_mdns.d.ts +1 -0
  105. package/dist/{dgram/mb_mdns.js → mb_mdns.js} +37 -81
  106. package/dist/pluginManager.d.ts +0 -305
  107. package/dist/pluginManager.js +8 -345
  108. package/dist/shelly.d.ts +0 -157
  109. package/dist/shelly.js +7 -178
  110. package/dist/spawn.d.ts +1 -0
  111. package/dist/{utils/spawn.js → spawn.js} +3 -73
  112. package/dist/storage/export.d.ts +0 -1
  113. package/dist/storage/export.js +0 -1
  114. package/dist/update.d.ts +0 -75
  115. package/dist/update.js +7 -100
  116. package/dist/utils/export.d.ts +1 -13
  117. package/dist/utils/export.js +1 -13
  118. package/dist/workerGlobalPrefix.d.ts +0 -24
  119. package/dist/workerGlobalPrefix.js +6 -40
  120. package/dist/workerTypes.d.ts +0 -25
  121. package/dist/workerTypes.js +0 -24
  122. package/dist/workers.d.ts +0 -61
  123. package/dist/workers.js +4 -68
  124. package/npm-shrinkwrap.json +35 -5
  125. package/package.json +5 -5
  126. package/dist/broadcastServer.d.ts.map +0 -1
  127. package/dist/broadcastServer.js.map +0 -1
  128. package/dist/broadcastServerTypes.d.ts.map +0 -1
  129. package/dist/broadcastServerTypes.js.map +0 -1
  130. package/dist/cli.d.ts.map +0 -1
  131. package/dist/cli.js.map +0 -1
  132. package/dist/cliEmitter.d.ts.map +0 -1
  133. package/dist/cliEmitter.js.map +0 -1
  134. package/dist/cliHistory.d.ts.map +0 -1
  135. package/dist/cliHistory.js.map +0 -1
  136. package/dist/clusters/export.d.ts.map +0 -1
  137. package/dist/clusters/export.js.map +0 -1
  138. package/dist/deviceManager.d.ts.map +0 -1
  139. package/dist/deviceManager.js.map +0 -1
  140. package/dist/devices/airConditioner.d.ts.map +0 -1
  141. package/dist/devices/airConditioner.js.map +0 -1
  142. package/dist/devices/batteryStorage.d.ts.map +0 -1
  143. package/dist/devices/batteryStorage.js.map +0 -1
  144. package/dist/devices/cooktop.d.ts.map +0 -1
  145. package/dist/devices/cooktop.js.map +0 -1
  146. package/dist/devices/dishwasher.d.ts.map +0 -1
  147. package/dist/devices/dishwasher.js.map +0 -1
  148. package/dist/devices/evse.d.ts.map +0 -1
  149. package/dist/devices/evse.js.map +0 -1
  150. package/dist/devices/export.d.ts.map +0 -1
  151. package/dist/devices/export.js.map +0 -1
  152. package/dist/devices/extractorHood.d.ts.map +0 -1
  153. package/dist/devices/extractorHood.js.map +0 -1
  154. package/dist/devices/heatPump.d.ts.map +0 -1
  155. package/dist/devices/heatPump.js.map +0 -1
  156. package/dist/devices/laundryDryer.d.ts.map +0 -1
  157. package/dist/devices/laundryDryer.js.map +0 -1
  158. package/dist/devices/laundryWasher.d.ts.map +0 -1
  159. package/dist/devices/laundryWasher.js.map +0 -1
  160. package/dist/devices/microwaveOven.d.ts.map +0 -1
  161. package/dist/devices/microwaveOven.js.map +0 -1
  162. package/dist/devices/oven.d.ts.map +0 -1
  163. package/dist/devices/oven.js.map +0 -1
  164. package/dist/devices/refrigerator.d.ts.map +0 -1
  165. package/dist/devices/refrigerator.js.map +0 -1
  166. package/dist/devices/roboticVacuumCleaner.d.ts.map +0 -1
  167. package/dist/devices/roboticVacuumCleaner.js.map +0 -1
  168. package/dist/devices/solarPower.d.ts.map +0 -1
  169. package/dist/devices/solarPower.js.map +0 -1
  170. package/dist/devices/speaker.d.ts.map +0 -1
  171. package/dist/devices/speaker.js.map +0 -1
  172. package/dist/devices/temperatureControl.d.ts.map +0 -1
  173. package/dist/devices/temperatureControl.js.map +0 -1
  174. package/dist/devices/waterHeater.d.ts.map +0 -1
  175. package/dist/devices/waterHeater.js.map +0 -1
  176. package/dist/dgram/coap.d.ts +0 -205
  177. package/dist/dgram/coap.d.ts.map +0 -1
  178. package/dist/dgram/coap.js +0 -365
  179. package/dist/dgram/coap.js.map +0 -1
  180. package/dist/dgram/dgram.d.ts +0 -144
  181. package/dist/dgram/dgram.d.ts.map +0 -1
  182. package/dist/dgram/dgram.js +0 -363
  183. package/dist/dgram/dgram.js.map +0 -1
  184. package/dist/dgram/mb_coap.d.ts +0 -24
  185. package/dist/dgram/mb_coap.d.ts.map +0 -1
  186. package/dist/dgram/mb_coap.js.map +0 -1
  187. package/dist/dgram/mb_mdns.d.ts +0 -24
  188. package/dist/dgram/mb_mdns.d.ts.map +0 -1
  189. package/dist/dgram/mb_mdns.js.map +0 -1
  190. package/dist/dgram/mdns.d.ts +0 -371
  191. package/dist/dgram/mdns.d.ts.map +0 -1
  192. package/dist/dgram/mdns.js +0 -934
  193. package/dist/dgram/mdns.js.map +0 -1
  194. package/dist/dgram/multicast.d.ts +0 -67
  195. package/dist/dgram/multicast.d.ts.map +0 -1
  196. package/dist/dgram/multicast.js +0 -179
  197. package/dist/dgram/multicast.js.map +0 -1
  198. package/dist/dgram/unicast.d.ts +0 -64
  199. package/dist/dgram/unicast.d.ts.map +0 -1
  200. package/dist/dgram/unicast.js +0 -100
  201. package/dist/dgram/unicast.js.map +0 -1
  202. package/dist/frontend.d.ts.map +0 -1
  203. package/dist/frontend.js.map +0 -1
  204. package/dist/frontendTypes.d.ts.map +0 -1
  205. package/dist/frontendTypes.js.map +0 -1
  206. package/dist/helpers.d.ts.map +0 -1
  207. package/dist/helpers.js.map +0 -1
  208. package/dist/index.d.ts.map +0 -1
  209. package/dist/index.js.map +0 -1
  210. package/dist/jestutils/export.d.ts.map +0 -1
  211. package/dist/jestutils/export.js.map +0 -1
  212. package/dist/jestutils/jestHelpers.d.ts.map +0 -1
  213. package/dist/jestutils/jestHelpers.js.map +0 -1
  214. package/dist/logger/export.d.ts.map +0 -1
  215. package/dist/logger/export.js.map +0 -1
  216. package/dist/matter/behaviors.d.ts.map +0 -1
  217. package/dist/matter/behaviors.js.map +0 -1
  218. package/dist/matter/clusters.d.ts.map +0 -1
  219. package/dist/matter/clusters.js.map +0 -1
  220. package/dist/matter/devices.d.ts.map +0 -1
  221. package/dist/matter/devices.js.map +0 -1
  222. package/dist/matter/endpoints.d.ts.map +0 -1
  223. package/dist/matter/endpoints.js.map +0 -1
  224. package/dist/matter/export.d.ts.map +0 -1
  225. package/dist/matter/export.js.map +0 -1
  226. package/dist/matter/types.d.ts.map +0 -1
  227. package/dist/matter/types.js.map +0 -1
  228. package/dist/matterNode.d.ts.map +0 -1
  229. package/dist/matterNode.js.map +0 -1
  230. package/dist/matterbridge.d.ts.map +0 -1
  231. package/dist/matterbridge.js.map +0 -1
  232. package/dist/matterbridgeAccessoryPlatform.d.ts.map +0 -1
  233. package/dist/matterbridgeAccessoryPlatform.js.map +0 -1
  234. package/dist/matterbridgeBehaviors.d.ts.map +0 -1
  235. package/dist/matterbridgeBehaviors.js.map +0 -1
  236. package/dist/matterbridgeDeviceTypes.d.ts.map +0 -1
  237. package/dist/matterbridgeDeviceTypes.js.map +0 -1
  238. package/dist/matterbridgeDynamicPlatform.d.ts.map +0 -1
  239. package/dist/matterbridgeDynamicPlatform.js.map +0 -1
  240. package/dist/matterbridgeEndpoint.d.ts.map +0 -1
  241. package/dist/matterbridgeEndpoint.js.map +0 -1
  242. package/dist/matterbridgeEndpointHelpers.d.ts.map +0 -1
  243. package/dist/matterbridgeEndpointHelpers.js.map +0 -1
  244. package/dist/matterbridgeEndpointTypes.d.ts.map +0 -1
  245. package/dist/matterbridgeEndpointTypes.js.map +0 -1
  246. package/dist/matterbridgePlatform.d.ts.map +0 -1
  247. package/dist/matterbridgePlatform.js.map +0 -1
  248. package/dist/matterbridgeTypes.d.ts.map +0 -1
  249. package/dist/matterbridgeTypes.js.map +0 -1
  250. package/dist/pluginManager.d.ts.map +0 -1
  251. package/dist/pluginManager.js.map +0 -1
  252. package/dist/shelly.d.ts.map +0 -1
  253. package/dist/shelly.js.map +0 -1
  254. package/dist/storage/export.d.ts.map +0 -1
  255. package/dist/storage/export.js.map +0 -1
  256. package/dist/update.d.ts.map +0 -1
  257. package/dist/update.js.map +0 -1
  258. package/dist/utils/colorUtils.d.ts +0 -101
  259. package/dist/utils/colorUtils.d.ts.map +0 -1
  260. package/dist/utils/colorUtils.js +0 -282
  261. package/dist/utils/colorUtils.js.map +0 -1
  262. package/dist/utils/commandLine.d.ts +0 -66
  263. package/dist/utils/commandLine.d.ts.map +0 -1
  264. package/dist/utils/commandLine.js +0 -123
  265. package/dist/utils/commandLine.js.map +0 -1
  266. package/dist/utils/copyDirectory.d.ts +0 -35
  267. package/dist/utils/copyDirectory.d.ts.map +0 -1
  268. package/dist/utils/copyDirectory.js +0 -76
  269. package/dist/utils/copyDirectory.js.map +0 -1
  270. package/dist/utils/createDirectory.d.ts +0 -34
  271. package/dist/utils/createDirectory.d.ts.map +0 -1
  272. package/dist/utils/createDirectory.js +0 -54
  273. package/dist/utils/createDirectory.js.map +0 -1
  274. package/dist/utils/createZip.d.ts +0 -39
  275. package/dist/utils/createZip.d.ts.map +0 -1
  276. package/dist/utils/createZip.js +0 -114
  277. package/dist/utils/createZip.js.map +0 -1
  278. package/dist/utils/deepCopy.d.ts +0 -32
  279. package/dist/utils/deepCopy.d.ts.map +0 -1
  280. package/dist/utils/deepCopy.js +0 -79
  281. package/dist/utils/deepCopy.js.map +0 -1
  282. package/dist/utils/deepEqual.d.ts +0 -54
  283. package/dist/utils/deepEqual.d.ts.map +0 -1
  284. package/dist/utils/deepEqual.js +0 -129
  285. package/dist/utils/deepEqual.js.map +0 -1
  286. package/dist/utils/error.d.ts +0 -45
  287. package/dist/utils/error.d.ts.map +0 -1
  288. package/dist/utils/error.js +0 -54
  289. package/dist/utils/error.js.map +0 -1
  290. package/dist/utils/export.d.ts.map +0 -1
  291. package/dist/utils/export.js.map +0 -1
  292. package/dist/utils/format.d.ts +0 -53
  293. package/dist/utils/format.d.ts.map +0 -1
  294. package/dist/utils/format.js +0 -78
  295. package/dist/utils/format.js.map +0 -1
  296. package/dist/utils/hex.d.ts +0 -89
  297. package/dist/utils/hex.d.ts.map +0 -1
  298. package/dist/utils/hex.js +0 -242
  299. package/dist/utils/hex.js.map +0 -1
  300. package/dist/utils/inspector.d.ts +0 -87
  301. package/dist/utils/inspector.d.ts.map +0 -1
  302. package/dist/utils/inspector.js +0 -268
  303. package/dist/utils/inspector.js.map +0 -1
  304. package/dist/utils/isValid.d.ts +0 -103
  305. package/dist/utils/isValid.d.ts.map +0 -1
  306. package/dist/utils/isValid.js +0 -162
  307. package/dist/utils/isValid.js.map +0 -1
  308. package/dist/utils/network.d.ts +0 -141
  309. package/dist/utils/network.d.ts.map +0 -1
  310. package/dist/utils/network.js +0 -314
  311. package/dist/utils/network.js.map +0 -1
  312. package/dist/utils/spawn.d.ts +0 -33
  313. package/dist/utils/spawn.d.ts.map +0 -1
  314. package/dist/utils/spawn.js.map +0 -1
  315. package/dist/utils/tracker.d.ts +0 -108
  316. package/dist/utils/tracker.d.ts.map +0 -1
  317. package/dist/utils/tracker.js +0 -264
  318. package/dist/utils/tracker.js.map +0 -1
  319. package/dist/utils/wait.d.ts +0 -54
  320. package/dist/utils/wait.d.ts.map +0 -1
  321. package/dist/utils/wait.js +0 -125
  322. package/dist/utils/wait.js.map +0 -1
  323. package/dist/workerGlobalPrefix.d.ts.map +0 -1
  324. package/dist/workerGlobalPrefix.js.map +0 -1
  325. package/dist/workerTypes.d.ts.map +0 -1
  326. package/dist/workerTypes.js.map +0 -1
  327. package/dist/workers.d.ts.map +0 -1
  328. package/dist/workers.js.map +0 -1
@@ -1,205 +0,0 @@
1
- /**
2
- * @description This file contains the class Coap.
3
- * @file src/dgram/coap.ts
4
- * @author Luca Liguori
5
- * @created 2025-03-22
6
- * @version 1.0.0
7
- * @license Apache-2.0
8
- *
9
- * Copyright 2025, 2026, 2027 Luca Liguori.
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License.
22
- */
23
- import dgram from 'node:dgram';
24
- import { Multicast } from './multicast.js';
25
- /**
26
- * Represents a CoAP message.
27
- *
28
- * A CoAP message is structured with a fixed header, an optional token, a series of options,
29
- * and an optional payload. The header consists of version, type, token length, code, and message ID.
30
- * The token is used to match responses with requests, options provide additional metadata, and
31
- * the payload carries the message content.
32
- */
33
- export interface CoapMessage {
34
- /**
35
- * The CoAP protocol version.
36
- * Typically, this is 1.
37
- * (Stored in the top 2 bits of the first header byte.)
38
- */
39
- version: number;
40
- /**
41
- * The message type.
42
- * It indicates whether the message is Confirmable, Non-confirmable, Acknowledgement, or Reset.
43
- * (Stored in bits 5-4 of the first header byte.)
44
- * 0: Confirmable (CON)
45
- * 1: Non-confirmable (NON)
46
- * 2: Acknowledgement (ACK)
47
- * 3: Reset (RST)
48
- */
49
- type: number;
50
- /**
51
- * The token length.
52
- * This value (0-8) specifies the length of the token field.
53
- * (Stored in the lower 4 bits of the first header byte.)
54
- */
55
- tokenLength: number;
56
- /**
57
- * The message code.
58
- * It indicates the method or response code, e.g., GET, POST, or a success/error response.
59
- * (Stored in the second header byte.)
60
- * CoAP uses an 8‑bit Code field divided into a 3‑bit class and a 5‑bit detail. The code can be represented as X.XX (e.g. 0.01) and is defined in RFC 7252. Here are the standard CoAP codes:
61
- * Request Codes (Class 0)
62
- * 0.01 – 1-GET
63
- * Retrieve a resource.
64
- * 0.02 – 2-POST
65
- * Create a resource or trigger an action.
66
- * 0.03 – 3-PUT
67
- * Update or create a resource.
68
- * 0.04 – 4-DELETE
69
- * Remove a resource.
70
- * Success Response Codes (Class 2)
71
- * 2.00 – Empty / Success
72
- * Indicates an empty message or a successful request with no payload.
73
- * 2.01 – Created
74
- * The request resulted in a new resource being created.
75
- * 2.02 – Deleted
76
- * The resource was successfully deleted.
77
- * 2.03 – Valid
78
- * The response indicates that the resource is still valid (used with caching).
79
- * 2.04 – Changed
80
- * The resource was successfully modified.
81
- * 2.05 – Content
82
- * The response contains the requested content.
83
- * Client Error Response Codes (Class 4)
84
- * 4.00 – Bad Request
85
- * The request was malformed.
86
- * 4.01 – Unauthorized
87
- * The request requires authentication.
88
- * 4.02 – Bad Option
89
- * An option in the request was not understood or is unacceptable.
90
- * 4.03 – Forbidden
91
- * The server refuses to fulfill the request.
92
- * 4.04 – Not Found
93
- * The requested resource was not found.
94
- * 4.05 – Method Not Allowed
95
- * The request method is not supported for the target resource.
96
- * 4.06 – Not Acceptable
97
- * The server cannot generate a response matching the list of acceptable values.
98
- * 4.12 – Precondition Failed
99
- * A precondition given in the request evaluated to false.
100
- * 4.13 – Request Entity Too Large
101
- * The request payload is too large.
102
- * 4.15 – Unsupported Content-Format
103
- * The server does not support the content format of the request payload.
104
- * Server Error Response Codes (Class 5)
105
- * 5.00 – Internal Server Error
106
- * The server encountered an unexpected condition.
107
- * 5.01 – Not Implemented
108
- * The server does not support the requested method.
109
- * 5.02 – Bad Gateway
110
- * The server, while acting as a gateway or proxy, received an invalid response.
111
- * 5.03 – Service Unavailable
112
- * The server is currently unable to handle the request.
113
- * 5.04 – Gateway Timeout
114
- * The server did not receive a timely response from an upstream server.
115
- * 5.05 – Proxying Not Supported
116
- * The server does not support proxying for the requested resource.
117
- */
118
- code: number;
119
- /**
120
- * The message identifier.
121
- * This 16-bit field is used to match messages of type Acknowledgement/Reset with their corresponding requests.
122
- * (Stored in bytes 2-3 of the header.)
123
- */
124
- messageId: number;
125
- /**
126
- * The token.
127
- * A variable-length sequence (0-8 bytes) that helps match a request with its response.
128
- */
129
- token: Buffer;
130
- /**
131
- * An array of options.
132
- * Options carry additional information such as URI path, content format, etc., and are encoded using a delta mechanism.
133
- */
134
- options: CoapOption[];
135
- /**
136
- * The payload.
137
- * The actual content of the message, if present. It follows a payload marker (0xFF) if non-empty.
138
- */
139
- payload?: Buffer;
140
- }
141
- interface CoapOption {
142
- number: number;
143
- value: Buffer;
144
- }
145
- export declare const COAP_OPTION_URI_PATH = 11;
146
- export declare const COIOT_OPTION_DEVID = 3332;
147
- export declare const COIOT_OPTION_VALIDITY = 3412;
148
- export declare const COIOT_OPTION_SERIAL = 3420;
149
- export declare const COIOT_REQUEST_STATUS_ID = 56831;
150
- export declare const COIOT_REQUEST_DESCRIPTION_ID = 56832;
151
- export declare class Coap extends Multicast {
152
- constructor(name: string, multicastAddress: string, multicastPort: number, socketType: 'udp4' | 'udp6', reuseAddr?: boolean | undefined, interfaceName?: string, interfaceAddress?: string);
153
- onCoapMessage(message: CoapMessage, rinfo: dgram.RemoteInfo): void;
154
- onMessage(msg: Buffer, rinfo: dgram.RemoteInfo): void;
155
- /**
156
- * Decodes a CoAP message from a Buffer.
157
- *
158
- * @param {Buffer} msg - The Buffer containing the raw CoAP message.
159
- * @returns {CoapMessage} A parsed CoAP message object.
160
- * @throws {Error} if the message is malformed.
161
- */
162
- decodeCoapMessage(msg: Buffer): CoapMessage;
163
- /**
164
- * Encodes a CoAP message into a Buffer.
165
- *
166
- * @param {CoapMessage} msg - The CoAP message to encode.
167
- * @returns {Buffer} A Buffer representing the encoded CoAP message.
168
- * @throws {Error} if the message is malformed.
169
- */
170
- encodeCoapMessage(msg: CoapMessage): Buffer;
171
- /**
172
- * Converts a CoAP message type numeric value to its string representation.
173
- *
174
- * CoAP message types are:
175
- * - 0: Confirmable (CON)
176
- * - 1: Non-confirmable (NON)
177
- * - 2: Acknowledgement (ACK)
178
- * - 3: Reset (RST)
179
- *
180
- * @param {number} type - The numeric CoAP message type.
181
- * @returns {string} The string representation of the message type.
182
- */
183
- coapTypeToString(type: number): string;
184
- /**
185
- * Converts a CoAP code numeric value to its string representation.
186
- *
187
- * The CoAP code is split into a 3-bit class and a 5-bit detail.
188
- * For example:
189
- * - 0.01: GET
190
- * - 0.02: POST
191
- * - 0.03: PUT
192
- * - 0.04: DELETE
193
- * - 2.05: Content (success response)
194
- * - 4.04: Not Found (client error)
195
- * - 5.00: Internal Server Error (server error)
196
- *
197
- * @param {number} code - The numeric CoAP code.
198
- * @returns {string} The string representation of the code.
199
- */
200
- coapCodeToString(code: number): string;
201
- sendRequest(messageId: number, options: CoapOption[], payload: Record<string, any> | undefined, token: string | undefined, address: string | undefined, port: number | undefined): void;
202
- logCoapMessage(msg: CoapMessage): void;
203
- }
204
- export {};
205
- //# sourceMappingURL=coap.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coap.d.ts","sourceRoot":"","sources":["../../src/dgram/coap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,KAAK,MAAM,YAAY,CAAC;AAM/B,OAAO,EAAoD,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE7F;;;;;;;GAOG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;;OA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AAW,GAAG,MAAM;IA6F3C;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAetC;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAQtC,WAAW,CACT,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,UAAU,EAAE,EAErB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,EACxC,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,IAAI;IAeP,cAAc,CAAC,GAAG,EAAE,WAAW;CAuDhC"}
@@ -1,365 +0,0 @@
1
- /**
2
- * @description This file contains the class Coap.
3
- * @file src/dgram/coap.ts
4
- * @author Luca Liguori
5
- * @created 2025-03-22
6
- * @version 1.0.0
7
- * @license Apache-2.0
8
- *
9
- * Copyright 2025, 2026, 2027 Luca Liguori.
10
- *
11
- * Licensed under the Apache License, Version 2.0 (the "License");
12
- * you may not use this file except in compliance with the License.
13
- * You may obtain a copy of the License at
14
- *
15
- * http://www.apache.org/licenses/LICENSE-2.0
16
- *
17
- * Unless required by applicable law or agreed to in writing, software
18
- * distributed under the License is distributed on an "AS IS" BASIS,
19
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20
- * See the License for the specific language governing permissions and
21
- * limitations under the License.
22
- */
23
- // AnsiLogger imports
24
- import { BLUE, db, GREEN, MAGENTA, nf } from 'node-ansi-logger';
25
- // Net imports
26
- import { COAP_MULTICAST_IPV4_ADDRESS, COAP_MULTICAST_PORT, Multicast } from './multicast.js';
27
- export const COAP_OPTION_URI_PATH = 11;
28
- export const COIOT_OPTION_DEVID = 3332;
29
- export const COIOT_OPTION_VALIDITY = 3412;
30
- export const COIOT_OPTION_SERIAL = 3420;
31
- export const COIOT_REQUEST_STATUS_ID = 56831;
32
- export const COIOT_REQUEST_DESCRIPTION_ID = 56832;
33
- export class Coap extends Multicast {
34
- constructor(name, multicastAddress, multicastPort, socketType, reuseAddr = true, interfaceName, interfaceAddress) {
35
- super(name, multicastAddress, multicastPort, socketType, reuseAddr, interfaceName, interfaceAddress);
36
- }
37
- onCoapMessage(message, rinfo) {
38
- this.log.debug(`Coap message received from ${BLUE}${rinfo.family}${db} ${BLUE}${rinfo.address}${db}:${BLUE}${rinfo.port}${db}`);
39
- }
40
- onMessage(msg, rinfo) {
41
- this.log.info(`Dgram multicast socket received a CoAP message from ${BLUE}${rinfo.family}${nf} ${BLUE}${rinfo.address}${nf}:${BLUE}${rinfo.port}${nf}`);
42
- try {
43
- const result = this.decodeCoapMessage(msg);
44
- this.onCoapMessage(result, rinfo);
45
- this.logCoapMessage(result);
46
- }
47
- catch (error) {
48
- this.log.error(`Error decoding CoAP message: ${error instanceof Error ? error.message : error}`);
49
- }
50
- }
51
- /**
52
- * Decodes a CoAP message from a Buffer.
53
- *
54
- * @param {Buffer} msg - The Buffer containing the raw CoAP message.
55
- * @returns {CoapMessage} A parsed CoAP message object.
56
- * @throws {Error} if the message is malformed.
57
- */
58
- decodeCoapMessage(msg) {
59
- // A valid CoAP message must have at least 4 bytes for the header.
60
- if (msg.length < 4) {
61
- throw new Error('Message too short to be a valid CoAP message');
62
- }
63
- // Parse the 4-byte fixed header.
64
- const version = (msg[0] & 0xc0) >> 6; // Bits 7-6: Version
65
- const type = (msg[0] & 0x30) >> 4; // Bits 5-4: Type
66
- const tokenLength = msg[0] & 0x0f; // Bits 3-0: Token Length
67
- const code = msg[1]; // 8-bit Code
68
- const messageId = msg.readUInt16BE(2); // 16-bit Message ID
69
- let offset = 4;
70
- // Parse token if present.
71
- let token = Buffer.alloc(0);
72
- if (tokenLength > 0) {
73
- if (msg.length < offset + tokenLength) {
74
- throw new Error('Message too short for the token length specified');
75
- }
76
- token = msg.slice(offset, offset + tokenLength);
77
- offset += tokenLength;
78
- }
79
- // Parse options.
80
- const options = [];
81
- let currentOptionNumber = 0;
82
- while (offset < msg.length) {
83
- // Payload marker: 0xFF indicates the beginning of the payload.
84
- if (msg[offset] === 0xff) {
85
- offset++; // Skip the marker.
86
- break;
87
- }
88
- // Read the option header byte.
89
- const optionHeader = msg[offset++];
90
- let delta = (optionHeader & 0xf0) >> 4; // High nibble: option delta.
91
- let length = optionHeader & 0x0f; // Low nibble: option length.
92
- // Extended delta handling.
93
- if (delta === 13) {
94
- if (offset >= msg.length) {
95
- throw new Error('Invalid extended option delta');
96
- }
97
- delta = msg[offset++] + 13;
98
- }
99
- else if (delta === 14) {
100
- if (offset + 1 >= msg.length) {
101
- throw new Error('Invalid extended option delta');
102
- }
103
- delta = msg.readUInt16BE(offset) + 269;
104
- offset += 2;
105
- }
106
- else if (delta === 15) {
107
- throw new Error('Reserved option delta value encountered');
108
- }
109
- // Extended length handling.
110
- if (length === 13) {
111
- if (offset >= msg.length) {
112
- throw new Error('Invalid extended option length');
113
- }
114
- length = msg[offset++] + 13;
115
- }
116
- else if (length === 14) {
117
- if (offset + 1 >= msg.length) {
118
- throw new Error('Invalid extended option length');
119
- }
120
- length = msg.readUInt16BE(offset) + 269;
121
- offset += 2;
122
- }
123
- else if (length === 15) {
124
- throw new Error('Reserved option length value encountered');
125
- }
126
- // Calculate the actual option number.
127
- currentOptionNumber += delta;
128
- // Ensure that the option's value fits in the remaining message.
129
- if (offset + length > msg.length) {
130
- throw new Error('Option length exceeds message length');
131
- }
132
- const optionValue = msg.slice(offset, offset + length);
133
- offset += length;
134
- options.push({
135
- number: currentOptionNumber,
136
- value: optionValue,
137
- });
138
- }
139
- // Parse payload if any remains.
140
- const payload = offset < msg.length ? msg.slice(offset) : undefined;
141
- return {
142
- version,
143
- type,
144
- tokenLength,
145
- code,
146
- messageId,
147
- token,
148
- options,
149
- payload,
150
- };
151
- }
152
- /**
153
- * Encodes a CoAP message into a Buffer.
154
- *
155
- * @param {CoapMessage} msg - The CoAP message to encode.
156
- * @returns {Buffer} A Buffer representing the encoded CoAP message.
157
- * @throws {Error} if the message is malformed.
158
- */
159
- encodeCoapMessage(msg) {
160
- const parts = [];
161
- // Determine token length (ensure it's consistent with msg.token)
162
- const token = msg.token || Buffer.alloc(0);
163
- const tokenLength = token.length;
164
- if (tokenLength > 8) {
165
- throw new Error('Token length cannot exceed 8 bytes');
166
- }
167
- // Create header (4 bytes):
168
- // Byte 0: Version (2 bits), Type (2 bits), Token Length (4 bits)
169
- // Byte 1: Code (8 bits)
170
- // Bytes 2-3: Message ID (16 bits)
171
- const header = Buffer.alloc(4);
172
- header[0] = ((msg.version & 0x03) << 6) | ((msg.type & 0x03) << 4) | (tokenLength & 0x0f);
173
- header[1] = msg.code;
174
- header.writeUInt16BE(msg.messageId, 2);
175
- parts.push(header);
176
- // Append token if present.
177
- if (tokenLength > 0) {
178
- parts.push(token);
179
- }
180
- // Sort options by option number in ascending order.
181
- const sortedOptions = msg.options.slice().sort((a, b) => a.number - b.number);
182
- let previousOptionNumber = 0;
183
- // Encode each option.
184
- for (const option of sortedOptions) {
185
- const optionDelta = option.number - previousOptionNumber;
186
- const optionValueLength = option.value.length;
187
- let deltaNibble;
188
- let deltaExtended = null;
189
- let lengthNibble;
190
- let lengthExtended = null;
191
- // Determine option delta nibble and extended delta field.
192
- if (optionDelta < 13) {
193
- deltaNibble = optionDelta;
194
- }
195
- else if (optionDelta < 269) {
196
- deltaNibble = 13;
197
- deltaExtended = Buffer.from([optionDelta - 13]);
198
- }
199
- else {
200
- deltaNibble = 14;
201
- deltaExtended = Buffer.alloc(2);
202
- deltaExtended.writeUInt16BE(optionDelta - 269, 0);
203
- }
204
- // Determine option length nibble and extended length field.
205
- if (optionValueLength < 13) {
206
- lengthNibble = optionValueLength;
207
- }
208
- else if (optionValueLength < 269) {
209
- lengthNibble = 13;
210
- lengthExtended = Buffer.from([optionValueLength - 13]);
211
- }
212
- else {
213
- lengthNibble = 14;
214
- lengthExtended = Buffer.alloc(2);
215
- lengthExtended.writeUInt16BE(optionValueLength - 269, 0);
216
- }
217
- // Option header byte: high nibble is delta, low nibble is length.
218
- const optionHeader = Buffer.alloc(1);
219
- optionHeader[0] = (deltaNibble << 4) | (lengthNibble & 0x0f);
220
- parts.push(optionHeader);
221
- // Append extended delta if needed.
222
- if (deltaExtended) {
223
- parts.push(deltaExtended);
224
- }
225
- // Append extended length if needed.
226
- if (lengthExtended) {
227
- parts.push(lengthExtended);
228
- }
229
- // Append the option value.
230
- parts.push(option.value);
231
- // Update previous option number.
232
- previousOptionNumber = option.number;
233
- }
234
- // If a payload is present, add the payload marker (0xFF) followed by the payload.
235
- if (msg.payload && msg.payload.length > 0) {
236
- parts.push(Buffer.from([0xff])); // Payload marker.
237
- parts.push(msg.payload);
238
- }
239
- return Buffer.concat(parts);
240
- }
241
- /**
242
- * Converts a CoAP message type numeric value to its string representation.
243
- *
244
- * CoAP message types are:
245
- * - 0: Confirmable (CON)
246
- * - 1: Non-confirmable (NON)
247
- * - 2: Acknowledgement (ACK)
248
- * - 3: Reset (RST)
249
- *
250
- * @param {number} type - The numeric CoAP message type.
251
- * @returns {string} The string representation of the message type.
252
- */
253
- coapTypeToString(type) {
254
- switch (type) {
255
- case 0:
256
- return 'Confirmable (CON)';
257
- case 1:
258
- return 'Non-confirmable (NON)';
259
- case 2:
260
- return 'Acknowledgement (ACK)';
261
- case 3:
262
- return 'Reset (RST)';
263
- default:
264
- return `Unknown Type (${type})`;
265
- }
266
- }
267
- /**
268
- * Converts a CoAP code numeric value to its string representation.
269
- *
270
- * The CoAP code is split into a 3-bit class and a 5-bit detail.
271
- * For example:
272
- * - 0.01: GET
273
- * - 0.02: POST
274
- * - 0.03: PUT
275
- * - 0.04: DELETE
276
- * - 2.05: Content (success response)
277
- * - 4.04: Not Found (client error)
278
- * - 5.00: Internal Server Error (server error)
279
- *
280
- * @param {number} code - The numeric CoAP code.
281
- * @returns {string} The string representation of the code.
282
- */
283
- coapCodeToString(code) {
284
- // Split the code: the upper 3 bits form the class and the lower 5 bits form the detail.
285
- const cls = code >> 5;
286
- const detail = code & 0x1f;
287
- const codeStr = `${cls}.${detail.toString().padStart(2, '0')}`;
288
- return codeStr;
289
- }
290
- sendRequest(messageId, options,
291
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
292
- payload, token, address, port) {
293
- const coapMessage = {
294
- version: 1,
295
- type: 1, // e.g., Confirmable
296
- tokenLength: token ? Buffer.from(token).length : 0,
297
- code: 1, // e.g., GET
298
- messageId,
299
- token: token ? Buffer.from(token) : Buffer.alloc(0),
300
- options,
301
- payload: payload ? Buffer.from(JSON.stringify(payload)) : undefined,
302
- };
303
- const encodedBuffer = this.encodeCoapMessage(coapMessage);
304
- this.send(encodedBuffer, address ?? COAP_MULTICAST_IPV4_ADDRESS, port ?? COAP_MULTICAST_PORT);
305
- }
306
- logCoapMessage(msg) {
307
- this.log.info(`Decoded CoAP message: version ${MAGENTA}${msg.version}${nf} type ${MAGENTA}${this.coapTypeToString(msg.type)}${nf} ` +
308
- `code ${MAGENTA}${this.coapCodeToString(msg.code)}${nf} messageId ${MAGENTA}${msg.messageId}${nf} ` +
309
- `tokenLength ${MAGENTA}${msg.tokenLength}${nf} token ${MAGENTA}${msg.tokenLength == 0 ? 'no token' : msg.token.toString('hex')}${nf} ` +
310
- `options ${MAGENTA}${msg.options.length}${nf} payload ${MAGENTA}${msg.payload ? msg.payload.length + ' bytes' : undefined}${nf}`);
311
- msg.options.forEach((option) => {
312
- if (option.number === COAP_OPTION_URI_PATH) {
313
- this.log.info(`Option: COAP_OPTION_URI_PATH => ${GREEN}${option.value}${nf}`);
314
- }
315
- else if (option.number === COIOT_OPTION_DEVID) {
316
- /*
317
- * First defined option is COIOT_OPTION_GLOBAL_DEVID. This is a global option and must be present in all CoIoT packages with request or payload.
318
- * Its value is a string in format <devtype>#<devid>#<version> for example SHSEN-1#4B3F9E#1 The whole option should be less than 50 bytes.
319
- */
320
- const parts = option.value.toString().split('#');
321
- const deviceModel = parts[0];
322
- const deviceMac = parts[1];
323
- const protocolRevision = parts[2];
324
- this.log.info(`Option: COIOT_OPTION_DEVID => ${option.value} => Model: ${GREEN}${deviceModel}${nf}, MAC: ${GREEN}${deviceMac}${nf}, Protocol: ${GREEN}${protocolRevision}${nf}`);
325
- }
326
- else if (option.number === COIOT_OPTION_SERIAL) {
327
- /*
328
- * This option is mandatory in status response and publishes. It is a uint16_t in network byte order which indicates a change in the status report.
329
- * When a new status report is handled, all payload processing can be skipped if the serial number does not change from the last processed payload.
330
- * The value 0 is reserved and should not be sent. This allows easy initialization in the receiving devices.
331
- */
332
- const serial = option.value.readUInt16BE(0);
333
- this.log.info(`Option: COIOT_OPTION_SERIAL => 0x${option.value.toString('hex')} => serial: ${GREEN}${serial}${nf}`);
334
- }
335
- else if (option.number === COIOT_OPTION_VALIDITY) {
336
- /*
337
- * COIOT_OPTION_STATUS_VALIDITY is a uint16_t in network byte order (big endian) that states the maximal time between this and the next status publish.
338
- * This way a device can state its report interval. If a report is not received from this device after the interval has passed the device should be considered offline.
339
- * The LS bit of this option controls how the value is scaled:
340
- * - If the LS bit is 0, the value is number of 1/10 of seconds in the validity period, so 2 is 0.2 seconds, 10 is a second, 600 is a minute, 65534 is 109 minutes and 13 seconds.
341
- * - If the LS bit is 1, the value is number of 4 seconds interval in the whole interval. So 3 is 12 seconds, 11 is 44 seconds and 65535 is more than 3 days.
342
- */
343
- const validity = option.value.readUInt16BE(0);
344
- let validFor = 0;
345
- if ((validity & 0x1) === 0) {
346
- validFor = Math.floor(validity / 10);
347
- }
348
- else {
349
- validFor = validity * 4;
350
- }
351
- this.log.info(`Option: COIOT_OPTION_VALIDITY => 0x${option.value.toString('hex')} => valid for: ${GREEN}${validFor}${nf} seconds`);
352
- }
353
- else
354
- this.log.info(`Option: ${option.number} - ${option.value
355
- .toString('hex')
356
- .match(/.{1,2}/g)
357
- ?.join(' ')}`); // Split into pairs of hex characters
358
- });
359
- if (msg.payload && msg.payload.length > 0)
360
- this.log.info(`Payload:`, JSON.parse(msg.payload.toString()), '\n');
361
- else
362
- this.log.info(`No payload`, '\n');
363
- }
364
- }
365
- //# sourceMappingURL=coap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"coap.js","sourceRoot":"","sources":["../../src/dgram/coap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,qBAAqB;AACrB,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEhE,cAAc;AACd,OAAO,EAAE,2BAA2B,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA4H7F,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AACvC,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAC1C,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACxC,MAAM,CAAC,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAC7C,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,CAAC;AAElD,MAAM,OAAO,IAAK,SAAQ,SAAS;IACjC,YAAY,IAAY,EAAE,gBAAwB,EAAE,aAAqB,EAAE,UAA2B,EAAE,YAAiC,IAAI,EAAE,aAAsB,EAAE,gBAAyB;QAC9L,KAAK,CAAC,IAAI,EAAE,gBAAgB,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,CAAC,CAAC;IACvG,CAAC;IAED,aAAa,CAAC,OAAoB,EAAE,KAAuB;QACzD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,8BAA8B,IAAI,GAAG,KAAK,CAAC,MAAM,GAAG,EAAE,IAAI,IAAI,GAAG,KAAK,CAAC,OAAO,GAAG,EAAE,IAAI,IAAI,GAAG,KAAK,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC,CA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