@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,46 +1,49 @@
1
+ import type {
2
+ AccessCodesUpdateBody,
3
+ SeamHttpApiError,
4
+ } from '@seamapi/http/connect'
5
+ import type { AccessCode } from '@seamapi/types/connect'
1
6
  import {
2
7
  useMutation,
3
8
  type UseMutationResult,
4
9
  useQueryClient,
5
10
  } from '@tanstack/react-query'
6
- import type {
7
- AccessCode,
8
- AccessCodesListResponse,
9
- AccessCodeUpdateRequest,
10
- AccessCodeUpdateResponse,
11
- ActionAttempt,
12
- SeamError,
13
- } from 'seamapi'
14
11
 
15
12
  import { NullSeamClientError, useSeamClient } from 'lib/seam/use-seam-client.js'
16
13
 
17
14
  export type UseUpdateAccessCodeParams = never
18
- export type UseUpdateAccessCodeData = ActionAttempt<'UPDATE_ACCESS_CODE'>
19
- export type UseUpdateAccessCodeMutationParams = AccessCodeUpdateRequest
15
+
16
+ export type UseUpdateAccessCodeData = undefined
17
+
18
+ export type UseUpdateAccessCodeMutationVariables = Pick<
19
+ AccessCodesUpdateBody,
20
+ | 'device_id'
21
+ | 'access_code_id'
22
+ | 'code'
23
+ | 'name'
24
+ | 'starts_at'
25
+ | 'ends_at'
26
+ | 'type'
27
+ >
20
28
 
21
29
  export function useUpdateAccessCode(): UseMutationResult<
22
30
  UseUpdateAccessCodeData,
