@fastybird/smart-panel-backend 1.1.0-alpha.2 → 1.1.0-alpha.21

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 (403) hide show
  1. package/dist/app.module.js +8 -0
  2. package/dist/app.module.js.map +1 -1
  3. package/dist/common/filters/conflict-exception.filter.d.ts +6 -0
  4. package/dist/common/filters/conflict-exception.filter.js +59 -0
  5. package/dist/common/filters/conflict-exception.filter.js.map +1 -0
  6. package/dist/common/filters/global-error.filter.js +1 -4
  7. package/dist/common/filters/global-error.filter.js.map +1 -1
  8. package/dist/common/filters/global-filters.d.ts +3 -0
  9. package/dist/common/filters/global-filters.js +22 -0
  10. package/dist/common/filters/global-filters.js.map +1 -0
  11. package/dist/common/filters/unprocessable-entity-exception.filter.d.ts +1 -0
  12. package/dist/common/filters/unprocessable-entity-exception.filter.js +15 -3
  13. package/dist/common/filters/unprocessable-entity-exception.filter.js.map +1 -1
  14. package/dist/common/utils/transform.utils.js +3 -0
  15. package/dist/common/utils/transform.utils.js.map +1 -1
  16. package/dist/dataSource.js +1 -0
  17. package/dist/dataSource.js.map +1 -1
  18. package/dist/main.js +2 -7
  19. package/dist/main.js.map +1 -1
  20. package/dist/migrations/1000000000026-AddHardwareInputCategories.d.ts +7 -0
  21. package/dist/migrations/1000000000026-AddHardwareInputCategories.js +364 -0
  22. package/dist/migrations/1000000000026-AddHardwareInputCategories.js.map +1 -0
  23. package/dist/modules/devices/controllers/channels.controller.d.ts +5 -1
  24. package/dist/modules/devices/controllers/channels.controller.js +34 -2
  25. package/dist/modules/devices/controllers/channels.controller.js.map +1 -1
  26. package/dist/modules/devices/controllers/channels.properties.controller.js +21 -4
  27. package/dist/modules/devices/controllers/channels.properties.controller.js.map +1 -1
  28. package/dist/modules/devices/controllers/devices.channels.controller.d.ts +5 -1
  29. package/dist/modules/devices/controllers/devices.channels.controller.js +38 -2
  30. package/dist/modules/devices/controllers/devices.channels.controller.js.map +1 -1
  31. package/dist/modules/devices/controllers/devices.channels.properties.controller.js +21 -4
  32. package/dist/modules/devices/controllers/devices.channels.properties.controller.js.map +1 -1
  33. package/dist/modules/devices/devices.constants.d.ts +6 -0
  34. package/dist/modules/devices/devices.constants.js +6 -0
  35. package/dist/modules/devices/devices.constants.js.map +1 -1
  36. package/dist/modules/devices/devices.module.js +18 -0
  37. package/dist/modules/devices/devices.module.js.map +1 -1
  38. package/dist/modules/devices/devices.openapi.d.ts +3 -1
  39. package/dist/modules/devices/devices.openapi.js +7 -0
  40. package/dist/modules/devices/devices.openapi.js.map +1 -1
  41. package/dist/modules/devices/dto/channel-input-occurrence.dto.d.ts +10 -0
  42. package/dist/modules/devices/dto/channel-input-occurrence.dto.js +99 -0
  43. package/dist/modules/devices/dto/channel-input-occurrence.dto.js.map +1 -0
  44. package/dist/modules/devices/models/channel-input-capabilities.model.d.ts +20 -0
  45. package/dist/modules/devices/models/channel-input-capabilities.model.js +111 -0
  46. package/dist/modules/devices/models/channel-input-capabilities.model.js.map +1 -0
  47. package/dist/modules/devices/models/channel-input-occurrence.model.d.ts +22 -0
  48. package/dist/modules/devices/models/channel-input-occurrence.model.js +154 -0
  49. package/dist/modules/devices/models/channel-input-occurrence.model.js.map +1 -0
  50. package/dist/modules/devices/services/channel-input-deduplication.service.d.ts +17 -0
  51. package/dist/modules/devices/services/channel-input-deduplication.service.js +88 -0
  52. package/dist/modules/devices/services/channel-input-deduplication.service.js.map +1 -0
  53. package/dist/modules/devices/services/channel-input-occurrences.service.d.ts +21 -0
  54. package/dist/modules/devices/services/channel-input-occurrences.service.js +163 -0
  55. package/dist/modules/devices/services/channel-input-occurrences.service.js.map +1 -0
  56. package/dist/modules/devices/services/channels.properties.service.d.ts +27 -3
  57. package/dist/modules/devices/services/channels.properties.service.js +304 -28
  58. package/dist/modules/devices/services/channels.properties.service.js.map +1 -1
  59. package/dist/modules/devices/services/channels.service.js +42 -38
  60. package/dist/modules/devices/services/channels.service.js.map +1 -1
  61. package/dist/modules/devices/services/command-latency-trace-collector.service.d.ts +101 -0
  62. package/dist/modules/devices/services/command-latency-trace-collector.service.js +451 -0
  63. package/dist/modules/devices/services/command-latency-trace-collector.service.js.map +1 -0
  64. package/dist/modules/devices/services/device-structure-lock.service.d.ts +10 -2
  65. package/dist/modules/devices/services/device-structure-lock.service.js +86 -7
  66. package/dist/modules/devices/services/device-structure-lock.service.js.map +1 -1
  67. package/dist/modules/devices/services/devices.service.js +37 -33
  68. package/dist/modules/devices/services/devices.service.js.map +1 -1
  69. package/dist/modules/devices/services/module-reset.service.d.ts +3 -1
  70. package/dist/modules/devices/services/module-reset.service.js +21 -16
  71. package/dist/modules/devices/services/module-reset.service.js.map +1 -1
  72. package/dist/modules/devices/services/property-command-dispatch.service.d.ts +45 -0
  73. package/dist/modules/devices/services/property-command-dispatch.service.js +227 -0
  74. package/dist/modules/devices/services/property-command-dispatch.service.js.map +1 -0
  75. package/dist/modules/devices/services/property-command-window.service.d.ts +71 -0
  76. package/dist/modules/devices/services/property-command-window.service.js +204 -0
  77. package/dist/modules/devices/services/property-command-window.service.js.map +1 -0
  78. package/dist/modules/devices/services/property-command.service.d.ts +20 -3
  79. package/dist/modules/devices/services/property-command.service.js +56 -10
  80. package/dist/modules/devices/services/property-command.service.js.map +1 -1
  81. package/dist/modules/devices/services/property-state-coordinator.service.d.ts +4 -0
  82. package/dist/modules/devices/services/property-state-coordinator.service.js +35 -0
  83. package/dist/modules/devices/services/property-state-coordinator.service.js.map +1 -0
  84. package/dist/modules/devices/services/property-value.service.d.ts +1 -0
  85. package/dist/modules/devices/services/property-value.service.js +4 -0
  86. package/dist/modules/devices/services/property-value.service.js.map +1 -1
  87. package/dist/modules/devices/utils/schema.utils.js +1 -1
  88. package/dist/modules/devices/utils/schema.utils.js.map +1 -1
  89. package/dist/modules/platform/services/platform.service.d.ts +13 -4
  90. package/dist/modules/platform/services/platform.service.js +57 -35
  91. package/dist/modules/platform/services/platform.service.js.map +1 -1
  92. package/dist/modules/remote-access/dto/update-config.dto.js +5 -0
  93. package/dist/modules/remote-access/dto/update-config.dto.js.map +1 -1
  94. package/dist/modules/remote-access/validators/is-remote-access-url.validator.js +5 -2
  95. package/dist/modules/remote-access/validators/is-remote-access-url.validator.js.map +1 -1
  96. package/dist/modules/system/scripts/update-worker.sh +983 -61
  97. package/dist/modules/system/services/privileged-worker.service.d.ts +10 -0
  98. package/dist/modules/system/services/privileged-worker.service.js +137 -11
  99. package/dist/modules/system/services/privileged-worker.service.js.map +1 -1
  100. package/dist/modules/system/services/update-executor.service.d.ts +20 -2
  101. package/dist/modules/system/services/update-executor.service.js +257 -25
  102. package/dist/modules/system/services/update-executor.service.js.map +1 -1
  103. package/dist/modules/websocket/gateway/websocket.gateway.d.ts +4 -1
  104. package/dist/modules/websocket/gateway/websocket.gateway.js +28 -5
  105. package/dist/modules/websocket/gateway/websocket.gateway.js.map +1 -1
  106. package/dist/modules/websocket/services/command-acknowledgement-trace.service.d.ts +143 -0
  107. package/dist/modules/websocket/services/command-acknowledgement-trace.service.js +523 -0
  108. package/dist/modules/websocket/services/command-acknowledgement-trace.service.js.map +1 -0
  109. package/dist/modules/websocket/websocket.module.js +9 -1
  110. package/dist/modules/websocket/websocket.module.js.map +1 -1
  111. package/dist/plugins/devices-home-assistant/devices-home-assistant.openapi.d.ts +2 -2
  112. package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.d.ts +6 -1
  113. package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.js +16 -1
  114. package/dist/plugins/devices-home-assistant/devices-home-assistant.plugin.js.map +1 -1
  115. package/dist/plugins/devices-home-assistant/dto/mapping-preview.dto.d.ts +1 -0
  116. package/dist/plugins/devices-home-assistant/dto/mapping-preview.dto.js +11 -0
  117. package/dist/plugins/devices-home-assistant/dto/mapping-preview.dto.js.map +1 -1
  118. package/dist/plugins/devices-home-assistant/mappers/button.entity.mapper.service.d.ts +19 -0
  119. package/dist/plugins/devices-home-assistant/mappers/button.entity.mapper.service.js +51 -0
  120. package/dist/plugins/devices-home-assistant/mappers/button.entity.mapper.service.js.map +1 -0
  121. package/dist/plugins/devices-home-assistant/mappings/definitions/entity-mappings.yaml +56 -7
  122. package/dist/plugins/devices-home-assistant/models/mapping-preview.model.d.ts +1 -0
  123. package/dist/plugins/devices-home-assistant/models/mapping-preview.model.js +11 -0
  124. package/dist/plugins/devices-home-assistant/models/mapping-preview.model.js.map +1 -1
  125. package/dist/plugins/devices-home-assistant/services/device-adoption.service.js +17 -0
  126. package/dist/plugins/devices-home-assistant/services/device-adoption.service.js.map +1 -1
  127. package/dist/plugins/devices-home-assistant/services/home-assistant-raw-event.service.d.ts +27 -0
  128. package/dist/plugins/devices-home-assistant/services/home-assistant-raw-event.service.js +271 -0
  129. package/dist/plugins/devices-home-assistant/services/home-assistant-raw-event.service.js.map +1 -0
  130. package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.d.ts +2 -2
  131. package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.js +33 -14
  132. package/dist/plugins/devices-home-assistant/services/home-assistant.ws.service.js.map +1 -1
  133. package/dist/plugins/devices-home-assistant/services/mapping-preview.service.js +24 -4
  134. package/dist/plugins/devices-home-assistant/services/mapping-preview.service.js.map +1 -1
  135. package/dist/plugins/devices-home-assistant/services/state-changed.event.service.d.ts +4 -1
  136. package/dist/plugins/devices-home-assistant/services/state-changed.event.service.js +84 -5
  137. package/dist/plugins/devices-home-assistant/services/state-changed.event.service.js.map +1 -1
  138. package/dist/plugins/devices-home-assistant/services/wizard.service.js +1 -0
  139. package/dist/plugins/devices-home-assistant/services/wizard.service.js.map +1 -1
  140. package/dist/plugins/devices-home-assistant/utils/ha-event.utils.d.ts +2 -0
  141. package/dist/plugins/devices-home-assistant/utils/ha-event.utils.js +50 -0
  142. package/dist/plugins/devices-home-assistant/utils/ha-event.utils.js.map +1 -0
  143. package/dist/plugins/devices-homekit/listeners/homekit-event.listener.d.ts +2 -0
  144. package/dist/plugins/devices-homekit/listeners/homekit-event.listener.js +28 -1
  145. package/dist/plugins/devices-homekit/listeners/homekit-event.listener.js.map +1 -1
  146. package/dist/plugins/devices-homekit/mappers/base.mapper.js +27 -4
  147. package/dist/plugins/devices-homekit/mappers/base.mapper.js.map +1 -1
  148. package/dist/plugins/devices-homekit/mappers/button.mapper.d.ts +15 -0
  149. package/dist/plugins/devices-homekit/mappers/button.mapper.js +143 -0
  150. package/dist/plugins/devices-homekit/mappers/button.mapper.js.map +1 -0
  151. package/dist/plugins/devices-homekit/mappers/homekit-mapper.interface.d.ts +16 -0
  152. package/dist/plugins/devices-homekit/mappers/thermostat-coordinator.d.ts +7 -0
  153. package/dist/plugins/devices-homekit/mappers/thermostat-coordinator.js +84 -73
  154. package/dist/plugins/devices-homekit/mappers/thermostat-coordinator.js.map +1 -1
  155. package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.d.ts +5 -1
  156. package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.js +42 -0
  157. package/dist/plugins/devices-homekit/services/homekit-mapper-registry.service.js.map +1 -1
  158. package/dist/plugins/devices-homey/mappings/definitions/channels.yaml +50 -0
  159. package/dist/plugins/devices-homey/mappings/definitions/devices.yaml +18 -0
  160. package/dist/plugins/devices-homey/mappings/definitions/properties.yaml +55 -0
  161. package/dist/plugins/devices-homey/mappings/device-support.js +10 -0
  162. package/dist/plugins/devices-homey/mappings/device-support.js.map +1 -1
  163. package/dist/plugins/devices-homey/mappings/mapping-loader.service.d.ts +1 -0
  164. package/dist/plugins/devices-homey/mappings/mapping-loader.service.js +66 -8
  165. package/dist/plugins/devices-homey/mappings/mapping-loader.service.js.map +1 -1
  166. package/dist/plugins/devices-homey/models/inventory.model.d.ts +2 -1
  167. package/dist/plugins/devices-homey/models/inventory.model.js +1 -0
  168. package/dist/plugins/devices-homey/models/inventory.model.js.map +1 -1
  169. package/dist/plugins/devices-homey/models/mapping-preview.model.d.ts +1 -0
  170. package/dist/plugins/devices-homey/models/mapping-preview.model.js +1 -0
  171. package/dist/plugins/devices-homey/models/mapping-preview.model.js.map +1 -1
  172. package/dist/plugins/devices-homey/services/homey-mapping-preview.service.js +7 -0
  173. package/dist/plugins/devices-homey/services/homey-mapping-preview.service.js.map +1 -1
  174. package/dist/plugins/devices-homey/services/homey-synchronizer.service.d.ts +3 -1
  175. package/dist/plugins/devices-homey/services/homey-synchronizer.service.js +37 -6
  176. package/dist/plugins/devices-homey/services/homey-synchronizer.service.js.map +1 -1
  177. package/dist/plugins/devices-reterminal/services/reterminal-button.service.d.ts +7 -3
  178. package/dist/plugins/devices-reterminal/services/reterminal-button.service.js +63 -17
  179. package/dist/plugins/devices-reterminal/services/reterminal-button.service.js.map +1 -1
  180. package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.d.ts +38 -3
  181. package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.js +840 -134
  182. package/dist/plugins/devices-shelly-ng/delegates/delegates-manager.service.js.map +1 -1
  183. package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.d.ts +15 -1
  184. package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.js +117 -10
  185. package/dist/plugins/devices-shelly-ng/delegates/shelly-device.delegate.js.map +1 -1
  186. package/dist/plugins/devices-shelly-ng/devices-shelly-ng.constants.js +11 -13
  187. package/dist/plugins/devices-shelly-ng/devices-shelly-ng.constants.js.map +1 -1
  188. package/dist/plugins/devices-shelly-ng/devices-shelly-ng.plugin.js +2 -0
  189. package/dist/plugins/devices-shelly-ng/devices-shelly-ng.plugin.js.map +1 -1
  190. package/dist/plugins/devices-shelly-ng/mappings/definitions/inputs.yaml +80 -0
  191. package/dist/plugins/devices-shelly-ng/mappings/mapping-loader.service.js +11 -1
  192. package/dist/plugins/devices-shelly-ng/mappings/mapping-loader.service.js.map +1 -1
  193. package/dist/plugins/devices-shelly-ng/mappings/mapping.types.d.ts +6 -3
  194. package/dist/plugins/devices-shelly-ng/mappings/schema/mapping-schema.json +5 -0
  195. package/dist/plugins/devices-shelly-ng/services/device-manager.service.js +130 -7
  196. package/dist/plugins/devices-shelly-ng/services/device-manager.service.js.map +1 -1
  197. package/dist/plugins/devices-shelly-ng/services/poll-placement-diagnostics.service.d.ts +48 -0
  198. package/dist/plugins/devices-shelly-ng/services/poll-placement-diagnostics.service.js +457 -0
  199. package/dist/plugins/devices-shelly-ng/services/poll-placement-diagnostics.service.js.map +1 -0
  200. package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.d.ts +12 -2
  201. package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.js +86 -28
  202. package/dist/plugins/devices-shelly-ng/services/shelly-ng.service.js.map +1 -1
  203. package/dist/plugins/devices-shelly-ng/services/shelly-rpc-client.service.js +3 -0
  204. package/dist/plugins/devices-shelly-ng/services/shelly-rpc-client.service.js.map +1 -1
  205. package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.d.ts +1 -1
  206. package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.js +18 -13
  207. package/dist/plugins/devices-shelly-ng/services/shelly-ws-server.service.js.map +1 -1
  208. package/dist/plugins/devices-shelly-ng/utils/transform.utils.d.ts +2 -0
  209. package/dist/plugins/devices-shelly-ng/utils/transform.utils.js +14 -1
  210. package/dist/plugins/devices-shelly-ng/utils/transform.utils.js.map +1 -1
  211. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.constants.d.ts +2 -0
  212. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.constants.js +66 -4
  213. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.constants.js.map +1 -1
  214. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.plugin.js +2 -0
  215. package/dist/plugins/devices-shelly-v1/devices-shelly-v1.plugin.js.map +1 -1
  216. package/dist/plugins/devices-shelly-v1/platforms/shelly-v1.device.platform.js +7 -0
  217. package/dist/plugins/devices-shelly-v1/platforms/shelly-v1.device.platform.js.map +1 -1
  218. package/dist/plugins/devices-shelly-v1/services/device-mapper.service.d.ts +3 -1
  219. package/dist/plugins/devices-shelly-v1/services/device-mapper.service.js +20 -2
  220. package/dist/plugins/devices-shelly-v1/services/device-mapper.service.js.map +1 -1
  221. package/dist/plugins/devices-shelly-v1/services/shelly-v1-input-tracker.service.d.ts +16 -0
  222. package/dist/plugins/devices-shelly-v1/services/shelly-v1-input-tracker.service.js +107 -0
  223. package/dist/plugins/devices-shelly-v1/services/shelly-v1-input-tracker.service.js.map +1 -0
  224. package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.d.ts +7 -1
  225. package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.js +98 -3
  226. package/dist/plugins/devices-shelly-v1/services/shelly-v1.service.js.map +1 -1
  227. package/dist/plugins/devices-third-party/controllers/third-party-inputs.controller.d.ts +17 -0
  228. package/dist/plugins/devices-third-party/controllers/third-party-inputs.controller.js +205 -0
  229. package/dist/plugins/devices-third-party/controllers/third-party-inputs.controller.js.map +1 -0
  230. package/dist/plugins/devices-third-party/devices-third-party.openapi.d.ts +1 -1
  231. package/dist/plugins/devices-third-party/devices-third-party.plugin.js +2 -1
  232. package/dist/plugins/devices-third-party/devices-third-party.plugin.js.map +1 -1
  233. package/dist/plugins/devices-third-party/dto/report-input-occurrence-response.dto.d.ts +5 -0
  234. package/dist/plugins/devices-third-party/dto/report-input-occurrence-response.dto.js +50 -0
  235. package/dist/plugins/devices-third-party/dto/report-input-occurrence-response.dto.js.map +1 -0
  236. package/dist/plugins/devices-third-party/dto/report-input-occurrence.dto.d.ts +8 -0
  237. package/dist/plugins/devices-third-party/dto/report-input-occurrence.dto.js +81 -0
  238. package/dist/plugins/devices-third-party/dto/report-input-occurrence.dto.js.map +1 -0
  239. package/dist/plugins/devices-third-party/platforms/third-party-device.platform.js +19 -4
  240. package/dist/plugins/devices-third-party/platforms/third-party-device.platform.js.map +1 -1
  241. package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.d.ts +2 -0
  242. package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.js +57 -0
  243. package/dist/plugins/devices-virtual/listeners/virtual-projection.listener.js.map +1 -1
  244. package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.constants.d.ts +3 -0
  245. package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.constants.js +41 -5
  246. package/dist/plugins/devices-zigbee2mqtt/devices-zigbee2mqtt.constants.js.map +1 -1
  247. package/dist/plugins/devices-zigbee2mqtt/interfaces/zigbee2mqtt.interface.d.ts +7 -1
  248. package/dist/plugins/devices-zigbee2mqtt/mappings/config-driven.converter.js +16 -15
  249. package/dist/plugins/devices-zigbee2mqtt/mappings/config-driven.converter.js.map +1 -1
  250. package/dist/plugins/devices-zigbee2mqtt/mappings/definitions/remotes.yaml +505 -74
  251. package/dist/plugins/devices-zigbee2mqtt/mappings/schema/mapping-schema.json +3 -3
  252. package/dist/plugins/devices-zigbee2mqtt/mappings/transformers/transformer.types.d.ts +1 -1
  253. package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.d.ts +8 -2
  254. package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.js +6 -5
  255. package/dist/plugins/devices-zigbee2mqtt/services/base-client-adapter.js.map +1 -1
  256. package/dist/plugins/devices-zigbee2mqtt/services/device-adoption.service.js +18 -11
  257. package/dist/plugins/devices-zigbee2mqtt/services/device-adoption.service.js.map +1 -1
  258. package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.d.ts +9 -3
  259. package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.js +166 -3
  260. package/dist/plugins/devices-zigbee2mqtt/services/device-mapper.service.js.map +1 -1
  261. package/dist/plugins/devices-zigbee2mqtt/services/mqtt-client-adapter.service.js +5 -2
  262. package/dist/plugins/devices-zigbee2mqtt/services/mqtt-client-adapter.service.js.map +1 -1
  263. package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.d.ts +1 -0
  264. package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.js +44 -4
  265. package/dist/plugins/devices-zigbee2mqtt/services/zigbee2mqtt.service.js.map +1 -1
  266. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/setup.controller.d.ts +17 -0
  267. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/setup.controller.js +147 -0
  268. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/setup.controller.js.map +1 -0
  269. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/status.controller.d.ts +15 -0
  270. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/status.controller.js +98 -0
  271. package/dist/plugins/remote-access-cloudflare-tunnel/controllers/status.controller.js.map +1 -0
  272. package/dist/plugins/remote-access-cloudflare-tunnel/dto/update-config.dto.d.ts +9 -0
  273. package/dist/plugins/remote-access-cloudflare-tunnel/dto/update-config.dto.js +94 -0
  274. package/dist/plugins/remote-access-cloudflare-tunnel/dto/update-config.dto.js.map +1 -0
  275. package/dist/plugins/remote-access-cloudflare-tunnel/models/config.model.d.ts +9 -0
  276. package/dist/plugins/remote-access-cloudflare-tunnel/models/config.model.js +92 -0
  277. package/dist/plugins/remote-access-cloudflare-tunnel/models/config.model.js.map +1 -0
  278. package/dist/plugins/remote-access-cloudflare-tunnel/models/install.model.d.ts +7 -0
  279. package/dist/plugins/remote-access-cloudflare-tunnel/models/install.model.js +48 -0
  280. package/dist/plugins/remote-access-cloudflare-tunnel/models/install.model.js.map +1 -0
  281. package/dist/plugins/remote-access-cloudflare-tunnel/models/status.model.d.ts +42 -0
  282. package/dist/plugins/remote-access-cloudflare-tunnel/models/status.model.js +352 -0
  283. package/dist/plugins/remote-access-cloudflare-tunnel/models/status.model.js.map +1 -0
  284. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.constants.d.ts +24 -0
  285. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.constants.js +27 -0
  286. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.constants.js.map +1 -0
  287. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.exceptions.d.ts +8 -0
  288. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.exceptions.js +19 -0
  289. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.exceptions.js.map +1 -0
  290. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.openapi.d.ts +4 -0
  291. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.openapi.js +20 -0
  292. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.openapi.js.map +1 -0
  293. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.plugin.d.ts +21 -0
  294. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.plugin.js +135 -0
  295. package/dist/plugins/remote-access-cloudflare-tunnel/remote-access-cloudflare-tunnel.plugin.js.map +1 -0
  296. package/dist/plugins/remote-access-cloudflare-tunnel/scripts/cloudflared-setup.sh +185 -0
  297. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-managed.service.d.ts +82 -0
  298. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-managed.service.js +507 -0
  299. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-managed.service.js.map +1 -0
  300. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-provider.service.d.ts +10 -0
  301. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-provider.service.js +37 -0
  302. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-provider.service.js.map +1 -0
  303. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-setup.service.d.ts +38 -0
  304. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-setup.service.js +147 -0
  305. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflare-tunnel-setup.service.js.map +1 -0
  306. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-cli.service.d.ts +15 -0
  307. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-cli.service.js +67 -0
  308. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-cli.service.js.map +1 -0
  309. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-metrics.service.d.ts +8 -0
  310. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-metrics.service.js +46 -0
  311. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-metrics.service.js.map +1 -0
  312. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-process.service.d.ts +27 -0
  313. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-process.service.js +139 -0
  314. package/dist/plugins/remote-access-cloudflare-tunnel/services/cloudflared-process.service.js.map +1 -0
  315. package/dist/plugins/remote-access-tailscale/controllers/setup.controller.d.ts +1 -0
  316. package/dist/plugins/remote-access-tailscale/controllers/setup.controller.js +26 -10
  317. package/dist/plugins/remote-access-tailscale/controllers/setup.controller.js.map +1 -1
  318. package/dist/plugins/remote-access-tailscale/controllers/status.controller.d.ts +6 -1
  319. package/dist/plugins/remote-access-tailscale/controllers/status.controller.js +28 -3
  320. package/dist/plugins/remote-access-tailscale/controllers/status.controller.js.map +1 -1
  321. package/dist/plugins/remote-access-tailscale/models/status.model.d.ts +19 -0
  322. package/dist/plugins/remote-access-tailscale/models/status.model.js +158 -1
  323. package/dist/plugins/remote-access-tailscale/models/status.model.js.map +1 -1
  324. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.constants.d.ts +3 -0
  325. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.constants.js +4 -1
  326. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.constants.js.map +1 -1
  327. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.exceptions.d.ts +13 -0
  328. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.exceptions.js +27 -0
  329. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.exceptions.js.map +1 -0
  330. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.openapi.d.ts +2 -2
  331. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.openapi.js +2 -0
  332. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.openapi.js.map +1 -1
  333. package/dist/plugins/remote-access-tailscale/remote-access-tailscale.plugin.js +1 -1
  334. package/dist/plugins/remote-access-tailscale/scripts/tailscale-setup.sh +61 -0
  335. package/dist/plugins/remote-access-tailscale/services/tailscale-cli.service.d.ts +9 -0
  336. package/dist/plugins/remote-access-tailscale/services/tailscale-cli.service.js +12 -0
  337. package/dist/plugins/remote-access-tailscale/services/tailscale-cli.service.js.map +1 -1
  338. package/dist/plugins/remote-access-tailscale/services/tailscale-login.service.d.ts +1 -0
  339. package/dist/plugins/remote-access-tailscale/services/tailscale-login.service.js +27 -2
  340. package/dist/plugins/remote-access-tailscale/services/tailscale-login.service.js.map +1 -1
  341. package/dist/plugins/remote-access-tailscale/services/tailscale-node-managed.service.d.ts +31 -1
  342. package/dist/plugins/remote-access-tailscale/services/tailscale-node-managed.service.js +316 -30
  343. package/dist/plugins/remote-access-tailscale/services/tailscale-node-managed.service.js.map +1 -1
  344. package/dist/plugins/remote-access-tailscale/services/tailscale-serve.service.d.ts +8 -3
  345. package/dist/plugins/remote-access-tailscale/services/tailscale-serve.service.js +39 -12
  346. package/dist/plugins/remote-access-tailscale/services/tailscale-serve.service.js.map +1 -1
  347. package/dist/plugins/remote-access-tailscale/services/tailscale-setup.service.d.ts +14 -5
  348. package/dist/plugins/remote-access-tailscale/services/tailscale-setup.service.js +51 -16
  349. package/dist/plugins/remote-access-tailscale/services/tailscale-setup.service.js.map +1 -1
  350. package/dist/plugins/scenes-local/platforms/local-scene.platform.d.ts +3 -1
  351. package/dist/plugins/scenes-local/platforms/local-scene.platform.js +12 -7
  352. package/dist/plugins/scenes-local/platforms/local-scene.platform.js.map +1 -1
  353. package/dist/plugins/simulator/controllers/simulator.controller.d.ts +8 -2
  354. package/dist/plugins/simulator/controllers/simulator.controller.js +102 -2
  355. package/dist/plugins/simulator/controllers/simulator.controller.js.map +1 -1
  356. package/dist/plugins/simulator/dto/simulate-occurrence.dto.d.ts +12 -0
  357. package/dist/plugins/simulator/dto/simulate-occurrence.dto.js +122 -0
  358. package/dist/plugins/simulator/dto/simulate-occurrence.dto.js.map +1 -0
  359. package/dist/plugins/simulator/models/simulator-response.model.d.ts +12 -0
  360. package/dist/plugins/simulator/models/simulator-response.model.js +84 -1
  361. package/dist/plugins/simulator/models/simulator-response.model.js.map +1 -1
  362. package/dist/plugins/simulator/scenarios/definitions/small-apartment.yaml +78 -0
  363. package/dist/plugins/simulator/services/scenario-executor.service.js +3 -1
  364. package/dist/plugins/simulator/services/scenario-executor.service.js.map +1 -1
  365. package/dist/plugins/simulator/services/simulation.service.js +10 -1
  366. package/dist/plugins/simulator/services/simulation.service.js.map +1 -1
  367. package/dist/plugins/simulator/simulator.openapi.d.ts +3 -2
  368. package/dist/plugins/simulator/simulator.openapi.js +5 -0
  369. package/dist/plugins/simulator/simulator.openapi.js.map +1 -1
  370. package/dist/plugins/simulator/simulators/device-simulator.interface.d.ts +2 -0
  371. package/dist/plugins/simulator/simulators/device-simulator.interface.js +83 -0
  372. package/dist/plugins/simulator/simulators/device-simulator.interface.js.map +1 -1
  373. package/dist/plugins/simulator/simulators/index.d.ts +1 -0
  374. package/dist/plugins/simulator/simulators/index.js +1 -0
  375. package/dist/plugins/simulator/simulators/index.js.map +1 -1
  376. package/dist/plugins/simulator/simulators/input-controller.simulator.d.ts +10 -0
  377. package/dist/plugins/simulator/simulators/input-controller.simulator.js +57 -0
  378. package/dist/plugins/simulator/simulators/input-controller.simulator.js.map +1 -0
  379. package/dist/plugins/simulator/simulators/lighting.simulator.js +1 -0
  380. package/dist/plugins/simulator/simulators/lighting.simulator.js.map +1 -1
  381. package/dist/plugins/spaces-home-control/services/climate-intent.service.d.ts +3 -1
  382. package/dist/plugins/spaces-home-control/services/climate-intent.service.js +6 -3
  383. package/dist/plugins/spaces-home-control/services/climate-intent.service.js.map +1 -1
  384. package/dist/plugins/spaces-home-control/services/covers-intent.service.d.ts +3 -1
  385. package/dist/plugins/spaces-home-control/services/covers-intent.service.js +6 -3
  386. package/dist/plugins/spaces-home-control/services/covers-intent.service.js.map +1 -1
  387. package/dist/plugins/spaces-home-control/services/lighting-intent.service.d.ts +3 -1
  388. package/dist/plugins/spaces-home-control/services/lighting-intent.service.js +7 -4
  389. package/dist/plugins/spaces-home-control/services/lighting-intent.service.js.map +1 -1
  390. package/dist/plugins/spaces-home-control/services/space-media-activity.service.d.ts +3 -1
  391. package/dist/plugins/spaces-home-control/services/space-media-activity.service.js +11 -5
  392. package/dist/plugins/spaces-home-control/services/space-media-activity.service.js.map +1 -1
  393. package/dist/plugins/spaces-home-control/services/space-undo-history.service.d.ts +3 -1
  394. package/dist/plugins/spaces-home-control/services/space-undo-history.service.js +8 -5
  395. package/dist/plugins/spaces-home-control/services/space-undo-history.service.js.map +1 -1
  396. package/dist/spec/channels.d.ts +51 -1
  397. package/dist/spec/channels.js +64 -1
  398. package/dist/spec/channels.js.map +1 -1
  399. package/dist/spec/devices.d.ts +155 -2
  400. package/dist/spec/devices.js +161 -2
  401. package/dist/spec/devices.js.map +1 -1
  402. package/dist/tsconfig.build.tsbuildinfo +1 -1
  403. package/package.json +2 -2
