@seamapi/http 2.38.0 → 2.39.0

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 (46) hide show
  1. package/lib/resources/access-grant.d.ts +2 -2
  2. package/lib/resources/access-method.d.ts +16 -1
  3. package/lib/resources/acs-entrance.d.ts +6 -2
  4. package/lib/resources/acs-system.d.ts +15 -0
  5. package/lib/resources/action-attempt.d.ts +332 -7
  6. package/lib/resources/connect-webview.d.ts +1 -1
  7. package/lib/resources/connected-account.d.ts +1 -1
  8. package/lib/resources/device-provider.d.ts +17 -1
  9. package/lib/resources/device.d.ts +112 -1
  10. package/lib/resources/phone.d.ts +702 -10
  11. package/lib/resources/unmanaged-access-grant.d.ts +2 -2
  12. package/lib/resources/unmanaged-access-method.d.ts +16 -1
  13. package/lib/resources/unmanaged-device.d.ts +17 -1
  14. package/lib/routes/connect-webviews/connect-webviews.d.ts +2 -2
  15. package/lib/routes/connected-accounts/connected-accounts.d.ts +1 -1
  16. package/lib/routes/customers/customers.d.ts +13 -0
  17. package/lib/routes/customers/customers.js +1 -0
  18. package/lib/routes/customers/customers.js.map +1 -1
  19. package/lib/routes/devices/devices.d.ts +3 -3
  20. package/lib/routes/devices/unmanaged/unmanaged.d.ts +3 -3
  21. package/lib/routes/seam-http-endpoints.d.ts +1 -0
  22. package/lib/routes/seam-http-endpoints.js +1 -0
  23. package/lib/routes/seam-http-endpoints.js.map +1 -1
  24. package/lib/version.d.ts +1 -1
  25. package/lib/version.js +1 -1
  26. package/package.json +2 -2
  27. package/src/lib/resources/access-grant.ts +2 -2
  28. package/src/lib/resources/access-method.ts +19 -1
  29. package/src/lib/resources/acs-entrance.ts +17 -12
  30. package/src/lib/resources/acs-system.ts +18 -0
  31. package/src/lib/resources/action-attempt.ts +425 -24
  32. package/src/lib/resources/connect-webview.ts +6 -1
  33. package/src/lib/resources/connected-account.ts +6 -1
  34. package/src/lib/resources/device-provider.ts +17 -0
  35. package/src/lib/resources/device.ts +127 -0
  36. package/src/lib/resources/phone.ts +855 -22
  37. package/src/lib/resources/unmanaged-access-grant.ts +2 -2
  38. package/src/lib/resources/unmanaged-access-method.ts +19 -1
  39. package/src/lib/resources/unmanaged-device.ts +17 -0
  40. package/src/lib/routes/connect-webviews/connect-webviews.ts +7 -1
  41. package/src/lib/routes/connected-accounts/connected-accounts.ts +6 -1
  42. package/src/lib/routes/customers/customers.ts +13 -0
  43. package/src/lib/routes/devices/devices.ts +3 -0
  44. package/src/lib/routes/devices/unmanaged/unmanaged.ts +3 -0
  45. package/src/lib/routes/seam-http-endpoints.ts +1 -0
  46. package/src/lib/version.ts +1 -1
@@ -321,9 +321,9 @@ export type AccessGrant = {
321
321
  device_id: string
322
322
 
323
323
  /**
324
- * Reason the access code could not be revoked (e.g. `offline_access_code_not_revocable`).
324
+ * Reason the access code could not be revoked.
325
325
  */
326
- error_code: string
326
+ error_code: 'offline_access_code_not_revocable'
327
327
 
328
328
  /**
329
329
  * Human-readable description of why revocation failed.
@@ -104,7 +104,7 @@ export type AccessMethod = {
104
104
  */
105
105
  is_ready_for_assignment?: boolean | undefined
106
106
  /**
107
- * Indicates whether the access method is ready to be encoded. This is true when the credential has been created and the card has not yet been issued.
107
+ * Indicates whether the access method is ready to be encoded. This is true when the card has not yet been issued and the access system has received all the access the card needs. While it is false, `pending_mutations` contains `waiting_for_access_on_acs_system`.
108
108
  */
109
109
  is_ready_for_encoding?: boolean | undefined
110
110
  /**
@@ -242,6 +242,24 @@ export type AccessMethod = {
242
242
  */
243
243
  starts_at: string | null
244
244
  }