23
- SeamError,
24
- UseUpdateAccessCodeMutationParams
31
+ SeamHttpApiError,
32
+ UseUpdateAccessCodeMutationVariables
25
33
  > {
26
34
  const { client } = useSeamClient()
27
35
  const queryClient = useQueryClient()
28
36
 
29
37
  return useMutation<
30
- AccessCodeUpdateResponse['action_attempt'],
31
- SeamError,
32
- AccessCodeUpdateRequest
38
+ UseUpdateAccessCodeData,
39
+ SeamHttpApiError,
40
+ UseUpdateAccessCodeMutationVariables
33
41
  >({
34
- mutationFn: async (mutationParams: UseUpdateAccessCodeMutationParams) => {
42
+ mutationFn: async (variables) => {
35
43
  if (client === null) throw new NullSeamClientError()
36
-
37
- return await client.accessCodes.update(mutationParams)
44
+ await client.accessCodes.update(variables)
38
45
  },
39
46
  onSuccess: (_data, variables) => {
40
- // There is no guarantee that the actual code has updated even if the
41
- // request was succesful. To prevent stale data in the UI, the
42
- // code below optimistically updates the data in cache.
43
-
44
47
  queryClient.setQueryData<AccessCode | null>(
45
48
  ['access_codes', 'get', { access_code_id: variables.access_code_id }],
46
49
  (accessCode) => {
@@ -52,15 +55,19 @@ export function useUpdateAccessCode(): UseMutationResult<
52
55
  ...accessCode,
53
56
  code: variables.code ?? accessCode.code,
54
57
  name: variables.name ?? accessCode.name,
58
+ starts_at: variables.starts_at ?? accessCode.starts_at,
59
+ ends_at: variables.ends_at ?? accessCode.ends_at,
60
+ type: variables.type ?? accessCode.type,
61
+ status: 'setting',
55
62
  }
56
63
  }
57
64
  )
58
65
 
59
- queryClient.setQueryData<AccessCodesListResponse['access_codes']>(
60
- ['access_codes', 'list', { device_id: variables.device_id }],
66
+ queryClient.setQueryData<AccessCode[]>(
67
+ ['access_codes', 'list'],
61
68
  (accessCodes) => {
62
69
  if (accessCodes == null) {
63
- return
70
+ return accessCodes
64
71
  }
65
72
 
66
73
  return accessCodes.map((accessCode) => {
@@ -69,6 +76,7 @@ export function useUpdateAccessCode(): UseMutationResult<
69
76
  ...accessCode,
70
77
  code: variables.code ?? accessCode.code,
71
78
  name: variables.name ?? accessCode.name,
79
+ status: 'setting',
72
80
  }
73
81
  }
74
82
 
@@ -1,14 +1,12 @@
1
+ import type { SeamHttpApiError } from '@seamapi/http/connect'
2
+ import type { ClientSession } from '@seamapi/types/connect'
1
3
  import { useQuery } from '@tanstack/react-query'
2
- import type {
3
- ClientSession,
4
- ClientSessionsGetResponse,
5
- SeamError,
6
- } from 'seamapi'
7
4
 
8
5
  import { useSeamClient } from 'lib/seam/use-seam-client.js'
9
6
  import type { UseSeamQueryResult } from 'lib/seam/use-seam-query-result.js'
10
7
 
11
8
  export type UseClientSessionParams = never
9
+
12
10
  export type UseClientSessionData = ClientSession | null
13
11
 
14
12
  export function useClientSession(): UseSeamQueryResult<
@@ -16,15 +14,12 @@ export function useClientSession(): UseSeamQueryResult<
16
14
  UseClientSessionData
17
15
  > {
18
16
  const { client } = useSeamClient()
19
- const { data, ...rest } = useQuery<
20
- ClientSessionsGetResponse['client_session'] | null,
21
- SeamError
22
- >({
17
+ const { data, ...rest } = useQuery<UseClientSessionData, SeamHttpApiError>({
23
18
  enabled: client != null,
24
19
  queryKey: ['client_session', 'get'],
25
20
  queryFn: async () => {
26
21
  if (client == null) return null
27
- return await client.clientSessions.get({})
22
+ return await client.clientSessions.get()
28
23
  },
29
24
  })
30
25
 
@@ -1,7 +1,7 @@
1
+ import type { AccessCode } from '@seamapi/types/connect'
1
2
  import classNames from 'classnames'
2
3
  import { DateTime } from 'luxon'
3
4
  import { useState } from 'react'
4
- import type { AccessCode } from 'seamapi'
5
5
 
6
6
  import { CopyIcon } from 'lib/icons/Copy.js'
7
7
  import { useAccessCode } from 'lib/seam/access-codes/use-access-code.js'
@@ -49,9 +49,9 @@ export function AccessCodeDetails({
49
49
  }: AccessCodeDetailsProps): JSX.Element | null {
50
50
  useComponentTelemetry('AccessCodeDetails')
51
51
 
52
- const { accessCode } = useAccessCode(accessCodeId)
52
+ const { accessCode } = useAccessCode({ access_code_id: accessCodeId })
53
53
  const [selectedDeviceId, selectDevice] = useState<string | null>(null)
54
- const { mutate: deleteCode, isLoading: isDeleting } = useDeleteAccessCode()
54
+ const { mutate: deleteCode, isPending: isDeleting } = useDeleteAccessCode()
55
55
 
56
56
  if (accessCode == null) {
57
57
  return null
@@ -191,21 +191,25 @@ function ScheduleInfo({ accessCode }: { accessCode: AccessCode }): JSX.Element {
191
191
  }
192
192
  return (
193
193
  <div className='seam-times'>
194
- <div>
195
- <div className='seam-label'>{t.start}</div>
196
- <div className='seam-date'>{formatDate(accessCode.starts_at)}</div>
197
- <div className='seam-time'>{formatTime(accessCode.starts_at)}</div>
198
- </div>
199
- <div>
200
- <div className='seam-label'>{t.end}</div>
201
- <div className='seam-date'>{formatDate(accessCode.ends_at)}</div>
202
- <div className='seam-time'>{formatTime(accessCode.ends_at)}</div>
203
- </div>
194
+ {accessCode.starts_at != null && (
195
+ <div>
196
+ <div className='seam-label'>{t.start}</div>
197
+ <div className='seam-date'>{formatDate(accessCode.starts_at)}</div>
198
+ <div className='seam-time'>{formatTime(accessCode.starts_at)}</div>
199
+ </div>
200
+ )}
201
+ {accessCode.ends_at != null && (
202
+ <div>
203
+ <div className='seam-label'>{t.end}</div>
204
+ <div className='seam-date'>{formatDate(accessCode.ends_at)}</div>
205
+ <div className='seam-time'>{formatTime(accessCode.ends_at)}</div>
206
+ </div>
207
+ )}
204
208
  </div>
205
209
  )
206
210
  }
207
211
 
208
- function Duration(props: { accessCode: AccessCode }): JSX.Element {
212
+ function Duration(props: { accessCode: AccessCode }): JSX.Element | null {
209
213
  const { accessCode } = props
210
214
 
211
215
  const hasStarted =
@@ -220,22 +224,26 @@ function Duration(props: { accessCode: AccessCode }): JSX.Element {
220
224
  )
221
225
  }
222
226
 
223
- if (hasStarted) {
227
+ if (hasStarted && accessCode.ends_at != null) {
224
228
  return (
225
229
  <span>
226
- <span className='seam-label'>Active</span> until{' '}
227
- {formatDurationDate(accessCode.ends_at)} at{' '}
230
+ <span className='seam-label'>{t.active}</span> {t.until}{' '}
231
+ {formatDurationDate(accessCode.ends_at)} {t.at}{' '}
228
232
  {formatTime(accessCode.ends_at)}
229
233
  </span>
230
234
  )
231
235
  }
232
236
 
233
- return (
234
- <span>
235
- Starts {formatDurationDate(accessCode.starts_at)} as{' '}
236
- {formatTime(accessCode.starts_at)}
237
- </span>
238
- )
237
+ if (accessCode.starts_at != null) {
238
+ return (
239
+ <span>
240
+ {t.starts} {formatDurationDate(accessCode.starts_at)} {t.as}{' '}
241
+ {formatTime(accessCode.starts_at)}
242
+ </span>
243
+ )
244
+ }
245
+
246
+ return null
239
247
  }
240
248
 
241
249
  const formatDurationDate = (date: string): string =>
@@ -267,6 +275,11 @@ const t = {
267
275
  ongoing: 'Ongoing',
268
276
  start: 'Start',
269
277
  end: 'End',
278
+ starts: 'Starts',
279
+ active: 'Active',
280
+ until: 'until',
281
+ as: 'as',
282
+ at: 'at',
270
283
  editCode: 'Edit code',
271
284
  deleteCode: 'Delete code',
272
285
  }
@@ -1,7 +1,6 @@
1
- import { isLockDevice, type LockDevice } from 'seamapi'
2
-
3
1
  import { useDevice } from 'lib/seam/devices/use-device.js'
4
- import { useToggleLock } from 'lib/seam/devices/use-toggle-lock.js'
2
+ import { isLockDevice, type LockDevice } from 'lib/seam/locks/lock-device.js'
3
+ import { useToggleLock } from 'lib/seam/locks/use-toggle-lock.js'
5
4
  import { Button } from 'lib/ui/Button.js'
6
5
  import { DeviceImage } from 'lib/ui/device/DeviceImage.js'
7
6
  import { TextButton } from 'lib/ui/TextButton.js'
@@ -15,11 +14,11 @@ export function AccessCodeDevice({
15
14
  disableLockUnlock: boolean
16
15
  onSelectDevice: (deviceId: string) => void
17
16
  }): JSX.Element | null {
18
- const { isLoading, device } = useDevice({
17
+ const { isPending, device } = useDevice({
19
18
  device_id: deviceId,
20
19
  })
21
20
 
22
- if (isLoading) {
21
+ if (isPending) {
23
22
  return null
24
23
  }
25
24
 
@@ -31,6 +30,10 @@ export function AccessCodeDevice({
31
30
  return null
32
31
  }
33
32
 
33
+ if (device.can_program_online_access_codes == null) {
34
+ return null
35
+ }
36
+
34
37
  return (
35
38
  <Content
36
39
  device={device}
@@ -46,7 +49,7 @@ function Content(props: {
46
49
  onSelectDevice: (deviceId: string) => void
47
50
  }): JSX.Element {
48
51
  const { device, disableLockUnlock, onSelectDevice } = props
49
- const toggleLock = useToggleLock(device)
52
+ const toggleLock = useToggleLock()
50
53
 
51
54
  const toggleLockLabel = device.properties.locked ? t.unlock : t.lock
52
55
 
@@ -68,7 +71,7 @@ function Content(props: {
68
71
  {!disableLockUnlock && (
69
72
  <Button
70
73
  onClick={() => {
71
- toggleLock.mutate()
74
+ toggleLock.mutate(device)
72
75
  }}
73
76
  >
74
77
  {toggleLockLabel}
@@ -1,15 +1,14 @@
1
- import type { AccessCode } from 'seamapi'
1
+ import type { AccessCode } from '@seamapi/types/connect'
2
2
 
3
3
  import { CheckIcon } from 'lib/icons/Check.js'
4
4
  import { ExclamationCircleOutlineIcon } from 'lib/icons/ExclamationCircleOutline.js'
5
- import type { UseAccessCodesData } from 'lib/seam/access-codes/use-access-codes.js'
6
5
  import { TableFilterBar } from 'lib/ui/Table/TableFilterBar/TableFilterBar.js'
7
6
  import { TableFilterItem } from 'lib/ui/Table/TableFilterBar/TableFilterItem.js'
8
7
 
9
8
  export type AccessCodeFilter = 'access_code_issues'
10
9
 
11
10
  interface AccessCodeHealthBarProps {
12
- accessCodes: Array<UseAccessCodesData[number]>
11
+ accessCodes: AccessCode[]
13
12
  errorFilter: (error: AccessCode['errors'][number]) => boolean
14
13
  warningFilter: (warning: AccessCode['warnings'][number]) => boolean
15
14
  filter: AccessCodeFilter | null
@@ -1,10 +1,11 @@
1
+ import type { AccessCode } from '@seamapi/types/connect'
2
+
1
3
  import { AccessCodeKeyIcon } from 'lib/icons/AccessCodeKey.js'
2
4
  import { ExclamationCircleOutlineIcon } from 'lib/icons/ExclamationCircleOutline.js'
3
5
  import { TriangleWarningOutlineIcon } from 'lib/icons/TriangleWarningOutline.js'
4
- import type { UseAccessCodesData } from 'lib/seam/access-codes/use-access-codes.js'
5
6
 
6
7
  export interface AccessCodeMainIconProps {
7
- accessCode: UseAccessCodesData[number]
8
+ accessCode: AccessCode
8
9
  }
9
10
 
10
11
  export function AccessCodeMainIcon({
@@ -1,5 +1,6 @@
1
+ import type { AccessCode } from '@seamapi/types/connect'
2
+
1
3
  import { CopyIcon } from 'lib/icons/Copy.js'
2
- import type { UseAccessCodeData } from 'lib/seam/access-codes/use-access-code.js'
3
4
  import { useDeleteAccessCode } from 'lib/seam/access-codes/use-delete-access-code.js'
4
5
  import { Button } from 'lib/ui/Button.js'
5
6
  import { copyToClipboard } from 'lib/ui/clipboard.js'
@@ -8,7 +9,7 @@ import { MoreActionsMenu } from 'lib/ui/Menu/MoreActionsMenu.js'
8
9
  import { useToggle } from 'lib/ui/use-toggle.js'
9
10
 
10
11
  export interface AccessCodeMenuProps {
11
- accessCode: NonNullable<UseAccessCodeData>
12
+ accessCode: AccessCode
12
13
  onEdit: () => void
13
14
  onViewDetails: () => void
14
15
  disableEditAccessCode: boolean
@@ -47,13 +48,13 @@ function Content({
47
48
  <div className='seam-actions'>
48
49
  <Button
49
50
  onClick={toggleDeleteConfirmation}
50
- disabled={deleteAccessCode.isLoading}
51
+ disabled={deleteAccessCode.isPending}
51
52
  >
52
53
  {t.cancelDelete}
53
54
  </Button>
54
55
  <Button
55
56
  variant='solid'
56
- disabled={deleteAccessCode.isLoading}
57
+ disabled={deleteAccessCode.isPending}
57
58
  onClick={() => {
58
59
  deleteAccessCode.mutate({
59
60
  access_code_id: accessCode.access_code_id,
@@ -1,6 +1,7 @@
1
+ import type { AccessCode } from '@seamapi/types/connect'
2
+
1
3
  import { ExclamationCircleOutlineIcon } from 'lib/icons/ExclamationCircleOutline.js'
2
4
  import { TriangleWarningOutlineIcon } from 'lib/icons/TriangleWarningOutline.js'
3
- import type { UseAccessCodesData } from 'lib/seam/access-codes/use-access-codes.js'
4
5
  import { AccessCodeMainIcon } from 'lib/seam/components/AccessCodeTable/AccessCodeMainIcon.js'
5
6
  import { AccessCodeMenu } from 'lib/seam/components/AccessCodeTable/AccessCodeMenu.js'
6
7
  import { CodeDetails } from 'lib/seam/components/AccessCodeTable/CodeDetails.js'
@@ -9,7 +10,7 @@ import { TableRow } from 'lib/ui/Table/TableRow.js'
9
10
  import { Title } from 'lib/ui/typography/Title.js'
10
11
 
11
12
  export interface AccessCodeRowProps {
12
- accessCode: UseAccessCodesData[number]
13
+ accessCode: AccessCode
13
14
  onClick: () => void
14
15
  onEdit: () => void
15
16
  disableEditAccessCode: boolean
@@ -1,12 +1,10 @@
1
+ import type { AccessCode } from '@seamapi/types/connect'
1
2
  import classNames from 'classnames'
2
3
  import { useCallback, useMemo, useState } from 'react'
3
4
 
4
5
  import { compareByCreatedAtDesc } from 'lib/dates.js'
5
6
  import { AddIcon } from 'lib/icons/Add.js'
6
- import {
7
- useAccessCodes,
8
- type UseAccessCodesData,
9
- } from 'lib/seam/access-codes/use-access-codes.js'
7
+ import { useAccessCodes } from 'lib/seam/access-codes/use-access-codes.js'
10
8
  import { NestedAccessCodeDetails } from 'lib/seam/components/AccessCodeDetails/AccessCodeDetails.js'
11
9
  import {
12
10
  type AccessCodeFilter,
@@ -50,8 +48,6 @@ export interface AccessCodeTableProps extends CommonProps {
50
48
  heading?: string | null
51
49
  }
52
50
 
53
- type AccessCode = UseAccessCodesData[number]
54
-
55
51
  const defaultAccessCodeFilter = (
56
52
  accessCode: AccessCode,
57
53
  searchInputValue: string
@@ -296,7 +292,7 @@ export function AccessCodeTable({
296
292
  }
297
293
 
298
294
  function Content(props: {
299
- accessCodes: Array<UseAccessCodesData[number]>
295
+ accessCodes: AccessCode[]
300
296
  onAccessCodeClick: (accessCodeId: string) => void
301
297
  onAccessCodeEdit: (accessCodeId: string) => void
302
298
  errorFilter: (error: AccessCode['errors'][number]) => boolean
@@ -1,5 +1,5 @@
1
+ import type { AccessCode } from '@seamapi/types/connect'
1
2
  import { DateTime } from 'luxon'
2
- import type { AccessCode } from 'seamapi'
3
3
 
4
4
  import { useDevice } from 'lib/seam/devices/use-device.js'
5
5
  import { DotDivider } from 'lib/ui/layout/DotDivider.js'
@@ -23,7 +23,7 @@ export function CodeDetails(props: { accessCode: AccessCode }): JSX.Element {
23
23
  )
24
24
  }
25
25
 
26
- function Duration(props: { accessCode: AccessCode }): JSX.Element {
26
+ function Duration(props: { accessCode: AccessCode }): JSX.Element | null {
27
27
  const { accessCode } = props
28
28
 
29
29
  const hasStarted =
@@ -38,7 +38,7 @@ function Duration(props: { accessCode: AccessCode }): JSX.Element {
38
38
  )
39
39
  }
40
40
 
41
- if (hasStarted) {
41
+ if (hasStarted && accessCode.ends_at != null) {
42
42
  return (
43
43
  <span>
44
44
  {t.ends}: {formatDate(accessCode.ends_at)}{' '}
@@ -46,11 +46,15 @@ function Duration(props: { accessCode: AccessCode }): JSX.Element {
46
46
  )
47
47
  }
48
48
 
49
- return (
50
- <span>
51
- {t.starts}: {formatDate(accessCode.starts_at)}
52
- </span>
53
- )
49
+ if (hasStarted && accessCode.starts_at != null) {
50
+ return (
51
+ <span>
52
+ {t.starts}: {formatDate(accessCode.starts_at)}
53
+ </span>
54
+ )
55
+ }
56
+
57
+ return null
54
58
  }
55
59
 
56
60
  const formatDate = (date: string): string =>
@@ -1,5 +1,5 @@
1
+ import type { ClimateSettingSchedule } from '@seamapi/types/connect'
1
2
  import { DateTime } from 'luxon'
2
- import type { ClimateSettingSchedule } from 'seamapi'
3
3
 
4
4
  import { ClimateSettingScheduleIcon } from 'lib/icons/ClimateSettingSchedule.js'
5
5
  import { ClimateSettingScheduleDeviceBar } from 'lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDeviceBar.js'
@@ -35,9 +35,9 @@ function Content(props: {
35
35
  }): JSX.Element | null {
36
36
  const { climateSettingScheduleId, onSelectDevice } = props
37
37
 
38
- const { climateSettingSchedule } = useClimateSettingSchedule(
39
- climateSettingScheduleId
40
- )
38
+ const { climateSettingSchedule } = useClimateSettingSchedule({
39
+ climate_setting_schedule_id: climateSettingScheduleId,
40
+ })
41
41
 
42
42
  if (climateSettingSchedule == null) {
43
43
  return null
@@ -45,9 +45,9 @@ export function ClimateSettingScheduleDetails({
45
45
  }: ClimateSettingScheduleDetailsProps): JSX.Element | null {
46
46
  useComponentTelemetry('ClimateSettingScheduleDetails')
47
47
 
48
- const { climateSettingSchedule } = useClimateSettingSchedule(
49
- climateSettingScheduleId
50
- )
48
+ const { climateSettingSchedule } = useClimateSettingSchedule({
49
+ climate_setting_schedule_id: climateSettingScheduleId,
50
+ })
51
51
 
52
52
  const { mutate, isSuccess, isError } = useUpdateClimateSettingSchedule()
53
53
 
@@ -1,7 +1,9 @@
1
- import { isThermostatDevice, type ThermostatDevice } from 'seamapi'
2
-
3
1
  import { ChevronWideIcon } from 'lib/icons/ChevronWide.js'
4
2
  import { useDevice } from 'lib/seam/devices/use-device.js'
3
+ import {
4
+ isThermostatDevice,
5
+ type ThermostatDevice,
6
+ } from 'lib/seam/thermostats/thermostat-device.js'
5
7
  import { DeviceImage } from 'lib/ui/device/DeviceImage.js'
6
8
  import { ClimateSettingStatus } from 'lib/ui/thermostat/ClimateSettingStatus.js'
7
9
 
@@ -12,11 +14,11 @@ export function ClimateSettingScheduleDeviceBar({
12
14
  deviceId: string
13
15
  onSelectDevice: (deviceId: string) => void
14
16
  }): JSX.Element | null {
15
- const { isLoading, device } = useDevice({
17
+ const { isPending, device } = useDevice({
16
18
  device_id: deviceId,
17
19
  })
18
20
 
19
- if (isLoading) {
21
+ if (isPending) {
20
22
  return null
21
23
  }
22
24
 
@@ -1,12 +1,13 @@
1
+ import type { ClimateSettingSchedule } from '@seamapi/types/connect'
2
+
1
3
  import { ClimateSettingScheduleIcon } from 'lib/icons/ClimateSettingSchedule.js'
2
4
  import { ClimateSettingScheduleRowDetails } from 'lib/seam/components/ClimateSettingScheduleTable/ClimateSettingScheduleRowDetails.js'
3
- import type { UseClimateSettingSchedulesData } from 'lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js'
4
5
  import { TableCell } from 'lib/ui/Table/TableCell.js'
5
6
  import { TableRow } from 'lib/ui/Table/TableRow.js'
6
7
  import { Title } from 'lib/ui/typography/Title.js'
7
8
 
8
9
  interface ClimateSettingScheduleRowProps {
9
- climateSettingSchedule: UseClimateSettingSchedulesData[number]
10
+ climateSettingSchedule: ClimateSettingSchedule
10
11
  onClick: () => void
11
12
  }
12
13
 
@@ -1,5 +1,5 @@
1
+ import type { ClimateSettingSchedule } from '@seamapi/types/connect'
1
2
  import { DateTime } from 'luxon'
2
- import type { ClimateSettingSchedule } from 'seamapi'
3
3
 
4
4
  import { useDevice } from 'lib/seam/devices/use-device.js'
5
5
  import { DotDivider } from 'lib/ui/layout/DotDivider.js'
@@ -1,6 +1,6 @@
1
+ import type { ClimateSettingSchedule } from '@seamapi/types/connect'
1
2
  import classNames from 'classnames'
2
3
  import { useCallback, useMemo, useState } from 'react'
3
- import type { ClimateSettingSchedule } from 'seamapi'
4
4
 
5
5
  import { compareByCreatedAtDesc } from 'lib/dates.js'
6
6
  import { NestedClimateSettingScheduleDetails } from 'lib/seam/components/ClimateSettingScheduleDetails/ClimateSettingScheduleDetails.js'
@@ -9,10 +9,7 @@ import {
9
9
  type CommonProps,
10
10
  withRequiredCommonProps,
11
11
  } from 'lib/seam/components/common-props.js'
12
- import {
13
- useClimateSettingSchedules,
14
- type UseClimateSettingSchedulesData,
15
- } from 'lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js'
12
+ import { useClimateSettingSchedules } from 'lib/seam/thermostats/climate-setting-schedules/use-climate-setting-schedules.js'
16
13
  import { useComponentTelemetry } from 'lib/telemetry/index.js'
17
14
  import { ContentHeader } from 'lib/ui/layout/ContentHeader.js'
18
15
  import { LoadingToast } from 'lib/ui/LoadingToast/LoadingToast.js'
@@ -187,7 +184,7 @@ export function ClimateSettingScheduleTable({
187
184
  }
188
185
 
189
186
  function Content(props: {
190
- climateSettingSchedules: Array<UseClimateSettingSchedulesData[number]>
187
+ climateSettingSchedules: ClimateSettingSchedule[]
191
188
  onClimateSettingScheduleClick: (climateSettingScheduleId: string) => void
192
189
  }): JSX.Element {
193
190
  const { climateSettingSchedules, onClimateSettingScheduleClick } = props
@@ -18,7 +18,7 @@ export function ConnectAccountButton({
18
18
  }: ConnectAccountButtonProps = {}): JSX.Element {
19
19
  useComponentTelemetry('ConnectAccountButton')
20
20
 
21
- const { isLoading, mutate } = useCreateConnectWebview({
21
+ const { isPending, mutate } = useCreateConnectWebview({
22
22
  willNavigateToWebview: true,
23
23
  })
24
24
 
@@ -34,7 +34,7 @@ export function ConnectAccountButton({
34
34
  size='small'
35
35
  onClick={handleClick}
36
36
  className={className}
37
- disabled={isLoading}
37
+ disabled={isPending}
38
38
  >
39
39
  {t.connectAccount}
40
40
  </Button>