@@ -0,0 +1,205 @@
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 ThirdPartyInputsController_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ThirdPartyInputsController = void 0;
17
+ const class_validator_1 = require("class-validator");
18
+ const common_1 = require("@nestjs/common");
19
+ const swagger_1 = require("@nestjs/swagger");
20
+ const logger_1 = require("../../../common/logger");
21
+ const channel_input_occurrence_model_1 = require("../../../modules/devices/models/channel-input-occurrence.model");
22
+ const channel_input_occurrences_service_1 = require("../../../modules/devices/services/channel-input-occurrences.service");
23
+ const channels_properties_service_1 = require("../../../modules/devices/services/channels.properties.service");
24
+ const channels_service_1 = require("../../../modules/devices/services/channels.service");
25
+ const devices_service_1 = require("../../../modules/devices/services/devices.service");
26
+ const api_documentation_decorator_1 = require("../../../modules/swagger/decorators/api-documentation.decorator");
27
+ const devices_third_party_constants_1 = require("../devices-third-party.constants");
28
+ const report_input_occurrence_dto_1 = require("../dto/report-input-occurrence.dto");
29
+ let ThirdPartyInputsController = ThirdPartyInputsController_1 = class ThirdPartyInputsController {
30
+ constructor(devicesService, channelsService, channelsPropertiesService, channelInputOccurrencesService) {
31
+ this.devicesService = devicesService;
32
+ this.channelsService = channelsService;
33
+ this.channelsPropertiesService = channelsPropertiesService;
34
+ this.channelInputOccurrencesService = channelInputOccurrencesService;
35
+ this.logger = (0, logger_1.createExtensionLogger)(devices_third_party_constants_1.DEVICES_THIRD_PARTY_PLUGIN_NAME, ThirdPartyInputsController_1.name);
36
+ }
37
+ async reportOccurrence(deviceId, channelId, dto, res) {
38
+ const device = await this.devicesService.findOne(deviceId);
39
+ if (!device) {
40
+ throw new common_1.NotFoundException(`Device id=${deviceId} not found`);
41
+ }
42
+ if (device.type !== devices_third_party_constants_1.DEVICES_THIRD_PARTY_TYPE) {
43
+ throw new common_1.BadRequestException(`Device id=${deviceId} is not a third-party device`);
44
+ }
45
+ const channel = await this.channelsService.findOne(channelId);
46
+ const devChannelId = typeof channel?.device === 'string' ? channel.device : channel?.device?.id;
47
+ if (!channel || devChannelId !== device.id) {
48
+ throw new common_1.NotFoundException(`Channel id=${channelId} not found on device id=${deviceId}`);
49
+ }
50
+ let property;
51
+ if (dto.property) {
52
+ if ((0, class_validator_1.isUUID)(dto.property)) {
53
+ property = await this.channelsPropertiesService.findOne(dto.property);
54
+ const propChannelId = typeof property?.channel === 'string' ? property.channel : property?.channel?.id;
55
+ if (!property || propChannelId !== channel.id) {
56
+ throw new common_1.NotFoundException(`Property id=${dto.property} not found on channel id=${channelId}`);
57
+ }
58
+ }
59
+ else {
60
+ property = await this.channelsPropertiesService.findOneBy('identifier', dto.property, channel.id);
61
+ if (!property ||
62
+ (typeof property.channel === 'string' ? property.channel : property.channel?.id) !== channel.id) {
63
+ const allProps = await this.channelsPropertiesService.findAll();
64
+ property =
65
+ allProps.find((p) => (typeof p.channel === 'string' ? p.channel : p.channel?.id) === channel.id &&
66
+ p.identifier === dto.property) ?? null;
67
+ }
68
+ if (!property) {
69
+ throw new common_1.NotFoundException(`Property identifier=${dto.property} not found on channel id=${channelId}`);
70
+ }
71
+ }
72
+ }
73
+ else {
74
+ property = await this.channelsPropertiesService.findOneBy('identifier', 'event', channel.id);
75
+ if (!property ||
76
+ (typeof property.channel === 'string' ? property.channel : property.channel?.id) !== channel.id) {
77
+ const allProps = await this.channelsPropertiesService.findAll();
78
+ property =
79
+ allProps.find((p) => (typeof p.channel === 'string' ? p.channel : p.channel?.id) === channel.id && p.identifier === 'event') ??
80
+ allProps.find((p) => (typeof p.channel === 'string' ? p.channel : p.channel?.id) === channel.id) ??
81
+ null;
82
+ }
83
+ }
84
+ if (!property) {
85
+ throw new common_1.NotFoundException(`No valid property found for channel id=${channelId} to associate event with`);
86
+ }
87
+ if (property.format && Array.isArray(property.format) && property.format.length > 0) {
88
+ const supportedEvents = property.format.map((val) => String(val));
89
+ if (!supportedEvents.includes(String(dto.event))) {
90
+ throw new common_1.UnprocessableEntityException(`Reported event '${dto.event}' is not within declared supported events: ${supportedEvents.join(', ')}`);
91
+ }
92
+ }
93
+ const occurrence = await this.channelInputOccurrencesService.publishOccurrence({
94
+ deviceId: device.id,
95
+ channelId: channel.id,
96
+ propertyId: property.id,
97
+ event: dto.event,
98
+ sourceOccurrenceId: dto.sourceOccurrenceId,
99
+ sourceTimestamp: dto.sourceTimestamp,
100
+ nativeEventType: dto.nativeEventType,
101
+ data: dto.data,
102
+ });
103
+ if (!occurrence) {
104
+ this.logger.debug(`Duplicate occurrence dropped: device=${deviceId} channel=${channelId} sourceOccurrenceId=${dto.sourceOccurrenceId}`);
105
+ if (res !== undefined) {
106
+ res.status(common_1.HttpStatus.NO_CONTENT);
107
+ }
108
+ return;
109
+ }
110
+ const response = new channel_input_occurrence_model_1.ChannelInputOccurrenceResponseModel();
111
+ response.data = occurrence;
112
+ return response;
113
+ }
114
+ async reportEvent(deviceId, channelId, dto, res) {
115
+ return this.reportOccurrence(deviceId, channelId, dto, res);
116
+ }
117
+ };
118
+ exports.ThirdPartyInputsController = ThirdPartyInputsController;
119
+ __decorate([
120
+ (0, swagger_1.ApiOperation)({
121
+ tags: [devices_third_party_constants_1.DEVICES_THIRD_PARTY_PLUGIN_API_TAG_NAME],
122
+ summary: 'Report a physical hardware input occurrence from an authenticated third-party device',
123
+ description: 'Ingests physical button presses, switch clicks, or sensor occurrences for third-party devices. Validates device ownership, channel capabilities, and deduplication tokens.',
124
+ operationId: 'report-devices-third-party-input-occurrence',
125
+ }),
126
+ (0, swagger_1.ApiParam)({
127
+ name: 'id',
128
+ type: 'string',
129
+ format: 'uuid',
130
+ description: 'Third-party device unique identifier',
131
+ }),
132
+ (0, swagger_1.ApiParam)({
133
+ name: 'channelId',
134
+ type: 'string',
135
+ format: 'uuid',
136
+ description: 'Input channel unique identifier',
137
+ }),
138
+ (0, swagger_1.ApiBody)({
139
+ type: report_input_occurrence_dto_1.ReportInputOccurrenceDto,
140
+ description: 'Occurrence payload including event name and optional deduplication or timing metadata',
141
+ }),
142
+ (0, api_documentation_decorator_1.ApiCreatedSuccessResponse)(channel_input_occurrence_model_1.ChannelInputOccurrenceResponseModel, 'Occurrence ingested and broadcast successfully'),
143
+ (0, swagger_1.ApiNoContentResponse)({ description: 'Occurrence was deduplicated or dropped' }),
144
+ (0, api_documentation_decorator_1.ApiBadRequestResponse)('Invalid device type or input channel'),
145
+ (0, api_documentation_decorator_1.ApiNotFoundResponse)('Device, channel, or target property not found'),
146
+ (0, api_documentation_decorator_1.ApiUnprocessableEntityResponse)('Reported event is not declared as a supported capability for this channel'),
147
+ (0, api_documentation_decorator_1.ApiInternalServerErrorResponse)('Internal server error'),
148
+ (0, common_1.Post)(':id/channels/:channelId/occurrences'),
149
+ (0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
150
+ __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
151
+ __param(1, (0, common_1.Param)('channelId', common_1.ParseUUIDPipe)),
152
+ __param(2, (0, common_1.Body)()),
153
+ __param(3, (0, common_1.Res)({ passthrough: true })),
154
+ __metadata("design:type", Function),
155
+ __metadata("design:paramtypes", [String, String, report_input_occurrence_dto_1.ReportInputOccurrenceDto, Object]),
156
+ __metadata("design:returntype", Promise)
157
+ ], ThirdPartyInputsController.prototype, "reportOccurrence", null);
158
+ __decorate([
159
+ (0, swagger_1.ApiOperation)({
160
+ tags: [devices_third_party_constants_1.DEVICES_THIRD_PARTY_PLUGIN_API_TAG_NAME],
161
+ summary: 'Report a physical hardware input event for a third-party channel',
162
+ description: 'Alternative alias endpoint to report hardware input occurrences for third-party devices.',
163
+ operationId: 'report-devices-third-party-input-event',
164
+ }),
165
+ (0, swagger_1.ApiParam)({
166
+ name: 'id',
167
+ type: 'string',
168
+ format: 'uuid',
169
+ description: 'Third-party device unique identifier',
170
+ }),
171
+ (0, swagger_1.ApiParam)({
172
+ name: 'channelId',
173
+ type: 'string',
174
+ format: 'uuid',
175
+ description: 'Input channel unique identifier',
176
+ }),
177
+ (0, swagger_1.ApiBody)({
178
+ type: report_input_occurrence_dto_1.ReportInputOccurrenceDto,
179
+ description: 'Occurrence payload including event name and optional deduplication or timing metadata',
180
+ }),
181
+ (0, api_documentation_decorator_1.ApiCreatedSuccessResponse)(channel_input_occurrence_model_1.ChannelInputOccurrenceResponseModel, 'Occurrence ingested and broadcast successfully'),
182
+ (0, swagger_1.ApiNoContentResponse)({ description: 'Occurrence was deduplicated or dropped' }),
183
+ (0, api_documentation_decorator_1.ApiBadRequestResponse)('Invalid device type or input channel'),
184
+ (0, api_documentation_decorator_1.ApiNotFoundResponse)('Device, channel, or target property not found'),
185
+ (0, api_documentation_decorator_1.ApiUnprocessableEntityResponse)('Reported event is not declared as a supported capability for this channel'),
186
+ (0, api_documentation_decorator_1.ApiInternalServerErrorResponse)('Internal server error'),
187
+ (0, common_1.Post)(':id/channels/:channelId/events'),
188
+ (0, common_1.HttpCode)(common_1.HttpStatus.CREATED),
189
+ __param(0, (0, common_1.Param)('id', common_1.ParseUUIDPipe)),
190
+ __param(1, (0, common_1.Param)('channelId', common_1.ParseUUIDPipe)),
191
+ __param(2, (0, common_1.Body)()),
192
+ __param(3, (0, common_1.Res)({ passthrough: true })),
193
+ __metadata("design:type", Function),
194
+ __metadata("design:paramtypes", [String, String, report_input_occurrence_dto_1.ReportInputOccurrenceDto, Object]),
195
+ __metadata("design:returntype", Promise)
196
+ ], ThirdPartyInputsController.prototype, "reportEvent", null);
197
+ exports.ThirdPartyInputsController = ThirdPartyInputsController = ThirdPartyInputsController_1 = __decorate([
198
+ (0, swagger_1.ApiTags)(devices_third_party_constants_1.DEVICES_THIRD_PARTY_PLUGIN_API_TAG_NAME),
199
+ (0, common_1.Controller)('devices'),
200
+ __metadata("design:paramtypes", [devices_service_1.DevicesService,
201
+ channels_service_1.ChannelsService,
202
+ channels_properties_service_1.ChannelsPropertiesService,
203
+ channel_input_occurrences_service_1.ChannelInputOccurrencesService])
204
+ ], ThirdPartyInputsController);
205
+ //# sourceMappingURL=third-party-inputs.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"third-party-inputs.controller.js","sourceRoot":"","sources":["../../../../src/plugins/devices-third-party/controllers/third-party-inputs.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAyC;AAGzC,2CAYwB;AACxB,6CAAiG;AAEjG,mDAAuF;AAEvF,mHAAqH;AACrH,2HAAqH;AACrH,+GAA0G;AAC1G,yFAAqF;AACrF,uFAAmF;AACnF,iHAMyE;AACzE,oFAI0C;AAC1C,oFAA8E;AAQvE,IAAM,0BAA0B,kCAAhC,MAAM,0BAA0B;IAMtC,YACkB,cAA8B,EAC9B,eAAgC,EAChC,yBAAoD,EACpD,8BAA8D;QAH9D,mBAAc,GAAd,cAAc,CAAgB;QAC9B,oBAAe,GAAf,eAAe,CAAiB;QAChC,8BAAyB,GAAzB,yBAAyB,CAA2B;QACpD,mCAA8B,GAA9B,8BAA8B,CAAgC;QAT/D,WAAM,GAA2B,IAAA,8BAAqB,EACtE,+DAA+B,EAC/B,4BAA0B,CAAC,IAAI,CAC/B,CAAC;IAOC,CAAC;IAiCE,AAAN,KAAK,CAAC,gBAAgB,CACO,QAAgB,EACT,SAAiB,EAC5C,GAA6B,EACT,GAAkB;QAG9C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAyB,QAAQ,CAAC,CAAC;QACnF,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,IAAI,0BAAiB,CAAC,aAAa,QAAQ,YAAY,CAAC,CAAC;QAChE,CAAC;QAED,IAAI,MAAM,CAAC,IAAI,KAAK,wDAAwB,EAAE,CAAC;YAC9C,MAAM,IAAI,4BAAmB,CAAC,aAAa,QAAQ,8BAA8B,CAAC,CAAC;QACpF,CAAC;QAGD,MAAM,OAAO,GAAG,MAAM,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AC;IACD,IAAA,uDAAyB,EAAC,oEAAmC,EAAE,gDAAgD,CAAC;IAChH,IAAA,8BAAoB,EAAC,EAAE,WAAW,EAAE,wCAAwC,EAAE,CAAC;IAC/E,IAAA,mDAAqB,EAAC,sCAAsC,CAAC;IAC7D,IAAA,iDAAmB,EAAC,+CAA+C,CAAC;IACpE,IAAA,4DAA8B,EAAC,2EAA2E,CAAC;IAC3G,IAAA,4DAA8B,EAAC,uBAAuB,CAAC;IACvD,IAAA,aAAI,EAAC,gCAAgC,CAAC;IACtC,IAAA,iBAAQ,EAAC,mBAAU,CAAC,OAAO,CAAC;IAE3B,WAAA,IAAA,cAAK,EAAC,IAAI,EAAE,sBAAa,CAAC,CAAA;IAC1B,WAAA,IAAA,cAAK,EAAC,WAAW,EAAE,sBAAa,CAAC,CAAA;IACjC,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,YAAG,EAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAA;;qDADd,sDAAwB;;6DAIrC;qCA9LW,0BAA0B;IAFtC,IAAA,iBAAO,EAAC,uEAAuC,CAAC;IAChD,IAAA,mBAAU,EAAC,SAAS,CAAC;qCAQa,gCAAc;QACb,kCAAe;QACL,uDAAyB;QACpB,kEAA8B;GAVpE,0BAA0B,CA+LtC"}
@@ -10,4 +10,4 @@ import { UpdateThirdPartyDeviceDto } from './dto/update-device.dto';
10
10
  import { ThirdPartyChannelEntity, ThirdPartyChannelPropertyEntity, ThirdPartyDeviceEntity } from './entities/devices-third-party.entity';
11
11
  import { ThirdPartyConfigModel } from './models/config.model';
12
12
  import { DevicesThirdPartyPluginErrorCode } from './models/demo-control.model';
13
- export declare const DEVICES_THIRD_PARTY_PLUGIN_SWAGGER_EXTRA_MODELS: (typeof PropertyUpdateRequestDto | typeof PropertyUpdateResultModel | typeof PropertiesUpdateResultModel | typeof CreateThirdPartyChannelPropertyDto | typeof CreateThirdPartyChannelDto | typeof CreateThirdPartyDeviceDto | typeof UpdateThirdPartyChannelPropertyDto | typeof UpdateThirdPartyChannelDto | typeof ThirdPartyUpdatePluginConfigDto | typeof UpdateThirdPartyDeviceDto | typeof ThirdPartyDeviceEntity | typeof ThirdPartyChannelEntity | typeof ThirdPartyChannelPropertyEntity | typeof ThirdPartyConfigModel | typeof DevicesThirdPartyPluginErrorCode)[];
13
+ export declare const DEVICES_THIRD_PARTY_PLUGIN_SWAGGER_EXTRA_MODELS: (typeof PropertyUpdateRequestDto | typeof PropertyUpdateResultModel | typeof PropertiesUpdateResultModel | typeof ThirdPartyDeviceEntity | typeof ThirdPartyChannelEntity | typeof ThirdPartyChannelPropertyEntity | typeof CreateThirdPartyChannelPropertyDto | typeof CreateThirdPartyChannelDto | typeof CreateThirdPartyDeviceDto | typeof UpdateThirdPartyChannelPropertyDto | typeof UpdateThirdPartyChannelDto | typeof ThirdPartyUpdatePluginConfigDto | typeof UpdateThirdPartyDeviceDto | typeof ThirdPartyConfigModel | typeof DevicesThirdPartyPluginErrorCode)[];
@@ -33,6 +33,7 @@ const extended_discriminator_service_1 = require("../../modules/swagger/services
33
33
  const swagger_models_registry_service_1 = require("../../modules/swagger/services/swagger-models-registry.service");
34
34
  const swagger_module_1 = require("../../modules/swagger/swagger.module");
35
35
  const third_party_demo_controller_1 = require("./controllers/third-party-demo.controller");
36
+ const third_party_inputs_controller_1 = require("./controllers/third-party-inputs.controller");
36
37
  const devices_third_party_constants_1 = require("./devices-third-party.constants");
37
38
  const devices_third_party_openapi_1 = require("./devices-third-party.openapi");
38
39
  const create_channel_property_dto_2 = require("./dto/create-channel-property.dto");
@@ -194,7 +195,7 @@ exports.DevicesThirdPartyPlugin = DevicesThirdPartyPlugin = __decorate([
194
195
  swagger_module_1.SwaggerModule,
195
196
  ],
196
197
  providers: [third_party_device_platform_1.ThirdPartyDevicePlatform],
197
- controllers: [third_party_demo_controller_1.ThirdPartyDemoController],
198
+ controllers: [third_party_demo_controller_1.ThirdPartyDemoController, third_party_inputs_controller_1.ThirdPartyInputsController],
198
199
  }),
199
200
  __metadata("design:paramtypes", [plugins_type_mapper_service_1.PluginsTypeMapperService,
200
201
  devices_type_mapper_service_1.DevicesTypeMapperService,
@@ -1 +1 @@
1
- {"version":3,"file":"devices-third-party.plugin.js","sourceRoot":"","sources":["../../../src/plugins/devices-third-party/devices-third-party.plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAEhD,sEAAkE;AAClE,2GAAqG;AACrG,yEAAqE;AACrE,uGAAiG;AACjG,qFAAgF;AAChF,mFAA8E;AAC9E,uGAAiG;AACjG,qFAAgF;AAChF,mFAA8E;AAC9E,kFAAmH;AACnH,8GAAwG;AACxG,oIAA6H;AAC7H,4GAAsG;AACtG,wGAAmG;AACnG,kFAA8E;AAC9E,6FAAyF;AACzF,0FAA4E;AAC5E,kHAA6G;AAC7G,oHAA8G;AAC9G,yEAAqE;AAErE,2FAAqF;AACrF,mFAKyC;AACzC,+EAAgG;AAChG,mFAAuF;AACvF,iEAAsE;AACtE,+DAAoE;AACpE,mFAAuF;AACvF,iEAAsE;AACtE,+DAA0E;AAC1E,+DAAoE;AACpE,sFAI+C;AAC/C,wDAA8D;AAC9D,yFAAmF;AAkB5E,IAAM,uBAAuB,GAA7B,MAAM,uBAAuB;IACnC,YACkB,YAAsC,EACtC,aAAuC,EACvC,cAAyC,EACzC,wBAA6D,EAC7D,uBAAgD,EAChD,wBAAkD,EAClD,eAA6C,EAC7C,qBAAmD,EACnD,iBAAoC;QARpC,iBAAY,GAAZ,YAAY,CAA0B;QACtC,kBAAa,GAAb,aAAa,CAA0B;QACvC,mBAAc,GAAd,cAAc,CAA2B;QACzC,6BAAwB,GAAxB,wBAAwB,CAAqC;QAC7D,4BAAuB,GAAvB,uBAAuB,CAAyB;QAChD,6BAAwB,GAAxB,wBAAwB,CAA0B;QAClD,oBAAe,GAAf,eAAe,CAA8B;QAC7C,0BAAqB,GAArB,qBAAqB,CAA8B;QACnD,sBAAiB,GAA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C,CAAC;QAGH,IAAI,CAAC,iBAAiB,CAAC,sBAAsB,CAAC;YAC7C,IAAI,EAAE,+DAA+B;YACrC,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,kEAAkE;YAC/E,MAAM,EAAE,WAAW;YACnB,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;+EA0BoE;YAC5E,KAAK,EAAE;gBACN,aAAa,EAAE,wCAAwC;gBACvD,UAAU,EAAE,0CAA0C;aACtD;SACD,CAAC,CAAC;IACJ,CAAC;CACD,CAAA;AA7JY,0DAAuB;kCAAvB,uBAAuB;IAhBnC,IAAA,0BAAM,EAAC;QACP,OAAO,EAAE,+DAA+B;QACxC,WAAW,EAAE,uEAAuC;QACpD,WAAW,EAAE,8EAA8C;KAC3D,CAAC;IACD,IAAA,eAAM,EAAC;QACP,OAAO,EAAE;YACR,uBAAa,CAAC,UAAU,CAAC,CAAC,mDAAsB,CAAC,CAAC;YAClD,8BAAa;YACb,4BAAY;YACZ,oCAAgB;YAChB,8BAAa;SACb;QACD,SAAS,EAAE,CAAC,sDAAwB,CAAC;QACrC,WAAW,EAAE,CAAC,sDAAwB,CAAC;KACvC,CAAC;qCAG+B,sDAAwB;QACvB,sDAAwB;QACvB,wDAAyB;QACf,6EAAmC;QACpC,mDAAuB;QACtB,sDAAwB;QACjC,8DAA4B;QACtB,6DAA4B;QAChC,sCAAiB;GAV1C,uBAAuB,CA6JnC"}
1
+ {"version":3,"file":"devices-third-party.plugin.js","sourceRoot":"","sources":["../../../src/plugins/devices-third-party/devices-third-party.plugin.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAEhD,sEAAkE;AAClE,2GAAqG;AACrG,yEAAqE;AACrE,uGAAiG;AACjG,qFAAgF;AAChF,mFAA8E;AAC9E,uGAAiG;AACjG,qFAAgF;AAChF,mFAA8E;AAC9E,kFAAmH;AACnH,8GAAwG;AACxG,oIAA6H;AAC7H,4GAAsG;AACtG,wGAAm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AAW,EAAE,8EAA8C;KAC3D,CAAC;IACD,IAAA,eAAM,EAAC;QACP,OAAO,EAAE;YACR,uBAAa,CAAC,UAAU,CAAC,CAAC,mDAAsB,CAAC,CAAC;YAClD,8BAAa;YACb,4BAAY;YACZ,oCAAgB;YAChB,8BAAa;SACb;QACD,SAAS,EAAE,CAAC,sDAAwB,CAAC;QACrC,WAAW,EAAE,CAAC,sDAAwB,EAAE,0DAA0B,CAAC;KACnE,CAAC;qCAG+B,sDAAwB;QACvB,sDAAwB;QACvB,wDAAyB;QACf,6EAAmC;QACpC,mDAAuB;QACtB,sDAAwB;QACjC,8DAA4B;QACtB,6DAA4B;QAChC,sCAAiB;GAV1C,uBAAuB,CA6JnC"}
@@ -0,0 +1,5 @@
1
+ export declare class ReportInputOccurrenceResponseDto {
2
+ id: string;
3
+ timestamp: string;
4
+ event: string;
5
+ }
@@ -0,0 +1,50 @@
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.ReportInputOccurrenceResponseDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const swagger_1 = require("@nestjs/swagger");
16
+ let ReportInputOccurrenceResponseDto = class ReportInputOccurrenceResponseDto {
17
+ };
18
+ exports.ReportInputOccurrenceResponseDto = ReportInputOccurrenceResponseDto;
19
+ __decorate([
20
+ (0, swagger_1.ApiProperty)({
21
+ description: 'Assigned occurrence UUID',
22
+ example: 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11',
23
+ }),
24
+ (0, class_transformer_1.Expose)(),
25
+ (0, class_validator_1.IsUUID)(),
26
+ __metadata("design:type", String)
27
+ ], ReportInputOccurrenceResponseDto.prototype, "id", void 0);
28
+ __decorate([
29
+ (0, swagger_1.ApiProperty)({
30
+ description: 'Ingestion timestamp in ISO format',
31
+ example: '2026-03-30T12:00:00.000Z',
32
+ }),
33
+ (0, class_transformer_1.Expose)(),
34
+ (0, class_validator_1.IsString)(),
35
+ __metadata("design:type", String)
36
+ ], ReportInputOccurrenceResponseDto.prototype, "timestamp", void 0);
37
+ __decorate([
38
+ (0, swagger_1.ApiProperty)({
39
+ description: 'Reported event name',
40
+ example: 'press',
41
+ }),
42
+ (0, class_transformer_1.Expose)(),
43
+ (0, class_validator_1.IsString)(),
44
+ (0, class_validator_1.IsNotEmpty)(),
45
+ __metadata("design:type", String)
46
+ ], ReportInputOccurrenceResponseDto.prototype, "event", void 0);
47
+ exports.ReportInputOccurrenceResponseDto = ReportInputOccurrenceResponseDto = __decorate([
48
+ (0, swagger_1.ApiSchema)({ name: 'DevicesThirdPartyPluginReportInputOccurrenceResponse' })
49
+ ], ReportInputOccurrenceResponseDto);
50
+ //# sourceMappingURL=report-input-occurrence-response.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-input-occurrence-response.dto.js","sourceRoot":"","sources":["../../../../src/plugins/devices-third-party/dto/report-input-occurrence-response.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA2C;AAC3C,qDAA+D;AAE/D,6CAAyD;AAGlD,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;CAyB5C,CAAA;AAzBY,4EAAgC;AAO5C;IANC,IAAA,qBAAW,EAAC;QACZ,WAAW,EAAE,0BAA0B;QACvC,OAAO,EAAE,sCAAsC;KAC/C,CAAC;IACD,IAAA,0BAAM,GAAE;IACR,IAAA,wBAAM,GAAE;;4DACE;AAQX;IANC,IAAA,qBAAW,EAAC;QACZ,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,0BAA0B;KACnC,CAAC;IACD,IAAA,0BAAM,GAAE;IACR,IAAA,0BAAQ,GAAE;;mEACO;AASlB;IAPC,IAAA,qBAAW,EAAC;QACZ,WAAW,EAAE,qBAAqB;QAClC,OAAO,EAAE,OAAO;KAChB,CAAC;IACD,IAAA,0BAAM,GAAE;IACR,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;+DACC;2CAxBF,gCAAgC;IAD5C,IAAA,mBAAS,EAAC,EAAE,IAAI,EAAE,sDAAsD,EAAE,CAAC;GAC/D,gCAAgC,CAyB5C"}
@@ -0,0 +1,8 @@
1
+ export declare class ReportInputOccurrenceDto {
2
+ event: string;
3
+ property?: string;
4
+ sourceOccurrenceId?: string;
5
+ sourceTimestamp?: string;
6
+ nativeEventType?: string;
7
+ data?: Record<string, unknown>;
8
+ }
@@ -0,0 +1,81 @@
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.ReportInputOccurrenceDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const swagger_1 = require("@nestjs/swagger");
16
+ let ReportInputOccurrenceDto = class ReportInputOccurrenceDto {
17
+ };
18
+ exports.ReportInputOccurrenceDto = ReportInputOccurrenceDto;
19
+ __decorate([
20
+ (0, swagger_1.ApiProperty)({
21
+ description: 'Input event name, e.g. press, double_press, long_press',
22
+ example: 'press',
23
+ }),
24
+ (0, class_transformer_1.Expose)(),
25
+ (0, class_validator_1.IsString)(),
26
+ (0, class_validator_1.IsNotEmpty)(),
27
+ __metadata("design:type", String)
28
+ ], ReportInputOccurrenceDto.prototype, "event", void 0);
29
+ __decorate([
30
+ (0, swagger_1.ApiPropertyOptional)({
31
+ description: 'Property identifier or UUID. If omitted, targets default event property',
32
+ example: 'event',
33
+ }),
34
+ (0, class_transformer_1.Expose)(),
35
+ (0, class_validator_1.IsString)(),
36
+ (0, class_validator_1.IsOptional)(),
37
+ __metadata("design:type", String)
38
+ ], ReportInputOccurrenceDto.prototype, "property", void 0);
39
+ __decorate([
40
+ (0, swagger_1.ApiPropertyOptional)({
41
+ description: 'Optional external source occurrence identifier for deduplication',
42
+ example: 'occ-12345',
43
+ }),
44
+ (0, class_transformer_1.Expose)(),
45
+ (0, class_validator_1.IsString)(),
46
+ (0, class_validator_1.IsOptional)(),
47
+ __metadata("design:type", String)
48
+ ], ReportInputOccurrenceDto.prototype, "sourceOccurrenceId", void 0);
49
+ __decorate([
50
+ (0, swagger_1.ApiPropertyOptional)({
51
+ description: 'ISO timestamp from external device',
52
+ example: '2026-03-30T12:00:00.000Z',
53
+ }),
54
+ (0, class_transformer_1.Expose)(),
55
+ (0, class_validator_1.IsDateString)(),
56
+ (0, class_validator_1.IsOptional)(),
57
+ __metadata("design:type", String)
58
+ ], ReportInputOccurrenceDto.prototype, "sourceTimestamp", void 0);
59
+ __decorate([
60
+ (0, swagger_1.ApiPropertyOptional)({
61
+ description: 'Native event type string before normalisation',
62
+ example: 'single_click',
63
+ }),
64
+ (0, class_transformer_1.Expose)(),
65
+ (0, class_validator_1.IsString)(),
66
+ (0, class_validator_1.IsOptional)(),
67
+ __metadata("design:type", String)
68
+ ], ReportInputOccurrenceDto.prototype, "nativeEventType", void 0);
69
+ __decorate([
70
+ (0, swagger_1.ApiPropertyOptional)({
71
+ description: 'Arbitrary metadata payload',
72
+ }),
73
+ (0, class_transformer_1.Expose)(),
74
+ (0, class_validator_1.IsObject)(),
75
+ (0, class_validator_1.IsOptional)(),
76
+ __metadata("design:type", Object)
77
+ ], ReportInputOccurrenceDto.prototype, "data", void 0);
78
+ exports.ReportInputOccurrenceDto = ReportInputOccurrenceDto = __decorate([
79
+ (0, swagger_1.ApiSchema)({ name: 'DevicesThirdPartyPluginReportInputOccurrence' })
80
+ ], ReportInputOccurrenceDto);
81
+ //# sourceMappingURL=report-input-occurrence.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report-input-occurrence.dto.js","sourceRoot":"","sources":["../../../../src/plugins/devices-third-party/dto/report-input-occurrence.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA2C;AAC3C,qDAA2F;AAE3F,6CAA8E;AAGvE,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;CAqDpC,CAAA;AArDY,4DAAwB;AAQpC;IAPC,IAAA,qBAAW,EAAC;QACZ,WAAW,EAAE,wDAAwD;QACrE,OAAO,EAAE,OAAO;KAChB,CAAC;IACD,IAAA,0BAAM,GAAE;IACR,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uDACC;AASd;IAPC,IAAA,6BAAmB,EAAC;QACpB,WAAW,EAAE,yEAAyE;QACtF,OAAO,EAAE,OAAO;KAChB,CAAC;IACD,IAAA,0BAAM,GAAE;IACR,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACK;AASlB;IAPC,IAAA,6BAAmB,EAAC;QACpB,WAAW,EAAE,kEAAkE;QAC/E,OAAO,EAAE,WAAW;KACpB,CAAC;IACD,IAAA,0BAAM,GAAE;IACR,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;oEACe;AAS5B;IAPC,IAAA,6BAAmB,EAAC;QACpB,WAAW,EAAE,oCAAoC;QACjD,OAAO,EAAE,0BAA0B;KACnC,CAAC;IACD,IAAA,0BAAM,GAAE;IACR,IAAA,8BAAY,GAAE;IACd,IAAA,4BAAU,GAAE;;iEACY;AASzB;IAPC,IAAA,6BAAmB,EAAC;QACpB,WAAW,EAAE,+CAA+C;QAC5D,OAAO,EAAE,cAAc;KACvB,CAAC;IACD,IAAA,0BAAM,GAAE;IACR,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;iEACY;AAQzB;IANC,IAAA,6BAAmB,EAAC;QACpB,WAAW,EAAE,4BAA4B;KACzC,CAAC;IACD,IAAA,0BAAM,GAAE;IACR,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;sDACkB;mCApDnB,wBAAwB;IADpC,IAAA,mBAAS,EAAC,EAAE,IAAI,EAAE,8CAA8C,EAAE,CAAC;GACvD,wBAAwB,CAqDpC"}
@@ -11,6 +11,7 @@ const class_validator_1 = require("class-validator");
11
11
  const common_1 = require("@nestjs/common");
12
12
  const extension_logger_service_1 = require("../../../common/logger/extension-logger.service");
13
13
  const transform_utils_1 = require("../../../common/utils/transform.utils");
14
+ const devices_constants_1 = require("../../../modules/devices/devices.constants");
14
15
  const http_device_platform_1 = require("../../../modules/devices/platforms/http-device.platform");
15
16
  const devices_third_party_constants_1 = require("../devices-third-party.constants");
16
17
  const third_party_property_update_request_dto_1 = require("../dto/third-party-property-update-request.dto");
@@ -28,10 +29,24 @@ let ThirdPartyDevicePlatform = class ThirdPartyDevicePlatform extends http_devic
28
29
  }
29
30
  async processBatch(updates) {
30
31
  try {
31
- const device = updates[0].device;
32
+ const validUpdates = updates.filter((update) => {
33
+ const permissions = update.property.permissions ?? [];
34
+ const isWritable = permissions.includes(devices_constants_1.PermissionType.READ_WRITE) || permissions.includes(devices_constants_1.PermissionType.WRITE_ONLY);
35
+ const isEventOnly = permissions.includes(devices_constants_1.PermissionType.EVENT_ONLY);
36
+ const isInputChannel = [devices_constants_1.ChannelCategory.BUTTON, devices_constants_1.ChannelCategory.BINARY_INPUT].includes(update.channel.category);
37
+ if (isEventOnly || !isWritable || isInputChannel) {
38
+ this.logger.warn(`Refusing to dispatch actuator command for non-actuator/event-only property id=${update.property.id} on channel=${update.channel.id}`, { resource: update.device.id });
39
+ return false;
40
+ }
41
+ return true;
42
+ });
43
+ if (validUpdates.length === 0) {
44
+ return true;
45
+ }
46
+ const device = validUpdates[0].device;
32
47
  const endpoint = device.serviceAddress;
33
48
  const payload = {
34
- properties: updates.map((update) => ({
49
+ properties: validUpdates.map((update) => ({
35
50
  device: update.device.id,
36
51
  channel: update.channel.id,
37
52
  property: update.property.id,
@@ -47,7 +62,7 @@ let ThirdPartyDevicePlatform = class ThirdPartyDevicePlatform extends http_devic
47
62
  return false;
48
63
  }
49
64
  else if (response.status === 204) {
50
- this.logger.log('Successfully updated properties');
65
+ this.logger.log('Successfully updated properties', { resource: device.id });
51
66
  return true;
52
67
  }
53
68
  else if (response.status === 207) {
@@ -56,7 +71,7 @@ let ThirdPartyDevicePlatform = class ThirdPartyDevicePlatform extends http_devic
56
71
  return false;
57
72
  }
58
73
  const responseModel = (0, transform_utils_1.toInstance)(third_party_property_update_response_dto_1.PropertiesUpdateResultModel, responseBody);
59
- const failedProperties = responseModel.properties.filter((p) => p.status != devices_third_party_constants_1.ThirdPartyPropertiesUpdateStatus.SUCCESS);
74
+ const failedProperties = responseModel.properties.filter((p) => p.status !== devices_third_party_constants_1.ThirdPartyPropertiesUpdateStatus.SUCCESS);
60
75
  if (failedProperties.length > 0) {
61
76
  this.logger.warn(`Some properties failed to update for device id=${device.id}: ${JSON.stringify(failedProperties)}`, { resource: device.id });
62
77
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"third-party-device.platform.js","sourceRoot":"","sources":["../../../../src/plugins/devices-third-party/platforms/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AC,iBAAiB,CAAC,CAAC,CAAC,eAAe,4BAA4B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAClH,CAAC;YAEF,OAAO,KAAK,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAA;AAjHY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;GACA,wBAAwB,CAiHpC"}
1
+ {"version":3,"file":"third-party-device.platform.js","sourceRoot":"","sources":["../../../../src/plugins/devices-third-party/platforms/third-party-device.platform.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qDAA2C;AAE3C,2CAA4C;AAE5C,8FAAgH;AAChH,2EAAmE;AACnE,kFAA6F;AAE7F,kGAA6F;AAC7F,oFAI0C;AAC1C,4GAAwF;AACxF,8GAGyD;AAQlD,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,yCAAkB;IAAzD;;QACW,WAAM,GAA2B,IAAA,gDAAqB,EACtE,+DAA+B,EAC/B,0BAA0B,CAC1B,CAAC;IAqIH,CAAC;IAnIA,OAAO;QACN,OAAO,wDAAwB,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAiC;QAChF,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAA6C;QAC/D,IAAI,CAAC;YAEJ,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE;gBAC9C,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,IAAI,EAAE,CAAC;gBACtD,MAAM,UAAU,GACf,WAAW,CAAC,QAAQ,CAAC,kCAAc,CAAC,UAAU,CAAC,IAAI,WAAW,CAAC,QAAQ,CA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MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,MAAM,CAAC,KAAK,CAChB,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,eAAe,4BAA4B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAClH,CAAC;YAEF,OAAO,KAAK,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAA;AAzIY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,mBAAU,GAAE;GACA,wBAAwB,CAyIpC"}
@@ -1,5 +1,6 @@
1
1
  import { EventEmitter2 } from '@nestjs/event-emitter';
2
2
  import { ChannelPropertyEntity } from '../../../modules/devices/entities/devices.entity';
3
+ import { ChannelInputOccurrencePayload } from '../../../modules/devices/models/channel-input-occurrence.model';
3
4
  import { VirtualPropertyIndexService } from '../services/virtual-property-index.service';
4
5
  export declare class VirtualProjectionListener {
5
6
  private readonly index;
@@ -7,4 +8,5 @@ export declare class VirtualProjectionListener {
7
8
  private readonly logger;
8
9
  constructor(index: VirtualPropertyIndexService, eventEmitter: EventEmitter2);
9
10
  handlePropertyValueSet(property: ChannelPropertyEntity): void;
11
+ handleChannelInputOccurrence(occurrence: ChannelInputOccurrencePayload): void;
10
12
  }
@@ -10,11 +10,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.VirtualProjectionListener = void 0;
13
+ const uuid_1 = require("uuid");
13
14
  const common_1 = require("@nestjs/common");
14
15
  const event_emitter_1 = require("@nestjs/event-emitter");
15
16
  const extension_logger_service_1 = require("../../../common/logger/extension-logger.service");
16
17
  const devices_constants_1 = require("../../../modules/devices/devices.constants");
17
18
  const devices_entity_1 = require("../../../modules/devices/entities/devices.entity");
19
+ const channel_input_occurrence_model_1 = require("../../../modules/devices/models/channel-input-occurrence.model");
18
20
  const devices_virtual_constants_1 = require("../devices-virtual.constants");
19
21
  const virtual_property_index_service_1 = require("../services/virtual-property-index.service");
20
22
  let VirtualProjectionListener = class VirtualProjectionListener {
@@ -34,6 +36,55 @@ let VirtualProjectionListener = class VirtualProjectionListener {
34
36
  }
35
37
  this.logger.debug(`Projected value of property id=${property.id} to ${projections.length} virtual properties`);
36
38
  }
39
+ handleChannelInputOccurrence(occurrence) {
40
+ if (typeof occurrence.data?.projection === 'object' &&
41
+ occurrence.data.projection !== null &&
42
+ 'originalOccurrenceId' in occurrence.data.projection) {
43
+ return;
44
+ }
45
+ const projections = this.index.findBySourceProperty(occurrence.propertyId);
46
+ if (projections.length === 0) {
47
+ return;
48
+ }
49
+ for (const projection of projections) {
50
+ const channel = projection.channel;
51
+ if (!channel || typeof channel === 'string') {
52
+ continue;
53
+ }
54
+ const virtualDeviceId = typeof channel.device === 'string' ? channel.device : channel.device?.id;
55
+ if (!virtualDeviceId || !channel.id) {
56
+ continue;
57
+ }
58
+ const deviceCategory = typeof channel.device !== 'string' ? channel.device?.category : undefined;
59
+ const projectedOccurrence = {
60
+ id: (0, uuid_1.v4)(),
61
+ deviceId: virtualDeviceId,
62
+ channelId: channel.id,
63
+ propertyId: projection.id,
64
+ channelCategory: channel.category,
65
+ propertyCategory: projection.category,
66
+ deviceCategory,
67
+ event: occurrence.event,
68
+ timestamp: new Date().toISOString(),
69
+ sourceTimestamp: occurrence.sourceTimestamp ?? occurrence.timestamp,
70
+ sourceOccurrenceId: occurrence.sourceOccurrenceId ?? occurrence.id,
71
+ nativeEventType: occurrence.nativeEventType,
72
+ integration: occurrence.integration,
73
+ endpoint: occurrence.endpoint,
74
+ data: {
75
+ ...(occurrence.data ?? {}),
76
+ projection: {
77
+ originalOccurrenceId: occurrence.id,
78
+ sourceDeviceId: occurrence.deviceId,
79
+ sourceChannelId: occurrence.channelId,
80
+ sourcePropertyId: occurrence.propertyId,
81
+ },
82
+ },
83
+ };
84
+ this.eventEmitter.emit(devices_constants_1.EventType.CHANNEL_INPUT_OCCURRENCE, projectedOccurrence);
85
+ }
86
+ this.logger.debug(`Projected input occurrence event=${occurrence.event} from property id=${occurrence.propertyId} to ${projections.length} virtual properties`);
87
+ }
37
88
  };
38
89
  exports.VirtualProjectionListener = VirtualProjectionListener;
39
90
  __decorate([
@@ -42,6 +93,12 @@ __decorate([
42
93
  __metadata("design:paramtypes", [devices_entity_1.ChannelPropertyEntity]),
43
94
  __metadata("design:returntype", void 0)
44
95
  ], VirtualProjectionListener.prototype, "handlePropertyValueSet", null);
96
+ __decorate([
97
+ (0, event_emitter_1.OnEvent)(devices_constants_1.EventType.CHANNEL_INPUT_OCCURRENCE),
98
+ __metadata("design:type", Function),
99
+ __metadata("design:paramtypes", [channel_input_occurrence_model_1.ChannelInputOccurrencePayload]),
100
+ __metadata("design:returntype", void 0)
101
+ ], VirtualProjectionListener.prototype, "handleChannelInputOccurrence", null);
45
102
  exports.VirtualProjectionListener = VirtualProjectionListener = __decorate([
46
103
  (0, common_1.Injectable)(),
47
104
  __metadata("design:paramtypes", [virtual_property_index_service_1.VirtualPropertyIndexService,
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-projection.listener.js","sourceRoot":"","sources":["../../../../src/plugins/devices-virtual/listeners/virtual-projection.listener.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yDAA+D;AAE/D,8FAAwF;AACxF,kFAAuE;AACvE,qFAAyF;AACzF,4EAA2E;AAC3E,+FAAyF;AAalF,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAGrC,YACkB,KAAkC,EAClC,YAA2B;QAD3B,UAAK,GAAL,KAAK,CAA6B;QAClC,iBAAY,GAAZ,YAAY,CAAe;QAJ5B,WAAM,GAAG,IAAA,gDAAqB,EAAC,uDAA2B,EAAE,2BAA2B,CAAC,CAAC;IAKvG,CAAC;IAGJ,sBAAsB,CAAC,QAA+B;QACrD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAEjE,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,OAAO;QACR,CAAC;QAED,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YAGtC,UAAU,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;YAElC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,6BAAS,CAAC,0BAA0B,EAAE,UAAU,CAAC,CAAC;QAC1E,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kCAAkC,QAAQ,CAAC,EAAE,OAAO,WAAW,CAAC,MAAM,qBAAqB,CAAC,CAAC;IAChH,CAAC;CACD,CAAA;AA1BY,8DAAyB;AASrC;IADC,IAAA,uBAAO,EAAC,6BAAS,CAAC,0BAA0B,CAAC;;qCACb,sCAAqB;;uEAgBrD;oCAzBW,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAKa,4DAA2B;QACpB,6BAAa;GALjC,yBAAyB,CA0BrC"}
1
+ {"version":3,"file":"virtual-projection.listener.js","sourceRoot":"","sources":["../../../../src/plugins/devices-virtual/listeners/virtual-projection.listener.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+BAAoC;AAEpC,2CAA4C;AAC5C,yDAA+D;AAE/D,8FAAwF;AACxF,kFAAuE;AACvE,qFAAyF;AACzF,mHAA+G;AAC/G,4EAA2E;AAC3E,+FAAyF;AAalF,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IAGrC,YACkB,KAAkC,EAClC,YAA2B;QAD3B,UAAK,GAAL,KAAK,CAA6B;QAClC,iBAAY,GAAZ,YAAY,CAAe;QAJ5B,WAAM,GAAG,IAAA,gDAAqB,EAAC,uDAA2B,EAAE,2BAA2B,CAAC,CAAC;IAKvG,CAAC;IAGJ,sBAAsB,CAAC,QAA+B;QACrD,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,QAAQ,CAAC,EAAE,CAAC,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,qBAAqB,CAC5I,CAAC;IACH,CAAC;CACD,CAAA;AA3FY,8DAAyB;AASrC;IADC,IAAA,uBAAO,EAAC,6BAAS,CAAC,0BAA0B,CAAC;;qCACb,sCAAqB;;uEAgBrD;AAGD;IADC,IAAA,uBAAO,EAAC,6BAAS,CAAC,wBAAwB,CAAC;;qCACH,8DAA6B;;6EA8DrE;oCA1FW,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAKa,4DAA2B;QACpB,6BAAa;GALjC,yBAAyB,CA2FrC"}
@@ -12,6 +12,8 @@ export declare const DEFAULT_MQTT_KEEPALIVE = 60;
12
12
  export declare const DEFAULT_WS_PORT = 8080;
13
13
  export declare const DEFAULT_WS_CONNECT_TIMEOUT = 10000;
14
14
  export declare const DEFAULT_WS_RECONNECT_INTERVAL = 5000;
15
+ export declare const MAX_PENDING_ACTION_STATES = 100;
16
+ export declare const MAX_PENDING_ACTION_AGE_MS = 30000;
15
17
  export declare const DEFAULT_CONNECTION_TYPE: "mqtt";
16
18
  export declare const Z2M_CHANNEL_IDENTIFIERS: {
17
19
  readonly DEVICE_INFORMATION: "device_information";
@@ -66,3 +68,4 @@ export declare const mapZ2mCategoryToDeviceCategory: (exposeTypes: string[], pro
66
68
  export declare const mapZ2mExposeToChannelCategory: (exposeType: string) => ChannelCategory;
67
69
  export declare const mapZ2mTypeToDataType: (type: string, valueMin?: number, valueMax?: number, _values?: string[]) => DataTypeType;
68
70
  export declare const mapZ2mAccessToPermissions: (access: number) => PermissionType[];
71
+ export declare const Z2M_ACTION_TO_PANEL_EVENT: Record<string, string>;