@fastybird/smart-panel-backend 1.1.0-alpha.5 → 1.1.0-alpha.50

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 (538) hide show
  1. package/dist/app.module.js +9 -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 +21 -4
  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 +21 -4
  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 +27 -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 +32 -3
  63. package/dist/modules/devices/services/channels.properties.service.js +360 -51
  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 +52 -38
  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/device-structure-lock.service.d.ts +10 -2
  75. package/dist/modules/devices/services/device-structure-lock.service.js +86 -7
  76. package/dist/modules/devices/services/device-structure-lock.service.js.map +1 -1
  77. package/dist/modules/devices/services/devices.service.d.ts +2 -0
  78. package/dist/modules/devices/services/devices.service.js +78 -64
  79. package/dist/modules/devices/services/devices.service.js.map +1 -1
  80. package/dist/modules/devices/services/module-reset.service.d.ts +3 -1
  81. package/dist/modules/devices/services/module-reset.service.js +21 -16
  82. package/dist/modules/devices/services/module-reset.service.js.map +1 -1
  83. package/dist/modules/devices/services/platform.registry.service.d.ts +2 -2
  84. package/dist/modules/devices/services/platform.registry.service.js.map +1 -1
  85. package/dist/modules/devices/services/property-command-dispatch.service.d.ts +47 -0
  86. package/dist/modules/devices/services/property-command-dispatch.service.js +231 -0
  87. package/dist/modules/devices/services/property-command-dispatch.service.js.map +1 -0
  88. package/dist/modules/devices/services/property-command-window.service.d.ts +71 -0
  89. package/dist/modules/devices/services/property-command-window.service.js +206 -0
  90. package/dist/modules/devices/services/property-command-window.service.js.map +1 -0
  91. package/dist/modules/devices/services/property-command.service.d.ts +26 -7
  92. package/dist/modules/devices/services/property-command.service.js +95 -28
  93. package/dist/modules/devices/services/property-command.service.js.map +1 -1
  94. package/dist/modules/devices/services/property-metadata.service.d.ts +38 -0
  95. package/dist/modules/devices/services/property-metadata.service.js +210 -0
  96. package/dist/modules/devices/services/property-metadata.service.js.map +1 -0
  97. package/dist/modules/devices/services/property-state-coordinator.service.d.ts +4 -0
  98. package/dist/modules/devices/services/property-state-coordinator.service.js +35 -0
  99. package/dist/modules/devices/services/property-state-coordinator.service.js.map +1 -0
  100. package/dist/modules/devices/services/property-value-lock.service.d.ts +4 -1
  101. package/dist/modules/devices/services/property-value-lock.service.js +16 -2
  102. package/dist/modules/devices/services/property-value-lock.service.js.map +1 -1
  103. package/dist/modules/devices/services/property-value.service.d.ts +3 -0
  104. package/dist/modules/devices/services/property-value.service.js +29 -5
  105. package/dist/modules/devices/services/property-value.service.js.map +1 -1
  106. package/dist/modules/devices/utils/device-graph-query.utils.d.ts +3 -0
  107. package/dist/modules/devices/utils/device-graph-query.utils.js +23 -0
  108. package/dist/modules/devices/utils/device-graph-query.utils.js.map +1 -0
  109. package/dist/modules/devices/utils/schema.utils.js +1 -1
  110. package/dist/modules/devices/utils/schema.utils.js.map +1 -1
  111. package/dist/modules/devices/validators/channel-exists-constraint.validator.d.ts +1 -3
  112. package/dist/modules/devices/validators/channel-exists-constraint.validator.js +3 -14
  113. package/dist/modules/devices/validators/channel-exists-constraint.validator.js.map +1 -1
  114. package/dist/modules/devices/validators/channel-property-exists-constraint.validator.d.ts +1 -3
  115. package/dist/modules/devices/validators/channel-property-exists-constraint.validator.js +3 -14
  116. package/dist/modules/devices/validators/channel-property-exists-constraint.validator.js.map +1 -1
  117. package/dist/modules/devices/validators/device-exists-constraint.validator.js +1 -2
  118. package/dist/modules/devices/validators/device-exists-constraint.validator.js.map +1 -1
  119. package/dist/modules/devices/validators/property-command-target-constraint.validator.d.ts +9 -0
  120. package/dist/modules/devices/validators/property-command-target-constraint.validator.js +58 -0
  121. package/dist/modules/devices/validators/property-command-target-constraint.validator.js.map +1 -0
  122. package/dist/modules/mdns/services/mdns.service.js +3 -1
  123. package/dist/modules/mdns/services/mdns.service.js.map +1 -1
  124. package/dist/modules/platform/platforms/abstract.platform.d.ts +2 -1
  125. package/dist/modules/platform/platforms/abstract.platform.js +2 -1
  126. package/dist/modules/platform/platforms/abstract.platform.js.map +1 -1
  127. package/dist/modules/platform/platforms/raspberry.platform.js +5 -10
  128. package/dist/modules/platform/platforms/raspberry.platform.js.map +1 -1
  129. package/dist/modules/platform/utils/linux-network-interface.utils.d.ts +3 -0
  130. package/dist/modules/platform/utils/linux-network-interface.utils.js +48 -0
  131. package/dist/modules/platform/utils/linux-network-interface.utils.js.map +1 -0
  132. package/dist/modules/remote-access/controllers/remote-access.controller.js +11 -6
  133. package/dist/modules/remote-access/controllers/remote-access.controller.js.map +1 -1
  134. package/dist/modules/remote-access/models/provider.model.d.ts +3 -0
  135. package/dist/modules/remote-access/models/provider.model.js +23 -0
  136. package/dist/modules/remote-access/models/provider.model.js.map +1 -1
  137. package/dist/modules/remote-access/models/status.model.d.ts +2 -0
  138. package/dist/modules/remote-access/models/status.model.js +18 -1
  139. package/dist/modules/remote-access/models/status.model.js.map +1 -1
  140. package/dist/modules/remote-access/models/urls.model.d.ts +2 -0
  141. package/dist/modules/remote-access/models/urls.model.js +17 -0
  142. package/dist/modules/remote-access/models/urls.model.js.map +1 -1
  143. package/dist/modules/remote-access/platforms/remote-access-provider.platform.d.ts +18 -1
  144. package/dist/modules/remote-access/remote-access.constants.d.ts +2 -1
  145. package/dist/modules/remote-access/remote-access.constants.js +2 -1
  146. package/dist/modules/remote-access/remote-access.constants.js.map +1 -1
  147. package/dist/modules/remote-access/services/remote-access-proxy-contribution.service.d.ts +1 -0
  148. package/dist/modules/remote-access/services/remote-access-proxy-contribution.service.js +4 -1
  149. package/dist/modules/remote-access/services/remote-access-proxy-contribution.service.js.map +1 -1
  150. package/dist/modules/remote-access/services/remote-access-status.service.d.ts +40 -8
  151. package/dist/modules/remote-access/services/remote-access-status.service.js +314 -65
  152. package/dist/modules/remote-access/services/remote-access-status.service.js.map +1 -1
  153. package/dist/modules/remote-access/services/remote-access-url.service.d.ts +2 -2
  154. package/dist/modules/remote-access/services/remote-access-url.service.js +4 -2
  155. package/dist/modules/remote-access/services/remote-access-url.service.js.map +1 -1
  156. package/dist/modules/spaces/services/module-reset.service.d.ts +5 -1
  157. package/dist/modules/spaces/services/module-reset.service.js +10 -2
  158. package/dist/modules/spaces/services/module-reset.service.js.map +1 -1
  159. package/dist/modules/spaces/services/space-activity.service.d.ts +14 -0
  160. package/dist/modules/spaces/services/space-activity.service.js +56 -0
  161. package/dist/modules/spaces/services/space-activity.service.js.map +1 -0
  162. package/dist/modules/spaces/spaces.module.js +5 -0
  163. package/dist/modules/spaces/spaces.module.js.map +1 -1
  164. package/dist/modules/spaces/subscribers/space-activity.subscriber.d.ts +17 -0
  165. package/dist/modules/spaces/subscribers/space-activity.subscriber.js +89 -0
  166. package/dist/modules/spaces/subscribers/space-activity.subscriber.js.map +1 -0
  167. package/dist/modules/storage/services/storage-write-buffer.d.ts +17 -0
  168. package/dist/modules/storage/services/storage-write-buffer.js +67 -0
  169. package/dist/modules/storage/services/storage-write-buffer.js.map +1 -0
  170. package/dist/modules/storage/services/storage.service.d.ts +9 -2
  171. package/dist/modules/storage/services/storage.service.js +54 -1
  172. package/dist/modules/storage/services/storage.service.js.map +1 -1
  173. package/dist/modules/system/scripts/update-worker.sh +1168 -61
  174. package/dist/modules/system/services/privileged-worker.service.d.ts +3 -0
  175. package/dist/modules/system/services/privileged-worker.service.js +62 -27
  176. package/dist/modules/system/services/privileged-worker.service.js.map +1 -1
  177. package/dist/modules/system/services/system.service.d.ts +2 -0
  178. package/dist/modules/system/services/system.service.js +22 -1
  179. package/dist/modules/system/services/system.service.js.map +1 -1
  180. package/dist/modules/system/services/update-executor.service.d.ts +20 -2
  181. package/dist/modules/system/services/update-executor.service.js +272 -26
  182. package/dist/modules/system/services/update-executor.service.js.map +1 -1
  183. package/dist/modules/websocket/gateway/websocket.gateway.d.ts +4 -1
  184. package/dist/modules/websocket/gateway/websocket.gateway.js +29 -5
  185. package/dist/modules/websocket/gateway/websocket.gateway.js.map +1 -1
  186. package/dist/modules/websocket/services/command-acknowledgement-trace.service.d.ts +143 -0
  187. package/dist/modules/websocket/services/command-acknowledgement-trace.service.js +523 -0
  188. package/dist/modules/websocket/services/command-acknowledgement-trace.service.js.map +1 -0
  189. package/dist/modules/websocket/services/ws-auth.service.js +12 -35
  190. package/dist/modules/websocket/services/ws-auth.service.js.map +1 -1
  191. package/dist/modules/websocket/websocket.module.js +9 -1
  192. package/dist/modules/websocket/websocket.module.js.map +1 -1
  193. package/dist/plugins/devices-home-assistant/devices-home-assistant.openapi.d.ts +2 -2
  194. package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.d.ts +6 -1
  195. package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.js +16 -1
  196. package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.js.map +1 -1
  197. package/dist/plugins/devices-home-assistant/dto/mapping-preview.dto.d.ts +1 -0
  198. package/dist/plugins/devices-home-assistant/dto/mapping-preview.dto.js +11 -0
  199. package/dist/plugins/devices-home-assistant/dto/mapping-preview.dto.js.map +1 -1
  200. package/dist/plugins/devices-home-assistant/mappers/button.entity.mapper.service.d.ts +19 -0
  201. package/dist/plugins/devices-home-assistant/mappers/button.entity.mapper.service.js +51 -0
  202. package/dist/plugins/devices-home-assistant/mappers/button.entity.mapper.service.js.map +1 -0
  203. package/dist/plugins/devices-home-assistant/mappings/definitions/entity-mappings.yaml +56 -7
  204. package/dist/plugins/devices-home-assistant/models/mapping-preview.model.d.ts +1 -0
  205. package/dist/plugins/devices-home-assistant/models/mapping-preview.model.js +11 -0
  206. package/dist/plugins/devices-home-assistant/models/mapping-preview.model.js.map +1 -1
  207. package/dist/plugins/devices-home-assistant/services/device-adoption.service.js +17 -0
  208. package/dist/plugins/devices-home-assistant/services/device-adoption.service.js.map +1 -1
  209. package/dist/plugins/devices-home-assistant/services/ha-mdns-discoverer.service.js +3 -1
  210. package/dist/plugins/devices-home-assistant/services/ha-mdns-discoverer.service.js.map +1 -1
  211. package/dist/plugins/devices-home-assistant/services/home-assistant-raw-event.service.d.ts +27 -0
  212. package/dist/plugins/devices-home-assistant/services/home-assistant-raw-event.service.js +271 -0
  213. package/dist/plugins/devices-home-assistant/services/home-assistant-raw-event.service.js.map +1 -0
  214. package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.d.ts +2 -2
  215. package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.js +33 -14
  216. package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.js.map +1 -1
  217. package/dist/plugins/devices-home-assistant/services/mapping-preview.service.js +24 -4
  218. package/dist/plugins/devices-home-assistant/services/mapping-preview.service.js.map +1 -1
  219. package/dist/plugins/devices-home-assistant/services/state-changed.event.service.d.ts +4 -1
  220. package/dist/plugins/devices-home-assistant/services/state-changed.event.service.js +84 -5
  221. package/dist/plugins/devices-home-assistant/services/state-changed.event.service.js.map +1 -1
  222. package/dist/plugins/devices-home-assistant/services/wizard.service.js +1 -0
  223. package/dist/plugins/devices-home-assistant/services/wizard.service.js.map +1 -1
  224. package/dist/plugins/devices-home-assistant/utils/ha-event.utils.d.ts +2 -0
  225. package/dist/plugins/devices-home-assistant/utils/ha-event.utils.js +50 -0
  226. package/dist/plugins/devices-home-assistant/utils/ha-event.utils.js.map +1 -0
  227. package/dist/plugins/devices-homekit/listeners/homekit-event.listener.d.ts +4 -1
  228. package/dist/plugins/devices-homekit/listeners/homekit-event.listener.js +39 -4
  229. package/dist/plugins/devices-homekit/listeners/homekit-event.listener.js.map +1 -1
  230. package/dist/plugins/devices-homekit/mappers/base.mapper.js +30 -6
  231. package/dist/plugins/devices-homekit/mappers/base.mapper.js.map +1 -1
  232. package/dist/plugins/devices-homekit/mappers/button.mapper.d.ts +15 -0
  233. package/dist/plugins/devices-homekit/mappers/button.mapper.js +143 -0
  234. package/dist/plugins/devices-homekit/mappers/button.mapper.js.map +1 -0
  235. package/dist/plugins/devices-homekit/mappers/characteristic-write.d.ts +2 -0
  236. package/dist/plugins/devices-homekit/mappers/characteristic-write.js +17 -0
  237. package/dist/plugins/devices-homekit/mappers/characteristic-write.js.map +1 -0
  238. package/dist/plugins/devices-homekit/mappers/homekit-mapper.interface.d.ts +17 -1
  239. package/dist/plugins/devices-homekit/mappers/thermostat-coordinator.d.ts +7 -0
  240. package/dist/plugins/devices-homekit/mappers/thermostat-coordinator.js +96 -84
  241. package/dist/plugins/devices-homekit/mappers/thermostat-coordinator.js.map +1 -1
  242. package/dist/plugins/devices-homekit/services/homekit-bridge.service.js +2 -0
  243. package/dist/plugins/devices-homekit/services/homekit-bridge.service.js.map +1 -1
  244. package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.d.ts +5 -1
  245. package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.js +42 -0
  246. package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.js.map +1 -1
  247. package/dist/plugins/devices-homekit/utils/ciao-receive-guard.d.ts +1 -0
  248. package/dist/plugins/devices-homekit/utils/ciao-receive-guard.js +36 -0
  249. package/dist/plugins/devices-homekit/utils/ciao-receive-guard.js.map +1 -0
  250. package/dist/plugins/devices-homey/mappings/definitions/channels.yaml +50 -0
  251. package/dist/plugins/devices-homey/mappings/definitions/devices.yaml +18 -0
  252. package/dist/plugins/devices-homey/mappings/definitions/properties.yaml +55 -0
  253. package/dist/plugins/devices-homey/mappings/device-support.js +10 -0
  254. package/dist/plugins/devices-homey/mappings/device-support.js.map +1 -1
  255. package/dist/plugins/devices-homey/mappings/mapping-loader.service.d.ts +1 -0
  256. package/dist/plugins/devices-homey/mappings/mapping-loader.service.js +66 -8
  257. package/dist/plugins/devices-homey/mappings/mapping-loader.service.js.map +1 -1
  258. package/dist/plugins/devices-homey/models/inventory.model.d.ts +2 -1
  259. package/dist/plugins/devices-homey/models/inventory.model.js +1 -0
  260. package/dist/plugins/devices-homey/models/inventory.model.js.map +1 -1
  261. package/dist/plugins/devices-homey/models/mapping-preview.model.d.ts +1 -0
  262. package/dist/plugins/devices-homey/models/mapping-preview.model.js +1 -0
  263. package/dist/plugins/devices-homey/models/mapping-preview.model.js.map +1 -1
  264. package/dist/plugins/devices-homey/services/homey-mapping-preview.service.js +7 -0
  265. package/dist/plugins/devices-homey/services/homey-mapping-preview.service.js.map +1 -1
  266. package/dist/plugins/devices-homey/services/homey-synchronizer.service.d.ts +3 -1
  267. package/dist/plugins/devices-homey/services/homey-synchronizer.service.js +37 -6
  268. package/dist/plugins/devices-homey/services/homey-synchronizer.service.js.map +1 -1
  269. package/dist/plugins/devices-reterminal/services/reterminal-button.service.d.ts +7 -3
  270. package/dist/plugins/devices-reterminal/services/reterminal-button.service.js +63 -17
  271. package/dist/plugins/devices-reterminal/services/reterminal-button.service.js.map +1 -1
  272. package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.d.ts +36 -3
  273. package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.js +707 -42
  274. package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.js.map +1 -1
  275. package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.d.ts +11 -1
  276. package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.js +100 -10
  277. package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.js.map +1 -1
  278. package/dist/plugins/devices-shelly-ng/devices-shelly-ng.constants.js +3 -2
  279. package/dist/plugins/devices-shelly-ng/devices-shelly-ng.constants.js.map +1 -1
  280. package/dist/plugins/devices-shelly-ng/devices-shelly-ng.plugin.js +2 -0
  281. package/dist/plugins/devices-shelly-ng/devices-shelly-ng.plugin.js.map +1 -1
  282. package/dist/plugins/devices-shelly-ng/mappings/definitions/inputs.yaml +80 -0
  283. package/dist/plugins/devices-shelly-ng/mappings/mapping-loader.service.js +7 -1
  284. package/dist/plugins/devices-shelly-ng/mappings/mapping-loader.service.js.map +1 -1
  285. package/dist/plugins/devices-shelly-ng/mappings/mapping.types.d.ts +6 -3
  286. package/dist/plugins/devices-shelly-ng/mappings/schema/mapping-schema.json +5 -0
  287. package/dist/plugins/devices-shelly-ng/services/device-manager.service.js +153 -8
  288. package/dist/plugins/devices-shelly-ng/services/device-manager.service.js.map +1 -1
  289. package/dist/plugins/devices-shelly-ng/services/poll-placement-diagnostics.service.d.ts +51 -0
  290. package/dist/plugins/devices-shelly-ng/services/poll-placement-diagnostics.service.js +549 -0
  291. package/dist/plugins/devices-shelly-ng/services/poll-placement-diagnostics.service.js.map +1 -0
  292. package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.d.ts +15 -2
  293. package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.js +140 -35
  294. package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.js.map +1 -1
  295. package/dist/plugins/devices-shelly-ng/services/shelly-rpc-client.service.js +3 -0
  296. package/dist/plugins/devices-shelly-ng/services/shelly-rpc-client.service.js.map +1 -1
  297. package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.d.ts +1 -0
  298. package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.js +14 -4
  299. package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.js.map +1 -1
  300. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.constants.d.ts +2 -0
  301. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.constants.js +66 -4
  302. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.constants.js.map +1 -1
  303. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.plugin.js +2 -0
  304. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.plugin.js.map +1 -1
  305. package/dist/plugins/devices-shelly-v1/platforms/shelly-v1.device.platform.js +7 -0
  306. package/dist/plugins/devices-shelly-v1/platforms/shelly-v1.device.platform.js.map +1 -1
  307. package/dist/plugins/devices-shelly-v1/services/device-mapper.service.d.ts +3 -1
  308. package/dist/plugins/devices-shelly-v1/services/device-mapper.service.js +20 -2
  309. package/dist/plugins/devices-shelly-v1/services/device-mapper.service.js.map +1 -1
  310. package/dist/plugins/devices-shelly-v1/services/shelly-v1-input-tracker.service.d.ts +16 -0
  311. package/dist/plugins/devices-shelly-v1/services/shelly-v1-input-tracker.service.js +107 -0
  312. package/dist/plugins/devices-shelly-v1/services/shelly-v1-input-tracker.service.js.map +1 -0
  313. package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.d.ts +7 -1
  314. package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.js +98 -3
  315. package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.js.map +1 -1
  316. package/dist/plugins/devices-third-party/controllers/third-party-inputs.controller.d.ts +17 -0
  317. package/dist/plugins/devices-third-party/controllers/third-party-inputs.controller.js +205 -0
  318. package/dist/plugins/devices-third-party/controllers/third-party-inputs.controller.js.map +1 -0
  319. package/dist/plugins/devices-third-party/devices-third-party.openapi.d.ts +1 -1
  320. package/dist/plugins/devices-third-party/devices-third-party.plugin.js +2 -1
  321. package/dist/plugins/devices-third-party/devices-third-party.plugin.js.map +1 -1
  322. package/dist/plugins/devices-third-party/dto/report-input-occurrence-response.dto.d.ts +5 -0
  323. package/dist/plugins/devices-third-party/dto/report-input-occurrence-response.dto.js +50 -0
  324. package/dist/plugins/devices-third-party/dto/report-input-occurrence-response.dto.js.map +1 -0
  325. package/dist/plugins/devices-third-party/dto/report-input-occurrence.dto.d.ts +8 -0
  326. package/dist/plugins/devices-third-party/dto/report-input-occurrence.dto.js +81 -0
  327. package/dist/plugins/devices-third-party/dto/report-input-occurrence.dto.js.map +1 -0
  328. package/dist/plugins/devices-third-party/platforms/third-party-device.platform.js +19 -4
  329. package/dist/plugins/devices-third-party/platforms/third-party-device.platform.js.map +1 -1
  330. package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.d.ts +2 -0
  331. package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.js +57 -0
  332. package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.js.map +1 -1
  333. package/dist/plugins/devices-virtual/platforms/virtual-device.platform.d.ts +3 -8
  334. package/dist/plugins/devices-virtual/platforms/virtual-device.platform.js +6 -31
  335. package/dist/plugins/devices-virtual/platforms/virtual-device.platform.js.map +1 -1
  336. package/dist/plugins/devices-wled/services/wled-mdns-discoverer.service.js +3 -1
  337. package/dist/plugins/devices-wled/services/wled-mdns-discoverer.service.js.map +1 -1
  338. package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.constants.d.ts +3 -0
  339. package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.constants.js +41 -5
  340. package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.constants.js.map +1 -1
  341. package/dist/plugins/devices-zigbee2mqtt/interfaces/zigbee2mqtt.interface.d.ts +7 -1
  342. package/dist/plugins/devices-zigbee2mqtt/mappings/config-driven.converter.js +16 -15
  343. package/dist/plugins/devices-zigbee2mqtt/mappings/config-driven.converter.js.map +1 -1
  344. package/dist/plugins/devices-zigbee2mqtt/mappings/definitions/remotes.yaml +505 -74
  345. package/dist/plugins/devices-zigbee2mqtt/mappings/schema/mapping-schema.json +3 -3
  346. package/dist/plugins/devices-zigbee2mqtt/mappings/transformers/transformer.types.d.ts +1 -1
  347. package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.d.ts +8 -2
  348. package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.js +6 -5
  349. package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.js.map +1 -1
  350. package/dist/plugins/devices-zigbee2mqtt/services/device-adoption.service.js +18 -11
  351. package/dist/plugins/devices-zigbee2mqtt/services/device-adoption.service.js.map +1 -1
  352. package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.d.ts +9 -3
  353. package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.js +166 -3
  354. package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.js.map +1 -1
  355. package/dist/plugins/devices-zigbee2mqtt/services/mqtt-client-adapter.service.js +5 -2
  356. package/dist/plugins/devices-zigbee2mqtt/services/mqtt-client-adapter.service.js.map +1 -1
  357. package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.d.ts +1 -0
  358. package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.js +44 -4
  359. package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.js.map +1 -1
  360. package/dist/plugins/influx-v1/services/influx-v1-managed.service.js +2 -2
  361. package/dist/plugins/influx-v1/services/influx-v1-managed.service.js.map +1 -1
  362. package/dist/plugins/influx-v2/services/influx-v2-managed.service.js +2 -2
  363. package/dist/plugins/influx-v2/services/influx-v2-managed.service.js.map +1 -1
  364. package/dist/plugins/memory-storage/services/memory-storage-managed.service.js +2 -2
  365. package/dist/plugins/memory-storage/services/memory-storage-managed.service.js.map +1 -1
  366. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/setup.controller.d.ts +19 -0
  367. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/setup.controller.js +159 -0
  368. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/setup.controller.js.map +1 -0
  369. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/status.controller.d.ts +13 -0
  370. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/status.controller.js +99 -0
  371. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/status.controller.js.map +1 -0
  372. package/dist/plugins/remote-access-cloudflare-tunnel/dto/update-config.dto.d.ts +9 -0
  373. package/dist/plugins/remote-access-cloudflare-tunnel/dto/update-config.dto.js +94 -0
  374. package/dist/plugins/remote-access-cloudflare-tunnel/dto/update-config.dto.js.map +1 -0
  375. package/dist/plugins/remote-access-cloudflare-tunnel/models/config.model.d.ts +9 -0
  376. package/dist/plugins/remote-access-cloudflare-tunnel/models/config.model.js +92 -0
  377. package/dist/plugins/remote-access-cloudflare-tunnel/models/config.model.js.map +1 -0
  378. package/dist/plugins/remote-access-cloudflare-tunnel/models/install.model.d.ts +7 -0
  379. package/dist/plugins/remote-access-cloudflare-tunnel/models/install.model.js +48 -0
  380. package/dist/plugins/remote-access-cloudflare-tunnel/models/install.model.js.map +1 -0
  381. package/dist/plugins/remote-access-cloudflare-tunnel/models/status.model.d.ts +44 -0
  382. package/dist/plugins/remote-access-cloudflare-tunnel/models/status.model.js +369 -0
  383. package/dist/plugins/remote-access-cloudflare-tunnel/models/status.model.js.map +1 -0
  384. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.constants.d.ts +24 -0
  385. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.constants.js +27 -0
  386. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.constants.js.map +1 -0
  387. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.exceptions.d.ts +8 -0
  388. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.exceptions.js +19 -0
  389. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.exceptions.js.map +1 -0
  390. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.openapi.d.ts +4 -0
  391. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.openapi.js +20 -0
  392. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.openapi.js.map +1 -0
  393. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.plugin.d.ts +21 -0
  394. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.plugin.js +135 -0
  395. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.plugin.js.map +1 -0
  396. package/dist/plugins/remote-access-cloudflare-tunnel/scripts/cloudflared-setup.sh +185 -0
  397. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-managed.service.d.ts +100 -0
  398. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-managed.service.js +564 -0
  399. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-managed.service.js.map +1 -0
  400. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-provider.service.d.ts +22 -0
  401. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-provider.service.js +43 -0
  402. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-provider.service.js.map +1 -0
  403. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-setup.service.d.ts +38 -0
  404. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-setup.service.js +147 -0
  405. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-setup.service.js.map +1 -0
  406. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-cli.service.d.ts +15 -0
  407. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-cli.service.js +55 -0
  408. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-cli.service.js.map +1 -0
  409. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-metrics.service.d.ts +8 -0
  410. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-metrics.service.js +49 -0
  411. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-metrics.service.js.map +1 -0
  412. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-process.service.d.ts +27 -0
  413. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-process.service.js +139 -0
  414. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-process.service.js.map +1 -0
  415. package/dist/plugins/remote-access-tailscale/controllers/setup.controller.d.ts +11 -6
  416. package/dist/plugins/remote-access-tailscale/controllers/setup.controller.js +115 -25
  417. package/dist/plugins/remote-access-tailscale/controllers/setup.controller.js.map +1 -1
  418. package/dist/plugins/remote-access-tailscale/controllers/status.controller.d.ts +6 -5
  419. package/dist/plugins/remote-access-tailscale/controllers/status.controller.js +26 -16
  420. package/dist/plugins/remote-access-tailscale/controllers/status.controller.js.map +1 -1
  421. package/dist/plugins/remote-access-tailscale/models/status.model.d.ts +16 -0
  422. package/dist/plugins/remote-access-tailscale/models/status.model.js +100 -1
  423. package/dist/plugins/remote-access-tailscale/models/status.model.js.map +1 -1
  424. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.constants.d.ts +3 -0
  425. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.constants.js +4 -1
  426. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.constants.js.map +1 -1
  427. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.exceptions.d.ts +17 -1
  428. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.exceptions.js +33 -1
  429. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.exceptions.js.map +1 -1
  430. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.openapi.d.ts +2 -2
  431. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.openapi.js +1 -0
  432. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.openapi.js.map +1 -1
  433. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.plugin.js +3 -1
  434. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.plugin.js.map +1 -1
  435. package/dist/plugins/remote-access-tailscale/services/tailscale-cli.service.d.ts +8 -4
  436. package/dist/plugins/remote-access-tailscale/services/tailscale-cli.service.js +58 -14
  437. package/dist/plugins/remote-access-tailscale/services/tailscale-cli.service.js.map +1 -1
  438. package/dist/plugins/remote-access-tailscale/services/tailscale-login.service.d.ts +8 -3
  439. package/dist/plugins/remote-access-tailscale/services/tailscale-login.service.js +175 -151
  440. package/dist/plugins/remote-access-tailscale/services/tailscale-login.service.js.map +1 -1
  441. package/dist/plugins/remote-access-tailscale/services/tailscale-node-managed.service.d.ts +54 -7
  442. package/dist/plugins/remote-access-tailscale/services/tailscale-node-managed.service.js +528 -109
  443. package/dist/plugins/remote-access-tailscale/services/tailscale-node-managed.service.js.map +1 -1
  444. package/dist/plugins/remote-access-tailscale/services/tailscale-operation-coordinator.service.d.ts +33 -0
  445. package/dist/plugins/remote-access-tailscale/services/tailscale-operation-coordinator.service.js +167 -0
  446. package/dist/plugins/remote-access-tailscale/services/tailscale-operation-coordinator.service.js.map +1 -0
  447. package/dist/plugins/remote-access-tailscale/services/tailscale-provider.service.d.ts +13 -1
  448. package/dist/plugins/remote-access-tailscale/services/tailscale-provider.service.js +8 -2
  449. package/dist/plugins/remote-access-tailscale/services/tailscale-provider.service.js.map +1 -1
  450. package/dist/plugins/remote-access-tailscale/services/tailscale-serve.service.d.ts +1 -1
  451. package/dist/plugins/remote-access-tailscale/services/tailscale-serve.service.js +7 -6
  452. package/dist/plugins/remote-access-tailscale/services/tailscale-serve.service.js.map +1 -1
  453. package/dist/plugins/remote-access-tailscale/services/tailscale-setup.service.d.ts +1 -3
  454. package/dist/plugins/remote-access-tailscale/services/tailscale-setup.service.js +9 -11
  455. package/dist/plugins/remote-access-tailscale/services/tailscale-setup.service.js.map +1 -1
  456. package/dist/plugins/remote-access-tailscale/utils/tailscale-control.utils.d.ts +5 -0
  457. package/dist/plugins/remote-access-tailscale/utils/tailscale-control.utils.js +36 -0
  458. package/dist/plugins/remote-access-tailscale/utils/tailscale-control.utils.js.map +1 -0
  459. package/dist/plugins/scenes-local/platforms/local-scene.platform.d.ts +3 -1
  460. package/dist/plugins/scenes-local/platforms/local-scene.platform.js +12 -7
  461. package/dist/plugins/scenes-local/platforms/local-scene.platform.js.map +1 -1
  462. package/dist/plugins/simulator/controllers/simulator.controller.d.ts +8 -2
  463. package/dist/plugins/simulator/controllers/simulator.controller.js +102 -2
  464. package/dist/plugins/simulator/controllers/simulator.controller.js.map +1 -1
  465. package/dist/plugins/simulator/dto/simulate-occurrence.dto.d.ts +12 -0
  466. package/dist/plugins/simulator/dto/simulate-occurrence.dto.js +122 -0
  467. package/dist/plugins/simulator/dto/simulate-occurrence.dto.js.map +1 -0
  468. package/dist/plugins/simulator/models/simulator-response.model.d.ts +12 -0
  469. package/dist/plugins/simulator/models/simulator-response.model.js +84 -1
  470. package/dist/plugins/simulator/models/simulator-response.model.js.map +1 -1
  471. package/dist/plugins/simulator/scenarios/definitions/small-apartment.yaml +78 -0
  472. package/dist/plugins/simulator/services/scenario-executor.service.js +3 -1
  473. package/dist/plugins/simulator/services/scenario-executor.service.js.map +1 -1
  474. package/dist/plugins/simulator/services/simulation.service.js +10 -1
  475. package/dist/plugins/simulator/services/simulation.service.js.map +1 -1
  476. package/dist/plugins/simulator/simulator.openapi.d.ts +3 -2
  477. package/dist/plugins/simulator/simulator.openapi.js +5 -0
  478. package/dist/plugins/simulator/simulator.openapi.js.map +1 -1
  479. package/dist/plugins/simulator/simulators/device-simulator.interface.d.ts +2 -0
  480. package/dist/plugins/simulator/simulators/device-simulator.interface.js +83 -0
  481. package/dist/plugins/simulator/simulators/device-simulator.interface.js.map +1 -1
  482. package/dist/plugins/simulator/simulators/index.d.ts +1 -0
  483. package/dist/plugins/simulator/simulators/index.js +1 -0
  484. package/dist/plugins/simulator/simulators/index.js.map +1 -1
  485. package/dist/plugins/simulator/simulators/input-controller.simulator.d.ts +10 -0
  486. package/dist/plugins/simulator/simulators/input-controller.simulator.js +57 -0
  487. package/dist/plugins/simulator/simulators/input-controller.simulator.js.map +1 -0
  488. package/dist/plugins/simulator/simulators/lighting.simulator.js +1 -0
  489. package/dist/plugins/simulator/simulators/lighting.simulator.js.map +1 -1
  490. package/dist/plugins/spaces-home-control/listeners/space-activity.listener.d.ts +6 -7
  491. package/dist/plugins/spaces-home-control/listeners/space-activity.listener.js +19 -44
  492. package/dist/plugins/spaces-home-control/listeners/space-activity.listener.js.map +1 -1
  493. package/dist/plugins/spaces-home-control/listeners/space-climate-state.listener.d.ts +4 -4
  494. package/dist/plugins/spaces-home-control/listeners/space-climate-state.listener.js +9 -22
  495. package/dist/plugins/spaces-home-control/listeners/space-climate-state.listener.js.map +1 -1
  496. package/dist/plugins/spaces-home-control/listeners/space-lighting-state.listener.d.ts +4 -4
  497. package/dist/plugins/spaces-home-control/listeners/space-lighting-state.listener.js +9 -22
  498. package/dist/plugins/spaces-home-control/listeners/space-lighting-state.listener.js.map +1 -1
  499. package/dist/plugins/spaces-home-control/listeners/space-sensor-state.listener.d.ts +4 -4
  500. package/dist/plugins/spaces-home-control/listeners/space-sensor-state.listener.js +9 -22
  501. package/dist/plugins/spaces-home-control/listeners/space-sensor-state.listener.js.map +1 -1
  502. package/dist/plugins/spaces-home-control/services/climate-intent.service.d.ts +3 -1
  503. package/dist/plugins/spaces-home-control/services/climate-intent.service.js +6 -3
  504. package/dist/plugins/spaces-home-control/services/climate-intent.service.js.map +1 -1
  505. package/dist/plugins/spaces-home-control/services/covers-intent.service.d.ts +3 -1
  506. package/dist/plugins/spaces-home-control/services/covers-intent.service.js +6 -3
  507. package/dist/plugins/spaces-home-control/services/covers-intent.service.js.map +1 -1
  508. package/dist/plugins/spaces-home-control/services/lighting-intent.service.d.ts +3 -1
  509. package/dist/plugins/spaces-home-control/services/lighting-intent.service.js +7 -4
  510. package/dist/plugins/spaces-home-control/services/lighting-intent.service.js.map +1 -1
  511. package/dist/plugins/spaces-home-control/services/space-climate-state.service.d.ts +3 -5
  512. package/dist/plugins/spaces-home-control/services/space-climate-state.service.js +9 -12
  513. package/dist/plugins/spaces-home-control/services/space-climate-state.service.js.map +1 -1
  514. package/dist/plugins/spaces-home-control/services/space-lighting-state.service.d.ts +3 -5
  515. package/dist/plugins/spaces-home-control/services/space-lighting-state.service.js +7 -10
  516. package/dist/plugins/spaces-home-control/services/space-lighting-state.service.js.map +1 -1
  517. package/dist/plugins/spaces-home-control/services/space-media-activity.service.d.ts +3 -1
  518. package/dist/plugins/spaces-home-control/services/space-media-activity.service.js +11 -5
  519. package/dist/plugins/spaces-home-control/services/space-media-activity.service.js.map +1 -1
  520. package/dist/plugins/spaces-home-control/services/space-sensor-state.service.d.ts +3 -5
  521. package/dist/plugins/spaces-home-control/services/space-sensor-state.service.js +7 -10
  522. package/dist/plugins/spaces-home-control/services/space-sensor-state.service.js.map +1 -1
  523. package/dist/plugins/spaces-home-control/services/space-state-read.service.d.ts +47 -0
  524. package/dist/plugins/spaces-home-control/services/space-state-read.service.js +262 -0
  525. package/dist/plugins/spaces-home-control/services/space-state-read.service.js.map +1 -0
  526. package/dist/plugins/spaces-home-control/services/space-undo-history.service.d.ts +3 -1
  527. package/dist/plugins/spaces-home-control/services/space-undo-history.service.js +8 -5
  528. package/dist/plugins/spaces-home-control/services/space-undo-history.service.js.map +1 -1
  529. package/dist/plugins/spaces-home-control/spaces-home-control.plugin.js +4 -0
  530. package/dist/plugins/spaces-home-control/spaces-home-control.plugin.js.map +1 -1
  531. package/dist/spec/channels.d.ts +51 -1
  532. package/dist/spec/channels.js +64 -1
  533. package/dist/spec/channels.js.map +1 -1
  534. package/dist/spec/devices.d.ts +155 -2
  535. package/dist/spec/devices.js +161 -2
  536. package/dist/spec/devices.js.map +1 -1
  537. package/dist/tsconfig.build.tsbuildinfo +1 -1
  538. package/package.json +4 -4