245
+ } /**
246
+ * The access system has not yet received all the access this card needs. A card encoded now would carry only the access the system already has, so wait until this clears before encoding.
247
+ */
248
+ | {
249
+ /**
250
+ * Date and time at which the mutation was created.
251
+ */
252
+ created_at: string
253
+
254
+ /**
255
+ * Detailed description of the mutation.
256
+ */
257
+ message: string
258
+
259
+ /**
260
+ * Mutation code to indicate that the access system has not yet received all the access this card needs, so the card is not ready to be encoded.
261
+ */
262
+ mutation_code: 'waiting_for_access_on_acs_system'
245
263
  }
246
264
  >
247
265
 
@@ -195,22 +195,27 @@ export type AcsEntrance = {
195
195
  /**
196
196
  * Errors associated with the [entrance](https://www.seam.co/docs/low-level-apis/access-systems/retrieving-entrance-details).
197
197
  */
198
- errors: Array<{
198
+ errors: Array<
199
199
  /**
200
- * Date and time at which Seam created the error.
200
+ * Indicates that the [entrance](https://www.seam.co/docs/low-level-apis/access-systems/retrieving-entrance-details) was removed from the connected account, so Seam can no longer sync it.
201
201
  */
202
- created_at: string
202
+ {
203
+ /**
204
+ * Date and time at which Seam created the error.
205
+ */
206
+ created_at: string
203
207
 
204
- /**
205
- * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
206
- */
207
- error_code: string
208
+ /**
209
+ * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
210
+ */
211
+ error_code: 'entrance_removed'
208
212
 
209
- /**
210
- * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
211
- */
212
- message: string
213
- }>
213
+ /**
214
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
215
+ */
216
+ message: string
217
+ }
218
+ >
214
219
 
215
220
  /**
216
221
  * Hotek-specific metadata associated with the [entrance](https://www.seam.co/docs/low-level-apis/access-systems/retrieving-entrance-details).
@@ -125,6 +125,24 @@ export type AcsSystem = {
125
125
  */
126
126
  error_code: 'salto_ks_subscription_limit_exceeded'
127
127
 
128
+ /**
129
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
130
+ */
131
+ message: string
132
+ } /**
133
+ * Indicates that the access control system has reached the maximum number of users its license allows, so Seam cannot create new users on it and access for new guests is not provisioned. Remove unused users from the access control system or increase its license. The error clears once Seam can create users again.
134
+ */
135
+ | {
136
+ /**
137
+ * Date and time at which Seam created the error.
138
+ */
139
+ created_at: string
140
+
141
+ /**
142
+ * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
143
+ */
144
+ error_code: 'user_license_limit_reached'
145
+
128
146
  /**
129
147
  * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
130
148
  */
@@ -1335,7 +1335,7 @@ export type ActionAttempt =
1335
1335
  */
1336
1336
  is_ready_for_assignment?: boolean | undefined
1337
1337
  /**
1338
- * Indicates whether the access method is ready to be encoded. This is true when the credential has been created and the card has not yet been issued.
1338
+ * Indicates whether the access method is ready to be encoded. This is true when the card has not yet been issued and the access system has received all the access the card needs. While it is false, `pending_mutations` contains `waiting_for_access_on_acs_system`.
1339
1339
  */
1340
1340
  is_ready_for_encoding?: boolean | undefined
1341
1341
  /**
@@ -1359,41 +1359,47 @@ export type ActionAttempt =
1359
1359
  /**
1360
1360
  * Previous access time configuration.
1361
1361
  */
1362
- from: {
1363
- /**
1364
- * Previous end time for access.
1365
- */
1366
- ends_at: string | null
1367
- /**
1368
- * Previous start time for access.
1369
- */
1370
- starts_at: string | null
1371
- }
1372
-
1362
+ from?:
1363
+ | {
1364
+ /**
1365
+ * Previous end time for access.
1366
+ */
1367
+ ends_at: string | null
1368
+ /**
1369
+ * Previous start time for access.
1370
+ */
1371
+ starts_at: string | null
1372
+ }
1373
+ | undefined
1373
1374
  /**
1374
1375
  * Detailed description of the mutation.
1375
1376
  */
1376
1377
  message: string
1377
1378
 
1378
1379
  /**
1379
- * Mutation code to indicate that Seam is in the process of updating the access times for this access method.
1380
+ * Mutation code to indicate that the access system has not yet received all the access this card needs, so the card is not ready to be encoded.
1380
1381
  */
1381
1382
  mutation_code:
1382
- 'provisioning_access' | 'revoking_access' | 'updating_access_times'
1383
+ | 'provisioning_access'
1384
+ | 'revoking_access'
1385
+ | 'updating_access_times'
1386
+ | 'waiting_for_access_on_acs_system'
1383
1387
 
1384
1388
  /**
1385
1389
  * New access time configuration.
1386
1390
  */
1387
- to: {
1388
- /**
1389
- * New end time for access.
1390
- */
1391
- ends_at: string | null
1392
- /**
1393
- * New start time for access.
1394
- */
1395
- starts_at: string | null
1396
- }
1391
+ to?:
1392
+ | {
1393
+ /**
1394
+ * New end time for access.
1395
+ */
1396
+ ends_at: string | null
1397
+ /**
1398
+ * New start time for access.
1399
+ */
1400
+ starts_at: string | null
1401
+ }
1402
+ | undefined
1397
1403
  }>
