@fastybird/smart-panel-backend 1.1.0-alpha.6 → 1.1.0-alpha.60

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 (494) hide show
  1. package/dist/app.module.js +2 -1
  2. package/dist/app.module.js.map +1 -1
  3. package/dist/common/utils/cancellable-exec.utils.d.ts +5 -0
  4. package/dist/common/utils/cancellable-exec.utils.js +34 -0
  5. package/dist/common/utils/cancellable-exec.utils.js.map +1 -0
  6. package/dist/common/utils/remote-access-observation.utils.d.ts +11 -0
  7. package/dist/common/utils/remote-access-observation.utils.js +89 -0
  8. package/dist/common/utils/remote-access-observation.utils.js.map +1 -0
  9. package/dist/dataSource.js +1 -0
  10. package/dist/dataSource.js.map +1 -1
  11. package/dist/migrations/1000000000026-AddHardwareInputCategories.d.ts +7 -0
  12. package/dist/migrations/1000000000026-AddHardwareInputCategories.js +364 -0
  13. package/dist/migrations/1000000000026-AddHardwareInputCategories.js.map +1 -0
  14. package/dist/modules/auth/auth.module.js +4 -0
  15. package/dist/modules/auth/auth.module.js.map +1 -1
  16. package/dist/modules/auth/guards/auth.guard.js +8 -21
  17. package/dist/modules/auth/guards/auth.guard.js.map +1 -1
  18. package/dist/modules/auth/services/token-metadata.service.d.ts +42 -0
  19. package/dist/modules/auth/services/token-metadata.service.js +202 -0
  20. package/dist/modules/auth/services/token-metadata.service.js.map +1 -0
  21. package/dist/modules/auth/services/token-usage.service.d.ts +22 -0
  22. package/dist/modules/auth/services/token-usage.service.js +93 -0
  23. package/dist/modules/auth/services/token-usage.service.js.map +1 -0
  24. package/dist/modules/auth/services/tokens.service.d.ts +10 -3
  25. package/dist/modules/auth/services/tokens.service.js +26 -10
  26. package/dist/modules/auth/services/tokens.service.js.map +1 -1
  27. package/dist/modules/devices/controllers/channels.controller.d.ts +5 -1
  28. package/dist/modules/devices/controllers/channels.controller.js +34 -2
  29. package/dist/modules/devices/controllers/channels.controller.js.map +1 -1
  30. package/dist/modules/devices/controllers/channels.properties.controller.js +5 -0
  31. package/dist/modules/devices/controllers/channels.properties.controller.js.map +1 -1
  32. package/dist/modules/devices/controllers/devices.channels.controller.d.ts +5 -1
  33. package/dist/modules/devices/controllers/devices.channels.controller.js +38 -2
  34. package/dist/modules/devices/controllers/devices.channels.controller.js.map +1 -1
  35. package/dist/modules/devices/controllers/devices.channels.properties.controller.js +5 -0
  36. package/dist/modules/devices/controllers/devices.channels.properties.controller.js.map +1 -1
  37. package/dist/modules/devices/devices.constants.d.ts +6 -0
  38. package/dist/modules/devices/devices.constants.js +6 -0
  39. package/dist/modules/devices/devices.constants.js.map +1 -1
  40. package/dist/modules/devices/devices.module.js +18 -0
  41. package/dist/modules/devices/devices.module.js.map +1 -1
  42. package/dist/modules/devices/devices.openapi.d.ts +3 -1
  43. package/dist/modules/devices/devices.openapi.js +7 -0
  44. package/dist/modules/devices/devices.openapi.js.map +1 -1
  45. package/dist/modules/devices/dto/channel-input-occurrence.dto.d.ts +10 -0
  46. package/dist/modules/devices/dto/channel-input-occurrence.dto.js +99 -0
  47. package/dist/modules/devices/dto/channel-input-occurrence.dto.js.map +1 -0
  48. package/dist/modules/devices/dto/property-command.dto.js +2 -8
  49. package/dist/modules/devices/dto/property-command.dto.js.map +1 -1
  50. package/dist/modules/devices/models/channel-input-capabilities.model.d.ts +20 -0
  51. package/dist/modules/devices/models/channel-input-capabilities.model.js +111 -0
  52. package/dist/modules/devices/models/channel-input-capabilities.model.js.map +1 -0
  53. package/dist/modules/devices/models/channel-input-occurrence.model.d.ts +22 -0
  54. package/dist/modules/devices/models/channel-input-occurrence.model.js +154 -0
  55. package/dist/modules/devices/models/channel-input-occurrence.model.js.map +1 -0
  56. package/dist/modules/devices/services/channel-input-deduplication.service.d.ts +17 -0
  57. package/dist/modules/devices/services/channel-input-deduplication.service.js +88 -0
  58. package/dist/modules/devices/services/channel-input-deduplication.service.js.map +1 -0
  59. package/dist/modules/devices/services/channel-input-occurrences.service.d.ts +21 -0
  60. package/dist/modules/devices/services/channel-input-occurrences.service.js +163 -0
  61. package/dist/modules/devices/services/channel-input-occurrences.service.js.map +1 -0
  62. package/dist/modules/devices/services/channels.properties.service.d.ts +10 -1
  63. package/dist/modules/devices/services/channels.properties.service.js +108 -44
  64. package/dist/modules/devices/services/channels.properties.service.js.map +1 -1
  65. package/dist/modules/devices/services/channels.service.d.ts +1 -0
  66. package/dist/modules/devices/services/channels.service.js +10 -0
  67. package/dist/modules/devices/services/channels.service.js.map +1 -1
  68. package/dist/modules/devices/services/command-latency-trace-collector.service.d.ts +101 -0
  69. package/dist/modules/devices/services/command-latency-trace-collector.service.js +451 -0
  70. package/dist/modules/devices/services/command-latency-trace-collector.service.js.map +1 -0
  71. package/dist/modules/devices/services/device-command-graph.service.d.ts +18 -0
  72. package/dist/modules/devices/services/device-command-graph.service.js +92 -0
  73. package/dist/modules/devices/services/device-command-graph.service.js.map +1 -0
  74. package/dist/modules/devices/services/devices.service.d.ts +2 -0
  75. package/dist/modules/devices/services/devices.service.js +41 -31
  76. package/dist/modules/devices/services/devices.service.js.map +1 -1
  77. package/dist/modules/devices/services/platform.registry.service.d.ts +2 -2
  78. package/dist/modules/devices/services/platform.registry.service.js.map +1 -1
  79. package/dist/modules/devices/services/property-command-dispatch.service.d.ts +7 -3
  80. package/dist/modules/devices/services/property-command-dispatch.service.js +38 -25
  81. package/dist/modules/devices/services/property-command-dispatch.service.js.map +1 -1
  82. package/dist/modules/devices/services/property-command-window.service.d.ts +2 -1
  83. package/dist/modules/devices/services/property-command-window.service.js +6 -0
  84. package/dist/modules/devices/services/property-command-window.service.js.map +1 -1
  85. package/dist/modules/devices/services/property-command.service.d.ts +9 -5
  86. package/dist/modules/devices/services/property-command.service.js +54 -21
  87. package/dist/modules/devices/services/property-command.service.js.map +1 -1
  88. package/dist/modules/devices/services/property-metadata.service.d.ts +38 -0
  89. package/dist/modules/devices/services/property-metadata.service.js +210 -0
  90. package/dist/modules/devices/services/property-metadata.service.js.map +1 -0
  91. package/dist/modules/devices/services/property-value-lock.service.d.ts +4 -1
  92. package/dist/modules/devices/services/property-value-lock.service.js +16 -2
  93. package/dist/modules/devices/services/property-value-lock.service.js.map +1 -1
  94. package/dist/modules/devices/services/property-value.service.d.ts +2 -0
  95. package/dist/modules/devices/services/property-value.service.js +25 -5
  96. package/dist/modules/devices/services/property-value.service.js.map +1 -1
  97. package/dist/modules/devices/utils/device-graph-query.utils.d.ts +3 -0
  98. package/dist/modules/devices/utils/device-graph-query.utils.js +23 -0
  99. package/dist/modules/devices/utils/device-graph-query.utils.js.map +1 -0
  100. package/dist/modules/devices/utils/schema.utils.js +1 -1
  101. package/dist/modules/devices/utils/schema.utils.js.map +1 -1
  102. package/dist/modules/devices/validators/channel-exists-constraint.validator.d.ts +1 -3
  103. package/dist/modules/devices/validators/channel-exists-constraint.validator.js +3 -14
  104. package/dist/modules/devices/validators/channel-exists-constraint.validator.js.map +1 -1
  105. package/dist/modules/devices/validators/channel-property-exists-constraint.validator.d.ts +1 -3
  106. package/dist/modules/devices/validators/channel-property-exists-constraint.validator.js +3 -14
  107. package/dist/modules/devices/validators/channel-property-exists-constraint.validator.js.map +1 -1
  108. package/dist/modules/devices/validators/device-exists-constraint.validator.js +1 -2
  109. package/dist/modules/devices/validators/device-exists-constraint.validator.js.map +1 -1
  110. package/dist/modules/devices/validators/property-command-target-constraint.validator.d.ts +9 -0
  111. package/dist/modules/devices/validators/property-command-target-constraint.validator.js +58 -0
  112. package/dist/modules/devices/validators/property-command-target-constraint.validator.js.map +1 -0
  113. package/dist/modules/mdns/services/mdns.service.js +3 -1
  114. package/dist/modules/mdns/services/mdns.service.js.map +1 -1
  115. package/dist/modules/platform/platforms/abstract.platform.d.ts +2 -1
  116. package/dist/modules/platform/platforms/abstract.platform.js +2 -1
  117. package/dist/modules/platform/platforms/abstract.platform.js.map +1 -1
  118. package/dist/modules/platform/platforms/raspberry.platform.js +5 -10
  119. package/dist/modules/platform/platforms/raspberry.platform.js.map +1 -1
  120. package/dist/modules/platform/utils/linux-network-interface.utils.d.ts +3 -0
  121. package/dist/modules/platform/utils/linux-network-interface.utils.js +48 -0
  122. package/dist/modules/platform/utils/linux-network-interface.utils.js.map +1 -0
  123. package/dist/modules/remote-access/controllers/remote-access.controller.js +11 -6
  124. package/dist/modules/remote-access/controllers/remote-access.controller.js.map +1 -1
  125. package/dist/modules/remote-access/models/provider.model.d.ts +3 -0
  126. package/dist/modules/remote-access/models/provider.model.js +23 -0
  127. package/dist/modules/remote-access/models/provider.model.js.map +1 -1
  128. package/dist/modules/remote-access/models/status.model.d.ts +2 -0
  129. package/dist/modules/remote-access/models/status.model.js +18 -1
  130. package/dist/modules/remote-access/models/status.model.js.map +1 -1
  131. package/dist/modules/remote-access/models/urls.model.d.ts +2 -0
  132. package/dist/modules/remote-access/models/urls.model.js +17 -0
  133. package/dist/modules/remote-access/models/urls.model.js.map +1 -1
  134. package/dist/modules/remote-access/platforms/remote-access-provider.platform.d.ts +18 -1
  135. package/dist/modules/remote-access/remote-access.constants.d.ts +2 -1
  136. package/dist/modules/remote-access/remote-access.constants.js +2 -1
  137. package/dist/modules/remote-access/remote-access.constants.js.map +1 -1
  138. package/dist/modules/remote-access/services/remote-access-proxy-contribution.service.d.ts +1 -0
  139. package/dist/modules/remote-access/services/remote-access-proxy-contribution.service.js +4 -1
  140. package/dist/modules/remote-access/services/remote-access-proxy-contribution.service.js.map +1 -1
  141. package/dist/modules/remote-access/services/remote-access-status.service.d.ts +40 -8
  142. package/dist/modules/remote-access/services/remote-access-status.service.js +314 -65
  143. package/dist/modules/remote-access/services/remote-access-status.service.js.map +1 -1
  144. package/dist/modules/remote-access/services/remote-access-url.service.d.ts +2 -2
  145. package/dist/modules/remote-access/services/remote-access-url.service.js +4 -2
  146. package/dist/modules/remote-access/services/remote-access-url.service.js.map +1 -1
  147. package/dist/modules/spaces/services/module-reset.service.d.ts +5 -1
  148. package/dist/modules/spaces/services/module-reset.service.js +10 -2
  149. package/dist/modules/spaces/services/module-reset.service.js.map +1 -1
  150. package/dist/modules/spaces/services/space-activity.service.d.ts +14 -0
  151. package/dist/modules/spaces/services/space-activity.service.js +56 -0
  152. package/dist/modules/spaces/services/space-activity.service.js.map +1 -0
  153. package/dist/modules/spaces/spaces.module.js +5 -0
  154. package/dist/modules/spaces/spaces.module.js.map +1 -1
  155. package/dist/modules/spaces/subscribers/space-activity.subscriber.d.ts +17 -0
  156. package/dist/modules/spaces/subscribers/space-activity.subscriber.js +89 -0
  157. package/dist/modules/spaces/subscribers/space-activity.subscriber.js.map +1 -0
  158. package/dist/modules/storage/services/storage-write-buffer.d.ts +17 -0
  159. package/dist/modules/storage/services/storage-write-buffer.js +67 -0
  160. package/dist/modules/storage/services/storage-write-buffer.js.map +1 -0
  161. package/dist/modules/storage/services/storage.service.d.ts +9 -2
  162. package/dist/modules/storage/services/storage.service.js +54 -1
  163. package/dist/modules/storage/services/storage.service.js.map +1 -1
  164. package/dist/modules/system/scripts/update-worker.sh +1168 -61
  165. package/dist/modules/system/services/privileged-worker.service.d.ts +10 -0
  166. package/dist/modules/system/services/privileged-worker.service.js +241 -32
  167. package/dist/modules/system/services/privileged-worker.service.js.map +1 -1
  168. package/dist/modules/system/services/system.service.d.ts +2 -0
  169. package/dist/modules/system/services/system.service.js +22 -1
  170. package/dist/modules/system/services/system.service.js.map +1 -1
  171. package/dist/modules/system/services/update-executor.service.d.ts +20 -2
  172. package/dist/modules/system/services/update-executor.service.js +272 -26
  173. package/dist/modules/system/services/update-executor.service.js.map +1 -1
  174. package/dist/modules/websocket/gateway/websocket.gateway.d.ts +4 -1
  175. package/dist/modules/websocket/gateway/websocket.gateway.js +29 -5
  176. package/dist/modules/websocket/gateway/websocket.gateway.js.map +1 -1
  177. package/dist/modules/websocket/services/command-acknowledgement-trace.service.d.ts +143 -0
  178. package/dist/modules/websocket/services/command-acknowledgement-trace.service.js +523 -0
  179. package/dist/modules/websocket/services/command-acknowledgement-trace.service.js.map +1 -0
  180. package/dist/modules/websocket/services/ws-auth.service.js +12 -35
  181. package/dist/modules/websocket/services/ws-auth.service.js.map +1 -1
  182. package/dist/modules/websocket/websocket.module.js +9 -1
  183. package/dist/modules/websocket/websocket.module.js.map +1 -1
  184. package/dist/plugins/devices-home-assistant/devices-home-assistant.openapi.d.ts +2 -2
  185. package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.d.ts +6 -1
  186. package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.js +16 -1
  187. package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.js.map +1 -1
  188. package/dist/plugins/devices-home-assistant/dto/mapping-preview.dto.d.ts +1 -0
  189. package/dist/plugins/devices-home-assistant/dto/mapping-preview.dto.js +11 -0
  190. package/dist/plugins/devices-home-assistant/dto/mapping-preview.dto.js.map +1 -1
  191. package/dist/plugins/devices-home-assistant/mappers/button.entity.mapper.service.d.ts +19 -0
  192. package/dist/plugins/devices-home-assistant/mappers/button.entity.mapper.service.js +51 -0
  193. package/dist/plugins/devices-home-assistant/mappers/button.entity.mapper.service.js.map +1 -0
  194. package/dist/plugins/devices-home-assistant/mappings/definitions/entity-mappings.yaml +56 -7
  195. package/dist/plugins/devices-home-assistant/models/mapping-preview.model.d.ts +1 -0
  196. package/dist/plugins/devices-home-assistant/models/mapping-preview.model.js +11 -0
  197. package/dist/plugins/devices-home-assistant/models/mapping-preview.model.js.map +1 -1
  198. package/dist/plugins/devices-home-assistant/services/device-adoption.service.js +17 -0
  199. package/dist/plugins/devices-home-assistant/services/device-adoption.service.js.map +1 -1
  200. package/dist/plugins/devices-home-assistant/services/ha-mdns-discoverer.service.js +3 -1
  201. package/dist/plugins/devices-home-assistant/services/ha-mdns-discoverer.service.js.map +1 -1
  202. package/dist/plugins/devices-home-assistant/services/home-assistant-raw-event.service.d.ts +27 -0
  203. package/dist/plugins/devices-home-assistant/services/home-assistant-raw-event.service.js +271 -0
  204. package/dist/plugins/devices-home-assistant/services/home-assistant-raw-event.service.js.map +1 -0
  205. package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.d.ts +2 -2
  206. package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.js +33 -14
  207. package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.js.map +1 -1
  208. package/dist/plugins/devices-home-assistant/services/mapping-preview.service.js +24 -4
  209. package/dist/plugins/devices-home-assistant/services/mapping-preview.service.js.map +1 -1
  210. package/dist/plugins/devices-home-assistant/services/state-changed.event.service.d.ts +4 -1
  211. package/dist/plugins/devices-home-assistant/services/state-changed.event.service.js +82 -2
  212. package/dist/plugins/devices-home-assistant/services/state-changed.event.service.js.map +1 -1
  213. package/dist/plugins/devices-home-assistant/services/wizard.service.js +1 -0
  214. package/dist/plugins/devices-home-assistant/services/wizard.service.js.map +1 -1
  215. package/dist/plugins/devices-home-assistant/utils/ha-event.utils.d.ts +2 -0
  216. package/dist/plugins/devices-home-assistant/utils/ha-event.utils.js +50 -0
  217. package/dist/plugins/devices-home-assistant/utils/ha-event.utils.js.map +1 -0
  218. package/dist/plugins/devices-homekit/listeners/homekit-event.listener.d.ts +4 -1
  219. package/dist/plugins/devices-homekit/listeners/homekit-event.listener.js +34 -4
  220. package/dist/plugins/devices-homekit/listeners/homekit-event.listener.js.map +1 -1
  221. package/dist/plugins/devices-homekit/mappers/base.mapper.js +3 -2
  222. package/dist/plugins/devices-homekit/mappers/base.mapper.js.map +1 -1
  223. package/dist/plugins/devices-homekit/mappers/button.mapper.d.ts +15 -0
  224. package/dist/plugins/devices-homekit/mappers/button.mapper.js +143 -0
  225. package/dist/plugins/devices-homekit/mappers/button.mapper.js.map +1 -0
  226. package/dist/plugins/devices-homekit/mappers/characteristic-write.d.ts +2 -0
  227. package/dist/plugins/devices-homekit/mappers/characteristic-write.js +17 -0
  228. package/dist/plugins/devices-homekit/mappers/characteristic-write.js.map +1 -0
  229. package/dist/plugins/devices-homekit/mappers/homekit-mapper.interface.d.ts +9 -1
  230. package/dist/plugins/devices-homekit/mappers/thermostat-coordinator.js +13 -12
  231. package/dist/plugins/devices-homekit/mappers/thermostat-coordinator.js.map +1 -1
  232. package/dist/plugins/devices-homekit/services/homekit-bridge.service.js +2 -0
  233. package/dist/plugins/devices-homekit/services/homekit-bridge.service.js.map +1 -1
  234. package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.d.ts +5 -1
  235. package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.js +42 -0
  236. package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.js.map +1 -1
  237. package/dist/plugins/devices-homekit/utils/ciao-receive-guard.d.ts +1 -0
  238. package/dist/plugins/devices-homekit/utils/ciao-receive-guard.js +36 -0
  239. package/dist/plugins/devices-homekit/utils/ciao-receive-guard.js.map +1 -0
  240. package/dist/plugins/devices-homey/mappings/definitions/channels.yaml +50 -0
  241. package/dist/plugins/devices-homey/mappings/definitions/devices.yaml +18 -0
  242. package/dist/plugins/devices-homey/mappings/definitions/properties.yaml +55 -0
  243. package/dist/plugins/devices-homey/mappings/device-support.js +10 -0
  244. package/dist/plugins/devices-homey/mappings/device-support.js.map +1 -1
  245. package/dist/plugins/devices-homey/mappings/mapping-loader.service.d.ts +1 -0
  246. package/dist/plugins/devices-homey/mappings/mapping-loader.service.js +66 -8
  247. package/dist/plugins/devices-homey/mappings/mapping-loader.service.js.map +1 -1
  248. package/dist/plugins/devices-homey/models/inventory.model.d.ts +2 -1
  249. package/dist/plugins/devices-homey/models/inventory.model.js +1 -0
  250. package/dist/plugins/devices-homey/models/inventory.model.js.map +1 -1
  251. package/dist/plugins/devices-homey/models/mapping-preview.model.d.ts +1 -0
  252. package/dist/plugins/devices-homey/models/mapping-preview.model.js +1 -0
  253. package/dist/plugins/devices-homey/models/mapping-preview.model.js.map +1 -1
  254. package/dist/plugins/devices-homey/services/homey-mapping-preview.service.js +7 -0
  255. package/dist/plugins/devices-homey/services/homey-mapping-preview.service.js.map +1 -1
  256. package/dist/plugins/devices-homey/services/homey-synchronizer.service.d.ts +3 -1
  257. package/dist/plugins/devices-homey/services/homey-synchronizer.service.js +37 -6
  258. package/dist/plugins/devices-homey/services/homey-synchronizer.service.js.map +1 -1
  259. package/dist/plugins/devices-reterminal/services/reterminal-button.service.d.ts +7 -3
  260. package/dist/plugins/devices-reterminal/services/reterminal-button.service.js +63 -17
  261. package/dist/plugins/devices-reterminal/services/reterminal-button.service.js.map +1 -1
  262. package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.d.ts +25 -3
  263. package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.js +607 -48
  264. package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.js.map +1 -1
  265. package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.d.ts +6 -0
  266. package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.js +51 -2
  267. package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.js.map +1 -1
  268. package/dist/plugins/devices-shelly-ng/devices-shelly-ng.constants.js +3 -2
  269. package/dist/plugins/devices-shelly-ng/devices-shelly-ng.constants.js.map +1 -1
  270. package/dist/plugins/devices-shelly-ng/devices-shelly-ng.plugin.js +2 -0
  271. package/dist/plugins/devices-shelly-ng/devices-shelly-ng.plugin.js.map +1 -1
  272. package/dist/plugins/devices-shelly-ng/mappings/definitions/inputs.yaml +80 -0
  273. package/dist/plugins/devices-shelly-ng/mappings/mapping-loader.service.js +7 -1
  274. package/dist/plugins/devices-shelly-ng/mappings/mapping-loader.service.js.map +1 -1
  275. package/dist/plugins/devices-shelly-ng/mappings/mapping.types.d.ts +6 -3
  276. package/dist/plugins/devices-shelly-ng/mappings/schema/mapping-schema.json +5 -0
  277. package/dist/plugins/devices-shelly-ng/services/device-manager.service.js +153 -8
  278. package/dist/plugins/devices-shelly-ng/services/device-manager.service.js.map +1 -1
  279. package/dist/plugins/devices-shelly-ng/services/poll-placement-diagnostics.service.d.ts +51 -0
  280. package/dist/plugins/devices-shelly-ng/services/poll-placement-diagnostics.service.js +549 -0
  281. package/dist/plugins/devices-shelly-ng/services/poll-placement-diagnostics.service.js.map +1 -0
  282. package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.d.ts +6 -1
  283. package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.js +84 -14
  284. package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.js.map +1 -1
  285. package/dist/plugins/devices-shelly-ng/services/shelly-rpc-client.service.js +3 -0
  286. package/dist/plugins/devices-shelly-ng/services/shelly-rpc-client.service.js.map +1 -1
  287. package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.d.ts +1 -0
  288. package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.js +13 -1
  289. package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.js.map +1 -1
  290. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.constants.d.ts +2 -0
  291. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.constants.js +66 -4
  292. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.constants.js.map +1 -1
  293. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.plugin.js +2 -0
  294. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.plugin.js.map +1 -1
  295. package/dist/plugins/devices-shelly-v1/platforms/shelly-v1.device.platform.js +7 -0
  296. package/dist/plugins/devices-shelly-v1/platforms/shelly-v1.device.platform.js.map +1 -1
  297. package/dist/plugins/devices-shelly-v1/services/device-mapper.service.d.ts +3 -1
  298. package/dist/plugins/devices-shelly-v1/services/device-mapper.service.js +20 -2
  299. package/dist/plugins/devices-shelly-v1/services/device-mapper.service.js.map +1 -1
  300. package/dist/plugins/devices-shelly-v1/services/shelly-v1-input-tracker.service.d.ts +16 -0
  301. package/dist/plugins/devices-shelly-v1/services/shelly-v1-input-tracker.service.js +107 -0
  302. package/dist/plugins/devices-shelly-v1/services/shelly-v1-input-tracker.service.js.map +1 -0
  303. package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.d.ts +7 -1
  304. package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.js +98 -3
  305. package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.js.map +1 -1
  306. package/dist/plugins/devices-third-party/controllers/third-party-inputs.controller.d.ts +17 -0
  307. package/dist/plugins/devices-third-party/controllers/third-party-inputs.controller.js +205 -0
  308. package/dist/plugins/devices-third-party/controllers/third-party-inputs.controller.js.map +1 -0
  309. package/dist/plugins/devices-third-party/devices-third-party.openapi.d.ts +1 -1
  310. package/dist/plugins/devices-third-party/devices-third-party.plugin.js +2 -1
  311. package/dist/plugins/devices-third-party/devices-third-party.plugin.js.map +1 -1
  312. package/dist/plugins/devices-third-party/dto/report-input-occurrence-response.dto.d.ts +5 -0
  313. package/dist/plugins/devices-third-party/dto/report-input-occurrence-response.dto.js +50 -0
  314. package/dist/plugins/devices-third-party/dto/report-input-occurrence-response.dto.js.map +1 -0
  315. package/dist/plugins/devices-third-party/dto/report-input-occurrence.dto.d.ts +8 -0
  316. package/dist/plugins/devices-third-party/dto/report-input-occurrence.dto.js +81 -0
  317. package/dist/plugins/devices-third-party/dto/report-input-occurrence.dto.js.map +1 -0
  318. package/dist/plugins/devices-third-party/platforms/third-party-device.platform.js +19 -4
  319. package/dist/plugins/devices-third-party/platforms/third-party-device.platform.js.map +1 -1
  320. package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.d.ts +2 -0
  321. package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.js +57 -0
  322. package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.js.map +1 -1
  323. package/dist/plugins/devices-virtual/platforms/virtual-device.platform.d.ts +3 -8
  324. package/dist/plugins/devices-virtual/platforms/virtual-device.platform.js +6 -31
  325. package/dist/plugins/devices-virtual/platforms/virtual-device.platform.js.map +1 -1
  326. package/dist/plugins/devices-wled/services/wled-mdns-discoverer.service.js +3 -1
  327. package/dist/plugins/devices-wled/services/wled-mdns-discoverer.service.js.map +1 -1
  328. package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.constants.d.ts +3 -0
  329. package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.constants.js +41 -5
  330. package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.constants.js.map +1 -1
  331. package/dist/plugins/devices-zigbee2mqtt/interfaces/zigbee2mqtt.interface.d.ts +7 -1
  332. package/dist/plugins/devices-zigbee2mqtt/mappings/config-driven.converter.js +16 -15
  333. package/dist/plugins/devices-zigbee2mqtt/mappings/config-driven.converter.js.map +1 -1
  334. package/dist/plugins/devices-zigbee2mqtt/mappings/definitions/remotes.yaml +505 -74
  335. package/dist/plugins/devices-zigbee2mqtt/mappings/schema/mapping-schema.json +3 -3
  336. package/dist/plugins/devices-zigbee2mqtt/mappings/transformers/transformer.types.d.ts +1 -1
  337. package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.d.ts +8 -2
  338. package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.js +6 -5
  339. package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.js.map +1 -1
  340. package/dist/plugins/devices-zigbee2mqtt/services/device-adoption.service.js +18 -11
  341. package/dist/plugins/devices-zigbee2mqtt/services/device-adoption.service.js.map +1 -1
  342. package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.d.ts +9 -3
  343. package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.js +166 -3
  344. package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.js.map +1 -1
  345. package/dist/plugins/devices-zigbee2mqtt/services/mqtt-client-adapter.service.js +5 -2
  346. package/dist/plugins/devices-zigbee2mqtt/services/mqtt-client-adapter.service.js.map +1 -1
  347. package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.d.ts +1 -0
  348. package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.js +44 -4
  349. package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.js.map +1 -1
  350. package/dist/plugins/influx-v1/services/influx-v1-managed.service.js +2 -2
  351. package/dist/plugins/influx-v1/services/influx-v1-managed.service.js.map +1 -1
  352. package/dist/plugins/influx-v2/services/influx-v2-managed.service.js +2 -2
  353. package/dist/plugins/influx-v2/services/influx-v2-managed.service.js.map +1 -1
  354. package/dist/plugins/memory-storage/services/memory-storage-managed.service.js +2 -2
  355. package/dist/plugins/memory-storage/services/memory-storage-managed.service.js.map +1 -1
  356. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/setup.controller.d.ts +6 -4
  357. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/setup.controller.js +28 -16
  358. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/setup.controller.js.map +1 -1
  359. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/status.controller.d.ts +4 -6
  360. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/status.controller.js +18 -17
  361. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/status.controller.js.map +1 -1
  362. package/dist/plugins/remote-access-cloudflare-tunnel/models/status.model.d.ts +2 -0
  363. package/dist/plugins/remote-access-cloudflare-tunnel/models/status.model.js +17 -0
  364. package/dist/plugins/remote-access-cloudflare-tunnel/models/status.model.js.map +1 -1
  365. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.constants.d.ts +1 -0
  366. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.constants.js +2 -1
  367. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.constants.js.map +1 -1
  368. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.plugin.js +1 -1
  369. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.plugin.js.map +1 -1
  370. package/dist/plugins/remote-access-cloudflare-tunnel/scripts/cloudflared-setup.sh +1 -1
  371. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-managed.service.d.ts +21 -2
  372. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-managed.service.js +132 -56
  373. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-managed.service.js.map +1 -1
  374. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-provider.service.d.ts +13 -1
  375. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-provider.service.js +8 -2
  376. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-provider.service.js.map +1 -1
  377. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-setup.service.js +1 -0
  378. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-setup.service.js.map +1 -1
  379. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-cli.service.d.ts +1 -1
  380. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-cli.service.js +12 -24
  381. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-cli.service.js.map +1 -1
  382. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-metrics.service.d.ts +1 -1
  383. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-metrics.service.js +5 -2
  384. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-metrics.service.js.map +1 -1
  385. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-process.service.d.ts +4 -3
  386. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-process.service.js +109 -49
  387. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-process.service.js.map +1 -1
  388. package/dist/plugins/remote-access-tailscale/controllers/setup.controller.d.ts +11 -6
  389. package/dist/plugins/remote-access-tailscale/controllers/setup.controller.js +115 -25
  390. package/dist/plugins/remote-access-tailscale/controllers/setup.controller.js.map +1 -1
  391. package/dist/plugins/remote-access-tailscale/controllers/status.controller.d.ts +6 -5
  392. package/dist/plugins/remote-access-tailscale/controllers/status.controller.js +26 -16
  393. package/dist/plugins/remote-access-tailscale/controllers/status.controller.js.map +1 -1
  394. package/dist/plugins/remote-access-tailscale/models/status.model.d.ts +16 -0
  395. package/dist/plugins/remote-access-tailscale/models/status.model.js +100 -1
  396. package/dist/plugins/remote-access-tailscale/models/status.model.js.map +1 -1
  397. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.constants.d.ts +3 -0
  398. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.constants.js +4 -1
  399. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.constants.js.map +1 -1
  400. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.exceptions.d.ts +17 -1
  401. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.exceptions.js +33 -1
  402. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.exceptions.js.map +1 -1
  403. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.openapi.d.ts +2 -2
  404. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.openapi.js +1 -0
  405. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.openapi.js.map +1 -1
  406. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.plugin.js +3 -1
  407. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.plugin.js.map +1 -1
  408. package/dist/plugins/remote-access-tailscale/scripts/tailscale-setup.sh +37 -4
  409. package/dist/plugins/remote-access-tailscale/services/tailscale-cli.service.d.ts +9 -4
  410. package/dist/plugins/remote-access-tailscale/services/tailscale-cli.service.js +63 -15
  411. package/dist/plugins/remote-access-tailscale/services/tailscale-cli.service.js.map +1 -1
  412. package/dist/plugins/remote-access-tailscale/services/tailscale-login.service.d.ts +8 -3
  413. package/dist/plugins/remote-access-tailscale/services/tailscale-login.service.js +175 -151
  414. package/dist/plugins/remote-access-tailscale/services/tailscale-login.service.js.map +1 -1
  415. package/dist/plugins/remote-access-tailscale/services/tailscale-node-managed.service.d.ts +55 -7
  416. package/dist/plugins/remote-access-tailscale/services/tailscale-node-managed.service.js +551 -109
  417. package/dist/plugins/remote-access-tailscale/services/tailscale-node-managed.service.js.map +1 -1
  418. package/dist/plugins/remote-access-tailscale/services/tailscale-operation-coordinator.service.d.ts +33 -0
  419. package/dist/plugins/remote-access-tailscale/services/tailscale-operation-coordinator.service.js +167 -0
  420. package/dist/plugins/remote-access-tailscale/services/tailscale-operation-coordinator.service.js.map +1 -0
  421. package/dist/plugins/remote-access-tailscale/services/tailscale-provider.service.d.ts +13 -1
  422. package/dist/plugins/remote-access-tailscale/services/tailscale-provider.service.js +8 -2
  423. package/dist/plugins/remote-access-tailscale/services/tailscale-provider.service.js.map +1 -1
  424. package/dist/plugins/remote-access-tailscale/services/tailscale-serve.service.d.ts +1 -1
  425. package/dist/plugins/remote-access-tailscale/services/tailscale-serve.service.js +7 -6
  426. package/dist/plugins/remote-access-tailscale/services/tailscale-serve.service.js.map +1 -1
  427. package/dist/plugins/remote-access-tailscale/services/tailscale-setup.service.d.ts +1 -3
  428. package/dist/plugins/remote-access-tailscale/services/tailscale-setup.service.js +11 -11
  429. package/dist/plugins/remote-access-tailscale/services/tailscale-setup.service.js.map +1 -1
  430. package/dist/plugins/remote-access-tailscale/utils/tailscale-control.utils.d.ts +5 -0
  431. package/dist/plugins/remote-access-tailscale/utils/tailscale-control.utils.js +36 -0
  432. package/dist/plugins/remote-access-tailscale/utils/tailscale-control.utils.js.map +1 -0
  433. package/dist/plugins/simulator/controllers/simulator.controller.d.ts +8 -2
  434. package/dist/plugins/simulator/controllers/simulator.controller.js +102 -2
  435. package/dist/plugins/simulator/controllers/simulator.controller.js.map +1 -1
  436. package/dist/plugins/simulator/dto/simulate-occurrence.dto.d.ts +12 -0
  437. package/dist/plugins/simulator/dto/simulate-occurrence.dto.js +122 -0
  438. package/dist/plugins/simulator/dto/simulate-occurrence.dto.js.map +1 -0
  439. package/dist/plugins/simulator/models/simulator-response.model.d.ts +12 -0
  440. package/dist/plugins/simulator/models/simulator-response.model.js +84 -1
  441. package/dist/plugins/simulator/models/simulator-response.model.js.map +1 -1
  442. package/dist/plugins/simulator/scenarios/definitions/small-apartment.yaml +78 -0
  443. package/dist/plugins/simulator/services/scenario-executor.service.js +3 -1
  444. package/dist/plugins/simulator/services/scenario-executor.service.js.map +1 -1
  445. package/dist/plugins/simulator/services/simulation.service.js +10 -1
  446. package/dist/plugins/simulator/services/simulation.service.js.map +1 -1
  447. package/dist/plugins/simulator/simulator.openapi.d.ts +3 -2
  448. package/dist/plugins/simulator/simulator.openapi.js +5 -0
  449. package/dist/plugins/simulator/simulator.openapi.js.map +1 -1
  450. package/dist/plugins/simulator/simulators/device-simulator.interface.d.ts +2 -0
  451. package/dist/plugins/simulator/simulators/device-simulator.interface.js +83 -0
  452. package/dist/plugins/simulator/simulators/device-simulator.interface.js.map +1 -1
  453. package/dist/plugins/simulator/simulators/index.d.ts +1 -0
  454. package/dist/plugins/simulator/simulators/index.js +1 -0
  455. package/dist/plugins/simulator/simulators/index.js.map +1 -1
  456. package/dist/plugins/simulator/simulators/input-controller.simulator.d.ts +10 -0
  457. package/dist/plugins/simulator/simulators/input-controller.simulator.js +57 -0
  458. package/dist/plugins/simulator/simulators/input-controller.simulator.js.map +1 -0
  459. package/dist/plugins/simulator/simulators/lighting.simulator.js +1 -0
  460. package/dist/plugins/simulator/simulators/lighting.simulator.js.map +1 -1
  461. package/dist/plugins/spaces-home-control/listeners/space-activity.listener.d.ts +6 -7
  462. package/dist/plugins/spaces-home-control/listeners/space-activity.listener.js +19 -44
  463. package/dist/plugins/spaces-home-control/listeners/space-activity.listener.js.map +1 -1
  464. package/dist/plugins/spaces-home-control/listeners/space-climate-state.listener.d.ts +4 -4
  465. package/dist/plugins/spaces-home-control/listeners/space-climate-state.listener.js +9 -22
  466. package/dist/plugins/spaces-home-control/listeners/space-climate-state.listener.js.map +1 -1
  467. package/dist/plugins/spaces-home-control/listeners/space-lighting-state.listener.d.ts +4 -4
  468. package/dist/plugins/spaces-home-control/listeners/space-lighting-state.listener.js +9 -22
  469. package/dist/plugins/spaces-home-control/listeners/space-lighting-state.listener.js.map +1 -1
  470. package/dist/plugins/spaces-home-control/listeners/space-sensor-state.listener.d.ts +4 -4
  471. package/dist/plugins/spaces-home-control/listeners/space-sensor-state.listener.js +9 -22
  472. package/dist/plugins/spaces-home-control/listeners/space-sensor-state.listener.js.map +1 -1
  473. package/dist/plugins/spaces-home-control/services/space-climate-state.service.d.ts +3 -5
  474. package/dist/plugins/spaces-home-control/services/space-climate-state.service.js +9 -12
  475. package/dist/plugins/spaces-home-control/services/space-climate-state.service.js.map +1 -1
  476. package/dist/plugins/spaces-home-control/services/space-lighting-state.service.d.ts +3 -5
  477. package/dist/plugins/spaces-home-control/services/space-lighting-state.service.js +7 -10
  478. package/dist/plugins/spaces-home-control/services/space-lighting-state.service.js.map +1 -1
  479. package/dist/plugins/spaces-home-control/services/space-sensor-state.service.d.ts +3 -5
  480. package/dist/plugins/spaces-home-control/services/space-sensor-state.service.js +7 -10
  481. package/dist/plugins/spaces-home-control/services/space-sensor-state.service.js.map +1 -1
  482. package/dist/plugins/spaces-home-control/services/space-state-read.service.d.ts +47 -0
  483. package/dist/plugins/spaces-home-control/services/space-state-read.service.js +262 -0
  484. package/dist/plugins/spaces-home-control/services/space-state-read.service.js.map +1 -0
  485. package/dist/plugins/spaces-home-control/spaces-home-control.plugin.js +4 -0
  486. package/dist/plugins/spaces-home-control/spaces-home-control.plugin.js.map +1 -1
  487. package/dist/spec/channels.d.ts +51 -1
  488. package/dist/spec/channels.js +64 -1
  489. package/dist/spec/channels.js.map +1 -1
  490. package/dist/spec/devices.d.ts +155 -2
  491. package/dist/spec/devices.js +161 -2
  492. package/dist/spec/devices.js.map +1 -1
  493. package/dist/tsconfig.build.tsbuildinfo +1 -1
  494. package/package.json +4 -4
