@seamapi/http 2.4.0 → 2.4.2

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 (181) hide show
  1. package/lib/error-interceptor.js +1 -1
  2. package/lib/request-parameters.d.ts +2 -0
  3. package/lib/request-parameters.js +17 -0
  4. package/lib/request-parameters.js.map +1 -0
  5. package/lib/resources/access-code.d.ts +13 -9
  6. package/lib/resources/acs-credential.d.ts +33 -1
  7. package/lib/resources/acs-entrance.d.ts +1 -1
  8. package/lib/resources/acs-system.d.ts +30 -0
  9. package/lib/resources/action-attempt.d.ts +82 -11
  10. package/lib/resources/device-provider.d.ts +1 -1
  11. package/lib/resources/device.d.ts +63 -18
  12. package/lib/resources/event.d.ts +0 -76
  13. package/lib/resources/unmanaged-access-code.d.ts +13 -9
  14. package/lib/resources/unmanaged-device.d.ts +28 -16
  15. package/lib/routes/access-codes/access-codes.d.ts +8 -35
  16. package/lib/routes/access-codes/access-codes.js +17 -6
  17. package/lib/routes/access-codes/access-codes.js.map +1 -1
  18. package/lib/routes/access-codes/simulate/simulate.js +2 -0
  19. package/lib/routes/access-codes/simulate/simulate.js.map +1 -1
  20. package/lib/routes/access-codes/unmanaged/unmanaged.d.ts +5 -4
  21. package/lib/routes/access-codes/unmanaged/unmanaged.js +12 -6
  22. package/lib/routes/access-codes/unmanaged/unmanaged.js.map +1 -1
  23. package/lib/routes/access-grants/access-grants.d.ts +20 -19
  24. package/lib/routes/access-grants/access-grants.js +10 -2
  25. package/lib/routes/access-grants/access-grants.js.map +1 -1
  26. package/lib/routes/access-grants/unmanaged/unmanaged.d.ts +1 -1
  27. package/lib/routes/access-grants/unmanaged/unmanaged.js +8 -4
  28. package/lib/routes/access-grants/unmanaged/unmanaged.js.map +1 -1
  29. package/lib/routes/access-methods/access-methods.d.ts +8 -7
  30. package/lib/routes/access-methods/access-methods.js +12 -4
  31. package/lib/routes/access-methods/access-methods.js.map +1 -1
  32. package/lib/routes/access-methods/unmanaged/unmanaged.js +7 -4
  33. package/lib/routes/access-methods/unmanaged/unmanaged.js.map +1 -1
  34. package/lib/routes/acs/access-groups/access-groups.js +20 -12
  35. package/lib/routes/acs/access-groups/access-groups.js.map +1 -1
  36. package/lib/routes/acs/credentials/credentials.d.ts +1 -1
  37. package/lib/routes/acs/credentials/credentials.js +15 -6
  38. package/lib/routes/acs/credentials/credentials.js.map +1 -1
  39. package/lib/routes/acs/encoders/encoders.d.ts +1 -1
  40. package/lib/routes/acs/encoders/encoders.js +10 -4
  41. package/lib/routes/acs/encoders/encoders.js.map +1 -1
  42. package/lib/routes/acs/encoders/simulate/simulate.js +5 -0
  43. package/lib/routes/acs/encoders/simulate/simulate.js.map +1 -1
  44. package/lib/routes/acs/entrances/entrances.d.ts +2 -2
  45. package/lib/routes/acs/entrances/entrances.js +8 -2
  46. package/lib/routes/acs/entrances/entrances.js.map +1 -1
  47. package/lib/routes/acs/systems/systems.js +11 -6
  48. package/lib/routes/acs/systems/systems.js.map +1 -1
  49. package/lib/routes/acs/users/users.d.ts +25 -24
  50. package/lib/routes/acs/users/users.js +22 -10
  51. package/lib/routes/acs/users/users.js.map +1 -1
  52. package/lib/routes/action-attempts/action-attempts.d.ts +1 -1
  53. package/lib/routes/action-attempts/action-attempts.js +5 -2
  54. package/lib/routes/action-attempts/action-attempts.js.map +1 -1
  55. package/lib/routes/client-sessions/client-sessions.d.ts +4 -3
  56. package/lib/routes/client-sessions/client-sessions.js +14 -6
  57. package/lib/routes/client-sessions/client-sessions.js.map +1 -1
  58. package/lib/routes/connect-webviews/connect-webviews.d.ts +2 -2
  59. package/lib/routes/connect-webviews/connect-webviews.js +9 -4
  60. package/lib/routes/connect-webviews/connect-webviews.js.map +1 -1
  61. package/lib/routes/connected-accounts/connected-accounts.d.ts +5 -4
  62. package/lib/routes/connected-accounts/connected-accounts.js +8 -2
  63. package/lib/routes/connected-accounts/connected-accounts.js.map +1 -1
  64. package/lib/routes/connected-accounts/simulate/simulate.js +2 -0
  65. package/lib/routes/connected-accounts/simulate/simulate.js.map +1 -1
  66. package/lib/routes/customers/customers.d.ts +9 -9
  67. package/lib/routes/customers/customers.js +4 -0
  68. package/lib/routes/customers/customers.js.map +1 -1
  69. package/lib/routes/devices/devices.d.ts +11 -10
  70. package/lib/routes/devices/devices.js +10 -4
  71. package/lib/routes/devices/devices.js.map +1 -1
  72. package/lib/routes/devices/simulate/simulate.js +7 -0
  73. package/lib/routes/devices/simulate/simulate.js.map +1 -1
  74. package/lib/routes/devices/unmanaged/unmanaged.d.ts +8 -23
  75. package/lib/routes/devices/unmanaged/unmanaged.js +6 -2
  76. package/lib/routes/devices/unmanaged/unmanaged.js.map +1 -1
  77. package/lib/routes/events/events.d.ts +8 -7
  78. package/lib/routes/events/events.js +5 -2
  79. package/lib/routes/events/events.js.map +1 -1
  80. package/lib/routes/instant-keys/instant-keys.d.ts +4 -3
  81. package/lib/routes/instant-keys/instant-keys.js +10 -6
  82. package/lib/routes/instant-keys/instant-keys.js.map +1 -1
  83. package/lib/routes/locks/locks.d.ts +7 -46
  84. package/lib/routes/locks/locks.js +8 -2
  85. package/lib/routes/locks/locks.js.map +1 -1
  86. package/lib/routes/locks/simulate/simulate.js +3 -0
  87. package/lib/routes/locks/simulate/simulate.js.map +1 -1
  88. package/lib/routes/noise-sensors/noise-sensors.d.ts +0 -40
  89. package/lib/routes/noise-sensors/noise-sensors.js +2 -0
  90. package/lib/routes/noise-sensors/noise-sensors.js.map +1 -1
  91. package/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.js +12 -6
  92. package/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.js.map +1 -1
  93. package/lib/routes/noise-sensors/simulate/simulate.js +2 -0
  94. package/lib/routes/noise-sensors/simulate/simulate.js.map +1 -1
  95. package/lib/routes/phones/phones.js +10 -6
  96. package/lib/routes/phones/phones.js.map +1 -1
  97. package/lib/routes/phones/simulate/simulate.js +2 -0
  98. package/lib/routes/phones/simulate/simulate.js.map +1 -1
  99. package/lib/routes/seam-http-endpoints.d.ts +26 -26
  100. package/lib/routes/spaces/spaces.d.ts +16 -15
  101. package/lib/routes/spaces/spaces.js +19 -6
  102. package/lib/routes/spaces/spaces.js.map +1 -1
  103. package/lib/routes/thermostats/daily-programs/daily-programs.js +6 -2
  104. package/lib/routes/thermostats/daily-programs/daily-programs.js.map +1 -1
  105. package/lib/routes/thermostats/schedules/schedules.d.ts +2 -2
  106. package/lib/routes/thermostats/schedules/schedules.js +12 -6
  107. package/lib/routes/thermostats/schedules/schedules.js.map +1 -1
  108. package/lib/routes/thermostats/simulate/simulate.js +3 -0
  109. package/lib/routes/thermostats/simulate/simulate.js.map +1 -1
  110. package/lib/routes/thermostats/thermostats.d.ts +13 -53
  111. package/lib/routes/thermostats/thermostats.js +17 -2
  112. package/lib/routes/thermostats/thermostats.js.map +1 -1
  113. package/lib/routes/user-identities/unmanaged/unmanaged.d.ts +1 -1
  114. package/lib/routes/user-identities/unmanaged/unmanaged.js +8 -4
  115. package/lib/routes/user-identities/unmanaged/unmanaged.js.map +1 -1
  116. package/lib/routes/user-identities/user-identities.d.ts +13 -12
  117. package/lib/routes/user-identities/user-identities.js +29 -14
  118. package/lib/routes/user-identities/user-identities.js.map +1 -1
  119. package/lib/routes/webhooks/webhooks.js +10 -4
  120. package/lib/routes/webhooks/webhooks.js.map +1 -1
  121. package/lib/routes/workspaces/workspaces.d.ts +9 -9
  122. package/lib/routes/workspaces/workspaces.js +6 -0
  123. package/lib/routes/workspaces/workspaces.js.map +1 -1
  124. package/lib/version.d.ts +1 -1
  125. package/lib/version.js +1 -1
  126. package/package.json +3 -3
  127. package/src/lib/error-interceptor.ts +1 -1
  128. package/src/lib/request-parameters.ts +33 -0
  129. package/src/lib/resources/access-code.ts +15 -9
  130. package/src/lib/resources/acs-credential.ts +40 -0
  131. package/src/lib/resources/acs-entrance.ts +1 -1
  132. package/src/lib/resources/acs-system.ts +36 -0
  133. package/src/lib/resources/action-attempt.ts +91 -6
  134. package/src/lib/resources/device-provider.ts +1 -0
  135. package/src/lib/resources/device.ts +70 -20
  136. package/src/lib/resources/event.ts +0 -76
  137. package/src/lib/resources/unmanaged-access-code.ts +15 -9
  138. package/src/lib/resources/unmanaged-device.ts +33 -18
  139. package/src/lib/routes/access-codes/access-codes.ts +57 -41
  140. package/src/lib/routes/access-codes/simulate/simulate.ts +7 -0
  141. package/src/lib/routes/access-codes/unmanaged/unmanaged.ts +44 -10
  142. package/src/lib/routes/access-grants/access-grants.ts +43 -21
  143. package/src/lib/routes/access-grants/unmanaged/unmanaged.ts +24 -5
  144. package/src/lib/routes/access-methods/access-methods.ts +41 -11
  145. package/src/lib/routes/access-methods/unmanaged/unmanaged.ts +17 -4
  146. package/src/lib/routes/acs/access-groups/access-groups.ts +43 -12
  147. package/src/lib/routes/acs/credentials/credentials.ts +28 -7
  148. package/src/lib/routes/acs/encoders/encoders.ts +28 -5
  149. package/src/lib/routes/acs/encoders/simulate/simulate.ts +25 -0
  150. package/src/lib/routes/acs/entrances/entrances.ts +23 -4
  151. package/src/lib/routes/acs/systems/systems.ts +23 -6
  152. package/src/lib/routes/acs/users/users.ts +76 -33
  153. package/src/lib/routes/action-attempts/action-attempts.ts +8 -3
  154. package/src/lib/routes/client-sessions/client-sessions.ts +35 -9
  155. package/src/lib/routes/connect-webviews/connect-webviews.ts +15 -5
  156. package/src/lib/routes/connected-accounts/connected-accounts.ts +20 -6
  157. package/src/lib/routes/connected-accounts/simulate/simulate.ts +7 -0
  158. package/src/lib/routes/customers/customers.ts +16 -9
  159. package/src/lib/routes/devices/devices.ts +36 -11
  160. package/src/lib/routes/devices/simulate/simulate.ts +29 -0
  161. package/src/lib/routes/devices/unmanaged/unmanaged.ts +19 -22
  162. package/src/lib/routes/events/events.ts +17 -9
  163. package/src/lib/routes/instant-keys/instant-keys.ts +19 -9
  164. package/src/lib/routes/locks/locks.ts +22 -45
  165. package/src/lib/routes/locks/simulate/simulate.ts +13 -0
  166. package/src/lib/routes/noise-sensors/noise-sensors.ts +3 -40
  167. package/src/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.ts +37 -6
  168. package/src/lib/routes/noise-sensors/simulate/simulate.ts +7 -0
  169. package/src/lib/routes/phones/phones.ts +13 -6
  170. package/src/lib/routes/phones/simulate/simulate.ts +7 -0
  171. package/src/lib/routes/seam-http-endpoints.ts +26 -26
  172. package/src/lib/routes/spaces/spaces.ts +61 -21
  173. package/src/lib/routes/thermostats/daily-programs/daily-programs.ts +21 -2
  174. package/src/lib/routes/thermostats/schedules/schedules.ts +35 -8
  175. package/src/lib/routes/thermostats/simulate/simulate.ts +13 -0
  176. package/src/lib/routes/thermostats/thermostats.ts +72 -55
  177. package/src/lib/routes/user-identities/unmanaged/unmanaged.ts +24 -5
  178. package/src/lib/routes/user-identities/user-identities.ts +94 -26
  179. package/src/lib/routes/webhooks/webhooks.ts +15 -4
  180. package/src/lib/routes/workspaces/workspaces.ts +20 -9
  181. package/src/lib/version.ts +1 -1
