@seamapi/http 2.4.1 → 2.4.3

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 (179) hide show
  1. package/lib/request-parameters.d.ts +4 -0
  2. package/lib/request-parameters.js +18 -0
  3. package/lib/request-parameters.js.map +1 -0
  4. package/lib/resources/access-code.d.ts +13 -9
  5. package/lib/resources/acs-credential.d.ts +33 -1
  6. package/lib/resources/acs-entrance.d.ts +1 -1
  7. package/lib/resources/acs-system.d.ts +30 -0
  8. package/lib/resources/action-attempt.d.ts +82 -11
  9. package/lib/resources/device-provider.d.ts +1 -1
  10. package/lib/resources/device.d.ts +63 -18
  11. package/lib/resources/event.d.ts +0 -76
  12. package/lib/resources/unmanaged-access-code.d.ts +13 -9
  13. package/lib/resources/unmanaged-device.d.ts +28 -16
  14. package/lib/routes/access-codes/access-codes.d.ts +8 -35
  15. package/lib/routes/access-codes/access-codes.js +17 -6
  16. package/lib/routes/access-codes/access-codes.js.map +1 -1
  17. package/lib/routes/access-codes/simulate/simulate.js +2 -0
  18. package/lib/routes/access-codes/simulate/simulate.js.map +1 -1
  19. package/lib/routes/access-codes/unmanaged/unmanaged.d.ts +5 -4
  20. package/lib/routes/access-codes/unmanaged/unmanaged.js +12 -6
  21. package/lib/routes/access-codes/unmanaged/unmanaged.js.map +1 -1
  22. package/lib/routes/access-grants/access-grants.d.ts +20 -19
  23. package/lib/routes/access-grants/access-grants.js +10 -2
  24. package/lib/routes/access-grants/access-grants.js.map +1 -1
  25. package/lib/routes/access-grants/unmanaged/unmanaged.d.ts +1 -1
  26. package/lib/routes/access-grants/unmanaged/unmanaged.js +8 -4
  27. package/lib/routes/access-grants/unmanaged/unmanaged.js.map +1 -1
  28. package/lib/routes/access-methods/access-methods.d.ts +8 -7
  29. package/lib/routes/access-methods/access-methods.js +12 -4
  30. package/lib/routes/access-methods/access-methods.js.map +1 -1
  31. package/lib/routes/access-methods/unmanaged/unmanaged.js +7 -4
  32. package/lib/routes/access-methods/unmanaged/unmanaged.js.map +1 -1
  33. package/lib/routes/acs/access-groups/access-groups.js +20 -12
  34. package/lib/routes/acs/access-groups/access-groups.js.map +1 -1
  35. package/lib/routes/acs/credentials/credentials.d.ts +1 -1
  36. package/lib/routes/acs/credentials/credentials.js +15 -6
  37. package/lib/routes/acs/credentials/credentials.js.map +1 -1
  38. package/lib/routes/acs/encoders/encoders.d.ts +1 -1
  39. package/lib/routes/acs/encoders/encoders.js +10 -4
  40. package/lib/routes/acs/encoders/encoders.js.map +1 -1
  41. package/lib/routes/acs/encoders/simulate/simulate.js +5 -0
  42. package/lib/routes/acs/encoders/simulate/simulate.js.map +1 -1
  43. package/lib/routes/acs/entrances/entrances.d.ts +2 -2
  44. package/lib/routes/acs/entrances/entrances.js +8 -2
  45. package/lib/routes/acs/entrances/entrances.js.map +1 -1
  46. package/lib/routes/acs/systems/systems.js +11 -6
  47. package/lib/routes/acs/systems/systems.js.map +1 -1
  48. package/lib/routes/acs/users/users.d.ts +25 -24
  49. package/lib/routes/acs/users/users.js +22 -10
  50. package/lib/routes/acs/users/users.js.map +1 -1
  51. package/lib/routes/action-attempts/action-attempts.d.ts +1 -1
  52. package/lib/routes/action-attempts/action-attempts.js +5 -2
  53. package/lib/routes/action-attempts/action-attempts.js.map +1 -1
  54. package/lib/routes/client-sessions/client-sessions.d.ts +4 -3
  55. package/lib/routes/client-sessions/client-sessions.js +14 -6
  56. package/lib/routes/client-sessions/client-sessions.js.map +1 -1
  57. package/lib/routes/connect-webviews/connect-webviews.d.ts +2 -2
  58. package/lib/routes/connect-webviews/connect-webviews.js +9 -4
  59. package/lib/routes/connect-webviews/connect-webviews.js.map +1 -1
  60. package/lib/routes/connected-accounts/connected-accounts.d.ts +5 -4
  61. package/lib/routes/connected-accounts/connected-accounts.js +8 -2
  62. package/lib/routes/connected-accounts/connected-accounts.js.map +1 -1
  63. package/lib/routes/connected-accounts/simulate/simulate.js +2 -0
  64. package/lib/routes/connected-accounts/simulate/simulate.js.map +1 -1
  65. package/lib/routes/customers/customers.d.ts +9 -9
  66. package/lib/routes/customers/customers.js +4 -0
  67. package/lib/routes/customers/customers.js.map +1 -1
  68. package/lib/routes/devices/devices.d.ts +11 -10
  69. package/lib/routes/devices/devices.js +10 -4
  70. package/lib/routes/devices/devices.js.map +1 -1
  71. package/lib/routes/devices/simulate/simulate.js +7 -0
  72. package/lib/routes/devices/simulate/simulate.js.map +1 -1
  73. package/lib/routes/devices/unmanaged/unmanaged.d.ts +8 -23
  74. package/lib/routes/devices/unmanaged/unmanaged.js +6 -2
  75. package/lib/routes/devices/unmanaged/unmanaged.js.map +1 -1
  76. package/lib/routes/events/events.d.ts +8 -7
  77. package/lib/routes/events/events.js +5 -2
  78. package/lib/routes/events/events.js.map +1 -1
  79. package/lib/routes/instant-keys/instant-keys.d.ts +4 -3
  80. package/lib/routes/instant-keys/instant-keys.js +10 -6
  81. package/lib/routes/instant-keys/instant-keys.js.map +1 -1
  82. package/lib/routes/locks/locks.d.ts +7 -46
  83. package/lib/routes/locks/locks.js +8 -2
  84. package/lib/routes/locks/locks.js.map +1 -1
  85. package/lib/routes/locks/simulate/simulate.js +3 -0
  86. package/lib/routes/locks/simulate/simulate.js.map +1 -1
  87. package/lib/routes/noise-sensors/noise-sensors.d.ts +0 -40
  88. package/lib/routes/noise-sensors/noise-sensors.js +2 -0
  89. package/lib/routes/noise-sensors/noise-sensors.js.map +1 -1
  90. package/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.js +12 -6
  91. package/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.js.map +1 -1
  92. package/lib/routes/noise-sensors/simulate/simulate.js +2 -0
  93. package/lib/routes/noise-sensors/simulate/simulate.js.map +1 -1
  94. package/lib/routes/phones/phones.js +10 -6
  95. package/lib/routes/phones/phones.js.map +1 -1
  96. package/lib/routes/phones/simulate/simulate.js +2 -0
  97. package/lib/routes/phones/simulate/simulate.js.map +1 -1
  98. package/lib/routes/seam-http-endpoints.d.ts +26 -26
  99. package/lib/routes/spaces/spaces.d.ts +16 -15
  100. package/lib/routes/spaces/spaces.js +19 -6
  101. package/lib/routes/spaces/spaces.js.map +1 -1
  102. package/lib/routes/thermostats/daily-programs/daily-programs.js +6 -2
  103. package/lib/routes/thermostats/daily-programs/daily-programs.js.map +1 -1
  104. package/lib/routes/thermostats/schedules/schedules.d.ts +2 -2
  105. package/lib/routes/thermostats/schedules/schedules.js +12 -6
  106. package/lib/routes/thermostats/schedules/schedules.js.map +1 -1
  107. package/lib/routes/thermostats/simulate/simulate.js +3 -0
  108. package/lib/routes/thermostats/simulate/simulate.js.map +1 -1
  109. package/lib/routes/thermostats/thermostats.d.ts +13 -53
  110. package/lib/routes/thermostats/thermostats.js +17 -2
  111. package/lib/routes/thermostats/thermostats.js.map +1 -1
  112. package/lib/routes/user-identities/unmanaged/unmanaged.d.ts +1 -1
  113. package/lib/routes/user-identities/unmanaged/unmanaged.js +8 -4
  114. package/lib/routes/user-identities/unmanaged/unmanaged.js.map +1 -1
  115. package/lib/routes/user-identities/user-identities.d.ts +13 -12
  116. package/lib/routes/user-identities/user-identities.js +29 -14
  117. package/lib/routes/user-identities/user-identities.js.map +1 -1
  118. package/lib/routes/webhooks/webhooks.js +10 -4
  119. package/lib/routes/webhooks/webhooks.js.map +1 -1
  120. package/lib/routes/workspaces/workspaces.d.ts +9 -9
  121. package/lib/routes/workspaces/workspaces.js +6 -0
  122. package/lib/routes/workspaces/workspaces.js.map +1 -1
  123. package/lib/version.d.ts +1 -1
  124. package/lib/version.js +1 -1
  125. package/package.json +3 -3
  126. package/src/lib/request-parameters.ts +34 -0
  127. package/src/lib/resources/access-code.ts +15 -9
  128. package/src/lib/resources/acs-credential.ts +40 -0
  129. package/src/lib/resources/acs-entrance.ts +1 -1
  130. package/src/lib/resources/acs-system.ts +36 -0
  131. package/src/lib/resources/action-attempt.ts +91 -6
  132. package/src/lib/resources/device-provider.ts +1 -0
  133. package/src/lib/resources/device.ts +70 -20
  134. package/src/lib/resources/event.ts +0 -76
  135. package/src/lib/resources/unmanaged-access-code.ts +15 -9
  136. package/src/lib/resources/unmanaged-device.ts +33 -18
  137. package/src/lib/routes/access-codes/access-codes.ts +57 -41
  138. package/src/lib/routes/access-codes/simulate/simulate.ts +7 -0
  139. package/src/lib/routes/access-codes/unmanaged/unmanaged.ts +44 -10
  140. package/src/lib/routes/access-grants/access-grants.ts +43 -21
  141. package/src/lib/routes/access-grants/unmanaged/unmanaged.ts +24 -5
  142. package/src/lib/routes/access-methods/access-methods.ts +41 -11
  143. package/src/lib/routes/access-methods/unmanaged/unmanaged.ts +17 -4
  144. package/src/lib/routes/acs/access-groups/access-groups.ts +43 -12
  145. package/src/lib/routes/acs/credentials/credentials.ts +28 -7
  146. package/src/lib/routes/acs/encoders/encoders.ts +28 -5
  147. package/src/lib/routes/acs/encoders/simulate/simulate.ts +25 -0
  148. package/src/lib/routes/acs/entrances/entrances.ts +23 -4
  149. package/src/lib/routes/acs/systems/systems.ts +23 -6
  150. package/src/lib/routes/acs/users/users.ts +76 -33
  151. package/src/lib/routes/action-attempts/action-attempts.ts +8 -3
  152. package/src/lib/routes/client-sessions/client-sessions.ts +35 -9
  153. package/src/lib/routes/connect-webviews/connect-webviews.ts +15 -5
  154. package/src/lib/routes/connected-accounts/connected-accounts.ts +20 -6
  155. package/src/lib/routes/connected-accounts/simulate/simulate.ts +7 -0
  156. package/src/lib/routes/customers/customers.ts +16 -9
  157. package/src/lib/routes/devices/devices.ts +36 -11
  158. package/src/lib/routes/devices/simulate/simulate.ts +29 -0
  159. package/src/lib/routes/devices/unmanaged/unmanaged.ts +19 -22
  160. package/src/lib/routes/events/events.ts +17 -9
  161. package/src/lib/routes/instant-keys/instant-keys.ts +19 -9
  162. package/src/lib/routes/locks/locks.ts +22 -45
  163. package/src/lib/routes/locks/simulate/simulate.ts +13 -0
  164. package/src/lib/routes/noise-sensors/noise-sensors.ts +3 -40
  165. package/src/lib/routes/noise-sensors/noise-thresholds/noise-thresholds.ts +37 -6
  166. package/src/lib/routes/noise-sensors/simulate/simulate.ts +7 -0
  167. package/src/lib/routes/phones/phones.ts +13 -6
  168. package/src/lib/routes/phones/simulate/simulate.ts +7 -0
  169. package/src/lib/routes/seam-http-endpoints.ts +26 -26
  170. package/src/lib/routes/spaces/spaces.ts +61 -21
  171. package/src/lib/routes/thermostats/daily-programs/daily-programs.ts +21 -2
  172. package/src/lib/routes/thermostats/schedules/schedules.ts +35 -8
  173. package/src/lib/routes/thermostats/simulate/simulate.ts +13 -0
  174. package/src/lib/routes/thermostats/thermostats.ts +72 -55
  175. package/src/lib/routes/user-identities/unmanaged/unmanaged.ts +24 -5
  176. package/src/lib/routes/user-identities/user-identities.ts +94 -26
  177. package/src/lib/routes/webhooks/webhooks.ts +15 -4
  178. package/src/lib/routes/workspaces/workspaces.ts +20 -9
  179. package/src/lib/version.ts +1 -1