1398
1404
 
1399
1405
  /**
@@ -2263,6 +2269,401 @@ export type ActionAttempt =
2263
2269
  */
2264
2270
  action_attempt_id: string
2265
2271
 
2272
+ /**
2273
+ * Action attempt to track the status of setting the volume on a speaker.
2274
+ */
2275
+ action_type: 'SET_SPEAKER_VOLUME'
2276
+
2277
+ /**
2278
+ * Error associated with the action.
2279
+ */
2280
+ error: null
2281
+ /**
2282
+ * Result of the action.
2283
+ */
2284
+ result: {}
2285
+
2286
+ status: 'success'
2287
+ }
2288
+ | {
2289
+ /**
2290
+ * ID of the action attempt.
2291
+ */
2292
+ action_attempt_id: string
2293
+
2294
+ /**
2295
+ * Action attempt to track the status of setting the volume on a speaker.
2296
+ */
2297
+ action_type: 'SET_SPEAKER_VOLUME'
2298
+
2299
+ /**
2300
+ * Error associated with the action.
2301
+ */
2302
+ error: null
2303
+ /**
2304
+ * Result of the action.
2305
+ */
2306
+ result: null
2307
+
2308
+ status: 'pending'
2309
+ }
2310
+ | {
2311
+ /**
2312
+ * ID of the action attempt.
2313
+ */
2314
+ action_attempt_id: string
2315
+
2316
+ /**
2317
+ * Action attempt to track the status of setting the volume on a speaker.
2318
+ */
2319
+ action_type: 'SET_SPEAKER_VOLUME'
2320
+
2321
+ /**
2322
+ * Error associated with the action.
2323
+ */
2324
+ error: {
2325
+ /**
2326
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
2327
+ */
2328
+ message: string
2329
+
2330
+ /**
2331
+ * Type of the error.
2332
+ */
2333
+ type: string
2334
+ }
2335
+
2336
+ /**
2337
+ * Result of the action.
2338
+ */
2339
+ result: null
2340
+
2341
+ status: 'error'
2342
+ }
2343
+ | {
2344
+ /**
2345
+ * ID of the action attempt.
2346
+ */
2347
+ action_attempt_id: string
2348
+
2349
+ /**
2350
+ * Action attempt to track the status of muting or unmuting a speaker.
2351
+ */
2352
+ action_type: 'SET_SPEAKER_MUTE'
2353
+
2354
+ /**
2355
+ * Error associated with the action.
2356
+ */
2357
+ error: null
2358
+ /**
2359
+ * Result of the action.
2360
+ */
2361
+ result: {}
2362
+
2363
+ status: 'success'
2364
+ }
2365
+ | {
2366
+ /**
2367
+ * ID of the action attempt.
2368
+ */
2369
+ action_attempt_id: string
2370
+
2371
+ /**
2372
+ * Action attempt to track the status of muting or unmuting a speaker.
2373
+ */
2374
+ action_type: 'SET_SPEAKER_MUTE'
2375
+
2376
+ /**
2377
+ * Error associated with the action.
2378
+ */
2379
+ error: null
2380
+ /**
2381
+ * Result of the action.
2382
+ */
2383
+ result: null
2384
+
2385
+ status: 'pending'
2386
+ }
2387
+ | {
2388
+ /**
2389
+ * ID of the action attempt.
2390
+ */
2391
+ action_attempt_id: string
2392
+
2393
+ /**
2394
+ * Action attempt to track the status of muting or unmuting a speaker.
2395
+ */
2396
+ action_type: 'SET_SPEAKER_MUTE'
2397
+
2398
+ /**
2399
+ * Error associated with the action.
2400
+ */
2401
+ error: {
2402
+ /**
2403
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
2404
+ */
2405
+ message: string
2406
+
2407
+ /**
2408
+ * Type of the error.
2409
+ */
2410
+ type: string
2411
+ }
2412
+
2413
+ /**
2414
+ * Result of the action.
2415
+ */
2416
+ result: null
2417
+
2418
+ status: 'error'
2419
+ }
2420
+ | {
2421
+ /**
2422
+ * ID of the action attempt.
2423
+ */
2424
+ action_attempt_id: string
2425
+
2426
+ /**
2427
+ * Action attempt to track the status of pausing playback on a speaker.
2428
+ */
2429
+ action_type: 'PAUSE_SPEAKER_PLAYBACK'
2430
+
2431
+ /**
2432
+ * Error associated with the action.
2433
+ */
2434
+ error: null
2435
+ /**
2436
+ * Result of the action.
2437
+ */
2438
+ result: {
2439
+ /**
2440
+ * IDs of the speakers whose playback was paused, including speakers grouped with the requested speaker.
2441
+ */
2442
+ affected_device_ids: Array<string>
2443
+ }
2444
+
2445
+ status: 'success'
2446
+ }
2447
+ | {
2448
+ /**
2449
+ * ID of the action attempt.
2450
+ */
2451
+ action_attempt_id: string
2452
+
2453
+ /**
2454
+ * Action attempt to track the status of pausing playback on a speaker.
2455
+ */
2456
+ action_type: 'PAUSE_SPEAKER_PLAYBACK'
2457
+
2458
+ /**
2459
+ * Error associated with the action.
2460
+ */
2461
+ error: null
2462
+ /**
2463
+ * Result of the action.
2464
+ */
2465
+ result: null
2466
+
2467
+ status: 'pending'
2468
+ }
2469
+ | {
2470
+ /**
2471
+ * ID of the action attempt.
2472
+ */
2473
+ action_attempt_id: string
2474
+
2475
+ /**
2476
+ * Action attempt to track the status of pausing playback on a speaker.
2477
+ */
2478
+ action_type: 'PAUSE_SPEAKER_PLAYBACK'
2479
+
2480
+ /**
2481
+ * Error associated with the action.
2482
+ */
2483
+ error: {
2484
+ /**
2485
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
2486
+ */
2487
+ message: string
2488
+
2489
+ /**
2490
+ * Type of the error.
2491
+ */
2492
+ type: string
2493
+ }
2494
+
2495
+ /**
2496
+ * Result of the action.
2497
+ */
2498
+ result: null
2499
+
2500
+ status: 'error'
2501
+ }
2502
+ | {
2503
+ /**
2504
+ * ID of the action attempt.
2505
+ */
2506
+ action_attempt_id: string
2507
+
2508
+ /**
2509
+ * Action attempt to track the status of resuming playback on a speaker.
2510
+ */
2511
+ action_type: 'RESUME_SPEAKER_PLAYBACK'
2512
+
2513
+ /**
2514
+ * Error associated with the action.
2515
+ */
2516
+ error: null
2517
+ /**
2518
+ * Result of the action.
2519
+ */
2520
+ result: {
2521
+ /**
2522
+ * IDs of the speakers whose playback was resumed, including speakers grouped with the requested speaker.
2523
+ */
2524
+ affected_device_ids: Array<string>
2525
+ }
2526
+
2527
+ status: 'success'
2528
+ }
2529
+ | {
2530
+ /**
2531
+ * ID of the action attempt.
2532
+ */
2533
+ action_attempt_id: string
2534
+
2535
+ /**
2536
+ * Action attempt to track the status of resuming playback on a speaker.
2537
+ */
2538
+ action_type: 'RESUME_SPEAKER_PLAYBACK'
2539
+
2540
+ /**
2541
+ * Error associated with the action.
2542
+ */
2543
+ error: null
2544
+ /**
2545
+ * Result of the action.
2546
+ */
2547
+ result: null
2548
+
2549
+ status: 'pending'
2550
+ }
2551
+ | {
2552
+ /**
2553
+ * ID of the action attempt.
2554
+ */
2555
+ action_attempt_id: string
2556
+
2557
+ /**
2558
+ * Action attempt to track the status of resuming playback on a speaker.
2559
+ */
2560
+ action_type: 'RESUME_SPEAKER_PLAYBACK'
2561
+
2562
+ /**
2563
+ * Error associated with the action.
2564
+ */
2565
+ error: {
2566
+ /**
2567
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
2568
+ */
2569
+ message: string
2570
+
2571
+ /**
2572
+ * Type of the error.
2573
+ */
2574
+ type: string
2575
+ }
2576
+
2577
+ /**
2578
+ * Result of the action.
2579
+ */
2580
+ result: null
2581
+
2582
+ status: 'error'
2583
+ }
2584
+ | {
2585
+ /**
2586
+ * ID of the action attempt.
2587
+ */
2588
+ action_attempt_id: string
2589
+
2590
+ /**
2591
+ * Action attempt to track the status of playing a chime on a speaker.
2592
+ */
2593
+ action_type: 'PLAY_SPEAKER_CHIME'
2594
+
2595
+ /**
2596
+ * Error associated with the action.
2597
+ */
2598
+ error: null
2599
+ /**
2600
+ * Result of the action.
2601
+ */
2602
+ result: {}
2603
+
2604
+ status: 'success'
2605
+ }
2606
+ | {
2607
+ /**
2608
+ * ID of the action attempt.
2609
+ */
2610
+ action_attempt_id: string
2611
+
2612
+ /**
2613
+ * Action attempt to track the status of playing a chime on a speaker.
2614
+ */
2615
+ action_type: 'PLAY_SPEAKER_CHIME'
2616
+
2617
+ /**
2618
+ * Error associated with the action.
2619
+ */
2620
+ error: null
2621
+ /**
2622
+ * Result of the action.
2623
+ */
2624
+ result: null
2625
+
2626
+ status: 'pending'
2627
+ }
2628
+ | {
2629
+ /**
2630
+ * ID of the action attempt.
2631
+ */
2632
+ action_attempt_id: string
2633
+
2634
+ /**
2635
+ * Action attempt to track the status of playing a chime on a speaker.
2636
+ */
2637
+ action_type: 'PLAY_SPEAKER_CHIME'
2638
+
2639
+ /**
2640
+ * Error associated with the action.
2641
+ */
2642
+ error: {
2643
+ /**
2644
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
2645
+ */
2646
+ message: string
2647
+
2648
+ /**
2649
+ * Type of the error.
2650
+ */
2651
+ type: string
2652
+ }
2653
+
2654
+ /**
2655
+ * Result of the action.
2656
+ */
2657
+ result: null
2658
+
2659
+ status: 'error'
2660
+ }
2661
+ | {
2662
+ /**
2663
+ * ID of the action attempt.
2664
+ */
2665
+ action_attempt_id: string
2666
+
2266
2667
  /**
2267
2668
  * Syncing access codes is pending.
2268
2669
  */
@@ -21,7 +21,12 @@ export type ConnectWebview = {
21
21
  * High-level device capabilities that the Connect Webview can accept. When creating a Connect Webview, you can specify the types of devices that it can connect to Seam. If you do not set custom `accepted_capabilities`, Seam uses a default set of `accepted_capabilities` for each provider. For example, if you create a Connect Webview that accepts SmartThing devices, without specifying `accepted_capabilities`, Seam accepts only SmartThings locks. To connect SmartThings thermostats and locks to Seam, create a Connect Webview and include both `thermostat` and `lock` in the `accepted_capabilities`.
22
22
  */
23
23
  accepted_capabilities: Array<
24
- 'lock' | 'thermostat' | 'noise_sensor' | 'access_control' | 'camera'
24
+ | 'lock'
25
+ | 'thermostat'
26
+ | 'noise_sensor'
27
+ | 'access_control'
28
+ | 'camera'
29
+ | 'speaker'
25
30
  >
26
31
 
27
32
  /**
@@ -11,7 +11,12 @@ export type ConnectedAccount = {
11
11
  * List of capabilities that were accepted during the account connection process.
12
12
  */
13
13
  accepted_capabilities: Array<
14
- 'lock' | 'thermostat' | 'noise_sensor' | 'access_control' | 'camera'
14
+ | 'lock'
15
+ | 'thermostat'
16
+ | 'noise_sensor'
17
+ | 'access_control'
18
+ | 'camera'
19
+ | 'speaker'
15
20
  >
16
21
 
17
22
  /**
@@ -24,6 +24,18 @@ export type DeviceProvider = {
24
24
  * Indicates whether the thermostat supports simultaneous heating and cooling.
25
25
  */
26
26
  can_hvac_heat_cool?: boolean | undefined
27
+ /**
28
+ * Indicates whether the speaker supports muting and unmuting.
29
+ */
30
+ can_mute_speaker?: boolean | undefined
31
+ /**
32
+ * Indicates whether the speaker supports pausing and resuming playback.
33
+ */
34
+ can_pause_speaker_playback?: boolean | undefined
35
+ /**
36
+ * Indicates whether the speaker supports playing a chime.
37
+ */
38
+ can_play_speaker_chime?: boolean | undefined
27
39
  /**
28
40
  * Indicates whether the device supports programming offline access codes.
29
41
  */
@@ -56,6 +68,10 @@ export type DeviceProvider = {
56
68
  * Indicates whether the thermostat supports running climate programs.
57
69
  */
58
70
  can_run_thermostat_programs?: boolean | undefined
71
+ /**
72
+ * Indicates whether the speaker supports setting its volume.
73
+ */
74
+ can_set_speaker_volume?: boolean | undefined
59
75
  /**
60
76
  * Indicates whether the device supports simulating connection in a sandbox.
61
77
  */
@@ -164,6 +180,7 @@ export type DeviceProvider = {
164
180
  | 'omnitec'
165
181
  | 'kisi'
166
182
  | 'aqara'
183
+ | 'sonos'
167
184
 
168
185
  /**
169
186
  * Display name for the device provider.