@@ -194,6 +194,7 @@ export type Device = {
194
194
  | 'tedee_lock'
195
195
  | 'akiles_lock'
196
196
  | 'ultraloq_lock'
197
+ | 'yacan_lock'
197
198
  | 'keyincode_lock'
198
199
  | 'omnitec_lock'
199
200
  | 'kisi_lock'
@@ -272,6 +273,34 @@ export type Device = {
272
273
  */
273
274
  is_device_error: boolean
274
275
 
276
+ /**
277
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
278
+ */
279
+ message: string
280
+ } /**
281
+ * Indicates that Seam's integration user does not have sufficient permissions on the provider's system to which this device belongs, so Seam cannot manage access codes or unlock the device. See the error message for specifics, then either reauthorize the connected account in Seam or grant the integration user the required permissions in the provider's system.
282
+ */
283
+ | {
284
+ /**
285
+ * Date and time at which Seam created the error.
286
+ */
287
+ created_at: string
288
+
289
+ /**
290
+ * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
291
+ */
292
+ error_code: 'insufficient_permissions'
293
+
294
+ /**
295
+ * Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error.
296
+ */
297
+ is_connected_account_error: boolean
298
+
299
+ /**
300
+ * Indicates that the error is not a device error.
301
+ */
302
+ is_device_error: boolean
303
+
275
304
  /**
276
305
  * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
277
306
  */
@@ -554,6 +583,10 @@ export type Device = {
554
583
  * Name of the device location.
555
584
  */
556
585
  location_name?: string | undefined
586
+ /**
587
+ * Name of the room within the device location, when the provider reports one.
588
+ */
589
+ room_name?: string | undefined
557
590
  /**
558
591
  * Time zone of the device location.
559
592
  */
@@ -937,7 +970,7 @@ export type Device = {
937
970
  /**
938
971
  * Device ID for a dormakaba Oracode device.
939
972
  */
940
- device_id?: {} | undefined
973
+ device_id?: string | undefined
941
974
  /**
942
975
  * Door ID for a dormakaba Oracode device.
943
976
  */
@@ -1431,6 +1464,14 @@ export type Device = {
1431
1464
  * Device ID for a Google Nest device.
1432
1465
  */
1433
1466
  nest_device_id?: string | undefined
1467
+ /**
1468
+ * ID of the Google Nest structure containing the device.
1469
+ */
1470
+ nest_structure_id?: string | undefined
1471
+ /**
1472
+ * Name of the Google Nest structure containing the device. The device owner sets this value.
1473
+ */
1474
+ structure_name?: string | undefined
1434
1475
  }
1435
1476
  | undefined
1436
1477
  /**
@@ -1582,7 +1623,7 @@ export type Device = {
1582
1623
  | undefined
1583
1624
  /**
1584
1625
  * Metada for a Salto device.
1585
- * @deprecated Use `salto_ks_metadata ` instead.
1626
+ * @deprecated Use `salto_ks_metadata` instead.
1586
1627
  */
1587
1628
  salto_metadata?:
1588
1629
  | {
@@ -1675,6 +1716,10 @@ export type Device = {
1675
1716
  * Set to true when the device does not support the /dual-setpoints API endpoint.
1676
1717
  */
1677
1718
  dual_setpoints_not_supported?: boolean | undefined
1719
+ /**
1720
+ * Enforced setpoint range in Celsius for a Sensi device, derived from an OutOfRange API error.
1721
+ */
1722
+ enforced_setpoint_range_celsius?: Array<number> | undefined
1678
1723
  /**
1679
1724
  * Product type for a Sensi device.
1680
1725
  */
@@ -1919,6 +1964,29 @@ export type Device = {
1919
1964
  product_type?: string | undefined
1920
1965
  }
1921
1966
  | undefined
1967
+ /**
1968
+ * Metadata for a Yacan device.
1969
+ */
1970
+ yacan_metadata?:
1971
+ | {
1972
+ /**
1973
+ * Device ID for a Yacan device.
1974
+ */
1975
+ device_id?: string | undefined
1976
+ /**
1977
+ * Device name for a Yacan device.
1978
+ */
1979
+ device_name?: string | undefined
1980
+ /**
1981
+ * Device type for a Yacan device.
1982
+ */
1983
+ device_type?: string | undefined
1984
+ /**
1985
+ * Serial number for a Yacan device.
1986
+ */
1987
+ serial_number?: string | undefined
1988
+ }
1989
+ | undefined
1922
1990
  /**
1923
1991
  * The delay in seconds before the lock automatically locks after being unlocked.
1924
1992
  */
@@ -3189,24 +3257,6 @@ export type Device = {
3189
3257
  * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.
3190
3258
  */
3191
3259
  warning_code: 'max_access_codes_reached'
3192
- } /**
3193
- * Indicates that the connected Kwikset account has member-level access to this lock's home. Admin or owner access is required to manage access codes and control the lock remotely.
3194
- */
3195
- | {
3196
- /**
3197
- * Date and time at which Seam created the warning.
3198
- */
3199
- created_at: string
3200
-
3201
- /**
3202
- * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.
3203
- */
3204
- message: string
3205
-
3206
- /**
3207
- * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.
3208
- */
3209
- warning_code: 'insufficient_permissions'
3210
3260
  }
3211
3261
  >
3212
3262
 
@@ -3457,10 +3457,6 @@ export type SeamEvent =
3457
3457
  */
3458
3458
  connected_account_id: string
3459
3459
 
3460
- /**
3461
- * undocumented: Unreleased.
3462
- */
3463
- connected_account_type?: string | undefined
3464
3460
  /**
3465
3461
  * Date and time at which the event was created.
3466
3462
  */
@@ -5671,24 +5667,6 @@ export type SeamEvent =
5671
5667
  * Whether the access code is managed by Seam (true) or unmanaged (false). Only present when access_code_id is set.
5672
5668
  */
5673
5669
  access_code_is_managed?: boolean | undefined
5674
- /**
5675
- * undocumented: Unreleased.
5676
- * ---
5677
- * ID of the ACS entrance associated with the lock event.
5678
- */
5679
- acs_entrance_id?: string | undefined
5680
- /**
5681
- * undocumented: Unreleased.
5682
- * ---
5683
- * ID of the ACS system associated with the lock event.
5684
- */
5685
- acs_system_id?: string | undefined
5686
- /**
5687
- * undocumented: Unreleased.
5688
- * ---
5689
- * ID of the ACS user associated with the lock event.
5690
- */
5691
- acs_user_id?: string | undefined
5692
5670
  /**
5693
5671
  * ID of the Seam action attempt that triggered this lock. Present only when the lock was initiated through Seam (via a `LOCK_DOOR` action attempt).
5694
5672
  */
@@ -5753,12 +5731,6 @@ export type SeamEvent =
5753
5731
  */
5754
5732
  occurred_at: string
5755
5733
 
5756
- /**
5757
- * undocumented: Unreleased.
5758
- * ---
5759
- * ID of the user identity associated with the lock event.
5760
- */
5761
- user_identity_id?: string | undefined
5762
5734
  /**
5763
5735
  * ID of the workspace associated with the event.
5764
5736
  */
@@ -5773,24 +5745,6 @@ export type SeamEvent =
5773
5745
  * Whether the access code is managed by Seam (true) or unmanaged (false). Only present when access_code_id is set.
5774
5746
  */
5775
5747
  access_code_is_managed?: boolean | undefined
5776
- /**
5777
- * undocumented: Unreleased.
5778
- * ---
5779
- * ID of the ACS entrance associated with the unlock event.
5780
- */
5781
- acs_entrance_id?: string | undefined
5782
- /**
5783
- * undocumented: Unreleased.
5784
- * ---
5785
- * ID of the ACS system associated with the unlock event.
5786
- */
5787
- acs_system_id?: string | undefined
5788
- /**
5789
- * undocumented: Unreleased.
5790
- * ---
5791
- * ID of the ACS user associated with the unlock event.
5792
- */
5793
- acs_user_id?: string | undefined
5794
5748
  /**
5795
5749
  * ID of the Seam action attempt that triggered this unlock. Present only when the unlock was initiated through Seam (via an `UNLOCK_DOOR` action attempt).
5796
5750
  */
@@ -5854,12 +5808,6 @@ export type SeamEvent =
5854
5808
  */
5855
5809
  occurred_at: string
5856
5810
 
5857
- /**
5858
- * undocumented: Unreleased.
5859
- * ---
5860
- * ID of the user identity associated with the unlock event.
5861
- */
5862
- user_identity_id?: string | undefined
5863
5811
  /**
5864
5812
  * ID of the workspace associated with the event.
5865
5813
  */
@@ -5870,24 +5818,6 @@ export type SeamEvent =
5870
5818
  * ID of the access code that was used in the unlock attempts.
5871
5819
  */
5872
5820
  access_code_id?: string | undefined
5873
- /**
5874
- * undocumented: Unreleased.
5875
- * ---
5876
- * ID of the ACS entrance associated with the access-denied event.
5877
- */
5878
- acs_entrance_id?: string | undefined
5879
- /**
5880
- * undocumented: Unreleased.
5881
- * ---
5882
- * ID of the ACS system associated with the access-denied event.
5883
- */
5884
- acs_system_id?: string | undefined
5885
- /**
5886
- * undocumented: Unreleased.
5887
- * ---
5888
- * ID of the ACS user associated with the access-denied event.
5889
- */
5890
- acs_user_id?: string | undefined
5891
5821
  /**
5892
5822
  * Custom metadata of the connected account, present when connected_account_id is provided.
5893
5823
  */
@@ -5952,12 +5882,6 @@ export type SeamEvent =
5952
5882
  | 'credential_error'
5953
5883
  }
5954
5884
  | undefined
5955
- /**
5956
- * undocumented: Unreleased.
5957
- * ---
5958
- * ID of the user identity associated with the access-denied event.
5959
- */
5960
- user_identity_id?: string | undefined
5961
5885
  /**
5962
5886
  * ID of the workspace associated with the event.
5963
5887
  */
@@ -281,29 +281,35 @@ export type UnmanagedAccessCode = {
281
281
  */
282
282
  message: string
283
283
  } /**
284
- * Admin role required—insufficient permissions to manage PINs on this device. Please have an admin update your role, or ask them to set the PIN.
284
+ * Indicates that the account is disconnected.
285
285
  */
286
286
  | {
287
287
  /**
288
288
  * Date and time at which Seam created the error.
289
289
  */
290
- created_at?: string | undefined
290
+ created_at: string
291
+
291
292
  /**
292
293
  * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
293
294
  */
294
- error_code: 'insufficient_permissions'
295
+ error_code: 'account_disconnected'
295
296
 
296
297
  /**
297
- * Indicates that this is an access code error.
298
+ * Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error.
298
299
  */
299
- is_access_code_error: boolean
300
+ is_connected_account_error: boolean
301
+
302
+ /**
303
+ * Indicates that the error is not a device error.
304
+ */
305
+ is_device_error: boolean
300
306
 
301
307
  /**
302
308
  * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
303
309
  */
304
310
  message: string
305
311
  } /**
306
- * Indicates that the account is disconnected.
312
+ * Indicates that the Salto site user limit has been reached.
307
313
  */
308
314
  | {
309
315
  /**
@@ -314,7 +320,7 @@ export type UnmanagedAccessCode = {
314
320
  /**
315
321
  * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
316
322
  */
317
- error_code: 'account_disconnected'
323
+ error_code: 'salto_ks_subscription_limit_exceeded'
318
324
 
319
325
  /**
320
326
  * Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error.
@@ -331,7 +337,7 @@ export type UnmanagedAccessCode = {
331
337
  */
332
338
  message: string
333
339
  } /**
334
- * Indicates that the Salto site user limit has been reached.
340
+ * Indicates that Seam's integration user does not have sufficient permissions on the provider's system to which this device belongs, so Seam cannot manage access codes or unlock the device. See the error message for specifics, then either reauthorize the connected account in Seam or grant the integration user the required permissions in the provider's system.
335
341
  */
336
342
  | {
337
343
  /**
@@ -342,7 +348,7 @@ export type UnmanagedAccessCode = {
342
348
  /**
343
349
  * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
344
350
  */
345
- error_code: 'salto_ks_subscription_limit_exceeded'
351
+ error_code: 'insufficient_permissions'
346
352
 
347
353
  /**
348
354
  * Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error.
@@ -149,6 +149,7 @@ export type UnmanagedDevice = {
149
149
  | 'tedee_lock'
150
150
  | 'akiles_lock'
151
151
  | 'ultraloq_lock'
152
+ | 'yacan_lock'
152
153
  | 'keyincode_lock'
153
154
  | 'omnitec_lock'
154
155
  | 'kisi_lock'
@@ -222,6 +223,34 @@ export type UnmanagedDevice = {
222
223
  */
223
224
  is_device_error: boolean
224
225
 
226
+ /**
227
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
228
+ */
229
+ message: string
230
+ } /**
231
+ * Indicates that Seam's integration user does not have sufficient permissions on the provider's system to which this device belongs, so Seam cannot manage access codes or unlock the device. See the error message for specifics, then either reauthorize the connected account in Seam or grant the integration user the required permissions in the provider's system.
232
+ */
233
+ | {
234
+ /**
235
+ * Date and time at which Seam created the error.
236
+ */
237
+ created_at: string
238
+
239
+ /**
240
+ * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
241
+ */
242
+ error_code: 'insufficient_permissions'
243
+
244
+ /**
245
+ * Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error.
246
+ */
247
+ is_connected_account_error: boolean
248
+
249
+ /**
250
+ * Indicates that the error is not a device error.
251
+ */
252
+ is_device_error: boolean
253
+
225
254
  /**
226
255
  * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
227
256
  */
@@ -504,6 +533,10 @@ export type UnmanagedDevice = {
504
533
  * Name of the device location.
505
534
  */
506
535
  location_name?: string | undefined
536
+ /**
537
+ * Name of the room within the device location, when the provider reports one.
538
+ */
539
+ room_name?: string | undefined
507
540
  /**
508
541
  * Time zone of the device location.
509
542
  */
@@ -1129,24 +1162,6 @@ export type UnmanagedDevice = {
1129
1162
  * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.
1130
1163
  */
1131
1164
  warning_code: 'max_access_codes_reached'
1132
- } /**
1133
- * Indicates that the connected Kwikset account has member-level access to this lock's home. Admin or owner access is required to manage access codes and control the lock remotely.
1134
- */
1135
- | {
1136
- /**
1137
- * Date and time at which Seam created the warning.
1138
- */
1139
- created_at: string
1140
-
1141
- /**
1142
- * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.
1143
- */
1144
- message: string
1145
-
1146
- /**
1147
- * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.
1148
- */
1149
- warning_code: 'insufficient_permissions'
1150
1165
  }
1151
1166
  >
1152
1167
 
@@ -28,6 +28,10 @@ import {
28
28
  limitToSeamHttpRequestOptions,
29
29
  parseOptions,
30
30
  } from 'lib/parse-options.js'
31
+ import {
32
+ assertValidRequestParameters,
33
+ type RequireAtLeastOne,
34
+ } from 'lib/request-parameters.js'
31
35
  import type { AccessCode } from 'lib/resources/access-code.js'
32
36
  import { SeamHttpClientSessions } from 'lib/routes/client-sessions/index.js'
33
37
  import { SeamHttpRequest } from 'lib/seam-http-request.js'
@@ -176,6 +180,8 @@ export class SeamHttpAccessCodes {
176
180
  parameters: AccessCodesCreateParameters,
177
181
  options: AccessCodesCreateOptions = {},
178
182
  ): AccessCodesCreateRequest {
183
+ assertValidRequestParameters(parameters, '/access_codes/create', true)
184
+
179
185
  return new SeamHttpRequest(this, {
180
186
  pathname: '/access_codes/create',
181
187
  method: 'POST',
@@ -202,6 +208,12 @@ export class SeamHttpAccessCodes {
202
208
  parameters: AccessCodesCreateMultipleParameters,
203
209
  options: AccessCodesCreateMultipleOptions = {},
204
210
  ): AccessCodesCreateMultipleRequest {
211
+ assertValidRequestParameters(
212
+ parameters,
213
+ '/access_codes/create_multiple',
214
+ true,
215
+ )
216
+
205
217
  return new SeamHttpRequest(this, {
206
218
  pathname: '/access_codes/create_multiple',
207
219
  method: 'PUT',
@@ -218,10 +230,12 @@ export class SeamHttpAccessCodes {
218
230
  parameters: AccessCodesDeleteParameters,
219
231
  options: AccessCodesDeleteOptions = {},
220
232
  ): AccessCodesDeleteRequest {
233
+ assertValidRequestParameters(parameters, '/access_codes/delete', true)
234
+
221
235
  return new SeamHttpRequest(this, {
222
236
  pathname: '/access_codes/delete',
223
- method: 'POST',
224
- body: parameters,
237
+ method: 'DELETE',
238
+ params: parameters,
225
239
  responseKey: undefined,
226
240
  options,
227
241
  })
@@ -234,10 +248,16 @@ export class SeamHttpAccessCodes {
234
248
  parameters: AccessCodesGenerateCodeParameters,
235
249
  options: AccessCodesGenerateCodeOptions = {},
236
250
  ): AccessCodesGenerateCodeRequest {
251
+ assertValidRequestParameters(
252
+ parameters,
253
+ '/access_codes/generate_code',
254
+ true,
255
+ )
256
+
237
257
  return new SeamHttpRequest(this, {
238
258
  pathname: '/access_codes/generate_code',
239
- method: 'POST',
240
- body: parameters,
259
+ method: 'GET',
260
+ params: parameters,
241
261
  responseKey: 'generated_code',
242
262
  options,
243
263
  })
@@ -249,13 +269,15 @@ export class SeamHttpAccessCodes {
249
269
  * You must specify either `access_code_id` or both `device_id` and `code`.
250
270
  */
251
271
  get(
252
- parameters?: AccessCodesGetParameters,
272
+ parameters: AccessCodesGetParameters,
253
273
  options: AccessCodesGetOptions = {},
254
274
  ): AccessCodesGetRequest {
275
+ assertValidRequestParameters(parameters, '/access_codes/get', true)
276
+
255
277
  return new SeamHttpRequest(this, {
256
278
  pathname: '/access_codes/get',
257
- method: 'POST',
258
- body: parameters,
279
+ method: 'GET',
280
+ params: parameters,
259
281
  responseKey: 'access_code',
260
282
  options,
261
283
  })
@@ -267,9 +289,11 @@ export class SeamHttpAccessCodes {
267
289
  * Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`.
268
290
  */
269
291
  list(
270
- parameters?: AccessCodesListParameters,
292
+ parameters: AccessCodesListParameters,
271
293
  options: AccessCodesListOptions = {},
272
294
  ): AccessCodesListRequest {
295
+ assertValidRequestParameters(parameters, '/access_codes/list', true)
296
+
273
297
  return new SeamHttpRequest(this, {
274
298
  pathname: '/access_codes/list',
275
299
  method: 'POST',
@@ -294,6 +318,12 @@ export class SeamHttpAccessCodes {
294
318
  parameters: AccessCodesPullBackupAccessCodeParameters,
295
319
  options: AccessCodesPullBackupAccessCodeOptions = {},
296
320
  ): AccessCodesPullBackupAccessCodeRequest {
321
+ assertValidRequestParameters(
322
+ parameters,
323
+ '/access_codes/pull_backup_access_code',
324
+ true,
325
+ )
326
+
297
327
  return new SeamHttpRequest(this, {
298
328
  pathname: '/access_codes/pull_backup_access_code',
299
329
  method: 'POST',
@@ -312,6 +342,12 @@ export class SeamHttpAccessCodes {
312
342
  parameters: AccessCodesReportDeviceConstraintsParameters,
313
343
  options: AccessCodesReportDeviceConstraintsOptions = {},
314
344
  ): AccessCodesReportDeviceConstraintsRequest {
345
+ assertValidRequestParameters(
346
+ parameters,
347
+ '/access_codes/report_device_constraints',
348
+ true,
349
+ )
350
+
315
351
  return new SeamHttpRequest(this, {
316
352
  pathname: '/access_codes/report_device_constraints',
317
353
  method: 'POST',
@@ -330,6 +366,8 @@ export class SeamHttpAccessCodes {
330
366
  parameters: AccessCodesUpdateParameters,
331
367
  options: AccessCodesUpdateOptions = {},
332
368
  ): AccessCodesUpdateRequest {
369
+ assertValidRequestParameters(parameters, '/access_codes/update', true)
370
+
333
371
  return new SeamHttpRequest(this, {
334
372
  pathname: '/access_codes/update',
335
373
  method: 'PUT',
@@ -350,6 +388,12 @@ export class SeamHttpAccessCodes {
350
388
  parameters: AccessCodesUpdateMultipleParameters,
351
389
  options: AccessCodesUpdateMultipleOptions = {},
352
390
  ): AccessCodesUpdateMultipleRequest {
391
+ assertValidRequestParameters(
392
+ parameters,
393
+ '/access_codes/update_multiple',
394
+ true,
395
+ )
396
+
353
397
  return new SeamHttpRequest(this, {
354
398
  pathname: '/access_codes/update_multiple',
355
399
  method: 'PATCH',
@@ -555,7 +599,7 @@ export type AccessCodesGenerateCodeRequest = SeamHttpRequest<
555
599
 
556
600
  export interface AccessCodesGenerateCodeOptions {}
557
601
 
558
- export type AccessCodesGetParameters = {
602
+ export type AccessCodesGetParameters = RequireAtLeastOne<{
559
603
  /**
560
604
  * ID of the access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`.
561
605
  */
@@ -568,7 +612,7 @@ export type AccessCodesGetParameters = {
568
612
  * ID of the device containing the access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`.
569
613
  */
570
614
  device_id?: string | undefined
571
- }
615
+ }>
572
616
 
573
617
  /**
574
618
  * @deprecated Use AccessCodesGetRequest instead.
@@ -582,7 +626,7 @@ export type AccessCodesGetRequest = SeamHttpRequest<
582
626
 
583
627
  export interface AccessCodesGetOptions {}
584
628
 
585
- export type AccessCodesListParameters = {
629
+ export type AccessCodesListParameters = RequireAtLeastOne<{
586
630
  /**
587
631
  * IDs of the access codes that you want to retrieve. Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`.
588
632
  */
@@ -614,7 +658,7 @@ export type AccessCodesListParameters = {
614
658
  /**
615
659
  * Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
616
660
  */
617
- page_cursor?: string | undefined
661
+ page_cursor?: string | null | undefined
618
662
  /**
619
663
  * String for which to search. Filters returned access codes to include all records that satisfy a partial match using `name`, `code` or `access_code_id`.
620
664
  */
@@ -623,7 +667,7 @@ export type AccessCodesListParameters = {
623
667
  * Your user ID for the user by which to filter access codes.
624
668
  */
625
669
  user_identifier_key?: string | undefined
626
- }
670
+ }>
627
671
 
628
672
  /**
629
673
  * @deprecated Use AccessCodesListRequest instead.
@@ -722,18 +766,6 @@ export type AccessCodesUpdateParameters = {
722
766
  * Indicates whether the access code is managed through Seam. Note that to convert an unmanaged access code into a managed access code, use `/access_codes/unmanaged/convert_to_managed`.
723
767
  */
724
768
  is_managed?: boolean | undefined
725
- /**
726
- * Indicates whether the access code is an [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes).
727
- */
728
- is_offline_access_code?: boolean | undefined
729
- /**
730
- * Indicates whether the [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) is a single-use access code.
731
- */
732
- is_one_time_use?: boolean | undefined
733
- /**
734
- * Maximum rounding adjustment. To create a daily-bound [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) for devices that support this feature, set this parameter to `1d`.
735
- */
736
- max_time_rounding?: '1hour' | '1day' | '1h' | '1d' | undefined
737
769
  /**
738
770
  * Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes.
739
771
  *
@@ -744,14 +776,6 @@ export type AccessCodesUpdateParameters = {
744
776
  * To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called `appearance`. This is an object with a `name` property and, optionally, `first_name` and `last_name` properties (for providers that break down a name into components).
745
777
  */
746
778
  name?: string | undefined
747
- /**
748
- * Indicates whether [native scheduling](https://docs.seam.co/low-level-apis/smart-locks/access-codes#native-scheduling) should be used for time-bound codes when supported by the provider. Default: `true`.
749
- */
750
- prefer_native_scheduling?: boolean | undefined
751
- /**
752
- * Preferred code length. Only applicable if you do not specify a `code`. If the affected device does not support the preferred code length, Seam reverts to using the shortest supported code length.
753
- */
754
- preferred_code_length?: number | undefined
755
779
  /**
756
780
  * Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
757
781
  */
@@ -760,14 +784,6 @@ export type AccessCodesUpdateParameters = {
760
784
  * Type to which you want to convert the access code. To convert a time-bound access code to an ongoing access code, set `type` to `ongoing`. See also [Changing a time-bound access code to permanent access](https://docs.seam.co/low-level-apis/smart-locks/access-codes/modifying-access-codes#special-case-2-changing-a-time-bound-access-code-to-permanent-access).
761
785
  */
762
786
  type?: 'ongoing' | 'time_bound' | undefined
763
- /**
764
- * Indicates whether to use a [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) provided by Seam. If `true`, you can use [`/access_codes/pull_backup_access_code`](https://docs.seam.co/api/access_codes/pull_backup_access_code).
765
- */
766
- use_backup_access_code_pool?: boolean | undefined
767
- /**
768
- * @deprecated Use `is_offline_access_code` instead.
769
- */
770
- use_offline_access_code?: boolean | undefined
771
787
  }
772
788
 
773
789
  /**
@@ -28,6 +28,7 @@ import {
28
28
  limitToSeamHttpRequestOptions,
29
29
  parseOptions,
30
30
  } from 'lib/parse-options.js'
31
+ import { assertValidRequestParameters } from 'lib/request-parameters.js'
31
32
  import type { UnmanagedAccessCode } from 'lib/resources/unmanaged-access-code.js'
32
33
  import { SeamHttpClientSessions } from 'lib/routes/client-sessions/index.js'
33
34
  import { SeamHttpRequest } from 'lib/seam-http-request.js'
@@ -165,6 +166,12 @@ export class SeamHttpAccessCodesSimulate {
165
166
  parameters: AccessCodesSimulateCreateUnmanagedAccessCodeParameters,
166
167
  options: AccessCodesSimulateCreateUnmanagedAccessCodeOptions = {},
167
168
  ): AccessCodesSimulateCreateUnmanagedAccessCodeRequest {
169
+ assertValidRequestParameters(
170
+ parameters,
171
+ '/access_codes/simulate/create_unmanaged_access_code',
172
+ true,
173
+ )
174
+
168
175
  return new SeamHttpRequest(this, {
169
176
  pathname: '/access_codes/simulate/create_unmanaged_access_code',
170
177
  method: 'POST',