@@ -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 { Webhook } from 'lib/resources/webhook.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,8 @@ export class SeamHttpWebhooks {
165
166
  parameters: WebhooksCreateParameters,
166
167
  options: WebhooksCreateOptions = {},
167
168
  ): WebhooksCreateRequest {
169
+ assertValidRequestParameters(parameters, '/webhooks/create', true)
170
+
168
171
  return new SeamHttpRequest(this, {
169
172
  pathname: '/webhooks/create',
170
173
  method: 'POST',
@@ -181,10 +184,12 @@ export class SeamHttpWebhooks {
181
184
  parameters: WebhooksDeleteParameters,
182
185
  options: WebhooksDeleteOptions = {},
183
186
  ): WebhooksDeleteRequest {
187
+ assertValidRequestParameters(parameters, '/webhooks/delete', true)
188
+
184
189
  return new SeamHttpRequest(this, {
185
190
  pathname: '/webhooks/delete',
186
- method: 'POST',
187
- body: parameters,
191
+ method: 'DELETE',
192
+ params: parameters,
188
193
  responseKey: undefined,
189
194
  options,
190
195
  })
@@ -197,10 +202,12 @@ export class SeamHttpWebhooks {
197
202
  parameters: WebhooksGetParameters,
198
203
  options: WebhooksGetOptions = {},
199
204
  ): WebhooksGetRequest {
205
+ assertValidRequestParameters(parameters, '/webhooks/get', true)
206
+
200
207
  return new SeamHttpRequest(this, {
201
208
  pathname: '/webhooks/get',
202
- method: 'POST',
203
- body: parameters,
209
+ method: 'GET',
210
+ params: parameters,
204
211
  responseKey: 'webhook',
205
212
  options,
206
213
  })
@@ -213,6 +220,8 @@ export class SeamHttpWebhooks {
213
220
  parameters?: WebhooksListParameters,
214
221
  options: WebhooksListOptions = {},
215
222
  ): WebhooksListRequest {
223
+ assertValidRequestParameters(parameters, '/webhooks/list', false)
224
+
216
225
  return new SeamHttpRequest(this, {
217
226
  pathname: '/webhooks/list',
218
227
  method: 'GET',
@@ -229,6 +238,8 @@ export class SeamHttpWebhooks {
229
238
  parameters: WebhooksUpdateParameters,
230
239
  options: WebhooksUpdateOptions = {},
231
240
  ): WebhooksUpdateRequest {
241
+ assertValidRequestParameters(parameters, '/webhooks/update', true)
242
+
232
243
  return new SeamHttpRequest(this, {
233
244
  pathname: '/webhooks/update',
234
245
  method: 'PUT',
@@ -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 type { Workspace } from 'lib/resources/workspace.js'
33
34
  import { SeamHttpActionAttempts } from 'lib/routes/action-attempts/index.js'
@@ -167,6 +168,8 @@ export class SeamHttpWorkspaces {
167
168
  parameters: WorkspacesCreateParameters,
168
169
  options: WorkspacesCreateOptions = {},
169
170
  ): WorkspacesCreateRequest {
171
+ assertValidRequestParameters(parameters, '/workspaces/create', true)
172
+
170
173
  return new SeamHttpRequest(this, {
171
174
  pathname: '/workspaces/create',
172
175
  method: 'POST',
@@ -183,6 +186,8 @@ export class SeamHttpWorkspaces {
183
186
  parameters?: WorkspacesGetParameters,
184
187
  options: WorkspacesGetOptions = {},
185
188
  ): WorkspacesGetRequest {
189
+ assertValidRequestParameters(parameters, '/workspaces/get', false)
190
+
186
191
  return new SeamHttpRequest(this, {
187
192
  pathname: '/workspaces/get',
188
193
  method: 'GET',
@@ -199,6 +204,8 @@ export class SeamHttpWorkspaces {
199
204
  parameters?: WorkspacesListParameters,
200
205
  options: WorkspacesListOptions = {},
201
206
  ): WorkspacesListRequest {
207
+ assertValidRequestParameters(parameters, '/workspaces/list', false)
208
+
202
209
  return new SeamHttpRequest(this, {
203
210
  pathname: '/workspaces/list',
204
211
  method: 'GET',
@@ -215,6 +222,8 @@ export class SeamHttpWorkspaces {
215
222
  parameters?: WorkspacesResetSandboxParameters,
216
223
  options: WorkspacesResetSandboxOptions = {},
217
224
  ): WorkspacesResetSandboxRequest {
225
+ assertValidRequestParameters(parameters, '/workspaces/reset_sandbox', false)
226
+
218
227
  return new SeamHttpRequest(this, {
219
228
  pathname: '/workspaces/reset_sandbox',
220
229
  method: 'POST',
@@ -235,6 +244,8 @@ export class SeamHttpWorkspaces {
235
244
  parameters?: WorkspacesUpdateParameters,
236
245
  options: WorkspacesUpdateOptions = {},
237
246
  ): WorkspacesUpdateRequest {
247
+ assertValidRequestParameters(parameters, '/workspaces/update', false)
248
+
238
249
  return new SeamHttpRequest(this, {
239
250
  pathname: '/workspaces/update',
240
251
  method: 'PATCH',
@@ -254,7 +265,7 @@ export type WorkspacesCreateParameters = {
254
265
  * Connect partner name for the new workspace.
255
266
  * @deprecated Use `company_name` instead.
256
267
  */
257
- connect_partner_name?: string | undefined
268
+ connect_partner_name?: string | null | undefined
258
269
  /**
259
270
  * [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) customizations for the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
260
271
  */
@@ -263,19 +274,19 @@ export type WorkspacesCreateParameters = {
263
274
  /**
264
275
  * Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
265
276
  */
266
- logo_shape?: 'circle' | 'square' | undefined
277
+ logo_shape?: 'circle' | 'square' | null | undefined
267
278
  /**
268
279
  * Primary button color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
269
280
  */
270
- primary_button_color?: string | undefined
281
+ primary_button_color?: string | null | undefined
271
282
  /**
272
283
  * Primary button text color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
273
284
  */
274
- primary_button_text_color?: string | undefined
285
+ primary_button_text_color?: string | null | undefined
275
286
  /**
276
287
  * Success message for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
277
288
  */
278
- success_message?: string | undefined
289
+ success_message?: string | null | undefined
279
290
  }
280
291
  | undefined
281
292
  /**
@@ -379,19 +390,19 @@ export type WorkspacesUpdateParameters = {
379
390
  /**
380
391
  * Logo shape for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
381
392
  */
382
- logo_shape?: 'circle' | 'square' | undefined
393
+ logo_shape?: 'circle' | 'square' | null | undefined
383
394
  /**
384
395
  * Primary button color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
385
396
  */
386
- primary_button_color?: string | undefined
397
+ primary_button_color?: string | null | undefined
387
398
  /**
388
399
  * Primary button text color for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
389
400
  */
390
- primary_button_text_color?: string | undefined
401
+ primary_button_text_color?: string | null | undefined
391
402
  /**
392
403
  * Success message for [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) in the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews).
393
404
  */
394
- success_message?: string | undefined
405
+ success_message?: string | null | undefined
395
406
  }
396
407
  | undefined
397
408
  /**
@@ -1,3 +1,3 @@
1
- const seamapiJavascriptHttpVersion = '2.4.1'
1
+ const seamapiJavascriptHttpVersion = '2.4.3'
2
2
 
3
3
  export default seamapiJavascriptHttpVersion