@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
@@ -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 { AcsEntrance } from 'lib/resources/acs-entrance.js'
32
36
  import type { AcsUser } from 'lib/resources/acs-user.js'
33
37
  import { SeamHttpClientSessions } from 'lib/routes/client-sessions/index.js'
@@ -166,6 +170,12 @@ export class SeamHttpAcsUsers {
166
170
  parameters: AcsUsersAddToAccessGroupParameters,
167
171
  options: AcsUsersAddToAccessGroupOptions = {},
168
172
  ): AcsUsersAddToAccessGroupRequest {
173
+ assertValidRequestParameters(
174
+ parameters,
175
+ '/acs/users/add_to_access_group',
176
+ true,
177
+ )
178
+
169
179
  return new SeamHttpRequest(this, {
170
180
  pathname: '/acs/users/add_to_access_group',
171
181
  method: 'PUT',
@@ -182,6 +192,8 @@ export class SeamHttpAcsUsers {
182
192
  parameters: AcsUsersCreateParameters,
183
193
  options: AcsUsersCreateOptions = {},
184
194
  ): AcsUsersCreateRequest {
195
+ assertValidRequestParameters(parameters, '/acs/users/create', true)
196
+
185
197
  return new SeamHttpRequest(this, {
186
198
  pathname: '/acs/users/create',
187
199
  method: 'POST',
@@ -195,13 +207,15 @@ export class SeamHttpAcsUsers {
195
207
  * Deletes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) and invalidates the access system user's [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials).
196
208
  */
197
209
  delete(
198
- parameters?: AcsUsersDeleteParameters,
210
+ parameters: AcsUsersDeleteParameters,
199
211
  options: AcsUsersDeleteOptions = {},
200
212
  ): AcsUsersDeleteRequest {
213
+ assertValidRequestParameters(parameters, '/acs/users/delete', true)
214
+
201
215
  return new SeamHttpRequest(this, {
202
216
  pathname: '/acs/users/delete',
203
- method: 'POST',
204
- body: parameters,
217
+ method: 'DELETE',
218
+ params: parameters,
205
219
  responseKey: undefined,
206
220
  options,
207
221
  })
@@ -211,13 +225,15 @@ export class SeamHttpAcsUsers {
211
225
  * Returns a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management).
212
226
  */
213
227
  get(
214
- parameters?: AcsUsersGetParameters,
228
+ parameters: AcsUsersGetParameters,
215
229
  options: AcsUsersGetOptions = {},
216
230
  ): AcsUsersGetRequest {
231
+ assertValidRequestParameters(parameters, '/acs/users/get', true)
232
+
217
233
  return new SeamHttpRequest(this, {
218
234
  pathname: '/acs/users/get',
219
- method: 'POST',
220
- body: parameters,
235
+ method: 'GET',
236
+ params: parameters,
221
237
  responseKey: 'acs_user',
222
238
  options,
223
239
  })
@@ -230,10 +246,12 @@ export class SeamHttpAcsUsers {
230
246
  parameters?: AcsUsersListParameters,
231
247
  options: AcsUsersListOptions = {},
232
248
  ): AcsUsersListRequest {
249
+ assertValidRequestParameters(parameters, '/acs/users/list', false)
250
+
233
251
  return new SeamHttpRequest(this, {
234
252
  pathname: '/acs/users/list',
235
- method: 'POST',
236
- body: parameters,
253
+ method: 'GET',
254
+ params: parameters,
237
255
  responseKey: 'acs_users',
238
256
  options,
239
257
  })
@@ -243,13 +261,19 @@ export class SeamHttpAcsUsers {
243
261
  * Lists the [entrances](https://docs.seam.co/api/acs/entrances) to which a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) has access.
244
262
  */
245
263
  listAccessibleEntrances(
246
- parameters?: AcsUsersListAccessibleEntrancesParameters,
264
+ parameters: AcsUsersListAccessibleEntrancesParameters,
247
265
  options: AcsUsersListAccessibleEntrancesOptions = {},
248
266
  ): AcsUsersListAccessibleEntrancesRequest {
267
+ assertValidRequestParameters(
268
+ parameters,
269
+ '/acs/users/list_accessible_entrances',
270
+ true,
271
+ )
272
+
249
273
  return new SeamHttpRequest(this, {
250
274
  pathname: '/acs/users/list_accessible_entrances',
251
- method: 'POST',
252
- body: parameters,
275
+ method: 'GET',
276
+ params: parameters,
253
277
  responseKey: 'acs_entrances',
254
278
  options,
255
279
  })
@@ -262,10 +286,16 @@ export class SeamHttpAcsUsers {
262
286
  parameters: AcsUsersRemoveFromAccessGroupParameters,
263
287
  options: AcsUsersRemoveFromAccessGroupOptions = {},
264
288
  ): AcsUsersRemoveFromAccessGroupRequest {
289
+ assertValidRequestParameters(
290
+ parameters,
291
+ '/acs/users/remove_from_access_group',
292
+ true,
293
+ )
294
+
265
295
  return new SeamHttpRequest(this, {
266
296
  pathname: '/acs/users/remove_from_access_group',
267
- method: 'POST',
268
- body: parameters,
297
+ method: 'DELETE',
298
+ params: parameters,
269
299
  responseKey: undefined,
270
300
  options,
271
301
  })
@@ -275,9 +305,15 @@ export class SeamHttpAcsUsers {
275
305
  * Revokes access to all [entrances](https://docs.seam.co/api/acs/entrances) for a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management).
276
306
  */
277
307
  revokeAccessToAllEntrances(
278
- parameters?: AcsUsersRevokeAccessToAllEntrancesParameters,
308
+ parameters: AcsUsersRevokeAccessToAllEntrancesParameters,
279
309
  options: AcsUsersRevokeAccessToAllEntrancesOptions = {},
280
310
  ): AcsUsersRevokeAccessToAllEntrancesRequest {
311
+ assertValidRequestParameters(
312
+ parameters,
313
+ '/acs/users/revoke_access_to_all_entrances',
314
+ true,
315
+ )
316
+
281
317
  return new SeamHttpRequest(this, {
282
318
  pathname: '/acs/users/revoke_access_to_all_entrances',
283
319
  method: 'POST',
@@ -291,9 +327,11 @@ export class SeamHttpAcsUsers {
291
327
  * [Suspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#suspend-an-acs-user) a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). Suspending an access system user revokes their access temporarily. To restore an access system user's access, you can [unsuspend](https://docs.seam.co/api/acs/users/unsuspend) them.
292
328
  */
293
329
  suspend(
294
- parameters?: AcsUsersSuspendParameters,
330
+ parameters: AcsUsersSuspendParameters,
295
331
  options: AcsUsersSuspendOptions = {},
296
332
  ): AcsUsersSuspendRequest {
333
+ assertValidRequestParameters(parameters, '/acs/users/suspend', true)
334
+
297
335
  return new SeamHttpRequest(this, {
298
336
  pathname: '/acs/users/suspend',
299
337
  method: 'POST',
@@ -307,9 +345,11 @@ export class SeamHttpAcsUsers {
307
345
  * [Unsuspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#unsuspend-an-acs-user) a specified suspended [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). While [suspending an access system user](https://docs.seam.co/api/acs/users/suspend) revokes their access temporarily, unsuspending the access system user restores their access.
308
346
  */
309
347
  unsuspend(
310
- parameters?: AcsUsersUnsuspendParameters,
348
+ parameters: AcsUsersUnsuspendParameters,
311
349
  options: AcsUsersUnsuspendOptions = {},
312
350
  ): AcsUsersUnsuspendRequest {
351
+ assertValidRequestParameters(parameters, '/acs/users/unsuspend', true)
352
+
313
353
  return new SeamHttpRequest(this, {
314
354
  pathname: '/acs/users/unsuspend',
315
355
  method: 'POST',
@@ -323,9 +363,11 @@ export class SeamHttpAcsUsers {
323
363
  * Updates the properties of a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management).
324
364
  */
325
365
  update(
326
- parameters?: AcsUsersUpdateParameters,
366
+ parameters: AcsUsersUpdateParameters,
327
367
  options: AcsUsersUpdateOptions = {},
328
368
  ): AcsUsersUpdateRequest {
369
+ assertValidRequestParameters(parameters, '/acs/users/update', true)
370
+
329
371
  return new SeamHttpRequest(this, {
330
372
  pathname: '/acs/users/update',
331
373
  method: 'PATCH',
@@ -366,7 +408,7 @@ export type AcsUsersCreateParameters = {
366
408
  /**
367
409
  * Ending timestamp for the new access system user's access.
368
410
  */
369
- ends_at?: string | undefined
411
+ ends_at?: string | null | undefined
370
412
  /**
371
413
  * Starting timestamp for the new access system user's access.
372
414
  */
@@ -417,7 +459,7 @@ export type AcsUsersCreateRequest = SeamHttpRequest<
417
459
 
418
460
  export interface AcsUsersCreateOptions {}
419
461
 
420
- export type AcsUsersDeleteParameters = {
462
+ export type AcsUsersDeleteParameters = RequireAtLeastOne<{
421
463
  /**
422
464
  * ID of the access system that you want to delete. You must provide acs_system_id with user_identity_id.
423
465
  */
@@ -430,7 +472,7 @@ export type AcsUsersDeleteParameters = {
430
472
  * ID of the user identity that you want to delete. You must provide either acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id.
431
473
  */
432
474
  user_identity_id?: string | undefined
433
- }
475
+ }>
434
476
 
435
477
  /**
436
478
  * @deprecated Use AcsUsersDeleteRequest instead.
@@ -441,7 +483,7 @@ export type AcsUsersDeleteRequest = SeamHttpRequest<void, undefined>
441
483
 
442
484
  export interface AcsUsersDeleteOptions {}
443
485
 
444
- export type AcsUsersGetParameters = {
486
+ export type AcsUsersGetParameters = RequireAtLeastOne<{
445
487
  /**
446
488
  * ID of the access system that you want to get. You can only provide acs_user_id or user_identity_id.
447
489
  */
@@ -454,7 +496,7 @@ export type AcsUsersGetParameters = {
454
496
  * ID of the user identity that you want to get. You can only provide acs_user_id or user_identity_id.
455
497
  */
456
498
  user_identity_id?: string | undefined
457
- }
499
+ }>
458
500
 
459
501
  /**
460
502
  * @deprecated Use AcsUsersGetRequest instead.
@@ -484,7 +526,7 @@ export type AcsUsersListParameters = {
484
526
  /**
485
527
  * Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
486
528
  */
487
- page_cursor?: string | undefined
529
+ page_cursor?: string | null | undefined
488
530
  /**
489
531
  * String for which to search. Filters returned access system users to include all records that satisfy a partial match using `full_name`, `phone_number`, `email_address`, `acs_user_id`, `user_identity_id`, `user_identity_full_name` or `user_identity_phone_number`.
490
532
  */
@@ -515,7 +557,7 @@ export type AcsUsersListRequest = SeamHttpRequest<
515
557
 
516
558
  export interface AcsUsersListOptions {}
517
559
 
518
- export type AcsUsersListAccessibleEntrancesParameters = {
560
+ export type AcsUsersListAccessibleEntrancesParameters = RequireAtLeastOne<{
519
561
  /**
520
562
  * ID of the access system for which you want to list accessible entrances. You can only provide acs_system_id with user_identity_id.
521
563
  */
@@ -528,7 +570,7 @@ export type AcsUsersListAccessibleEntrancesParameters = {
528
570
  * ID of the user identity for whom you want to list accessible entrances. You can only provide acs_user_id or user_identity_id.
529
571
  */
530
572
  user_identity_id?: string | undefined
531
- }
573
+ }>
532
574
 
533
575
  /**
534
576
  * @deprecated Use AcsUsersListAccessibleEntrancesRequest instead.
@@ -572,7 +614,7 @@ export type AcsUsersRemoveFromAccessGroupRequest = SeamHttpRequest<
572
614
 
573
615
  export interface AcsUsersRemoveFromAccessGroupOptions {}
574
616
 
575
- export type AcsUsersRevokeAccessToAllEntrancesParameters = {
617
+ export type AcsUsersRevokeAccessToAllEntrancesParameters = RequireAtLeastOne<{
576
618
  /**
577
619
  * ID of the access system for which you want to revoke access. You can only provide acs_system_id with user_identity_id.
578
620
  */
@@ -585,7 +627,7 @@ export type AcsUsersRevokeAccessToAllEntrancesParameters = {
585
627
  * ID of the user identity for whom you want to revoke access. You can only provide acs_user_id or user_identity_id.
586
628
  */
587
629
  user_identity_id?: string | undefined
588
- }
630
+ }>
589
631
 
590
632
  /**
591
633
  * @deprecated Use AcsUsersRevokeAccessToAllEntrancesRequest instead.
@@ -599,7 +641,7 @@ export type AcsUsersRevokeAccessToAllEntrancesRequest = SeamHttpRequest<
599
641
 
600
642
  export interface AcsUsersRevokeAccessToAllEntrancesOptions {}
601
643
 
602
- export type AcsUsersSuspendParameters = {
644
+ export type AcsUsersSuspendParameters = RequireAtLeastOne<{
603
645
  /**
604
646
  * ID of the access system that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id.
605
647
  */
@@ -612,7 +654,7 @@ export type AcsUsersSuspendParameters = {
612
654
  * ID of the user identity that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id.
613
655
  */
614
656
  user_identity_id?: string | undefined
615
- }
657
+ }>
616
658
 
617
659
  /**
618
660
  * @deprecated Use AcsUsersSuspendRequest instead.
@@ -623,7 +665,7 @@ export type AcsUsersSuspendRequest = SeamHttpRequest<void, undefined>
623
665
 
624
666
  export interface AcsUsersSuspendOptions {}
625
667
 
626
- export type AcsUsersUnsuspendParameters = {
668
+ export type AcsUsersUnsuspendParameters = RequireAtLeastOne<{
627
669
  /**
628
670
  * ID of the access system of the user that you want to unsuspend. You can only provide acs_system_id with user_identity_id.
629
671
  */
@@ -636,7 +678,7 @@ export type AcsUsersUnsuspendParameters = {
636
678
  * ID of the user identity that you want to unsuspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id.
637
679
  */
638
680
  user_identity_id?: string | undefined
639
- }
681
+ }>
640
682
 
641
683
  /**
642
684
  * @deprecated Use AcsUsersUnsuspendRequest instead.
@@ -647,7 +689,7 @@ export type AcsUsersUnsuspendRequest = SeamHttpRequest<void, undefined>
647
689
 
648
690
  export interface AcsUsersUnsuspendOptions {}
649
691
 
650
- export type AcsUsersUpdateParameters = {
692
+ export type AcsUsersUpdateParameters = RequireAtLeastOne<{
651
693
  /**
652
694
  * `starts_at` and `ends_at` timestamps for the access system user's access. If you specify an `access_schedule`, you may include both `starts_at` and `ends_at`. If you omit `starts_at`, it defaults to the current time. `ends_at` is optional and must be a time in the future and after `starts_at`.
653
695
  */
@@ -662,6 +704,7 @@ export type AcsUsersUpdateParameters = {
662
704
  */
663
705
  starts_at?: string | undefined
664
706
  }
707
+ | null
665
708
  | undefined
666
709
  /**
667
710
  * ID of the access system that you want to update. You can only provide acs_system_id with user_identity_id.
@@ -695,7 +738,7 @@ export type AcsUsersUpdateParameters = {
695
738
  * ID of the user identity that you want to update. You can only provide acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id.
696
739
  */
697
740
  user_identity_id?: string | undefined
698
- }
741
+ }>
699
742
 
700
743
  /**
701
744
  * @deprecated Use AcsUsersUpdateRequest instead.
@@ -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 { ActionAttempt } from 'lib/resources/action-attempt.js'
32
33
  import { SeamHttpClientSessions } from 'lib/routes/client-sessions/index.js'
33
34
  import { SeamHttpRequest } from 'lib/seam-http-request.js'
@@ -165,10 +166,12 @@ export class SeamHttpActionAttempts {
165
166
  parameters: ActionAttemptsGetParameters,
166
167
  options: ActionAttemptsGetOptions = {},
167
168
  ): ActionAttemptsGetRequest {
169
+ assertValidRequestParameters(parameters, '/action_attempts/get', true)
170
+
168
171
  return new SeamHttpRequest(this, {
169
172
  pathname: '/action_attempts/get',
170
- method: 'POST',
171
- body: parameters,
173
+ method: 'GET',
174
+ params: parameters,
172
175
  responseKey: 'action_attempt',
173
176
  options,
174
177
  actionAttempts: SeamHttpActionAttempts.fromClient(this.client, {
@@ -185,6 +188,8 @@ export class SeamHttpActionAttempts {
185
188
  parameters?: ActionAttemptsListParameters,
186
189
  options: ActionAttemptsListOptions = {},
187
190
  ): ActionAttemptsListRequest {
191
+ assertValidRequestParameters(parameters, '/action_attempts/list', false)
192
+
188
193
  return new SeamHttpRequest(this, {
189
194
  pathname: '/action_attempts/list',
190
195
  method: 'POST',
@@ -233,7 +238,7 @@ export type ActionAttemptsListParameters = {
233
238
  /**
234
239
  * Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
235
240
  */
236
- page_cursor?: string | undefined
241
+ page_cursor?: string | null | undefined
237
242
  }
238
243
 
239
244
  /**
@@ -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 { ClientSession } from 'lib/resources/client-session.js'
32
36
  import { SeamHttpRequest } from 'lib/seam-http-request.js'
33
37
  import { SeamPaginator } from 'lib/seam-paginator.js'
@@ -164,6 +168,8 @@ export class SeamHttpClientSessions {
164
168
  parameters?: ClientSessionsCreateParameters,
165
169
  options: ClientSessionsCreateOptions = {},
166
170
  ): ClientSessionsCreateRequest {
171
+ assertValidRequestParameters(parameters, '/client_sessions/create', false)
172
+
167
173
  return new SeamHttpRequest(this, {
168
174
  pathname: '/client_sessions/create',
169
175
  method: 'PUT',
@@ -180,10 +186,12 @@ export class SeamHttpClientSessions {
180
186
  parameters: ClientSessionsDeleteParameters,
181
187
  options: ClientSessionsDeleteOptions = {},
182
188
  ): ClientSessionsDeleteRequest {
189
+ assertValidRequestParameters(parameters, '/client_sessions/delete', true)
190
+
183
191
  return new SeamHttpRequest(this, {
184
192
  pathname: '/client_sessions/delete',
185
- method: 'POST',
186
- body: parameters,
193
+ method: 'DELETE',
194
+ params: parameters,
187
195
  responseKey: undefined,
188
196
  options,
189
197
  })
@@ -196,10 +204,12 @@ export class SeamHttpClientSessions {
196
204
  parameters?: ClientSessionsGetParameters,
197
205
  options: ClientSessionsGetOptions = {},
198
206
  ): ClientSessionsGetRequest {
207
+ assertValidRequestParameters(parameters, '/client_sessions/get', false)
208
+
199
209
  return new SeamHttpRequest(this, {
200
210
  pathname: '/client_sessions/get',
201
- method: 'POST',
202
- body: parameters,
211
+ method: 'GET',
212
+ params: parameters,
203
213
  responseKey: 'client_session',
204
214
  options,
205
215
  })
@@ -212,6 +222,12 @@ export class SeamHttpClientSessions {
212
222
  parameters?: ClientSessionsGetOrCreateParameters,
213
223
  options: ClientSessionsGetOrCreateOptions = {},
214
224
  ): ClientSessionsGetOrCreateRequest {
225
+ assertValidRequestParameters(
226
+ parameters,
227
+ '/client_sessions/get_or_create',
228
+ false,
229
+ )
230
+
215
231
  return new SeamHttpRequest(this, {
216
232
  pathname: '/client_sessions/get_or_create',
217
233
  method: 'POST',
@@ -225,9 +241,15 @@ export class SeamHttpClientSessions {
225
241
  * Grants a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) access to one or more resources, such as [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews), [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity), and so on.
226
242
  */
227
243
  grantAccess(
228
- parameters?: ClientSessionsGrantAccessParameters,
244
+ parameters: ClientSessionsGrantAccessParameters,
229
245
  options: ClientSessionsGrantAccessOptions = {},
230
246
  ): ClientSessionsGrantAccessRequest {
247
+ assertValidRequestParameters(
248
+ parameters,
249
+ '/client_sessions/grant_access',
250
+ true,
251
+ )
252
+
231
253
  return new SeamHttpRequest(this, {
232
254
  pathname: '/client_sessions/grant_access',
233
255
  method: 'PATCH',
@@ -244,10 +266,12 @@ export class SeamHttpClientSessions {
244
266
  parameters?: ClientSessionsListParameters,
245
267
  options: ClientSessionsListOptions = {},
246
268
  ): ClientSessionsListRequest {
269
+ assertValidRequestParameters(parameters, '/client_sessions/list', false)
270
+
247
271
  return new SeamHttpRequest(this, {
248
272
  pathname: '/client_sessions/list',
249
- method: 'POST',
250
- body: parameters,
273
+ method: 'GET',
274
+ params: parameters,
251
275
  responseKey: 'client_sessions',
252
276
  options,
253
277
  })
@@ -262,6 +286,8 @@ export class SeamHttpClientSessions {
262
286
  parameters: ClientSessionsRevokeParameters,
263
287
  options: ClientSessionsRevokeOptions = {},
264
288
  ): ClientSessionsRevokeRequest {
289
+ assertValidRequestParameters(parameters, '/client_sessions/revoke', true)
290
+
265
291
  return new SeamHttpRequest(this, {
266
292
  pathname: '/client_sessions/revoke',
267
293
  method: 'POST',
@@ -401,7 +427,7 @@ export type ClientSessionsGetOrCreateRequest = SeamHttpRequest<
401
427
 
402
428
  export interface ClientSessionsGetOrCreateOptions {}
403
429
 
404
- export type ClientSessionsGrantAccessParameters = {
430
+ export type ClientSessionsGrantAccessParameters = RequireAtLeastOne<{
405
431
  /**
406
432
  * ID of the client session to which you want to grant access to resources.
407
433
  */
@@ -427,7 +453,7 @@ export type ClientSessionsGrantAccessParameters = {
427
453
  * @deprecated Use `user_identity_id`.
428
454
  */
429
455
  user_identity_ids?: Array<string> | undefined
430
- }
456
+ }>
431
457
 
432
458
  /**
433
459
  * @deprecated Use ClientSessionsGrantAccessRequest instead.
@@ -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 { ConnectWebview } from 'lib/resources/connect-webview.js'
32
33
  import { SeamHttpClientSessions } from 'lib/routes/client-sessions/index.js'
33
34
  import { SeamHttpRequest } from 'lib/seam-http-request.js'
@@ -171,6 +172,8 @@ export class SeamHttpConnectWebviews {
171
172
  parameters?: ConnectWebviewsCreateParameters,
172
173
  options: ConnectWebviewsCreateOptions = {},
173
174
  ): ConnectWebviewsCreateRequest {
175
+ assertValidRequestParameters(parameters, '/connect_webviews/create', false)
176
+
174
177
  return new SeamHttpRequest(this, {
175
178
  pathname: '/connect_webviews/create',
176
179
  method: 'POST',
@@ -189,10 +192,12 @@ export class SeamHttpConnectWebviews {
189
192
  parameters: ConnectWebviewsDeleteParameters,
190
193
  options: ConnectWebviewsDeleteOptions = {},
191
194
  ): ConnectWebviewsDeleteRequest {
195
+ assertValidRequestParameters(parameters, '/connect_webviews/delete', true)
196
+
192
197
  return new SeamHttpRequest(this, {
193
198
  pathname: '/connect_webviews/delete',
194
- method: 'POST',
195
- body: parameters,
199
+ method: 'DELETE',
200
+ params: parameters,
196
201
  responseKey: undefined,
197
202
  options,
198
203
  })
@@ -207,10 +212,12 @@ export class SeamHttpConnectWebviews {
207
212
  parameters: ConnectWebviewsGetParameters,
208
213
  options: ConnectWebviewsGetOptions = {},
209
214
  ): ConnectWebviewsGetRequest {
215
+ assertValidRequestParameters(parameters, '/connect_webviews/get', true)
216
+
210
217
  return new SeamHttpRequest(this, {
211
218
  pathname: '/connect_webviews/get',
212
- method: 'POST',
213
- body: parameters,
219
+ method: 'GET',
220
+ params: parameters,
214
221
  responseKey: 'connect_webview',
215
222
  options,
216
223
  })
@@ -223,6 +230,8 @@ export class SeamHttpConnectWebviews {
223
230
  parameters?: ConnectWebviewsListParameters,
224
231
  options: ConnectWebviewsListOptions = {},
225
232
  ): ConnectWebviewsListRequest {
233
+ assertValidRequestParameters(parameters, '/connect_webviews/list', false)
234
+
226
235
  return new SeamHttpRequest(this, {
227
236
  pathname: '/connect_webviews/list',
228
237
  method: 'POST',
@@ -298,6 +307,7 @@ export type ConnectWebviewsCreateParameters = {
298
307
  | 'keyincode'
299
308
  | 'dormakaba_ambiance'
300
309
  | 'ultraloq'
310
+ | 'yacan'
301
311
  | 'dusaw'
302
312
  | 'sifely'
303
313
  | 'thirty_three_lock'
@@ -423,7 +433,7 @@ export type ConnectWebviewsListParameters = {
423
433
  /**
424
434
  * Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
425
435
  */
426
- page_cursor?: string | undefined
436
+ page_cursor?: string | null | undefined
427
437
  /**
428
438
  * String for which to search. Filters returned Connect Webviews to include all records that satisfy a partial match using `connect_webview_id`, `accepted_providers`, `custom_metadata`, or `customer_key`.
429
439
  */
@@ -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 { ConnectedAccount } from 'lib/resources/connected-account.js'
32
36
  import { SeamHttpClientSessions } from 'lib/routes/client-sessions/index.js'
33
37
  import { SeamHttpRequest } from 'lib/seam-http-request.js'
@@ -178,10 +182,12 @@ export class SeamHttpConnectedAccounts {
178
182
  parameters: ConnectedAccountsDeleteParameters,
179
183
  options: ConnectedAccountsDeleteOptions = {},
180
184
  ): ConnectedAccountsDeleteRequest {
185
+ assertValidRequestParameters(parameters, '/connected_accounts/delete', true)
186
+
181
187
  return new SeamHttpRequest(this, {
182
188
  pathname: '/connected_accounts/delete',
183
- method: 'POST',
184
- body: parameters,
189
+ method: 'DELETE',
190
+ params: parameters,
185
191
  responseKey: undefined,
186
192
  options,
187
193
  })
@@ -191,9 +197,11 @@ export class SeamHttpConnectedAccounts {
191
197
  * Returns a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts).
192
198
  */
193
199
  get(
194
- parameters?: ConnectedAccountsGetParameters,
200
+ parameters: ConnectedAccountsGetParameters,
195
201
  options: ConnectedAccountsGetOptions = {},
196
202
  ): ConnectedAccountsGetRequest {
203
+ assertValidRequestParameters(parameters, '/connected_accounts/get', true)
204
+
197
205
  return new SeamHttpRequest(this, {
198
206
  pathname: '/connected_accounts/get',
199
207
  method: 'GET',
@@ -210,6 +218,8 @@ export class SeamHttpConnectedAccounts {
210
218
  parameters?: ConnectedAccountsListParameters,
211
219
  options: ConnectedAccountsListOptions = {},
212
220
  ): ConnectedAccountsListRequest {
221
+ assertValidRequestParameters(parameters, '/connected_accounts/list', false)
222
+
213
223
  return new SeamHttpRequest(this, {
214
224
  pathname: '/connected_accounts/list',
215
225
  method: 'POST',
@@ -226,6 +236,8 @@ export class SeamHttpConnectedAccounts {
226
236
  parameters: ConnectedAccountsSyncParameters,
227
237
  options: ConnectedAccountsSyncOptions = {},
228
238
  ): ConnectedAccountsSyncRequest {
239
+ assertValidRequestParameters(parameters, '/connected_accounts/sync', true)
240
+
229
241
  return new SeamHttpRequest(this, {
230
242
  pathname: '/connected_accounts/sync',
231
243
  method: 'POST',
@@ -242,6 +254,8 @@ export class SeamHttpConnectedAccounts {
242
254
  parameters: ConnectedAccountsUpdateParameters,
243
255
  options: ConnectedAccountsUpdateOptions = {},
244
256
  ): ConnectedAccountsUpdateRequest {
257
+ assertValidRequestParameters(parameters, '/connected_accounts/update', true)
258
+
245
259
  return new SeamHttpRequest(this, {
246
260
  pathname: '/connected_accounts/update',
247
261
  method: 'PATCH',
@@ -268,7 +282,7 @@ export type ConnectedAccountsDeleteRequest = SeamHttpRequest<void, undefined>
268
282
 
269
283
  export interface ConnectedAccountsDeleteOptions {}
270
284
 
271
- export type ConnectedAccountsGetParameters = {
285
+ export type ConnectedAccountsGetParameters = RequireAtLeastOne<{
272
286
  /**
273
287
  * ID of the connected account that you want to get.
274
288
  */
@@ -277,7 +291,7 @@ export type ConnectedAccountsGetParameters = {
277
291
  * Email address associated with the connected account that you want to get.
278
292
  */
279
293
  email?: string | undefined
280
- }
294
+ }>
281
295
 
282
296
  /**
283
297
  * @deprecated Use ConnectedAccountsGetRequest instead.
@@ -309,7 +323,7 @@ export type ConnectedAccountsListParameters = {
309
323
  /**
310
324
  * Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
311
325
  */
312
- page_cursor?: string | undefined
326
+ page_cursor?: string | null | undefined
313
327
  /**
314
328
  * String for which to search. Filters returned connected accounts to include all records that satisfy a partial match using `connected_account_id`, `account_type`, `customer_key`, `custom_metadata`, `user_identifier.username`, `user_identifier.email` or `user_identifier.phone`.
315
329
  */
@@ -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 { SeamHttpClientSessions } from 'lib/routes/client-sessions/index.js'
32
33
  import { SeamHttpRequest } from 'lib/seam-http-request.js'
33
34
  import { SeamPaginator } from 'lib/seam-paginator.js'
@@ -167,6 +168,12 @@ export class SeamHttpConnectedAccountsSimulate {
167
168
  parameters: ConnectedAccountsSimulateDisconnectParameters,
168
169
  options: ConnectedAccountsSimulateDisconnectOptions = {},
169
170
  ): ConnectedAccountsSimulateDisconnectRequest {
171
+ assertValidRequestParameters(
172
+ parameters,
173
+ '/connected_accounts/simulate/disconnect',
174
+ true,
175
+ )
176
+
170
177
  return new SeamHttpRequest(this, {
171
178
  pathname: '/connected_accounts/simulate/disconnect',
172
179
  method: 'POST',