@@ -0,0 +1,202 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.TokenMetadataService = exports.tokenMetadataCapacity = void 0;
16
+ const typeorm_1 = require("typeorm");
17
+ const common_1 = require("@nestjs/common");
18
+ const config_1 = require("@nestjs/config");
19
+ const config_utils_1 = require("../../../common/utils/config.utils");
20
+ const users_entity_1 = require("../../users/entities/users.entity");
21
+ const auth_entity_1 = require("../entities/auth.entity");
22
+ exports.tokenMetadataCapacity = 1_000;
23
+ let TokenMetadataService = class TokenMetadataService {
24
+ constructor(dataSource, config = new config_1.ConfigService()) {
25
+ this.dataSource = dataSource;
26
+ this.tokens = new Map();
27
+ this.loading = new Map();
28
+ this.dirtyTransactions = new Set();
29
+ this.generation = 0;
30
+ this.stopped = false;
31
+ this.enabled = !(0, config_utils_1.getEnvValue)(config, 'FB_PROPERTY_VALUE_LOCKS_ENABLED', false);
32
+ dataSource.subscribers.push(this);
33
+ }
34
+ async findByHash(hash) {
35
+ const entry = await this.findCached(`long-lived:${hash}`, async () => {
36
+ const facts = await this.query(hash);
37
+ return facts ? { kind: 'long-lived', facts } : null;
38
+ });
39
+ return entry?.kind === 'long-lived' ? entry.facts : null;
40
+ }
41
+ async findAccessToken(ownerId, hash) {
42
+ const entry = await this.findCached(JSON.stringify(['access', ownerId, hash]), async () => {
43
+ const token = await this.dataSource
44
+ .getRepository(auth_entity_1.AccessTokenEntity)
45
+ .createQueryBuilder('token')
46
+ .leftJoinAndSelect('token.owner', 'owner')
47
+ .leftJoinAndSelect('token.children', 'children')
48
+ .select([
49
+ 'token.id',
50
+ 'token.revoked',
51
+ 'token.expiresAt',
52
+ 'owner.id',
53
+ 'owner.role',
54
+ 'children.id',
55
+ 'children.revoked',
56
+ ])
57
+ .where('owner.id = :ownerId', { ownerId })
58
+ .andWhere('token.hashedToken = :hash', { hash })
59
+ .getOne();
60
+ if (!token)
61
+ return null;
62
+ return {
63
+ kind: 'access',
64
+ facts: {
65
+ id: token.id,
66
+ revoked: token.revoked,
67
+ expiresAt: token.expiresAt,
68
+ owner: token.owner ? { id: token.owner.id, role: token.owner.role } : null,
69
+ refreshRevoked: token.revoked || token.refreshToken.revoked,
70
+ },
71
+ };
72
+ });
73
+ return entry?.kind === 'access' ? entry.facts : null;
74
+ }
75
+ async findCached(key, query) {
76
+ while (true) {
77
+ if (!this.enabled || this.stopped || this.dirtyTransactions.size > 0)
78
+ return query();
79
+ const cached = this.tokens.get(key);
80
+ if (cached) {
81
+ this.tokens.delete(key);
82
+ if (!cached.facts.expiresAt || cached.facts.expiresAt.getTime() >= Date.now())
83
+ this.tokens.set(key, cached);
84
+ return this.copy(cached);
85
+ }
86
+ const generation = this.generation;
87
+ let pending = this.loading.get(key);
88
+ if (!pending || pending.generation !== generation) {
89
+ if (!pending && this.loading.size >= exports.tokenMetadataCapacity)
90
+ return query();
91
+ pending = { generation, promise: query() };
92
+ this.loading.set(key, pending);
93
+ }
94
+ try {
95
+ const token = await pending.promise;
96
+ if (generation !== this.generation)
97
+ continue;
98
+ if (token &&
99
+ !token.facts.revoked &&
100
+ (token.kind !== 'access' || !token.facts.refreshRevoked) &&
101
+ (!token.facts.expiresAt || token.facts.expiresAt.getTime() >= Date.now()) &&
102
+ !this.stopped &&
103
+ this.dirtyTransactions.size === 0) {
104
+ if (!this.tokens.has(key) && this.tokens.size >= exports.tokenMetadataCapacity) {
105
+ const oldest = this.tokens.keys().next().value;
106
+ if (typeof oldest === 'string')
107
+ this.tokens.delete(oldest);
108
+ }
109
+ this.tokens.set(key, token);
110
+ }
111
+ return token ? this.copy(token) : null;
112
+ }
113
+ finally {
114
+ if (this.loading.get(key) === pending)
115
+ this.loading.delete(key);
116
+ }
117
+ }
118
+ }
119
+ invalidate() {
120
+ this.generation++;
121
+ this.tokens.clear();
122
+ }
123
+ beforeInsert(event) {
124
+ this.mutation(event);
125
+ }
126
+ afterInsert(event) {
127
+ this.mutation(event);
128
+ }
129
+ beforeRemove(event) {
130
+ this.mutation(event);
131
+ }
132
+ afterRemove(event) {
133
+ this.mutation(event);
134
+ }
135
+ beforeUpdate(event) {
136
+ if (!this.isUsageOnly(event))
137
+ this.mutation(event);
138
+ }
139
+ afterUpdate(event) {
140
+ if (!this.isUsageOnly(event))
141
+ this.mutation(event);
142
+ }
143
+ afterTransactionCommit(event) {
144
+ this.settled(event.queryRunner);
145
+ }
146
+ afterTransactionRollback(event) {
147
+ this.settled(event.queryRunner);
148
+ }
149
+ onModuleDestroy() {
150
+ this.stopped = true;
151
+ const index = this.dataSource.subscribers.indexOf(this);
152
+ if (index >= 0)
153
+ this.dataSource.subscribers.splice(index, 1);
154
+ this.invalidate();
155
+ this.dirtyTransactions.clear();
156
+ }
157
+ mutation(event) {
158
+ if (!event.metadata.inheritanceTree.some((type) => type === auth_entity_1.TokenEntity || type === users_entity_1.UserEntity))
159
+ return;
160
+ if (event.queryRunner.isTransactionActive)
161
+ this.dirtyTransactions.add(event.queryRunner);
162
+ this.invalidate();
163
+ }
164
+ settled(runner) {
165
+ if (!this.dirtyTransactions.has(runner))
166
+ return;
167
+ this.invalidate();
168
+ if (!runner.isTransactionActive)
169
+ this.dirtyTransactions.delete(runner);
170
+ }
171
+ isUsageOnly(event) {
172
+ const keys = Object.keys(event.entity ?? {});
173
+ return (event.metadata.inheritanceTree.includes(auth_entity_1.LongLiveTokenEntity) && keys.length === 1 && keys[0] === 'lastUsedAt');
174
+ }
175
+ async query(hash) {
176
+ const token = await this.dataSource.getRepository(auth_entity_1.LongLiveTokenEntity).findOne({
177
+ select: { id: true, hashedToken: true, ownerType: true, tokenOwnerId: true, revoked: true, expiresAt: true },
178
+ where: { hashedToken: hash },
179
+ });
180
+ return token
181
+ ? {
182
+ id: token.id,
183
+ hashedToken: token.hashedToken,
184
+ ownerType: token.ownerType,
185
+ ownerId: token.ownerId,
186
+ revoked: token.revoked,
187
+ expiresAt: token.expiresAt,
188
+ }
189
+ : null;
190
+ }
191
+ copy(token) {
192
+ return structuredClone(token);
193
+ }
194
+ };
195
+ exports.TokenMetadataService = TokenMetadataService;
196
+ exports.TokenMetadataService = TokenMetadataService = __decorate([
197
+ (0, common_1.Injectable)(),
198
+ __param(1, (0, common_1.Optional)()),
199
+ __metadata("design:paramtypes", [typeorm_1.DataSource,
200
+ config_1.ConfigService])
201
+ ], TokenMetadataService);
202
+ //# sourceMappingURL=token-metadata.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-metadata.service.js","sourceRoot":"","sources":["../../../../src/modules/auth/services/token-metadata.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qCASiB;AAEjB,2CAAuE;AACvE,2CAA+C;AAE/C,qEAAiE;AACjE,oEAA+D;AAC/D,yDAA8F;AAcjF,QAAA,qBAAqB,GAAG,KAAK,CAAC;AAUpC,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAQhC,YACkB,UAAsB,EAC3B,SAAwB,IAAI,sBAAa,EAAE;QADtC,eAAU,GAAV,UAAU,CAAY;QAPvB,WAAM,GAAG,IAAI,GAAG,EAAuB,CAAC;QACxC,YAAO,GAAG,IAAI,GAAG,EAAwB,CAAC;QAC1C,sBAAiB,GAAG,IAAI,GAAG,EAAe,CAAC;QACpD,eAAU,GAAG,CAAC,CAAC;QACf,YAAO,GAAG,KAAK,CAAC;QAMvB,IAAI,CAAC,OAAO,GAAG,CAAC,IAAA,0BAAW,EAAU,MAAM,EAAE,iCAAiC,EAAE,KAAK,CAAC,CAAC;QACvF,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAGD,KAAK,CAAC,UAAU,CAAC,IAAY;QAC5B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,cAAc,IAAI,EAAE,EAAE,KAAK,IAAI,EAAE;YACpE,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;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AAY;QAC/B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,iCAAmB,CAAC,CAAC,OAAO,CAAC;YAC9E,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE;YAC5G,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;SAC5B,CAAC,CAAC;QACH,OAAO,KAAK;YACX,CAAC,CAAC;gBACA,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,WAAW,EAAE,KAAK,CAAC,WAAW;gBAC9B,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,SAAS,EAAE,KAAK,CAAC,SAAS;aAC1B;YACF,CAAC,CAAC,IAAI,CAAC;IACT,CAAC;IAEO,IAAI,CAAC,KAAkB;QAE9B,OAAO,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACD,CAAA;AAvLY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,mBAAU,GAAE;IAWV,WAAA,IAAA,iBAAQ,GAAE,CAAA;qCADkB,oBAAU;QACnB,sBAAa;GAVtB,oBAAoB,CAuLhC"}
@@ -0,0 +1,22 @@
1
+ import { DataSource } from 'typeorm';
2
+ import { BeforeApplicationShutdown, OnModuleInit } from '@nestjs/common';
3
+ import { LongLiveTokenEntity } from '../entities/auth.entity';
4
+ export declare const tokenUsageFlushIntervalMs = 60000;
5
+ export declare const tokenUsageMaxPending = 1000;
6
+ type TokenIdentity = Pick<LongLiveTokenEntity, 'id' | 'hashedToken'>;
7
+ export declare class TokenUsageService implements OnModuleInit, BeforeApplicationShutdown {
8
+ private readonly dataSource;
9
+ private readonly logger;
10
+ private readonly pending;
11
+ private timer?;
12
+ private inFlight?;
13
+ private stopping;
14
+ private dropped;
15
+ constructor(dataSource: DataSource);
16
+ onModuleInit(): void;
17
+ record(token: TokenIdentity): void;
18
+ flush(): Promise<void>;
19
+ beforeApplicationShutdown(): Promise<void>;
20
+ private persist;
21
+ }
22
+ export {};
@@ -0,0 +1,93 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.TokenUsageService = exports.tokenUsageMaxPending = exports.tokenUsageFlushIntervalMs = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const common_1 = require("@nestjs/common");
15
+ const logger_1 = require("../../../common/logger");
16
+ const auth_constants_1 = require("../auth.constants");
17
+ const auth_entity_1 = require("../entities/auth.entity");
18
+ exports.tokenUsageFlushIntervalMs = 60_000;
19
+ exports.tokenUsageMaxPending = 1_000;
20
+ let TokenUsageService = class TokenUsageService {
21
+ constructor(dataSource) {
22
+ this.dataSource = dataSource;
23
+ this.logger = (0, logger_1.createExtensionLogger)(auth_constants_1.AUTH_MODULE_NAME, 'TokenUsageService');
24
+ this.pending = new Map();
25
+ this.stopping = false;
26
+ this.dropped = 0;
27
+ }
28
+ onModuleInit() {
29
+ this.timer = setInterval(() => void this.flush(), exports.tokenUsageFlushIntervalMs);
30
+ this.timer.unref();
31
+ }
32
+ record(token) {
33
+ if (this.stopping)
34
+ return;
35
+ const key = `${token.id}:${token.hashedToken}`;
36
+ const previous = this.pending.get(key);
37
+ if (!previous && this.pending.size >= exports.tokenUsageMaxPending) {
38
+ this.dropped++;
39
+ return;
40
+ }
41
+ this.pending.set(key, {
42
+ id: token.id,
43
+ hashedToken: token.hashedToken,
44
+ lastUsedAt: new Date(Math.max(Date.now(), previous?.lastUsedAt.getTime() ?? 0)),
45
+ });
46
+ }
47
+ flush() {
48
+ if (this.inFlight !== undefined)
49
+ return this.inFlight;
50
+ if (this.pending.size === 0)
51
+ return Promise.resolve();
52
+ const batch = [...this.pending.values()];
53
+ this.pending.clear();
54
+ if (this.dropped > 0) {
55
+ this.logger.warn(`Dropped ${this.dropped} token usage observations because the telemetry queue was full`);
56
+ this.dropped = 0;
57
+ }
58
+ this.inFlight = this.persist(batch).finally(() => {
59
+ this.inFlight = undefined;
60
+ });
61
+ return this.inFlight;
62
+ }
63
+ async beforeApplicationShutdown() {
64
+ this.stopping = true;
65
+ if (this.timer)
66
+ clearInterval(this.timer);
67
+ await this.flush();
68
+ await this.flush();
69
+ }
70
+ async persist(batch) {
71
+ let failures = 0;
72
+ for (const { id, hashedToken, lastUsedAt } of batch) {
73
+ try {
74
+ const identity = { id, hashedToken, revoked: false };
75
+ await this.dataSource.getRepository(auth_entity_1.LongLiveTokenEntity).update([
76
+ { ...identity, lastUsedAt: (0, typeorm_1.IsNull)() },
77
+ { ...identity, lastUsedAt: (0, typeorm_1.LessThan)(lastUsedAt) },
78
+ ], { lastUsedAt });
79
+ }
80
+ catch {
81
+ failures++;
82
+ }
83
+ }
84
+ if (failures > 0)
85
+ this.logger.warn(`Failed to persist ${failures} token usage observations`);
86
+ }
87
+ };
88
+ exports.TokenUsageService = TokenUsageService;
89
+ exports.TokenUsageService = TokenUsageService = __decorate([
90
+ (0, common_1.Injectable)(),
91
+ __metadata("design:paramtypes", [typeorm_1.DataSource])
92
+ ], TokenUsageService);
93
+ //# sourceMappingURL=token-usage.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-usage.service.js","sourceRoot":"","sources":["../../../../src/modules/auth/services/token-usage.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAuD;AAEvD,2CAAqF;AAErF,mDAA+D;AAC/D,sDAAqD;AACrD,yDAA8D;AAEjD,QAAA,yBAAyB,GAAG,MAAM,CAAC;AACnC,QAAA,oBAAoB,GAAG,KAAK,CAAC;AAOnC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAQ7B,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;QAPlC,WAAM,GAAG,IAAA,8BAAqB,EAAC,iCAAgB,EAAE,mBAAmB,CAAC,CAAC;QACtE,YAAO,GAAG,IAAI,GAAG,EAA4B,CAAC;QAGvD,aAAQ,GAAG,KAAK,CAAC;QACjB,YAAO,GAAG,CAAC,CAAC;IAEkC,CAAC;IAEvD,YAAY;QACX,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC,KAAK,EAAE,EAAE,iCAAyB,CAAC,CAAC;QAC7E,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;IAGD,MAAM,CAAC,KAAoB;QAC1B,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QAE1B,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC,EAAE,IAAI,KAAK,CAAC,WAAW,EAAE,CAAC;QAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAGvC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,4BAAoB,EAAE,CAAC;YAC5D,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,OAAO;QACR,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE;YACrB,EAAE,EAAE,KAAK,CA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O,CAAC,KAAyB;QAC9C,IAAI,QAAQ,GAAG,CAAC,CAAC;QAEjB,KAAK,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,KAAK,EAAE,CAAC;YACrD,IAAI,CAAC;gBAGJ,MAAM,QAAQ,GAAG,EAAE,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;gBACrD,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,iCAAmB,CAAC,CAAC,MAAM,CAC9D;oBACC,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,IAAA,gBAAM,GAAE,EAAE;oBACrC,EAAE,GAAG,QAAQ,EAAE,UAAU,EAAE,IAAA,kBAAQ,EAAC,UAAU,CAAC,EAAE;iBACjD,EACD,EAAE,UAAU,EAAE,CACd,CAAC;YACH,CAAC;YAAC,MAAM,CAAC;gBAGR,QAAQ,EAAE,CAAC;YACZ,CAAC;QACF,CAAC;QAED,IAAI,QAAQ,GAAG,CAAC;YAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,QAAQ,2BAA2B,CAAC,CAAC;IAC9F,CAAC;CACD,CAAA;AAzFY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;qCAS6B,oBAAU;GARvC,iBAAiB,CAyF7B"}
@@ -2,23 +2,30 @@ import { DataSource, EntityManager, Repository } from 'typeorm';
2
2
  import { TokenOwnerType } from '../auth.constants';