@@ -0,0 +1,101 @@
1
+ import { OnModuleDestroy } from '@nestjs/common';
2
+ import { ChannelPropertyEntity } from '../entities/devices.entity';
3
+ import { type PropertyCommandValue } from '../utils/property-command-value.utils';
4
+ export interface CommandLatencyTraceConfig {
5
+ readonly runId: string;
6
+ readonly sourcePropertyId: string;
7
+ readonly projectionPropertyId?: string;
8
+ readonly sourceDeviceId?: string;
9
+ readonly exportPath?: string;
10
+ readonly captureDurationMs?: number;
11
+ readonly maxRecords?: number;
12
+ }
13
+ export declare const COMMAND_LATENCY_TRACE_OPTIONS: unique symbol;
14
+ export type CommandLatencyTraceStage = 'command-received' | 'window-bound' | 'provider-receipt' | 'poll-rpc-start' | 'poll-rpc-complete' | 'poll-coalescer-admission' | 'poll-drain' | 'update-entry' | 'write-complete' | 'source-publication' | 'suppressed' | 'update-complete' | 'update-error';
15
+ export type CommandLatencyTraceStatus = 'complete' | 'suppressed' | 'error' | 'expired' | 'overflow' | 'shutdown';
16
+ export interface CommandLatencyTraceRecord {
17
+ readonly stage: CommandLatencyTraceStage;
18
+ readonly timestampMs: number;
19
+ readonly processId: number;
20
+ readonly runId: string;
21
+ readonly trialId: string;
22
+ readonly invocationId?: string;
23
+ readonly sourcePropertyId: string;
24
+ readonly projectionPropertyId?: string;
25
+ readonly commandValue: PropertyCommandValue;
26
+ readonly intentId?: string;
27
+ readonly windowGeneration?: string;
28
+ readonly metadata?: Record<string, unknown>;
29
+ }
30
+ export interface CommandLatencyTraceCapture {
31
+ readonly schemaVersion: 1;
32
+ readonly clock: 'backend-performance-now-v1';
33
+ readonly collectorHash: string;
34
+ readonly processId: number;
35
+ readonly runId: string;
36
+ readonly trialId: string;
37
+ readonly invocationId?: string;
38
+ readonly sourcePropertyId: string;
39
+ readonly projectionPropertyId?: string;
40
+ readonly commandValue: PropertyCommandValue;
41
+ readonly intentId?: string;
42
+ readonly windowGeneration?: string;
43
+ readonly status: CommandLatencyTraceStatus;
44
+ readonly failureReason?: string;
45
+ readonly records: readonly CommandLatencyTraceRecord[];
46
+ }
47
+ export interface CommandLatencyTraceCommand {
48
+ readonly requestId?: string;
49
+ readonly intentId: string;
50
+ readonly properties: readonly {
51
+ readonly property: string;
52
+ readonly value: PropertyCommandValue;
53
+ }[];
54
+ }
55
+ export declare class CommandLatencyTraceCollectorService implements OnModuleDestroy {
56
+ private readonly config;
57
+ private readonly context;
58
+ private readonly trialsByIntent;
59
+ private readonly trialsByGeneration;
60
+ private readonly captures;
61
+ private readonly pendingExports;
62
+ private readonly exportTasks;
63
+ private readonly collectorHash;
64
+ private recordCount;
65
+ private overflowed;
66
+ constructor(options?: CommandLatencyTraceConfig | null);
67
+ static getSourceHash(): string;
68
+ isEnabled(): boolean;
69
+ observeCommand(command: CommandLatencyTraceCommand): void;
70
+ bindWindow(intentId: string | undefined, sourcePropertyId: string, windowGeneration: string): void;
71
+ recordProviderReceipt(propertyId: string, value: PropertyCommandValue, origin: 'notify' | 'poll', metadata?: Record<string, unknown>): void;
72
+ recordPollActivity(propertyId: string, stage: Extract<CommandLatencyTraceStage, 'poll-coalescer-admission' | 'poll-drain'>, metadata?: Record<string, unknown>): void;
73
+ recordPollRpc(deviceId: string, stage: Extract<CommandLatencyTraceStage, 'poll-rpc-start' | 'poll-rpc-complete'>, metadata?: Record<string, unknown>): void;
74
+ traceUpdate<T>(input: {
75
+ propertyId: string;
76
+ value: PropertyCommandValue | undefined;
77
+ windowGeneration?: string;
78
+ }, callback: () => Promise<T>): Promise<T>;
79
+ recordWriteComplete(property: ChannelPropertyEntity, metadata?: Record<string, unknown>): void;
80
+ recordSuppressed(property: ChannelPropertyEntity, reason: string): void;
81
+ recordSourcePublication(property: ChannelPropertyEntity): void;
82
+ getCaptures(): readonly CommandLatencyTraceCapture[];
83
+ waitForExports(): Promise<void>;
84
+ onModuleDestroy(): void;
85
+ private beginInvocation;
86
+ private finishInvocation;
87
+ private getActiveInvocation;
88
+ private recordCurrentInvocation;
89
+ private getBoundTrial;
90
+ private recordTrial;
91
+ private appendRecord;
92
+ private recordInvocation;
93
+ private createRecord;
94
+ private acceptRecord;
95
+ private finishTrial;
96
+ private expireDueTrials;
97
+ private expireTrial;
98
+ private now;
99
+ private scheduleExport;
100
+ private replaceCaptureAfterSinkFailure;
101
+ }
@@ -0,0 +1,451 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var CommandLatencyTraceCollectorService_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.CommandLatencyTraceCollectorService = exports.COMMAND_LATENCY_TRACE_OPTIONS = void 0;
17
+ const node_async_hooks_1 = require("node:async_hooks");
18
+ const node_crypto_1 = require("node:crypto");
19
+ const node_fs_1 = require("node:fs");
20
+ const promises_1 = require("node:fs/promises");
21
+ const node_perf_hooks_1 = require("node:perf_hooks");
22
+ const common_1 = require("@nestjs/common");
23
+ exports.COMMAND_LATENCY_TRACE_OPTIONS = Symbol('COMMAND_LATENCY_TRACE_OPTIONS');
24
+ const MAX_CAPTURE_DURATION_MS = 30_000;
25
+ const MAX_CAPTURE_RECORDS = 4_096;
26
+ let CommandLatencyTraceCollectorService = CommandLatencyTraceCollectorService_1 = class CommandLatencyTraceCollectorService {
27
+ constructor(options) {
28
+ this.context = new node_async_hooks_1.AsyncLocalStorage();
29
+ this.trialsByIntent = new Map();
30
+ this.trialsByGeneration = new Map();
31
+ this.captures = [];
32
+ this.pendingExports = new Set();
33
+ this.exportTasks = new Set();
34
+ this.recordCount = 0;
35
+ this.overflowed = false;
36
+ this.config = normalizeConfig(options ?? parseEnvironmentConfig());
37
+ this.collectorHash = CommandLatencyTraceCollectorService_1.getSourceHash();
38
+ }
39
+ static getSourceHash() {
40
+ try {
41
+ return (0, node_crypto_1.createHash)('sha256').update((0, node_fs_1.readFileSync)(__filename, 'utf8')).digest('hex');
42
+ }
43
+ catch {
44
+ return (0, node_crypto_1.createHash)('sha256').update(CommandLatencyTraceCollectorService_1.toString()).digest('hex');
45
+ }
46
+ }
47
+ isEnabled() {
48
+ return this.config !== null && !this.overflowed;
49
+ }
50
+ observeCommand(command) {
51
+ if (!this.isEnabled() || !command.requestId || this.config === null) {
52
+ return;
53
+ }
54
+ this.expireDueTrials();
55
+ const matching = command.properties.filter((property) => property.property === this.config.sourcePropertyId || property.property === this.config.projectionPropertyId);
56
+ if (matching.length !== 1) {
57
+ return;
58
+ }
59
+ const selected = matching[0];
60
+ if (selected === undefined || this.trialsByIntent.has(command.intentId)) {
61
+ return;
62
+ }
63
+ const startedAtMs = this.now();
64
+ const expiryTimer = setTimeout(() => this.expireTrial(command.intentId), this.config.captureDurationMs);
65
+ expiryTimer.unref();
66
+ const trial = {
67
+ trialId: command.requestId,
68
+ intentId: command.intentId,
69
+ requestedPropertyId: selected.property,
70
+ commandValue: selected.value,
71
+ startedAtMs,
72
+ expiryTimer,
73
+ pendingRecords: [],
74
+ completed: false,
75
+ activeInvocationCount: 0,
76
+ };
77
+ this.trialsByIntent.set(trial.intentId, trial);
78
+ this.recordTrial(trial, 'command-received', undefined, { requestedPropertyId: selected.property });
79
+ }
80
+ bindWindow(intentId, sourcePropertyId, windowGeneration) {
81
+ if (!this.isEnabled() || !intentId || this.config === null || sourcePropertyId !== this.config.sourcePropertyId) {
82
+ return;
83
+ }
84
+ this.expireDueTrials();
85
+ const trial = this.trialsByIntent.get(intentId);
86
+ if (trial === undefined || trial.completed) {
87
+ return;
88
+ }
89
+ if (trial.windowGeneration !== undefined && trial.windowGeneration !== windowGeneration) {
90
+ this.finishTrial(trial, 'error', 'A validation trial was bound to more than one command-window generation.');
91
+ return;
92
+ }
93
+ const colliding = this.trialsByGeneration.get(windowGeneration);
94
+ if (colliding !== undefined && colliding !== trial) {
95
+ this.finishTrial(colliding, 'error', 'A command-window generation was correlated to multiple validation trials.');
96
+ this.finishTrial(trial, 'error', 'A command-window generation was correlated to multiple validation trials.');
97
+ return;
98
+ }
99
+ trial.windowGeneration = windowGeneration;
100
+ this.trialsByGeneration.set(windowGeneration, trial);
101
+ this.recordTrial(trial, 'window-bound');
102
+ }
103
+ recordProviderReceipt(propertyId, value, origin, metadata) {
104
+ const trial = this.getBoundTrial(propertyId);
105
+ if (trial === null) {
106
+ return;
107
+ }
108
+ this.recordTrial(trial, 'provider-receipt', undefined, { origin, receivedValue: value, ...metadata });
109
+ }
110
+ recordPollActivity(propertyId, stage, metadata) {
111
+ const trial = this.getBoundTrial(propertyId);
112
+ if (trial !== null) {
113
+ this.recordTrial(trial, stage, undefined, metadata);
114
+ }
115
+ }
116
+ recordPollRpc(deviceId, stage, metadata) {
117
+ if (!this.isEnabled() || this.config?.sourceDeviceId !== deviceId) {
118
+ return;
119
+ }
120
+ for (const trial of this.trialsByGeneration.values()) {
121
+ if (!trial.completed) {
122
+ this.recordTrial(trial, stage, undefined, { deviceId, ...metadata });
123
+ }
124
+ }
125
+ }
126
+ async traceUpdate(input, callback) {
127
+ const invocation = this.beginInvocation(input);
128
+ if (invocation === null) {
129
+ return callback();
130
+ }
131
+ return this.context.run(invocation, async () => {
132
+ try {
133
+ const result = await callback();
134
+ this.finishInvocation(invocation);
135
+ return result;
136
+ }
137
+ catch (error) {
138
+ invocation.status = 'error';
139
+ invocation.failureReason = error instanceof Error ? error.message : 'Unknown update failure';
140
+ this.recordInvocation(invocation, 'update-error', { reason: invocation.failureReason });
141
+ this.finishInvocation(invocation);
142
+ throw error;
143
+ }
144
+ });
145
+ }
146
+ recordWriteComplete(property, metadata) {
147
+ this.recordCurrentInvocation('write-complete', property.id, metadata);
148
+ }
149
+ recordSuppressed(property, reason) {
150
+ const invocation = this.context.getStore();
151
+ if (invocation === undefined || property.id !== this.config?.sourcePropertyId) {
152
+ return;
153
+ }
154
+ invocation.status = 'suppressed';
155
+ this.recordInvocation(invocation, 'suppressed', { reason });
156
+ }
157
+ recordSourcePublication(property) {
158
+ const invocation = this.context.getStore() ?? this.getActiveInvocation(property.id);
159
+ if (invocation === undefined || property.id !== this.config?.sourcePropertyId) {
160
+ return;
161
+ }
162
+ const publishedValue = property.value?.value;
163
+ if (publishedValue !== invocation.trial.commandValue) {
164
+ invocation.status = 'error';
165
+ invocation.failureReason = 'Canonical source publication did not match the commanded value.';
166
+ this.recordInvocation(invocation, 'update-error', { reason: invocation.failureReason, publishedValue });
167
+ return;
168
+ }
169
+ this.recordInvocation(invocation, 'source-publication');
170
+ this.recordInvocation(invocation, 'update-complete');
171
+ this.finishTrial(invocation.trial, 'complete', undefined, invocation);
172
+ }
173
+ getCaptures() {
174
+ this.expireDueTrials();
175
+ return this.captures.map((capture) => ({ ...capture, records: [...capture.records] }));
176
+ }
177
+ async waitForExports() {
178
+ await Promise.all([...this.exportTasks]);
179
+ }
180
+ onModuleDestroy() {
181
+ for (const trial of [...this.trialsByIntent.values()]) {
182
+ this.finishTrial(trial, 'shutdown', 'The backend stopped before the validation capture completed.');
183
+ }
184
+ }
185
+ beginInvocation(input) {
186
+ const trial = this.getBoundTrial(input.propertyId, input.windowGeneration);
187
+ if (trial === null || input.value === undefined) {
188
+ return null;
189
+ }
190
+ if (trial.activeInvocationCount > 0) {
191
+ this.finishTrial(trial, 'error', 'Concurrent provider updates share one command-window generation; server evidence is ambiguous.');
192
+ return null;
193
+ }
194
+ const invocation = {
195
+ invocationId: (0, node_crypto_1.randomUUID)(),
196
+ trial,
197
+ records: trial.pendingRecords.splice(0),
198
+ status: 'pending',
199
+ };
200
+ trial.activeInvocationCount++;
201
+ trial.activeInvocation = invocation;
202
+ this.recordInvocation(invocation, 'update-entry', { receivedValue: input.value });
203
+ return invocation;
204
+ }
205
+ finishInvocation(invocation) {
206
+ invocation.trial.activeInvocationCount = Math.max(0, invocation.trial.activeInvocationCount - 1);
207
+ if (invocation.trial.activeInvocation === invocation) {
208
+ invocation.trial.activeInvocation = undefined;
209
+ }
210
+ if (invocation.trial.completed) {
211
+ return;
212
+ }
213
+ const published = invocation.records.some((record) => record.stage === 'source-publication');
214
+ if (invocation.status === 'pending' && published) {
215
+ this.recordInvocation(invocation, 'update-complete');
216
+ this.finishTrial(invocation.trial, 'complete', undefined, invocation);
217
+ return;
218
+ }
219
+ if (invocation.status === 'suppressed') {
220
+ this.finishTrial(invocation.trial, 'suppressed', undefined, invocation, false);
221
+ return;
222
+ }
223
+ if (invocation.status === 'error') {
224
+ this.finishTrial(invocation.trial, 'error', invocation.failureReason, invocation);
225
+ }
226
+ }
227
+ getActiveInvocation(propertyId) {
228
+ if (!this.isEnabled() || propertyId !== this.config?.sourcePropertyId) {
229
+ return undefined;
230
+ }
231
+ const candidates = [...this.trialsByGeneration.values()]
232
+ .filter((trial) => !trial.completed && trial.activeInvocation !== undefined)
233
+ .map((trial) => trial.activeInvocation)
234
+ .filter((invocation) => invocation !== undefined);
235
+ return candidates.length === 1 ? candidates[0] : undefined;
236
+ }
237
+ recordCurrentInvocation(stage, propertyId, metadata) {
238
+ const invocation = this.context.getStore();
239
+ if (invocation !== undefined && propertyId === this.config?.sourcePropertyId) {
240
+ this.recordInvocation(invocation, stage, metadata);
241
+ }
242
+ }
243
+ getBoundTrial(propertyId, windowGeneration) {
244
+ if (!this.isEnabled() || this.config === null || propertyId !== this.config.sourcePropertyId) {
245
+ return null;
246
+ }
247
+ this.expireDueTrials();
248
+ if (windowGeneration !== undefined) {
249
+ return this.trialsByGeneration.get(windowGeneration) ?? null;
250
+ }
251
+ const candidates = [...this.trialsByGeneration.values()].filter((trial) => !trial.completed);
252
+ return candidates.length === 1 ? (candidates[0] ?? null) : null;
253
+ }
254
+ recordTrial(trial, stage, invocationId, metadata) {
255
+ const record = this.createRecord(trial, stage, invocationId, metadata);
256
+ if (!this.acceptRecord(record)) {
257
+ return null;
258
+ }
259
+ if (invocationId === undefined) {
260
+ const activeInvocation = trial.activeInvocation;
261
+ if (activeInvocation !== undefined && !trial.completed && trial.activeInvocationCount === 1) {
262
+ this.appendRecord(activeInvocation.records, record);
263
+ }
264
+ else {
265
+ this.appendRecord(trial.pendingRecords, record);
266
+ }
267
+ }
268
+ return record;
269
+ }
270
+ appendRecord(records, record) {
271
+ let index = records.length;
272
+ while (index > 0 && records[index - 1].timestampMs > record.timestampMs) {
273
+ index--;
274
+ }
275
+ records.splice(index, 0, record);
276
+ }
277
+ recordInvocation(invocation, stage, metadata) {
278
+ if (invocation.trial.completed) {
279
+ return;
280
+ }
281
+ const record = this.recordTrial(invocation.trial, stage, invocation.invocationId, metadata);
282
+ if (record !== null) {
283
+ invocation.records.push(record);
284
+ }
285
+ }
286
+ createRecord(trial, stage, invocationId, metadata) {
287
+ if (this.config === null) {
288
+ throw new Error('Cannot create a command latency trace record while capture is disabled.');
289
+ }
290
+ return Object.freeze({
291
+ stage,
292
+ timestampMs: this.now(),
293
+ processId: process.pid,
294
+ runId: this.config.runId,
295
+ trialId: trial.trialId,
296
+ invocationId,
297
+ sourcePropertyId: this.config.sourcePropertyId,
298
+ projectionPropertyId: this.config.projectionPropertyId,
299
+ commandValue: trial.commandValue,
300
+ intentId: trial.intentId,
301
+ windowGeneration: trial.windowGeneration,
302
+ metadata: metadata === undefined ? undefined : Object.freeze({ ...metadata }),
303
+ });
304
+ }
305
+ acceptRecord(_record) {
306
+ if (this.overflowed) {
307
+ return false;
308
+ }
309
+ if (this.recordCount >= (this.config?.maxRecords ?? 0)) {
310
+ this.overflowed = true;
311
+ for (const trial of [...this.trialsByIntent.values()]) {
312
+ this.finishTrial(trial, 'overflow', 'The bounded command latency capture exceeded its record limit.');
313
+ }
314
+ return false;
315
+ }
316
+ this.recordCount++;
317
+ return true;
318
+ }
319
+ finishTrial(trial, status, failureReason, invocation, finalize = true) {
320
+ if (trial.completed && finalize) {
321
+ return;
322
+ }
323
+ const records = invocation?.records ?? trial.pendingRecords;
324
+ const capture = Object.freeze({
325
+ schemaVersion: 1,
326
+ clock: 'backend-performance-now-v1',
327
+ collectorHash: this.collectorHash,
328
+ processId: process.pid,
329
+ runId: this.config?.runId ?? 'disabled',
330
+ trialId: trial.trialId,
331
+ invocationId: invocation?.invocationId,
332
+ sourcePropertyId: this.config?.sourcePropertyId ?? '',
333
+ projectionPropertyId: this.config?.projectionPropertyId,
334
+ commandValue: trial.commandValue,
335
+ intentId: trial.intentId,
336
+ windowGeneration: trial.windowGeneration,
337
+ status,
338
+ failureReason,
339
+ records: Object.freeze([...records]),
340
+ });
341
+ this.captures.push(capture);
342
+ this.scheduleExport(capture);
343
+ if (!finalize) {
344
+ return;
345
+ }
346
+ trial.completed = true;
347
+ trial.activeInvocation = undefined;
348
+ clearTimeout(trial.expiryTimer);
349
+ this.trialsByIntent.delete(trial.intentId);
350
+ if (trial.windowGeneration !== undefined && this.trialsByGeneration.get(trial.windowGeneration) === trial) {
351
+ this.trialsByGeneration.delete(trial.windowGeneration);
352
+ }
353
+ }
354
+ expireDueTrials() {
355
+ const captureDurationMs = this.config?.captureDurationMs;
356
+ if (captureDurationMs === undefined) {
357
+ return;
358
+ }
359
+ const now = this.now();
360
+ for (const trial of [...this.trialsByIntent.values()]) {
361
+ if (now - trial.startedAtMs >= captureDurationMs) {
362
+ this.finishTrial(trial, 'expired', `The ${captureDurationMs}ms validation capture window elapsed before source publication.`);
363
+ }
364
+ }
365
+ }
366
+ expireTrial(intentId) {
367
+ const captureDurationMs = this.config?.captureDurationMs;
368
+ const trial = this.trialsByIntent.get(intentId);
369
+ if (trial !== undefined && captureDurationMs !== undefined) {
370
+ this.finishTrial(trial, 'expired', `The ${captureDurationMs}ms validation capture window elapsed before source publication.`);
371
+ }
372
+ }
373
+ now() {
374
+ return node_perf_hooks_1.performance.now();
375
+ }
376
+ scheduleExport(capture) {
377
+ if (!this.config?.exportPath) {
378
+ return;
379
+ }
380
+ this.pendingExports.add(capture);
381
+ const task = new Promise((resolve) => {
382
+ setImmediate(() => {
383
+ void (0, promises_1.appendFile)(this.config?.exportPath ?? '', `${JSON.stringify(capture)}\n`, 'utf8')
384
+ .catch(() => {
385
+ this.replaceCaptureAfterSinkFailure(capture);
386
+ })
387
+ .finally(() => {
388
+ this.pendingExports.delete(capture);
389
+ this.exportTasks.delete(task);
390
+ resolve();
391
+ });
392
+ });
393
+ });
394
+ this.exportTasks.add(task);
395
+ }
396
+ replaceCaptureAfterSinkFailure(capture) {
397
+ const index = this.captures.indexOf(capture);
398
+ if (index === -1) {
399
+ return;
400
+ }
401
+ this.captures[index] = Object.freeze({
402
+ ...capture,
403
+ status: 'error',
404
+ failureReason: 'The private command latency capture sink failed to export this report.',
405
+ });
406
+ }
407
+ };
408
+ exports.CommandLatencyTraceCollectorService = CommandLatencyTraceCollectorService;
409
+ exports.CommandLatencyTraceCollectorService = CommandLatencyTraceCollectorService = CommandLatencyTraceCollectorService_1 = __decorate([
410
+ (0, common_1.Injectable)(),
411
+ __param(0, (0, common_1.Optional)()),
412
+ __param(0, (0, common_1.Inject)(exports.COMMAND_LATENCY_TRACE_OPTIONS)),
413
+ __metadata("design:paramtypes", [Object])
414
+ ], CommandLatencyTraceCollectorService);
415
+ function parseEnvironmentConfig() {
416
+ const raw = process.env.FB_COMMAND_LATENCY_CAPTURE;
417
+ if (!raw) {
418
+ return null;
419
+ }
420
+ try {
421
+ return JSON.parse(raw);
422
+ }
423
+ catch {
424
+ return null;
425
+ }
426
+ }
427
+ function normalizeConfig(config) {
428
+ if (config === null ||
429
+ !isNonEmptyString(config.runId) ||
430
+ !isNonEmptyString(config.sourcePropertyId) ||
431
+ (config.projectionPropertyId !== undefined && !isNonEmptyString(config.projectionPropertyId)) ||
432
+ (config.sourceDeviceId !== undefined && !isNonEmptyString(config.sourceDeviceId)) ||
433
+ (config.exportPath !== undefined && !isNonEmptyString(config.exportPath))) {
434
+ return null;
435
+ }
436
+ const captureDurationMs = config.captureDurationMs ?? MAX_CAPTURE_DURATION_MS;
437
+ const maxRecords = config.maxRecords ?? MAX_CAPTURE_RECORDS;
438
+ if (!Number.isInteger(captureDurationMs) ||
439
+ captureDurationMs <= 0 ||
440
+ captureDurationMs > MAX_CAPTURE_DURATION_MS ||
441
+ !Number.isInteger(maxRecords) ||
442
+ maxRecords <= 0 ||
443
+ maxRecords > MAX_CAPTURE_RECORDS) {
444
+ return null;
445
+ }
446
+ return Object.freeze({ ...config, captureDurationMs, maxRecords });
447
+ }
448
+ function isNonEmptyString(value) {
449
+ return typeof value === 'string' && value.trim().length > 0;
450
+ }
451
+ //# sourceMappingURL=command-latency-trace-collector.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-latency-trace-collector.service.js","sourceRoot":"","sources":["../../../../src/modules/devices/services/command-latency-trace-collector.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqD;AACrD,6CAAqD;AACrD,qCAAuC;AACvC,+CAA8C;AAC9C,qDAA8C;AAE9C,2CAA+E;AAqBlE,QAAA,6BAA6B,GAAG,MAAM,CAAC,+BAA+B,CAAC,CAAC;AAoFrF,MAAM,uBAAuB,GAAG,MAAM,CAAC;AACvC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAW3B,IAAM,mCAAmC,2CAAzC,MAAM,mCAAmC;IAc/C,YAGC,OAA0C;QAb1B,YAAO,GAAG,IAAI,oCAAiB,EAAmB,CAAC;QACnD,mBAAc,GAAG,IAAI,GAAG,EAAuB,CAAC;QAChD,uBAAkB,GAAG,IAAI,GAAG,EAAuB,CAAC;QACpD,aAAQ,GAAiC,EAAE,CAAC;QAC5C,mBAAc,GAAG,IAAI,GAAG,EAA8B,CAAC;QACvD,gBAAW,GAAG,IAAI,GAAG,EAAiB,CAAC;QAEhD,gBAAW,GAAG,CAAC,CAAC;QAChB,eAAU,GAAG,KAAK,CAAC;QAO1B,IAAI,CAAC,MAAM,GAAG,eAAe,CAAC,OAAO,IAAI,sBAAsB,EAAE,CAAC,CAAC;QACnE,IAAI,CA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AAiB,EAAE,UAAU,EAAE,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACvC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { ChannelEntity, ChannelPropertyEntity, DeviceEntity } from '../entities/devices.entity';
2
+ import { DeviceConnectionStateService } from './device-connection-state.service';
3
+ import { PropertyMetadataService } from './property-metadata.service';
4
+ import { PropertyValueService } from './property-value.service';
5
+ export declare class DeviceCommandGraphService {
6
+ private readonly metadata;
7
+ private readonly values;
8
+ private readonly connectivity;
9
+ private readonly logger;
10
+ constructor(metadata: PropertyMetadataService, values: PropertyValueService, connectivity: DeviceConnectionStateService);
11
+ findOne(id: string): Promise<DeviceEntity | null>;
12
+ findPropertyTarget(id: string): Promise<{
13
+ device: DeviceEntity;
14
+ channel: ChannelEntity;
15
+ property: ChannelPropertyEntity;
16
+ } | null>;
17
+ private hydrateProperty;
18
+ }