@seamapi/react 2.20.0 → 3.0.0-beta.1

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 (402) hide show
  1. package/README.md +4 -4
  2. package/dist/elements.js +19676 -25734
  3. package/dist/elements.js.map +1 -1
  4. package/lib/object.d.ts +5 -0
  5. package/lib/object.js +14 -0
  6. package/lib/object.js.map +1 -0
  7. package/lib/seam/SeamProvider.d.ts +5 -4
  8. package/lib/seam/SeamProvider.js.map +1 -1
  9. package/lib/seam/access-codes/use-access-code.d.ts +3 -2
  10. package/lib/seam/access-codes/use-access-code.js +2 -3
  11. package/lib/seam/access-codes/use-access-code.js.map +1 -1
  12. package/lib/seam/access-codes/use-access-codes.d.ts +3 -2
  13. package/lib/seam/access-codes/use-access-codes.js +3 -5
  14. package/lib/seam/access-codes/use-access-codes.js.map +1 -1
  15. package/lib/seam/access-codes/use-create-access-code.d.ts +4 -3
  16. package/lib/seam/access-codes/use-create-access-code.js +5 -4
  17. package/lib/seam/access-codes/use-create-access-code.js.map +1 -1
  18. package/lib/seam/access-codes/use-delete-access-code.d.ts +4 -6
  19. package/lib/seam/access-codes/use-delete-access-code.js +10 -8
  20. package/lib/seam/access-codes/use-delete-access-code.js.map +1 -1
  21. package/lib/seam/access-codes/use-generate-access-code-code.d.ts +4 -4
  22. package/lib/seam/access-codes/use-generate-access-code-code.js +3 -2
  23. package/lib/seam/access-codes/use-generate-access-code-code.js.map +1 -1
  24. package/lib/seam/access-codes/use-update-access-code.d.ts +4 -4
  25. package/lib/seam/access-codes/use-update-access-code.js +9 -7
  26. package/lib/seam/access-codes/use-update-access-code.js.map +1 -1
  27. package/lib/seam/client-sessions/use-client-session.d.ts +1 -1
  28. package/lib/seam/client-sessions/use-client-session.js +1 -1
  29. package/lib/seam/client-sessions/use-client-session.js.map +1 -1
  30. package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.d.ts +1 -1
  31. package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js +14 -6
  32. package/lib/seam/components/AccessCodeDetails/AccessCodeDetails.js.map +1 -1
  33. package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.d.ts +1 -1
  34. package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.js +9 -6
  35. package/lib/seam/components/AccessCodeDetails/AccessCodeDevice.js.map +1 -1
  36. package/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.d.ts +3 -4
  37. package/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.js.map +1 -1
  38. package/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.d.ts +3 -3
  39. package/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.js.map +1 -1
  40. package/lib/seam/components/AccessCodeTable/AccessCodeMenu.d.ts +3 -3
  41. package/lib/seam/components/AccessCodeTable/AccessCodeMenu.js +1 -1
  42. package/lib/seam/components/AccessCodeTable/AccessCodeMenu.js.map +1 -1
  43. package/lib/seam/components/AccessCodeTable/AccessCodeRow.d.ts +3 -3
  44. package/lib/seam/components/AccessCodeTable/AccessCodeRow.js.map +1 -1
  45. package/lib/seam/components/AccessCodeTable/AccessCodeTable.d.ts +2 -4
  46. package/lib/seam/components/AccessCodeTable/AccessCodeTable.js +1 -1
  47. package/lib/seam/components/AccessCodeTable/AccessCodeTable.js.map +1 -1
  48. package/lib/seam/components/AccessCodeTable/CodeDetails.d.ts +2 -2
  49. package/lib/seam/components/AccessCodeTable/CodeDetails.js +5 -2
  50. package/lib/seam/components/AccessCodeTable/CodeDetails.js.map +1 -1
  51. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.d.ts +1 -1
  52. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.js +3 -1
  53. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.js.map +1 -1
  54. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.d.ts +1 -1
  55. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js +3 -1
  56. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js.map +1 -1
  57. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.d.ts +1 -1
  58. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.js +3 -3
  59. package/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.js.map +1 -1
  60. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.d.ts +3 -3
  61. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.js.map +1 -1
  62. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.d.ts +2 -2
  63. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.js.map +1 -1
  64. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.d.ts +2 -2
  65. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.js +1 -1
  66. package/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.js.map +1 -1
  67. package/lib/seam/components/ConnectAccountButton/ConnectAccountButton.d.ts +1 -1
  68. package/lib/seam/components/ConnectAccountButton/ConnectAccountButton.js +2 -2
  69. package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.d.ts +3 -3
  70. package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.js +12 -9
  71. package/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.js.map +1 -1
  72. package/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.d.ts +1 -1
  73. package/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.js +1 -1
  74. package/lib/seam/components/DeviceDetails/DeviceDetails.d.ts +1 -1
  75. package/lib/seam/components/DeviceDetails/DeviceDetails.js +3 -1
  76. package/lib/seam/components/DeviceDetails/DeviceDetails.js.map +1 -1
  77. package/lib/seam/components/DeviceDetails/DeviceInfo.d.ts +3 -3
  78. package/lib/seam/components/DeviceDetails/DeviceInfo.js +3 -1
  79. package/lib/seam/components/DeviceDetails/DeviceInfo.js.map +1 -1
  80. package/lib/seam/components/DeviceDetails/DeviceModel.d.ts +3 -3
  81. package/lib/seam/components/DeviceDetails/LockDeviceDetails.d.ts +2 -2
  82. package/lib/seam/components/DeviceDetails/LockDeviceDetails.js +5 -5
  83. package/lib/seam/components/DeviceDetails/LockDeviceDetails.js.map +1 -1
  84. package/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.d.ts +2 -2
  85. package/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.js.map +1 -1
  86. package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.d.ts +2 -2
  87. package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js +3 -3
  88. package/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js.map +1 -1
  89. package/lib/seam/components/DeviceTable/DeviceHealthBar.d.ts +3 -4
  90. package/lib/seam/components/DeviceTable/DeviceHealthBar.js.map +1 -1
  91. package/lib/seam/components/DeviceTable/DeviceRow.d.ts +4 -3
  92. package/lib/seam/components/DeviceTable/DeviceRow.js +2 -2
  93. package/lib/seam/components/DeviceTable/DeviceRow.js.map +1 -1
  94. package/lib/seam/components/DeviceTable/DeviceTable.d.ts +3 -6
  95. package/lib/seam/components/DeviceTable/DeviceTable.js +4 -2
  96. package/lib/seam/components/DeviceTable/DeviceTable.js.map +1 -1
  97. package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.d.ts +1 -1
  98. package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.js +2 -2
  99. package/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.js.map +1 -1
  100. package/lib/seam/components/SupportedDeviceTable/FilterCategoryMenu.d.ts +1 -1
  101. package/lib/seam/components/SupportedDeviceTable/HiddenDevicesOverlay.d.ts +1 -1
  102. package/lib/seam/components/SupportedDeviceTable/ShowAllDevicesButton.d.ts +1 -1
  103. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.d.ts +1 -1
  104. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js +2 -2
  105. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.js.map +1 -1
  106. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.d.ts +3 -3
  107. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.js.map +1 -1
  108. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.d.ts +1 -1
  109. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.d.ts +1 -1
  110. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTable.d.ts +1 -1
  111. package/lib/seam/components/SupportedDeviceTable/SupportedDeviceTableManufacturerKeys.d.ts +1 -1
  112. package/lib/seam/components/SupportedDeviceTable/use-device-model.d.ts +2 -2
  113. package/lib/seam/components/SupportedDeviceTable/use-device-model.js +3 -4
  114. package/lib/seam/components/SupportedDeviceTable/use-device-model.js.map +1 -1
  115. package/lib/seam/components/SupportedDeviceTable/use-device-models.js +2 -4
  116. package/lib/seam/components/SupportedDeviceTable/use-device-models.js.map +1 -1
  117. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.d.ts +2 -2
  118. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js +2 -3
  119. package/lib/seam/components/SupportedDeviceTable/use-manufacturer.js.map +1 -1
  120. package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js +1 -3
  121. package/lib/seam/components/SupportedDeviceTable/use-manufacturers.js.map +1 -1
  122. package/lib/seam/components/common-props.d.ts +2 -2
  123. package/lib/seam/components/common-props.js.map +1 -1
  124. package/lib/seam/connect-webviews/use-create-connect-webview.d.ts +4 -3
  125. package/lib/seam/connect-webviews/use-create-connect-webview.js +3 -3
  126. package/lib/seam/connect-webviews/use-create-connect-webview.js.map +1 -1
  127. package/lib/seam/connected-accounts/use-connected-account.d.ts +3 -2
  128. package/lib/seam/connected-accounts/use-connected-account.js +2 -3
  129. package/lib/seam/connected-accounts/use-connected-account.js.map +1 -1
  130. package/lib/seam/devices/use-device-providers.d.ts +3 -2
  131. package/lib/seam/devices/use-device-providers.js.map +1 -1
  132. package/lib/seam/devices/use-device.d.ts +5 -4
  133. package/lib/seam/devices/use-device.js +2 -3
  134. package/lib/seam/devices/use-device.js.map +1 -1
  135. package/lib/seam/devices/use-devices.d.ts +4 -3
  136. package/lib/seam/devices/use-devices.js +2 -3
  137. package/lib/seam/devices/use-devices.js.map +1 -1
  138. package/lib/seam/events/use-events.d.ts +5 -4
  139. package/lib/seam/events/use-events.js +5 -5
  140. package/lib/seam/events/use-events.js.map +1 -1
  141. package/lib/seam/filters.d.ts +7 -7
  142. package/lib/seam/filters.js.map +1 -1
  143. package/lib/seam/locks/lock-device.d.ts +5 -0
  144. package/lib/seam/locks/lock-device.js +2 -0
  145. package/lib/seam/locks/lock-device.js.map +1 -0
  146. package/lib/seam/locks/use-toggle-lock.d.ts +16 -0
  147. package/lib/seam/locks/use-toggle-lock.js +59 -0
  148. package/lib/seam/locks/use-toggle-lock.js.map +1 -0
  149. package/lib/seam/noise-sensors/noise-sensor-device.d.ts +5 -0
  150. package/lib/seam/noise-sensors/noise-sensor-device.js +2 -0
  151. package/lib/seam/noise-sensors/noise-sensor-device.js.map +1 -0
  152. package/lib/seam/noise-sensors/use-noise-thresholds.d.ts +4 -3
  153. package/lib/seam/noise-sensors/use-noise-thresholds.js +2 -3
  154. package/lib/seam/noise-sensors/use-noise-thresholds.js.map +1 -1
  155. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.d.ts +3 -2
  156. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.js +2 -10
  157. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.js.map +1 -1
  158. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.d.ts +3 -2
  159. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js +3 -4
  160. package/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js.map +1 -1
  161. package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.d.ts +5 -3
  162. package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.js +10 -6
  163. package/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.js.map +1 -1
  164. package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.d.ts +5 -4
  165. package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.js +13 -13
  166. package/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.js.map +1 -1
  167. package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.d.ts +5 -5
  168. package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.js +12 -17
  169. package/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.js.map +1 -1
  170. package/lib/{temperature-bounds.d.ts → seam/thermostats/temperature-bounds.d.ts} +1 -1
  171. package/lib/{temperature-bounds.js → seam/thermostats/temperature-bounds.js} +4 -4
  172. package/lib/seam/thermostats/temperature-bounds.js.map +1 -0
  173. package/lib/seam/thermostats/thermostat-device.d.ts +17 -0
  174. package/lib/seam/thermostats/thermostat-device.js +2 -0
  175. package/lib/seam/thermostats/thermostat-device.js.map +1 -0
  176. package/lib/seam/thermostats/unit-conversion.d.ts +19 -0
  177. package/lib/seam/thermostats/unit-conversion.js +43 -0
  178. package/lib/seam/thermostats/unit-conversion.js.map +1 -0
  179. package/lib/seam/thermostats/use-cool-thermostat.d.ts +10 -4
  180. package/lib/seam/thermostats/use-cool-thermostat.js +34 -27
  181. package/lib/seam/thermostats/use-cool-thermostat.js.map +1 -1
  182. package/lib/seam/thermostats/use-heat-cool-thermostat.d.ts +10 -4
  183. package/lib/seam/thermostats/use-heat-cool-thermostat.js +34 -22
  184. package/lib/seam/thermostats/use-heat-cool-thermostat.js.map +1 -1
  185. package/lib/seam/thermostats/use-heat-thermostat.d.ts +10 -4
  186. package/lib/seam/thermostats/use-heat-thermostat.js +34 -27
  187. package/lib/seam/thermostats/use-heat-thermostat.js.map +1 -1
  188. package/lib/seam/thermostats/use-set-thermostat-fan-mode.d.ts +12 -0
  189. package/lib/seam/thermostats/use-set-thermostat-fan-mode.js +46 -0
  190. package/lib/seam/thermostats/use-set-thermostat-fan-mode.js.map +1 -0
  191. package/lib/seam/thermostats/use-set-thermostat-off.d.ts +10 -4
  192. package/lib/seam/thermostats/use-set-thermostat-off.js +36 -25
  193. package/lib/seam/thermostats/use-set-thermostat-off.js.map +1 -1
  194. package/lib/seam/thermostats/use-update-thermostat.d.ts +5 -5
  195. package/lib/seam/thermostats/use-update-thermostat.js +28 -27
  196. package/lib/seam/thermostats/use-update-thermostat.js.map +1 -1
  197. package/lib/seam/use-seam-client.d.ts +3 -3
  198. package/lib/seam/use-seam-client.js +5 -21
  199. package/lib/seam/use-seam-client.js.map +1 -1
  200. package/lib/seam/use-seam-query-result.d.ts +2 -2
  201. package/lib/ui/AccessCodeForm/AccessCodeForm.d.ts +5 -7
  202. package/lib/ui/AccessCodeForm/AccessCodeForm.js +9 -14
  203. package/lib/ui/AccessCodeForm/AccessCodeForm.js.map +1 -1
  204. package/lib/ui/AccessCodeForm/AccessCodeFormDatePicker.d.ts +1 -1
  205. package/lib/ui/AccessCodeForm/AccessCodeFormTimeZonePicker.d.ts +1 -1
  206. package/lib/ui/AccessCodeForm/AccessCodeFormTimes.d.ts +1 -1
  207. package/lib/ui/Checkbox.d.ts +1 -1
  208. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.d.ts +2 -2
  209. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js +1 -1
  210. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.js.map +1 -1
  211. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.d.ts +1 -1
  212. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js +3 -3
  213. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.js.map +1 -1
  214. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.d.ts +1 -1
  215. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.js.map +1 -1
  216. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDeviceSelect.d.ts +1 -1
  217. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormNameAndSchedule.d.ts +1 -1
  218. package/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormTimeZonePicker.d.ts +1 -1
  219. package/lib/ui/ClimateSettingForm/set-point-bounds.d.ts +4 -0
  220. package/lib/ui/ClimateSettingForm/set-point-bounds.js +17 -0
  221. package/lib/ui/ClimateSettingForm/set-point-bounds.js.map +1 -0
  222. package/lib/ui/DateTimePicker/DateTimePicker.d.ts +1 -1
  223. package/lib/ui/FormField.d.ts +1 -1
  224. package/lib/ui/IconButton.d.ts +1 -1
  225. package/lib/ui/LoadingToast/LoadingToast.d.ts +1 -1
  226. package/lib/ui/RadioField/Radio.d.ts +1 -1
  227. package/lib/ui/RadioField/RadioField.d.ts +1 -1
  228. package/lib/ui/Snackbar/Snackbar.d.ts +1 -1
  229. package/lib/ui/Spinner/Spinner.d.ts +1 -1
  230. package/lib/ui/Switch/Switch.d.ts +1 -1
  231. package/lib/ui/TabSet.d.ts +1 -1
  232. package/lib/ui/Table/EmptyPlaceholder.d.ts +1 -1
  233. package/lib/ui/Table/TableCell.d.ts +1 -1
  234. package/lib/ui/Table/TableFilterBar/TableFilterBar.d.ts +1 -1
  235. package/lib/ui/Table/TableFilterBar/TableFilterItem.d.ts +1 -1
  236. package/lib/ui/Table/TableRow.d.ts +1 -1
  237. package/lib/ui/TextButton.d.ts +1 -1
  238. package/lib/ui/TextField/SearchTextField.d.ts +1 -1
  239. package/lib/ui/TimeZonePicker/TimeZonePicker.d.ts +1 -1
  240. package/lib/ui/clipboard.d.ts +1 -1
  241. package/lib/ui/clipboard.js +2 -2
  242. package/lib/ui/clipboard.js.map +1 -1
  243. package/lib/ui/device/BatteryStatusIndicator.d.ts +7 -0
  244. package/lib/ui/device/{BatteryStatus.js → BatteryStatusIndicator.js} +2 -2
  245. package/lib/ui/device/BatteryStatusIndicator.js.map +1 -0
  246. package/lib/ui/device/DeviceImage.d.ts +2 -2
  247. package/lib/ui/device/LockStatus.d.ts +3 -3
  248. package/lib/ui/device/LockStatus.js +1 -1
  249. package/lib/ui/device/LockStatus.js.map +1 -1
  250. package/lib/ui/device/NoiseLevelStatus.d.ts +2 -2
  251. package/lib/ui/device/NoiseLevelStatus.js +4 -4
  252. package/lib/ui/device/NoiseLevelStatus.js.map +1 -1
  253. package/lib/ui/device/OnlineStatus.d.ts +4 -4
  254. package/lib/ui/device/OnlineStatus.js.map +1 -1
  255. package/lib/ui/layout/ContentHeader.d.ts +1 -1
  256. package/lib/ui/layout/DotDivider.d.ts +1 -1
  257. package/lib/ui/noise-sensor/NoiseSensorActivityList.d.ts +2 -2
  258. package/lib/ui/noise-sensor/NoiseSensorActivityList.js +4 -2
  259. package/lib/ui/noise-sensor/NoiseSensorActivityList.js.map +1 -1
  260. package/lib/ui/noise-sensor/NoiseSensorEventItem.d.ts +6 -3
  261. package/lib/ui/noise-sensor/NoiseSensorEventItem.js +4 -7
  262. package/lib/ui/noise-sensor/NoiseSensorEventItem.js.map +1 -1
  263. package/lib/ui/noise-sensor/NoiseThresholdsList.d.ts +2 -2
  264. package/lib/ui/noise-sensor/NoiseThresholdsList.js.map +1 -1
  265. package/lib/ui/thermostat/ClimateModeMenu.d.ts +2 -2
  266. package/lib/ui/thermostat/ClimateModeMenu.js.map +1 -1
  267. package/lib/ui/thermostat/ClimateSettingControlGroup.d.ts +2 -2
  268. package/lib/ui/thermostat/ClimateSettingControlGroup.js.map +1 -1
  269. package/lib/ui/thermostat/ClimateSettingStatus.d.ts +2 -2
  270. package/lib/ui/thermostat/ClimateSettingStatus.js +2 -2
  271. package/lib/ui/thermostat/ClimateSettingStatus.js.map +1 -1
  272. package/lib/ui/thermostat/FanModeMenu.d.ts +2 -2
  273. package/lib/ui/thermostat/FanModeMenu.js.map +1 -1
  274. package/lib/ui/thermostat/Temperature.d.ts +1 -1
  275. package/lib/ui/thermostat/TemperatureControl.d.ts +1 -1
  276. package/lib/ui/thermostat/TemperatureControlGroup.d.ts +2 -2
  277. package/lib/ui/thermostat/TemperatureControlGroup.js +1 -1
  278. package/lib/ui/thermostat/TemperatureControlGroup.js.map +1 -1
  279. package/lib/ui/thermostat/ThermoModeMenuOption.d.ts +1 -1
  280. package/lib/ui/thermostat/ThermostatCard.d.ts +2 -2
  281. package/lib/ui/thermostat/ThermostatCard.js +5 -4
  282. package/lib/ui/thermostat/ThermostatCard.js.map +1 -1
  283. package/lib/ui/thermostat/ThermostatSelect.d.ts +1 -1
  284. package/lib/ui/thermostat/ThermostatSelect.js +2 -2
  285. package/lib/ui/thermostat/ThermostatSelect.js.map +1 -1
  286. package/lib/ui/typography/Title.d.ts +1 -1
  287. package/lib/version.d.ts +1 -1
  288. package/lib/version.js +1 -1
  289. package/lib/version.js.map +1 -1
  290. package/package.json +7 -8
  291. package/src/index.scss +1 -1
  292. package/src/lib/object.ts +13 -0
  293. package/src/lib/seam/SeamProvider.tsx +9 -4
  294. package/src/lib/seam/access-codes/use-access-code.ts +10 -16
  295. package/src/lib/seam/access-codes/use-access-codes.ts +11 -18
  296. package/src/lib/seam/access-codes/use-create-access-code.ts +21 -16
  297. package/src/lib/seam/access-codes/use-delete-access-code.ts +22 -22
  298. package/src/lib/seam/access-codes/use-generate-access-code-code.ts +17 -21
  299. package/src/lib/seam/access-codes/use-update-access-code.ts +33 -25
  300. package/src/lib/seam/client-sessions/use-client-session.ts +5 -10
  301. package/src/lib/seam/components/AccessCodeDetails/AccessCodeDetails.tsx +36 -23
  302. package/src/lib/seam/components/AccessCodeDetails/AccessCodeDevice.tsx +10 -7
  303. package/src/lib/seam/components/AccessCodeTable/AccessCodeHealthBar.tsx +2 -3
  304. package/src/lib/seam/components/AccessCodeTable/AccessCodeMainIcon.tsx +3 -2
  305. package/src/lib/seam/components/AccessCodeTable/AccessCodeMenu.tsx +5 -4
  306. package/src/lib/seam/components/AccessCodeTable/AccessCodeRow.tsx +3 -2
  307. package/src/lib/seam/components/AccessCodeTable/AccessCodeTable.tsx +3 -7
  308. package/src/lib/seam/components/AccessCodeTable/CodeDetails.tsx +12 -8
  309. package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleCard.tsx +4 -4
  310. package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.tsx +3 -3
  311. package/src/lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.tsx +6 -4
  312. package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRow.tsx +3 -2
  313. package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.tsx +1 -1
  314. package/src/lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleTable.tsx +3 -6
  315. package/src/lib/seam/components/ConnectAccountButton/ConnectAccountButton.tsx +2 -2
  316. package/src/lib/seam/components/CreateAccessCodeForm/CreateAccessCodeForm.tsx +20 -16
  317. package/src/lib/seam/components/CreateClimateSettingScheduleForm/CreateClimateSettingScheduleForm.tsx +1 -1
  318. package/src/lib/seam/components/DeviceDetails/DeviceDetails.tsx +3 -2
  319. package/src/lib/seam/components/DeviceDetails/DeviceInfo.tsx +5 -3
  320. package/src/lib/seam/components/DeviceDetails/DeviceModel.tsx +2 -2
  321. package/src/lib/seam/components/DeviceDetails/LockDeviceDetails.tsx +6 -6
  322. package/src/lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.tsx +1 -1
  323. package/src/lib/seam/components/DeviceDetails/ThermostatDeviceDetails.tsx +7 -4
  324. package/src/lib/seam/components/DeviceTable/DeviceHealthBar.tsx +6 -3
  325. package/src/lib/seam/components/DeviceTable/DeviceRow.tsx +5 -7
  326. package/src/lib/seam/components/DeviceTable/DeviceTable.tsx +7 -14
  327. package/src/lib/seam/components/EditAccessCodeForm/EditAccessCodeForm.tsx +6 -7
  328. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContent.tsx +3 -4
  329. package/src/lib/seam/components/SupportedDeviceTable/SupportedDeviceContentRows.tsx +3 -2
  330. package/src/lib/seam/components/SupportedDeviceTable/use-device-model.ts +9 -14
  331. package/src/lib/seam/components/SupportedDeviceTable/use-device-models.ts +5 -9
  332. package/src/lib/seam/components/SupportedDeviceTable/use-manufacturer.ts +7 -12
  333. package/src/lib/seam/components/SupportedDeviceTable/use-manufacturers.ts +4 -8
  334. package/src/lib/seam/components/common-props.tsx +8 -4
  335. package/src/lib/seam/connect-webviews/use-create-connect-webview.ts +15 -17
  336. package/src/lib/seam/connected-accounts/use-connected-account.ts +17 -21
  337. package/src/lib/seam/devices/use-device-providers.ts +8 -11
  338. package/src/lib/seam/devices/use-device.ts +9 -18
  339. package/src/lib/seam/devices/use-devices.ts +20 -26
  340. package/src/lib/seam/events/use-events.ts +12 -14
  341. package/src/lib/seam/filters.ts +9 -8
  342. package/src/lib/seam/locks/lock-device.ts +9 -0
  343. package/src/lib/seam/locks/use-toggle-lock.ts +103 -0
  344. package/src/lib/seam/noise-sensors/noise-sensor-device.ts +10 -0
  345. package/src/lib/seam/noise-sensors/use-noise-thresholds.ts +12 -15
  346. package/src/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedule.ts +10 -23
  347. package/src/lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.ts +13 -13
  348. package/src/lib/seam/thermostats/climate-setting-schedules/use-create-climate-setting-schedule.ts +30 -25
  349. package/src/lib/seam/thermostats/climate-setting-schedules/use-delete-climate-setting-schedule.ts +26 -28
  350. package/src/lib/seam/thermostats/climate-setting-schedules/use-update-climate-setting-schedule.ts +32 -41
  351. package/src/lib/{temperature-bounds.ts → seam/thermostats/temperature-bounds.ts} +8 -5
  352. package/src/lib/seam/thermostats/thermostat-device.ts +43 -0
  353. package/src/lib/seam/thermostats/unit-conversion.ts +89 -0
  354. package/src/lib/seam/thermostats/use-cool-thermostat.ts +77 -47
  355. package/src/lib/seam/thermostats/use-heat-cool-thermostat.ts +89 -40
  356. package/src/lib/seam/thermostats/use-heat-thermostat.ts +77 -47
  357. package/src/lib/seam/thermostats/use-set-thermostat-fan-mode.ts +95 -0
  358. package/src/lib/seam/thermostats/use-set-thermostat-off.ts +64 -40
  359. package/src/lib/seam/thermostats/use-update-thermostat.ts +47 -49
  360. package/src/lib/seam/use-seam-client.ts +11 -22
  361. package/src/lib/seam/use-seam-query-result.ts +2 -2
  362. package/src/lib/ui/AccessCodeForm/AccessCodeForm.tsx +18 -24
  363. package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleForm.tsx +4 -4
  364. package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormClimateSetting.tsx +6 -3
  365. package/src/lib/ui/ClimateSettingForm/ClimateSettingScheduleFormDefaultClimateSetting.tsx +1 -1
  366. package/src/lib/ui/ClimateSettingForm/set-point-bounds.ts +31 -0
  367. package/src/lib/ui/clipboard.ts +1 -1
  368. package/src/lib/ui/device/{BatteryStatus.tsx → BatteryStatusIndicator.tsx} +10 -5
  369. package/src/lib/ui/device/DeviceImage.tsx +2 -2
  370. package/src/lib/ui/device/LockStatus.tsx +3 -2
  371. package/src/lib/ui/device/NoiseLevelStatus.tsx +3 -3
  372. package/src/lib/ui/device/OnlineStatus.tsx +3 -3
  373. package/src/lib/ui/noise-sensor/NoiseSensorActivityList.tsx +15 -6
  374. package/src/lib/ui/noise-sensor/NoiseSensorEventItem.tsx +13 -9
  375. package/src/lib/ui/noise-sensor/NoiseThresholdsList.tsx +4 -3
  376. package/src/lib/ui/thermostat/ClimateModeMenu.tsx +1 -2
  377. package/src/lib/ui/thermostat/ClimateSettingControlGroup.tsx +1 -2
  378. package/src/lib/ui/thermostat/ClimateSettingStatus.tsx +2 -3
  379. package/src/lib/ui/thermostat/FanModeMenu.tsx +1 -2
  380. package/src/lib/ui/thermostat/TemperatureControlGroup.tsx +2 -2
  381. package/src/lib/ui/thermostat/ThermostatCard.tsx +11 -8
  382. package/src/lib/ui/thermostat/ThermostatSelect.tsx +4 -10
  383. package/src/lib/version.ts +1 -1
  384. package/lib/seam/devices/use-toggle-lock.d.ts +0 -5
  385. package/lib/seam/devices/use-toggle-lock.js +0 -56
  386. package/lib/seam/devices/use-toggle-lock.js.map +0 -1
  387. package/lib/seam/error-handlers.d.ts +0 -5
  388. package/lib/seam/error-handlers.js +0 -12
  389. package/lib/seam/error-handlers.js.map +0 -1
  390. package/lib/seam/thermostats/use-update-fan-mode.d.ts +0 -6
  391. package/lib/seam/thermostats/use-update-fan-mode.js +0 -42
  392. package/lib/seam/thermostats/use-update-fan-mode.js.map +0 -1
  393. package/lib/set-point-bounds.d.ts +0 -4
  394. package/lib/set-point-bounds.js +0 -24
  395. package/lib/set-point-bounds.js.map +0 -1
  396. package/lib/temperature-bounds.js.map +0 -1
  397. package/lib/ui/device/BatteryStatus.d.ts +0 -7
  398. package/lib/ui/device/BatteryStatus.js.map +0 -1
  399. package/src/lib/seam/devices/use-toggle-lock.ts +0 -84
  400. package/src/lib/seam/error-handlers.ts +0 -19
  401. package/src/lib/seam/thermostats/use-update-fan-mode.ts +0 -81
  402. package/src/lib/set-point-bounds.ts +0 -39