3
3
  import { CreateTokenDto } from '../dto/create-token.dto';
4
4
  import { UpdateTokenDto } from '../dto/update-token.dto';
5
- import { LongLiveTokenEntity, TokenEntity } from '../entities/auth.entity';
5
+ import { AccessTokenEntity, LongLiveTokenEntity, TokenEntity } from '../entities/auth.entity';
6
+ import { AuthenticationAccessToken, AuthenticationToken, TokenMetadataService } from './token-metadata.service';
7
+ import { TokenUsageService } from './token-usage.service';
6
8
  import { TokensTypeMapperService } from './tokens-type-mapper.service';
7
9
  export declare class TokensService {
8
10
  private readonly repository;
9
11
  private readonly tokensMapperService;
10
12
  private readonly dataSource;
13
+ private readonly tokenUsageService;
14
+ private readonly tokenMetadata;
11
15
  private readonly logger;
12
- constructor(repository: Repository<TokenEntity>, tokensMapperService: TokensTypeMapperService, dataSource: DataSource);
16
+ constructor(repository: Repository<TokenEntity>, tokensMapperService: TokensTypeMapperService, dataSource: DataSource, tokenUsageService: TokenUsageService, tokenMetadata: TokenMetadataService);
13
17
  findAll<TToken extends TokenEntity>(type?: new (...args: any[]) => TToken): Promise<TToken[]>;
14
18
  findAllByOwner<TToken extends TokenEntity>(owner: string, type?: new (...args: any[]) => TToken): Promise<TToken[]>;
19
+ findAccessTokenByOwnerAndHash(ownerId: string, hashedToken: string): Promise<AccessTokenEntity | null>;
15
20
  findAllByOwnerType(ownerType: TokenOwnerType): Promise<LongLiveTokenEntity[]>;
16
21
  findByOwnerId(ownerId: string, ownerType: TokenOwnerType): Promise<LongLiveTokenEntity[]>;
17
22
  revokeByOwnerId(ownerId: string, ownerType: TokenOwnerType): Promise<void>;
18
23
  revokeUserCredentials(userId: string): Promise<void>;
19
24
  revoke(id: string, manager?: EntityManager): Promise<void>;
25
+ findAuthenticationAccessToken(ownerId: string, hashedToken: string): Promise<AuthenticationAccessToken | null>;
26
+ findAuthenticationTokenByHash(hashedToken: string): Promise<AuthenticationToken | null>;
20
27
  findOneByHashedToken(hashedToken: string): Promise<LongLiveTokenEntity | null>;
21
- updateLastUsedAt(tokenId: string): Promise<void>;
28
+ recordUsage(token: Pick<LongLiveTokenEntity, 'id' | 'hashedToken'>): void;
22
29
  findOne<TToken extends TokenEntity>(id: string, type?: new (...args: any[]) => TToken): Promise<TToken | null>;
23
30
  findByHashedToken<TToken extends TokenEntity>(token: string, type?: new (...args: any[]) => TToken): Promise<TToken | null>;
24
31
  create<TToken extends TokenEntity, TCreateDTO extends CreateTokenDto>(createDto: TCreateDTO): Promise<TToken>;
@@ -28,12 +28,16 @@ const auth_constants_1 = require("../auth.constants");
28
28
  const auth_exceptions_1 = require("../auth.exceptions");
29
29
  const auth_entity_1 = require("../entities/auth.entity");
30
30
  const token_utils_1 = require("../utils/token.utils");
31
+ const token_metadata_service_1 = require("./token-metadata.service");
32
+ const token_usage_service_1 = require("./token-usage.service");
31
33
  const tokens_type_mapper_service_1 = require("./tokens-type-mapper.service");
32
34
  let TokensService = class TokensService {
33
- constructor(repository, tokensMapperService, dataSource) {
35
+ constructor(repository, tokensMapperService, dataSource, tokenUsageService, tokenMetadata) {
34
36
  this.repository = repository;
35
37
  this.tokensMapperService = tokensMapperService;
36
38
  this.dataSource = dataSource;
39
+ this.tokenUsageService = tokenUsageService;
40
+ this.tokenMetadata = tokenMetadata;
37
41
  this.logger = (0, logger_1.createExtensionLogger)(auth_constants_1.AUTH_MODULE_NAME, 'TokensService');
38
42
  }
39
43
  async findAll(type) {
@@ -82,6 +86,16 @@ let TokensService = class TokensService {
82
86
  this.logger.debug(`Found ${tokens.length} tokens`);
83
87
  return tokens;
84
88
  }
89
+ async findAccessTokenByOwnerAndHash(ownerId, hashedToken) {
90
+ return this.dataSource
91
+ .getRepository(auth_entity_1.AccessTokenEntity)
92
+ .createQueryBuilder('token')
93
+ .leftJoinAndSelect('token.owner', 'owner')
94
+ .leftJoinAndSelect('token.children', 'children')
95
+ .where('owner.id = :ownerId', { ownerId })
96
+ .andWhere('token.hashedToken = :hashedToken', { hashedToken })
97
+ .getOne();
98
+ }
85
99
  async findAllByOwnerType(ownerType) {
86
100
  this.logger.debug(`Fetching all long-live tokens by owner type=${ownerType}`);
87
101
  const repository = this.dataSource.getRepository(auth_entity_1.LongLiveTokenEntity);
@@ -124,6 +138,12 @@ let TokensService = class TokensService {
124
138
  throw new auth_exceptions_1.AuthNotFoundException('Requested token does not exist');
125
139
  }
126
140
  }
141
+ findAuthenticationAccessToken(ownerId, hashedToken) {
142
+ return this.tokenMetadata.findAccessToken(ownerId, hashedToken);
143
+ }
144
+ findAuthenticationTokenByHash(hashedToken) {
145
+ return this.tokenMetadata.findByHash(hashedToken);
146
+ }
127
147
  async findOneByHashedToken(hashedToken) {
128
148
  this.logger.debug('Finding long-live token by hashed value');
129
149
  const repository = this.dataSource.getRepository(auth_entity_1.LongLiveTokenEntity);
@@ -132,14 +152,8 @@ let TokensService = class TokensService {
132
152
  });
133
153
  return token ?? null;
134
154
  }
135
- async updateLastUsedAt(tokenId) {
136
- try {
137
- const repository = this.dataSource.getRepository(auth_entity_1.LongLiveTokenEntity);
138
- await repository.update(tokenId, { lastUsedAt: new Date() });
139
- }
140
- catch (error) {
141
- this.logger.debug(`Failed to update lastUsedAt for token ${tokenId}: ${error.message}`);
142
- }
155
+ recordUsage(token) {
156
+ this.tokenUsageService.record(token);
143
157
  }
144
158
  async findOne(id, type) {
145
159
  return this.findByField('id', id, type);
@@ -316,6 +330,8 @@ exports.TokensService = TokensService = __decorate([
316
330
  __param(0, (0, typeorm_2.InjectRepository)(auth_entity_1.TokenEntity)),
317
331
  __metadata("design:paramtypes", [typeorm_1.Repository,
318
332
  tokens_type_mapper_service_1.TokensTypeMapperService,
319
- typeorm_1.DataSource])
333
+ typeorm_1.DataSource,
334
+ token_usage_service_1.TokenUsageService,
335
+ token_metadata_service_1.TokenMetadataService])
320
336
  ], TokensService);
321
337
  //# sourceMappingURL=tokens.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.service.js","sourceRoot":"","sources":["../../../../src/modules/auth/services/tokens.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,qDAA2C;AAC3C,4EAA6C;AAC7C,kEAAmC;AACnC,qCAAgE;AAEhE,2CAA4C;AAC5C,6CAAmD;AAEnD,mDAA+D;AAC/D,2EAAmE;AAEnE,sDAAqE;AACrE,wDAAmG;AAGnG,yDAAkH;AAClH,sDAAiD;AAEjD,6EAAuE;AAGhE,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGzB,YAEC,UAAoD,EACnC,mBAA4C,EAC5C,UAAsB;QAFtB,eAAU,GAAV,UAA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,MAAM,WAAW,GAAG,IAAA,4BAAU,EAAC,QAAQ,EAAE,GAAG,EAAE;YAC7C,uBAAuB,EAAE,KAAK;SAC9B,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAQ,EAAC,WAAW,EAAE;YAC1C,SAAS,EAAE,IAAI;YACf,oBAAoB,EAAE,IAAI;YAC1B,gBAAgB,EAAE,KAAK;SACvB,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAElE,MAAM,IAAI,yCAAuB,CAAC,kCAAkC,CAAC,CAAC;QACvE,CAAC;QAED,OAAO,WAAW,CAAC;IACpB,CAAC;CACD,CAAA;AA9cY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAKV,WAAA,IAAA,0BAAgB,EAAC,yBAAW,CAAC,CAAA;qCACD,oBAAU;QACD,oDAAuB;QAChC,oBAAU;GAP5B,aAAa,CA8czB"}
1
+ {"version":3,"file":"tokens.service.js","sourceRoot":"","sources":["../../../../src/modules/auth/services/tokens.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,qDAA2C;AAC3C,4EAA6C;AAC7C,kEAAmC;AACnC,qCAAgE;AAEhE,2CAA4C;AAC5C,6CAAmD;AAEnD,mDAA+D;AAC/D,2EAAmE;AAEnE,sDAAqE;AACrE,wDAAmG;AAGnG,yDAAkH;AAClH,sDAAiD;AAEjD,qEAAgH;AAChH,+DAA0D;AAC1D,6EAAuE;AAGhE,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGzB,YAEC,UAAoD,EACnC,mBAA4C,EAC5C,UAAsB,EACtB,iBAAoC,EACpC,aAAmC;QAJnC,eAAU,GAAV,UAAU,CAAyB;QACnC,wBAAmB,GAAnB,mBAAmB,CAAyB;QAC5C,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AAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAErE,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,IAAI,+BAAa,CAAC,kCAAkC,CAAC,CAAC;QAC7D,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,8BAA8B,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QAE7D,OAAO,MAAM,CAAC;IACf,CAAC;IAEO,KAAK,CAAC,WAAW,CAAmB,QAAqB,EAAE,GAAQ;QAC1E,MAAM,WAAW,GAAG,IAAA,4BAAU,EAAC,QAAQ,EAAE,GAAG,EAAE;YAC7C,uBAAuB,EAAE,KAAK;SAC9B,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,IAAA,0BAAQ,EAAC,WAAW,EAAE;YAC1C,SAAS,EAAE,IAAI;YACf,oBAAoB,EAAE,IAAI;YAC1B,gBAAgB,EAAE,KAAK;SACvB,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAElE,MAAM,IAAI,yCAAuB,CAAC,kCAAkC,CAAC,CAAC;QACvE,CAAC;QAED,OAAO,WAAW,CAAC;IACpB,CAAC;CACD,CAAA;AAleY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAU,GAAE;IAKV,WAAA,IAAA,0BAAgB,EAAC,yBAAW,CAAC,CAAA;qCACD,oBAAU;QACD,oDAAuB;QAChC,oBAAU;QACH,uCAAiB;QACrB,6CAAoB;GATzC,aAAa,CAkezB"}
@@ -1,14 +1,18 @@
1
1
  import { FastifyRequest as Request, FastifyReply as Response } from 'fastify';
2
+ import { ChannelInputCapabilitiesResponseModel } from '../models/channel-input-capabilities.model';
2
3
  import { ChannelResponseModel, ChannelsResponseModel } from '../models/devices-response.model';
4
+ import { ChannelInputOccurrencesService } from '../services/channel-input-occurrences.service';
3
5
  import { ChannelsTypeMapperService } from '../services/channels-type-mapper.service';
4
6
  import { ChannelsService } from '../services/channels.service';
5
7
  export declare class ChannelsController {
6
8
  private readonly channelsService;
7
9
  private readonly channelsMapperService;
10
+ private readonly channelInputOccurrencesService;
8
11
  private readonly logger;
9
- constructor(channelsService: ChannelsService, channelsMapperService: ChannelsTypeMapperService);
12
+ constructor(channelsService: ChannelsService, channelsMapperService: ChannelsTypeMapperService, channelInputOccurrencesService: ChannelInputOccurrencesService);
10
13
  findAll(): Promise<ChannelsResponseModel>;
11
14
  findOne(id: string): Promise<ChannelResponseModel>;
15
+ getInputCapabilities(id: string): Promise<ChannelInputCapabilitiesResponseModel>;
12
16
  create(createDto: {
13
17
  data: object;
14
18
  }, res: Response, req: Request): Promise<ChannelResponseModel>;
@@ -25,13 +25,16 @@ const devices_constants_1 = require("../devices.constants");
25
25
  const devices_exceptions_1 = require("../devices.exceptions");
26
26
  const create_channel_dto_1 = require("../dto/create-channel.dto");
27
27
  const update_channel_dto_1 = require("../dto/update-channel.dto");
28
+ const channel_input_capabilities_model_1 = require("../models/channel-input-capabilities.model");
28
29
  const devices_response_model_1 = require("../models/devices-response.model");
30
+ const channel_input_occurrences_service_1 = require("../services/channel-input-occurrences.service");
29
31
  const channels_type_mapper_service_1 = require("../services/channels-type-mapper.service");
30
32
  const channels_service_1 = require("../services/channels.service");
31
33
  let ChannelsController = class ChannelsController {
32
- constructor(channelsService, channelsMapperService) {
34
+ constructor(channelsService, channelsMapperService, channelInputOccurrencesService) {
33
35
  this.channelsService = channelsService;
34
36
  this.channelsMapperService = channelsMapperService;
37
+ this.channelInputOccurrencesService = channelInputOccurrencesService;
35
38
  this.logger = (0, extension_logger_service_1.createExtensionLogger)(devices_constants_1.DEVICES_MODULE_NAME, 'ChannelsController');
36
39
  }
37
40
  async findAll() {
@@ -50,6 +53,16 @@ let ChannelsController = class ChannelsController {
50
53
  response.data = channel;
51
54
  return response;
52
55
  }
56
+ async getInputCapabilities(id) {
57
+ this.logger.debug(`Fetching input capabilities for channel id=${id}`);
58
+ const capabilities = await this.channelInputOccurrencesService.getInputCapabilities(id);
59
+ if (!capabilities) {
60
+ throw new common_1.NotFoundException(`Channel with ID ${id} was not found.`);
61
+ }
62
+ const response = new channel_input_capabilities_model_1.ChannelInputCapabilitiesResponseModel();
63
+ response.data = capabilities;
64
+ return response;
65
+ }
53
66
  async create(createDto, res, req) {
54
67
  this.logger.debug('Incoming request to create a new channel');
55
68
  const type = 'type' in createDto.data && typeof createDto.data.type === 'string' ? createDto.data.type : undefined;
@@ -192,6 +205,24 @@ __decorate([
192
205
  __metadata("design:paramtypes", [String]),
193
206
  __metadata("design:returntype", Promise)
194
207
  ], ChannelsController.prototype, "findOne", null);
208
+ __decorate([
209
+ (0, swagger_1.ApiOperation)({
210
+ tags: [devices_constants_1.DEVICES_MODULE_API_TAG_NAME],
211
+ summary: 'Retrieve input capabilities of a specific channel',
212
+ description: 'Fetches input capabilities and supported event interactions for a channel.',
213
+ operationId: 'get-devices-module-channel-input-capabilities',
214
+ }),
215
+ (0, swagger_1.ApiParam)({ name: 'id', type: 'string', format: 'uuid', description: 'Channel ID' }),
216
+ (0, api_documentation_decorator_1.ApiSuccessResponse)(channel_input_capabilities_model_1.ChannelInputCapabilitiesResponseModel, 'Input capabilities of the channel successfully retrieved.'),
217
+ (0, api_documentation_decorator_1.ApiBadRequestResponse)('Invalid UUID format'),
218
+ (0, api_documentation_decorator_1.ApiNotFoundResponse)('Channel not found'),
219
+ (0, api_documentation_decorator_1.ApiInternalServerErrorResponse)('Internal server error'),
220
+ (0, common_1.Get)(':id/input-capabilities'),
221
+ __param(0, (0, common_1.Param)('id', new common_1.ParseUUIDPipe({ version: '4' }))),
222
+ __metadata("design:type", Function),
223
+ __metadata("design:paramtypes", [String]),
224
+ __metadata("design:returntype", Promise)
225
+ ], ChannelsController.prototype, "getInputCapabilities", null);
195
226
  __decorate([
196
227
  (0, swagger_1.ApiOperation)({
197
228
  tags: [devices_constants_1.DEVICES_MODULE_API_TAG_NAME],
@@ -256,6 +287,7 @@ exports.ChannelsController = ChannelsController = __decorate([
256
287
  (0, swagger_1.ApiTags)(devices_constants_1.DEVICES_MODULE_API_TAG_NAME),
257
288
  (0, common_1.Controller)('channels'),
258
289
  __metadata("design:paramtypes", [channels_service_1.ChannelsService,
259
- channels_type_mapper_service_1.ChannelsTypeMapperService])
290
+ channels_type_mapper_service_1.ChannelsTypeMapperService,
291
+ channel_input_occurrences_service_1.ChannelInputOccurrencesService])
260
292
  ], ChannelsController);
261
293
  //# sourceMappingURL=channels.controller.js.map