@@ -1,13 +1,17 @@
1
+ import {
2
+ isSeamHttpInvalidInputError,
3
+ type SeamHttpApiError,
4
+ } from '@seamapi/http/connect'
5
+ import type { AccessCode, Device } from '@seamapi/types/connect'
1
6
  import { useState } from 'react'
2
- import type { AccessCode, SeamError } from 'seamapi'
3
7
 
8
+ import { shake } from 'lib/object.js'
4
9
  import { useCreateAccessCode } from 'lib/seam/access-codes/use-create-access-code.js'
5
10
  import {
6
11
  type CommonProps,
7
12
  withRequiredCommonProps,
8
13
  } from 'lib/seam/components/common-props.js'
9
- import { useDevice, type UseDeviceData } from 'lib/seam/devices/use-device.js'
10
- import { getValidationError } from 'lib/seam/error-handlers.js'
14
+ import { useDevice } from 'lib/seam/devices/use-device.js'
11
15
  import { useComponentTelemetry } from 'lib/telemetry/index.js'
12
16
  import {
13
17
  AccessCodeForm,
@@ -55,7 +59,7 @@ function Content({
55
59
  onBack,
56
60
  onSuccess,
57
61
  }: Omit<CreateAccessCodeFormProps, 'deviceId'> & {
58
- device: NonNullable<UseDeviceData>
62
+ device: Device
59
63
  }): JSX.Element {
60
64
  const { submit, isSubmitting, responseErrors } = useSubmitCreateAccessCode({
61
65
  onSuccess: (accessCode: AccessCode) => {
@@ -89,7 +93,7 @@ function useSubmitCreateAccessCode(params: {
89
93
  responseErrors: ResponseErrors | null
90
94
  } {
91
95
  const { onSuccess } = params
92
- const { mutate, isLoading: isSubmitting } = useCreateAccessCode()
96
+ const { mutate, isPending: isSubmitting } = useCreateAccessCode()
93
97
  const { responseErrors, handleResponseError, resetResponseErrors } =
94
98
  useResponseErrors()
95
99
 
@@ -141,7 +145,7 @@ function useSubmitCreateAccessCode(params: {
141
145
 
142
146
  export function useResponseErrors(): {
143
147
  responseErrors: ResponseErrors | null
144
- handleResponseError: (error: SeamError) => void
148
+ handleResponseError: (error: SeamHttpApiError) => void
145
149
  resetResponseErrors: () => void
146
150
  } {
147
151
  const [responseErrors, setResponseErrors] = useState<Record<
@@ -149,17 +153,17 @@ export function useResponseErrors(): {
149
153
  string | undefined
150
154
  > | null>(null)
151
155
 
152
- const handleResponseError = (error: SeamError): void => {
153
- const code = getValidationError({ error, property: 'code' })
154
- const name = getValidationError({ error, property: 'name' })
155
-
156
- if (code != null || name != null) {
157
- setResponseErrors({
158
- code,
159
- name,
156
+ const handleResponseError = (error: SeamHttpApiError): void => {
157
+ if (isSeamHttpInvalidInputError(error)) {
158
+ const errors = shake({
159
+ code: error.getValidationErrorMessages('code')[0],
160
+ name: error.getValidationErrorMessages('name')[0],
160
161
  })
161
-
162
- return
162
+ if (Object.keys(errors).length === 0) {
163
+ setResponseErrors({
164
+ unknown: error.message,
165
+ })
166
+ }
163
167
  }
164
168
 
165
169
  setResponseErrors({
@@ -30,7 +30,7 @@ function useSubmitCreateClimateSettingSchedule(onSuccess?: () => void): {
30
30
  submit: (data: ClimateSettingScheduleFormSubmitData) => void
31
31
  isSubmitting: boolean
32
32
  } {
33
- const { mutate, isLoading: isSubmitting } = useCreateClimateSettingSchedule()
33
+ const { mutate, isPending: isSubmitting } = useCreateClimateSettingSchedule()
34
34
  const submit = (data: ClimateSettingScheduleFormSubmitData): void => {
35
35
  const { name, deviceId, startDate, endDate, climateSetting } = data
36
36
 
@@ -1,5 +1,3 @@
1
- import { isLockDevice, isNoiseSensorDevice, isThermostatDevice } from 'seamapi'
2
-
3
1
  import {
4
2
  type CommonProps,
5
3
  withRequiredCommonProps,
@@ -8,6 +6,9 @@ import { LockDeviceDetails } from 'lib/seam/components/DeviceDetails/LockDeviceD
8
6
  import { NoiseSensorDeviceDetails } from 'lib/seam/components/DeviceDetails/NoiseSensorDeviceDetails.js'
9
7
  import { ThermostatDeviceDetails } from 'lib/seam/components/DeviceDetails/ThermostatDeviceDetails.js'
10
8
  import { useDevice } from 'lib/seam/devices/use-device.js'
9
+ import { isLockDevice } from 'lib/seam/locks/lock-device.js'
10
+ import { isNoiseSensorDevice } from 'lib/seam/noise-sensors/noise-sensor-device.js'
11
+ import { isThermostatDevice } from 'lib/seam/thermostats/thermostat-device.js'
11
12
  import { useComponentTelemetry } from 'lib/telemetry/index.js'
12
13
 
13
14
  export interface DeviceDetailsProps extends CommonProps {
@@ -1,4 +1,4 @@
1
- import type { CommonDevice } from 'seamapi'
1
+ import type { Device } from '@seamapi/types/connect'
2
2
 
3
3
  import { BeeIcon } from 'lib/icons/Bee.js'
4
4
  import type { CommonProps } from 'lib/seam/components/common-props.js'
@@ -13,7 +13,7 @@ interface DeviceInfoProps
13
13
  'disableConnectedAccountInformation' | 'disableResourceIds'
14
14
  >
15
15
  > {
16
- device: CommonDevice
16
+ device: Device
17
17
  }
18
18
 
19
19
  export function DeviceInfo({
@@ -21,7 +21,9 @@ export function DeviceInfo({
21
21
  disableConnectedAccountInformation,
22
22
  disableResourceIds,
23
23
  }: DeviceInfoProps): JSX.Element | null {
24
- const { connectedAccount } = useConnectedAccount(device.connected_account_id)
24
+ const { connectedAccount } = useConnectedAccount({
25
+ connected_account_id: device.connected_account_id,
26
+ })
25
27
  return (
26
28
  <DetailSection
27
29
  label={t.deviceInfo}
@@ -1,7 +1,7 @@
1
- import type { CommonDevice } from 'seamapi'
1
+ import type { Device } from '@seamapi/types/connect'
2
2
 
3
3
  interface DeviceModelProps {
4
- device: CommonDevice
4
+ device: Device
5
5
  }
6
6
 
7
7
  export function DeviceModel({ device }: DeviceModelProps): JSX.Element | null {
@@ -1,5 +1,4 @@
1
1
  import classNames from 'classnames'
2
- import type { LockDevice } from 'seamapi'
3
2
 
4
3
  import { ChevronRightIcon } from 'lib/icons/ChevronRight.js'
5
4
  import { useAccessCodes } from 'lib/seam/access-codes/use-access-codes.js'
@@ -7,11 +6,12 @@ import { NestedAccessCodeTable } from 'lib/seam/components/AccessCodeTable/Acces
7
6
  import type { NestedSpecificDeviceDetailsProps } from 'lib/seam/components/DeviceDetails/DeviceDetails.js'
8
7
  import { DeviceInfo } from 'lib/seam/components/DeviceDetails/DeviceInfo.js'
9
8
  import { DeviceModel } from 'lib/seam/components/DeviceDetails/DeviceModel.js'
10
- import { useToggleLock } from 'lib/seam/devices/use-toggle-lock.js'
11
9
  import { deviceErrorFilter, deviceWarningFilter } from 'lib/seam/filters.js'
10
+ import type { LockDevice } from 'lib/seam/locks/lock-device.js'
11
+ import { useToggleLock } from 'lib/seam/locks/use-toggle-lock.js'
12
12
  import { Alerts } from 'lib/ui/Alert/Alerts.js'
13
13
  import { Button } from 'lib/ui/Button.js'
14
- import { BatteryStatus } from 'lib/ui/device/BatteryStatus.js'
14
+ import { BatteryStatusIndicator } from 'lib/ui/device/BatteryStatusIndicator.js'
15
15
  import { DeviceImage } from 'lib/ui/device/DeviceImage.js'
16
16
  import { OnlineStatus } from 'lib/ui/device/OnlineStatus.js'
17
17
  import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
@@ -36,7 +36,7 @@ export function LockDeviceDetails({
36
36
  className,
37
37
  }: LockDeviceDetailsProps): JSX.Element | null {
38
38
  const [accessCodesOpen, toggleAccessCodesOpen] = useToggle()
39
- const toggleLock = useToggleLock(device)
39
+ const toggleLock = useToggleLock()
40
40
  const { accessCodes } = useAccessCodes({
41
41
  device_id: device.device_id,
42
42
  })
@@ -102,7 +102,7 @@ export function LockDeviceDetails({
102
102
  <span className='seam-label'>{t.status}:</span>{' '}
103
103
  <OnlineStatus device={device} />
104
104
  <span className='seam-label'>{t.power}:</span>{' '}
105
- <BatteryStatus device={device} />
105
+ <BatteryStatusIndicator device={device} />
106
106
  <DeviceModel device={device} />
107
107
  </div>
108
108
  </div>
@@ -133,7 +133,7 @@ export function LockDeviceDetails({
133
133
  <Button
134
134
  size='small'
135
135
  onClick={() => {
136
- toggleLock.mutate()
136
+ toggleLock.mutate(device)
137
137
  }}
138
138
  >
139
139
  {toggleLockLabel}
@@ -1,10 +1,10 @@
1
1
  import classNames from 'classnames'
2
2
  import { useState } from 'react'
3
- import type { NoiseSensorDevice } from 'seamapi'
4
3
 
5
4
  import type { NestedSpecificDeviceDetailsProps } from 'lib/seam/components/DeviceDetails/DeviceDetails.js'
6
5
  import { DeviceInfo } from 'lib/seam/components/DeviceDetails/DeviceInfo.js'
7
6
  import { DeviceModel } from 'lib/seam/components/DeviceDetails/DeviceModel.js'
7
+ import type { NoiseSensorDevice } from 'lib/seam/noise-sensors/noise-sensor-device.js'
8
8
  import { DeviceImage } from 'lib/ui/device/DeviceImage.js'
9
9
  import { NoiseLevelStatus } from 'lib/ui/device/NoiseLevelStatus.js'
10
10
  import { OnlineStatus } from 'lib/ui/device/OnlineStatus.js'
@@ -1,6 +1,5 @@
1
1
  import classNames from 'classnames'
2
2
  import { useEffect, useState } from 'react'
3
- import type { HvacModeSetting, ThermostatDevice } from 'seamapi'
4
3
 
5
4
  import { debounce } from 'lib/debounce.js'
6
5
  import { CheckBlackIcon } from 'lib/icons/CheckBlack.js'
@@ -9,13 +8,17 @@ import { NestedClimateSettingScheduleTable } from 'lib/seam/components/ClimateSe
9
8
  import type { NestedSpecificDeviceDetailsProps } from 'lib/seam/components/DeviceDetails/DeviceDetails.js'
10
9
  import { DeviceInfo } from 'lib/seam/components/DeviceDetails/DeviceInfo.js'
11
10
  import { useClimateSettingSchedules } from 'lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js'
11
+ import { getSupportedThermostatModes } from 'lib/seam/thermostats/temperature-bounds.js'
12
+ import type {
13
+ HvacModeSetting,
14
+ ThermostatDevice,
15
+ } from 'lib/seam/thermostats/thermostat-device.js'
12
16
  import { useCoolThermostat } from 'lib/seam/thermostats/use-cool-thermostat.js'
13
17
  import { useHeatCoolThermostat } from 'lib/seam/thermostats/use-heat-cool-thermostat.js'
14
18
  import { useHeatThermostat } from 'lib/seam/thermostats/use-heat-thermostat.js'
19
+ import { useSetThermostatFanMode } from 'lib/seam/thermostats/use-set-thermostat-fan-mode.js'
15
20
  import { useSetThermostatOff } from 'lib/seam/thermostats/use-set-thermostat-off.js'
16
- import { useUpdateFanMode } from 'lib/seam/thermostats/use-update-fan-mode.js'
17
21
  import { useUpdateThermostat } from 'lib/seam/thermostats/use-update-thermostat.js'
18
- import { getSupportedThermostatModes } from 'lib/temperature-bounds.js'
19
22
  import { AccordionRow } from 'lib/ui/layout/AccordionRow.js'
20
23
  import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
21
24
  import { DetailRow } from 'lib/ui/layout/DetailRow.js'
@@ -203,7 +206,7 @@ function ManualOverrideRow({
203
206
  }
204
207
 
205
208
  function FanModeRow({ device }: { device: ThermostatDevice }): JSX.Element {
206
- const { mutate, isSuccess, isError } = useUpdateFanMode()
209
+ const { mutate, isSuccess, isError } = useSetThermostatFanMode()
207
210
 
208
211
  return (
209
212
  <>
@@ -1,9 +1,12 @@
1
- import type { ConnectedAccountError, DeviceError } from 'seamapi'
1
+ import type {
2
+ ConnectedAccountError,
3
+ Device,
4
+ DeviceError,
5
+ } from '@seamapi/types/connect'
2
6
 
3
7
  import { CheckIcon } from 'lib/icons/Check.js'
4
8
  import { ExclamationCircleOutlineIcon } from 'lib/icons/ExclamationCircleOutline.js'
5
9
  import { OnlineStatusAccountOfflineIcon } from 'lib/icons/OnlineStatusAccountOffline.js'
6
- import type { UseDevicesData } from 'lib/seam/devices/use-devices.js'
7
10
  import {
8
11
  connectedAccountErrorFilter,
9
12
  deviceErrorFilter,
@@ -15,7 +18,7 @@ export type AccountFilter = 'account_issues'
15
18
  export type DeviceFilter = 'device_issues'
16
19
 
17
20
  interface DeviceHealthBarProps {
18
- devices: Array<UseDevicesData[number]>
21
+ devices: Device[]
19
22
  filter: AccountFilter | DeviceFilter | null
20
23
  onFilterSelect: (filter: AccountFilter | DeviceFilter | null) => void
21
24
  errorFilter: (error: DeviceError | ConnectedAccountError) => boolean
@@ -1,10 +1,8 @@
1
+ import type { Device } from '@seamapi/types/connect'
1
2
  import classNames from 'classnames'
2
3
 
3
- import type {
4
- UseDevicesData,
5
- UseDevicesParams,
6
- } from 'lib/seam/devices/use-devices.js'
7
- import { BatteryStatus } from 'lib/ui/device/BatteryStatus.js'
4
+ import type { UseDevicesParams } from 'lib/seam/devices/use-devices.js'
5
+ import { BatteryStatusIndicator } from 'lib/ui/device/BatteryStatusIndicator.js'
8
6
  import { DeviceImage } from 'lib/ui/device/DeviceImage.js'
9
7
  import { LockStatus } from 'lib/ui/device/LockStatus.js'
10
8
  import {
@@ -22,7 +20,7 @@ interface Props {
22
20
  }
23
21
 
24
22
  interface DeviceRowProps {
25
- device: UseDevicesData[number]
23
+ device: Device
26
24
  onClick: () => void
27
25
  }
28
26
 
@@ -62,7 +60,7 @@ export function DeviceRow({
62
60
  </span>
63
61
  <div className='seam-device-statuses'>
64
62
  <OnlineStatus device={device} />
65
- {isConnected && <BatteryStatus device={device} />}
63
+ {isConnected && <BatteryStatusIndicator device={device} />}
66
64
  {isConnected && <LockStatus device={device} />}
67
65
  </div>
68
66
  </div>
@@ -1,11 +1,6 @@
1
+ import type { Device } from '@seamapi/types/connect'
1
2
  import classNames from 'classnames'
2
3
  import { useCallback, useMemo, useState } from 'react'
3
- import {
4
- type CommonDevice,
5
- isLockDevice,
6
- isNoiseSensorDevice,
7
- isThermostatDevice,
8
- } from 'seamapi'
9
4
 
10
5
  import { compareByCreatedAtDesc } from 'lib/dates.js'
11
6
  import {
@@ -19,10 +14,10 @@ import {
19
14
  DeviceHealthBar,
20
15
  } from 'lib/seam/components/DeviceTable/DeviceHealthBar.js'
21
16
  import { DeviceRow } from 'lib/seam/components/DeviceTable/DeviceRow.js'
22
- import {
23
- useDevices,
24
- type UseDevicesData,
25
- } from 'lib/seam/devices/use-devices.js'
17
+ import { useDevices } from 'lib/seam/devices/use-devices.js'
18
+ import { isLockDevice } from 'lib/seam/locks/lock-device.js'
19
+ import { isNoiseSensorDevice } from 'lib/seam/noise-sensors/noise-sensor-device.js'
20
+ import { isThermostatDevice } from 'lib/seam/thermostats/thermostat-device.js'
26
21
  import { useComponentTelemetry } from 'lib/telemetry/index.js'
27
22
  import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
28
23
  import { LoadingToast } from 'lib/ui/LoadingToast/LoadingToast.js'
@@ -34,8 +29,6 @@ import { TableTitle } from 'lib/ui/Table/TableTitle.js'
34
29
  import { SearchTextField } from 'lib/ui/TextField/SearchTextField.js'
35
30
  import { Caption } from 'lib/ui/typography/Caption.js'
36
31
 
37
- type Device = UseDevicesData[number]
38
-
39
32
  export interface DeviceTableProps extends CommonProps {
40
33
  deviceIds?: string[]
41
34
  connectedAccountIds?: string[]
@@ -48,7 +41,7 @@ export interface DeviceTableProps extends CommonProps {
48
41
  }
49
42
 
50
43
  export const defaultDeviceFilter = (
51
- device: CommonDevice,
44
+ device: Device,
52
45
  searchInputValue: string
53
46
  ): boolean => {
54
47
  const value = searchInputValue.trim()
@@ -184,7 +177,7 @@ export function DeviceTable({
184
177
  }
185
178
 
186
179
  function Content(props: {
187
- devices: Array<UseDevicesData[number]>
180
+ devices: Device[]
188
181
  onDeviceClick: (deviceId: string) => void
189
182
  errorFilter: (error: any) => boolean
190
183
  }): JSX.Element {
@@ -1,7 +1,6 @@
1
- import {
2
- useAccessCode,
3
- type UseAccessCodeData,
4
- } from 'lib/seam/access-codes/use-access-code.js'
1
+ import type { AccessCode } from '@seamapi/types/connect'
2
+
3
+ import { useAccessCode } from 'lib/seam/access-codes/use-access-code.js'
5
4
  import { useUpdateAccessCode } from 'lib/seam/access-codes/use-update-access-code.js'
6
5
  import {
7
6
  type CommonProps,
@@ -56,7 +55,7 @@ function Content({
56
55
  accessCode,
57
56
  onSuccess,
58
57
  }: Omit<EditAccessCodeFormProps, 'accessCodeId'> & {
59
- accessCode: NonNullable<UseAccessCodeData>
58
+ accessCode: AccessCode
60
59
  }): JSX.Element | null {
61
60
  const { device } = useDevice({
62
61
  device_id: accessCode.device_id,
@@ -93,14 +92,14 @@ function Content({
93
92
  }
94
93
 
95
94
  function useSubmitEditAccessCode(
96
- accessCode: NonNullable<UseAccessCodeData>,
95
+ accessCode: AccessCode,
97
96
  onSuccess?: () => void
98
97
  ): {
99
98
  submit: (data: AccessCodeFormSubmitData) => void
100
99
  isSubmitting: boolean
101
100
  responseErrors: ResponseErrors | null
102
101
  } {
103
- const { mutate, isLoading: isSubmitting } = useUpdateAccessCode()
102
+ const { mutate, isPending: isSubmitting } = useUpdateAccessCode()
104
103
  const { responseErrors, handleResponseError, resetResponseErrors } =
105
104
  useResponseErrors()
106
105
 
@@ -2,7 +2,6 @@ import type { DeviceModel } from '@seamapi/types/devicedb'
2
2
  import { useMemo } from 'react'
3
3
 
4
4
  import { SupportedDeviceManufacturerSection } from 'lib/seam/components/SupportedDeviceTable/SupportedDeviceManufacturerSection.js'
5
- import type { UseDeviceModelsData } from 'lib/seam/components/SupportedDeviceTable/use-device-models.js'
6
5
  import {
7
6
  type DeviceModelFilters,
8
7
  useFilteredDeviceModels,
@@ -28,7 +27,7 @@ export function SupportedDeviceContent({
28
27
  includeIf,
29
28
  excludeIf,
30
29
  }: SupportedDeviceContentProps): JSX.Element | null {
31
- const { deviceModels, isLoading, isError, refetch } = useFilteredDeviceModels(
30
+ const { deviceModels, isPending, isError, refetch } = useFilteredDeviceModels(
32
31
  {
33
32
  filterValue,
34
33
  filters,
@@ -44,7 +43,7 @@ export function SupportedDeviceContent({
44
43
  [deviceModels]
45
44
  )
46
45
 
47
- if (isLoading) {
46
+ if (isPending) {
48
47
  return (
49
48
  <div className='seam-supported-device-table-content-state-block'>
50
49
  <p>{t.loading}</p>
@@ -140,7 +139,7 @@ function EmptyResult({
140
139
  }
141
140
 
142
141
  const groupDeviceModelsByManufacturer = (
143
- deviceModels: UseDeviceModelsData
142
+ deviceModels: DeviceModel[]
144
143
  ): Record<string, DeviceModel[]> => {
145
144
  const result: Record<string, DeviceModel[]> = {}
146
145
 
@@ -1,8 +1,9 @@
1
+ import type { DeviceModel } from '@seamapi/types/devicedb'
2
+
1
3
  import { SupportedDeviceRow } from 'lib/seam/components/SupportedDeviceTable/SupportedDeviceRow.js'
2
- import type { UseDeviceModelsData } from 'lib/seam/components/SupportedDeviceTable/use-device-models.js'
3
4
 
4
5
  interface SupportedDeviceContentRowsProps {
5
- deviceModels: UseDeviceModelsData
6
+ deviceModels: DeviceModel[]
6
7
  }
7
8
 
8
9
  export function SupportedDeviceContentRows({
@@ -1,45 +1,40 @@
1
+ import type { SeamHttpApiError } from '@seamapi/http/connect'
1
2
  import type {
2
3
  DeviceModel,
3
4
  RouteRequestParams,
4
5
  RouteResponse,
5
6
  } from '@seamapi/types/devicedb'
6
7
  import { useQuery } from '@tanstack/react-query'
7
- import type { SeamError } from 'seamapi'
8
8
 
9
9
  import { useSeamClient } from 'lib/seam/use-seam-client.js'
10
10
  import type { UseSeamQueryResult } from 'lib/seam/use-seam-query-result.js'
11
11
 
12
- export type UseDeviceModelParams = DeviceModelsGetParams | string
12
+ export type UseDeviceModelParams = DeviceModelsGetParams
13
+
13
14
  export type UseDeviceModelData = DeviceModel | null
14
15
 
15
16
  export function useDeviceModel(
16
- params?: UseDeviceModelParams
17
+ params: UseDeviceModelParams
17
18
  ): UseSeamQueryResult<'deviceModel', UseDeviceModelData> {
18
- const normalizedParams =
19
- typeof params === 'string' ? { device_model_id: params } : params
20
-
21
19
  const { client: seam } = useSeamClient()
22
- const { data, ...rest } = useQuery<
23
- DeviceModelsGetResponse['device_model'] | null,
24
- SeamError
25
- >({
20
+ const { data, ...rest } = useQuery<UseDeviceModelData, SeamHttpApiError>({
26
21
  enabled: seam != null,
27
- queryKey: ['internal', 'device_models', 'get', normalizedParams],
22
+ queryKey: ['internal', 'device_models', 'get', params],
28
23
  queryFn: async () => {
29
24
  if (seam == null) return null
30
25
  const {
31
26
  data: { device_model: deviceModel },
32
27
  } = await seam.client.get<DeviceModelsGetResponse>(
33
28
  '/internal/devicedb/v1/device_models/get',
34
- { params: normalizedParams }
29
+ { params }
35
30
  )
36
- return deviceModel
31
+ // UPSTREAM: Response type does not match DeviceModel.
32
+ return deviceModel as DeviceModel
37
33
  },
38
34
  })
39
35
 
40
36
  return {
41
37
  ...rest,
42
- // @ts-expect-error: Upstream mismatch between type and route type.
43
38
  deviceModel: data,
44
39
  }
45
40
  }
@@ -1,15 +1,16 @@
1
+ import type { SeamHttpApiError } from '@seamapi/http/connect'
1
2
  import type {
2
3
  DeviceModel,
3
4
  RouteRequestParams,
4
5
  RouteResponse,
5
6
  } from '@seamapi/types/devicedb'
6
7
  import { useQuery, useQueryClient } from '@tanstack/react-query'
7
- import type { SeamError } from 'seamapi'
8
8
 
9
9
  import { useSeamClient } from 'lib/seam/use-seam-client.js'
10
10
  import type { UseSeamQueryResult } from 'lib/seam/use-seam-query-result.js'
11
11
 
12
12
  export type UseDeviceModelsParams = DeviceModelsListParams
13
+
13
14
  export type UseDeviceModelsData = DeviceModel[]
14
15
 
15
16
  export function useDeviceModels(
@@ -18,10 +19,7 @@ export function useDeviceModels(
18
19
  const { client: seam } = useSeamClient()
19
20
  const queryClient = useQueryClient()
20
21
 
21
- const { data, ...rest } = useQuery<
22
- DeviceModelsListResponse['device_models'],
23
- SeamError
24
- >({
22
+ const { data, ...rest } = useQuery<UseDeviceModelsData, SeamHttpApiError>({
25
23
  enabled: seam != null,
26
24
  queryKey: ['internal', 'device_models', 'list', params],
27
25
  queryFn: async () => {
@@ -32,9 +30,6 @@ export function useDeviceModels(
32
30
  '/internal/devicedb/v1/device_models/list',
33
31
  { params }
34
32
  )
35
- return deviceModels
36
- },
37
- onSuccess: (deviceModels) => {
38
33
  for (const deviceModel of deviceModels) {
39
34
  queryClient.setQueryData(
40
35
  [
@@ -46,12 +41,13 @@ export function useDeviceModels(
46
41
  deviceModel
47
42
  )
48
43
  }
44
+ // UPSTREAM: Response type does not match DeviceModel[].
45
+ return deviceModels as DeviceModel[]
49
46
  },
50
47
  })
51
48
 
52
49
  return {
53
50
  ...rest,
54
- // @ts-expect-error: Upstream mismatch between type and route type.
55
51
  deviceModels: data,
56
52
  }
57
53
  }
@@ -1,37 +1,32 @@
1
+ import type { SeamHttpApiError } from '@seamapi/http/connect'
1
2
  import type {
2
3
  Manufacturer,
3
4
  RouteRequestParams,
4
5
  RouteResponse,
5
6
  } from '@seamapi/types/devicedb'
6
7
  import { useQuery } from '@tanstack/react-query'
7
- import type { SeamError } from 'seamapi'
8
8
 
9
9
  import { useSeamClient } from 'lib/seam/use-seam-client.js'
10
10
  import type { UseSeamQueryResult } from 'lib/seam/use-seam-query-result.js'
11
11
 
12
- export type UseManufacturerParams = ManufacturersGetParams | string
12
+ export type UseManufacturerParams = ManufacturersGetParams
13
+
13
14
  export type UseManufacturerData = Manufacturer | null
14
15
 
15
16
  export function useManufacturer(
16
- params?: UseManufacturerParams
17
+ params: UseManufacturerParams
17
18
  ): UseSeamQueryResult<'manufacturer', UseManufacturerData> {
18
- const normalizedParams =
19
- typeof params === 'string' ? { manufacturer_id: params } : params
20
-
21
19
  const { client: seam } = useSeamClient()
22
- const { data, ...rest } = useQuery<
23
- ManufacturersGetResponse['manufacturer'] | null,
24
- SeamError
25
- >({
20
+ const { data, ...rest } = useQuery<UseManufacturerData, SeamHttpApiError>({
26
21
  enabled: seam != null,
27
- queryKey: ['internal', 'manufacturers', 'get', normalizedParams],
22
+ queryKey: ['internal', 'manufacturers', 'get', params],
28
23
  queryFn: async () => {
29
24
  if (seam == null) return null
30
25
  const {
31
26
  data: { manufacturer },
32
27
  } = await seam.client.get<ManufacturersGetResponse>(
33
28
  '/internal/devicedb/v1/manufacturers/get',
34
- { params: normalizedParams }
29
+ { params }
35
30
  )
36
31
  return manufacturer
37
32
  },
@@ -1,15 +1,16 @@
1
+ import type { SeamHttpApiError } from '@seamapi/http/connect'
1
2
  import type {
2
3
  Manufacturer,
3
4
  RouteRequestParams,
4
5
  RouteResponse,
5
6
  } from '@seamapi/types/devicedb'
6
7
  import { useQuery, useQueryClient } from '@tanstack/react-query'
7
- import type { SeamError } from 'seamapi'
8
8
 
9
9
  import { useSeamClient } from 'lib/seam/use-seam-client.js'
10
10
  import type { UseSeamQueryResult } from 'lib/seam/use-seam-query-result.js'
11
11
 
12
12
  export type UseManufacturersParams = ManufacturersListParams
13
+
13
14
  export type UseManufacturersData = Manufacturer[]
14
15
 
15
16
  export function useManufacturers(
@@ -18,10 +19,7 @@ export function useManufacturers(
18
19
  const { client: seam } = useSeamClient()
19
20
  const queryClient = useQueryClient()
20
21
 
21
- const { data, ...rest } = useQuery<
22
- ManufacturersListResponse['manufacturers'],
23
- SeamError
24
- >({
22
+ const { data, ...rest } = useQuery<UseManufacturersData, SeamHttpApiError>({
25
23
  enabled: seam != null,
26
24
  queryKey: ['internal', 'manufacturers', 'list', params],
27
25
  queryFn: async () => {
@@ -32,9 +30,6 @@ export function useManufacturers(
32
30
  '/internal/devicedb/v1/manufacturers/list',
33
31
  { params }
34
32
  )
35
- return manufacturers
36
- },
37
- onSuccess: (manufacturers) => {
38
33
  for (const manufacturer of manufacturers) {
39
34
  queryClient.setQueryData(
40
35
  [
@@ -46,6 +41,7 @@ export function useManufacturers(
46
41
  manufacturer
47
42
  )
48
43
  }
44
+ return manufacturers
49
45
  },
50
46
  })
51
47
 
@@ -1,10 +1,12 @@
1
- import type { ComponentType } from 'react'
2
1
  import type {
3
2
  AccessCodeError,
3
+ AccessCodeWarning,
4
4
  ConnectedAccountError,
5
+ ConnectedAccountWarning,
5
6
  DeviceError,
6
- SeamWarning,
7
- } from 'seamapi'
7
+ DeviceWarning,
8
+ } from '@seamapi/types/connect'
9
+ import type { ComponentType } from 'react'
8
10
 
9
11
  export interface RequiredCommonProps {
10
12
  className: string | undefined
@@ -12,7 +14,9 @@ export interface RequiredCommonProps {
12
14
  errorFilter: (
13
15
  error: ConnectedAccountError | DeviceError | AccessCodeError
14
16
  ) => boolean
15
- warningFilter: (warning: SeamWarning) => boolean
17
+ warningFilter: (
18
+ warning: ConnectedAccountWarning | DeviceWarning | AccessCodeWarning
19
+ ) => boolean
16
20
  disableDeleteAccessCode: boolean | undefined
17
21
  disableCreateAccessCode: boolean | undefined
18
22
  disableEditAccessCode: boolean | undefined