@seamapi/http 1.0.0-rc.1 → 1.0.0-rc.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 (67) hide show
  1. package/LICENSE.txt +1 -1
  2. package/README.md +39 -33
  3. package/dist/connect.cjs +33 -67
  4. package/dist/connect.cjs.map +1 -1
  5. package/dist/connect.d.cts +995 -59
  6. package/lib/seam/connect/parse-options.js +1 -1
  7. package/lib/seam/connect/parse-options.js.map +1 -1
  8. package/lib/seam/connect/resolve-action-attempt.d.ts +1273 -5
  9. package/lib/seam/connect/resolve-action-attempt.js.map +1 -1
  10. package/lib/seam/connect/routes/access-codes-unmanaged.d.ts +2 -2
  11. package/lib/seam/connect/routes/access-codes-unmanaged.js.map +1 -1
  12. package/lib/seam/connect/routes/access-codes.d.ts +2 -2
  13. package/lib/seam/connect/routes/access-codes.js.map +1 -1
  14. package/lib/seam/connect/routes/acs-access-groups.d.ts +2 -2
  15. package/lib/seam/connect/routes/acs-access-groups.js.map +1 -1
  16. package/lib/seam/connect/routes/acs-credentials.d.ts +2 -2
  17. package/lib/seam/connect/routes/acs-credentials.js.map +1 -1
  18. package/lib/seam/connect/routes/acs-users.d.ts +6 -6
  19. package/lib/seam/connect/routes/acs-users.js.map +1 -1
  20. package/lib/seam/connect/routes/client-sessions.d.ts +4 -4
  21. package/lib/seam/connect/routes/client-sessions.js.map +1 -1
  22. package/lib/seam/connect/routes/connect-webviews.d.ts +2 -2
  23. package/lib/seam/connect/routes/connect-webviews.js.map +1 -1
  24. package/lib/seam/connect/routes/connected-accounts.d.ts +2 -2
  25. package/lib/seam/connect/routes/connected-accounts.js.map +1 -1
  26. package/lib/seam/connect/routes/devices-simulate.d.ts +2 -2
  27. package/lib/seam/connect/routes/devices-simulate.js.map +1 -1
  28. package/lib/seam/connect/routes/devices.d.ts +2 -2
  29. package/lib/seam/connect/routes/devices.js.map +1 -1
  30. package/lib/seam/connect/routes/noise-sensors-noise-thresholds.d.ts +2 -2
  31. package/lib/seam/connect/routes/noise-sensors-noise-thresholds.js.map +1 -1
  32. package/lib/seam/connect/routes/phones.d.ts +2 -2
  33. package/lib/seam/connect/routes/phones.js.map +1 -1
  34. package/lib/seam/connect/routes/thermostats-climate-setting-schedules.d.ts +2 -2
  35. package/lib/seam/connect/routes/thermostats-climate-setting-schedules.js.map +1 -1
  36. package/lib/seam/connect/routes/user-identities-enrollment-automations.d.ts +2 -2
  37. package/lib/seam/connect/routes/user-identities-enrollment-automations.js.map +1 -1
  38. package/lib/seam/connect/routes/user-identities.d.ts +6 -6
  39. package/lib/seam/connect/routes/user-identities.js.map +1 -1
  40. package/lib/seam/connect/routes/webhooks.d.ts +2 -2
  41. package/lib/seam/connect/routes/webhooks.js.map +1 -1
  42. package/lib/version.d.ts +1 -1
  43. package/lib/version.js +1 -1
  44. package/package.json +6 -6
  45. package/src/lib/seam/connect/parse-options.ts +1 -1
  46. package/src/lib/seam/connect/resolve-action-attempt.ts +16 -9
  47. package/src/lib/seam/connect/routes/access-codes-unmanaged.ts +2 -2
  48. package/src/lib/seam/connect/routes/access-codes.ts +2 -2
  49. package/src/lib/seam/connect/routes/acs-access-groups.ts +2 -2
  50. package/src/lib/seam/connect/routes/acs-credentials.ts +2 -2
  51. package/src/lib/seam/connect/routes/acs-users.ts +6 -6
  52. package/src/lib/seam/connect/routes/client-sessions.ts +4 -4
  53. package/src/lib/seam/connect/routes/connect-webviews.ts +2 -2
  54. package/src/lib/seam/connect/routes/connected-accounts.ts +4 -2
  55. package/src/lib/seam/connect/routes/devices-simulate.ts +2 -2
  56. package/src/lib/seam/connect/routes/devices.ts +2 -2
  57. package/src/lib/seam/connect/routes/noise-sensors-noise-thresholds.ts +2 -2
  58. package/src/lib/seam/connect/routes/phones.ts +2 -2
  59. package/src/lib/seam/connect/routes/thermostats-climate-setting-schedules.ts +2 -2
  60. package/src/lib/seam/connect/routes/user-identities-enrollment-automations.ts +2 -2
  61. package/src/lib/seam/connect/routes/user-identities.ts +6 -6
  62. package/src/lib/seam/connect/routes/webhooks.ts +2 -2
  63. package/src/lib/version.ts +1 -1
  64. package/lib/seam/connect/action-attempt-types.d.ts +0 -17
  65. package/lib/seam/connect/action-attempt-types.js +0 -3
  66. package/lib/seam/connect/action-attempt-types.js.map +0 -1
  67. package/src/lib/seam/connect/action-attempt-types.ts +0 -22
@@ -1,21 +1,1289 @@
1
- import type { ActionAttempt, FailedActionAttempt, SuccessfulActionAttempt } from './action-attempt-types.js';
1
+ import type { ActionAttempt } from '@seamapi/types/connect';
2
2
  import type { SeamHttpActionAttempts } from './routes/index.js';
3
3
  export interface ResolveActionAttemptOptions {
4
4
  timeout?: number;
5
5
  pollingInterval?: number;
6
6
  }
7
- export declare const resolveActionAttempt: <T extends ActionAttempt>(actionAttempt: T, actionAttempts: SeamHttpActionAttempts, { timeout, pollingInterval }: ResolveActionAttemptOptions) => Promise<SuccessfulActionAttempt<T>>;
8
- export declare const isSeamActionAttemptError: <T extends ActionAttempt>(error: unknown) => error is SeamActionAttemptError<T>;
7
+ export declare const resolveActionAttempt: <T extends {
8
+ error: null;
9
+ status: "pending";
10
+ action_attempt_id: string;
11
+ result: null;
12
+ action_type: "LOCK_DOOR";
13
+ } | {
14
+ error: null;
15
+ status: "success";
16
+ action_attempt_id: string;
17
+ result: {};
18
+ action_type: "LOCK_DOOR";
19
+ } | {
20
+ error: {
21
+ type: string;
22
+ message: string;
23
+ };
24
+ status: "error";
25
+ action_attempt_id: string;
26
+ result: null;
27
+ action_type: "LOCK_DOOR";
28
+ } | {
29
+ error: null;
30
+ status: "pending";
31
+ action_attempt_id: string;
32
+ result: null;
33
+ action_type: "UNLOCK_DOOR";
34
+ } | {
35
+ error: null;
36
+ status: "success";
37
+ action_attempt_id: string;
38
+ result: {};
39
+ action_type: "UNLOCK_DOOR";
40
+ } | {
41
+ error: {
42
+ type: string;
43
+ message: string;
44
+ };
45
+ status: "error";
46
+ action_attempt_id: string;
47
+ result: null;
48
+ action_type: "UNLOCK_DOOR";
49
+ } | {
50
+ error: null;
51
+ status: "pending";
52
+ action_attempt_id: string;
53
+ result: null;
54
+ action_type: "RESET_SANDBOX_WORKSPACE";
55
+ } | {
56
+ error: null;
57
+ status: "success";
58
+ action_attempt_id: string;
59
+ result: {};
60
+ action_type: "RESET_SANDBOX_WORKSPACE";
61
+ } | {
62
+ error: {
63
+ type: string;
64
+ message: string;
65
+ };
66
+ status: "error";
67
+ action_attempt_id: string;
68
+ result: null;
69
+ action_type: "RESET_SANDBOX_WORKSPACE";
70
+ } | {
71
+ error: null;
72
+ status: "pending";
73
+ action_attempt_id: string;
74
+ result: null;
75
+ action_type: "SET_COOL";
76
+ } | {
77
+ error: null;
78
+ status: "success";
79
+ action_attempt_id: string;
80
+ result: {};
81
+ action_type: "SET_COOL";
82
+ } | {
83
+ error: {
84
+ type: string;
85
+ message: string;
86
+ };
87
+ status: "error";
88
+ action_attempt_id: string;
89
+ result: null;
90
+ action_type: "SET_COOL";
91
+ } | {
92
+ error: null;
93
+ status: "pending";
94
+ action_attempt_id: string;
95
+ result: null;
96
+ action_type: "SET_HEAT";
97
+ } | {
98
+ error: null;
99
+ status: "success";
100
+ action_attempt_id: string;
101
+ result: {};
102
+ action_type: "SET_HEAT";
103
+ } | {
104
+ error: {
105
+ type: string;
106
+ message: string;
107
+ };
108
+ status: "error";
109
+ action_attempt_id: string;
110
+ result: null;
111
+ action_type: "SET_HEAT";
112
+ } | {
113
+ error: null;
114
+ status: "pending";
115
+ action_attempt_id: string;
116
+ result: null;
117
+ action_type: "SET_HEAT_COOL";
118
+ } | {
119
+ error: null;
120
+ status: "success";
121
+ action_attempt_id: string;
122
+ result: {};
123
+ action_type: "SET_HEAT_COOL";
124
+ } | {
125
+ error: {
126
+ type: string;
127
+ message: string;
128
+ };
129
+ status: "error";
130
+ action_attempt_id: string;
131
+ result: null;
132
+ action_type: "SET_HEAT_COOL";
133
+ } | {
134
+ error: null;
135
+ status: "pending";
136
+ action_attempt_id: string;
137
+ result: null;
138
+ action_type: "SET_FAN_MODE";
139
+ } | {
140
+ error: null;
141
+ status: "success";
142
+ action_attempt_id: string;
143
+ result: {};
144
+ action_type: "SET_FAN_MODE";
145
+ } | {
146
+ error: {
147
+ type: string;
148
+ message: string;
149
+ };
150
+ status: "error";
151
+ action_attempt_id: string;
152
+ result: null;
153
+ action_type: "SET_FAN_MODE";
154
+ } | {
155
+ error: null;
156
+ status: "pending";
157
+ action_attempt_id: string;
158
+ result: null;
159
+ action_type: "SET_THERMOSTAT_OFF";
160
+ } | {
161
+ error: null;
162
+ status: "success";
163
+ action_attempt_id: string;
164
+ result: {};
165
+ action_type: "SET_THERMOSTAT_OFF";
166
+ } | {
167
+ error: {
168
+ type: string;
169
+ message: string;
170
+ };
171
+ status: "error";
172
+ action_attempt_id: string;
173
+ result: null;
174
+ action_type: "SET_THERMOSTAT_OFF";
175
+ } | {
176
+ error: null;
177
+ status: "pending";
178
+ action_attempt_id: string;
179
+ result: null;
180
+ action_type: "SYNC_ACCESS_CODES";
181
+ } | {
182
+ error: null;
183
+ status: "success";
184
+ action_attempt_id: string;
185
+ action_type: "SYNC_ACCESS_CODES";
186
+ result?: any;
187
+ } | {
188
+ error: {
189
+ type: string;
190
+ message: string;
191
+ };
192
+ status: "error";
193
+ action_attempt_id: string;
194
+ result: null;
195
+ action_type: "SYNC_ACCESS_CODES";
196
+ } | {
197
+ error: null;
198
+ status: "pending";
199
+ action_attempt_id: string;
200
+ result: null;
201
+ action_type: "CREATE_ACCESS_CODE";
202
+ } | {
203
+ error: null;
204
+ status: "success";
205
+ action_attempt_id: string;
206
+ action_type: "CREATE_ACCESS_CODE";
207
+ result?: any;
208
+ } | {
209
+ error: {
210
+ type: string;
211
+ message: string;
212
+ };
213
+ status: "error";
214
+ action_attempt_id: string;
215
+ result: null;
216
+ action_type: "CREATE_ACCESS_CODE";
217
+ } | {
218
+ error: null;
219
+ status: "pending";
220
+ action_attempt_id: string;
221
+ result: null;
222
+ action_type: "DELETE_ACCESS_CODE";
223
+ } | {
224
+ error: null;
225
+ status: "success";
226
+ action_attempt_id: string;
227
+ action_type: "DELETE_ACCESS_CODE";
228
+ result?: any;
229
+ } | {
230
+ error: {
231
+ type: string;
232
+ message: string;
233
+ };
234
+ status: "error";
235
+ action_attempt_id: string;
236
+ result: null;
237
+ action_type: "DELETE_ACCESS_CODE";
238
+ } | {
239
+ error: null;
240
+ status: "pending";
241
+ action_attempt_id: string;
242
+ result: null;
243
+ action_type: "UPDATE_ACCESS_CODE";
244
+ } | {
245
+ error: null;
246
+ status: "success";
247
+ action_attempt_id: string;
248
+ action_type: "UPDATE_ACCESS_CODE";
249
+ result?: any;
250
+ } | {
251
+ error: {
252
+ type: string;
253
+ message: string;
254
+ };
255
+ status: "error";
256
+ action_attempt_id: string;
257
+ result: null;
258
+ action_type: "UPDATE_ACCESS_CODE";
259
+ } | {
260
+ error: null;
261
+ status: "pending";
262
+ action_attempt_id: string;
263
+ result: null;
264
+ action_type: "CREATE_NOISE_THRESHOLD";
265
+ } | {
266
+ error: null;
267
+ status: "success";
268
+ action_attempt_id: string;
269
+ action_type: "CREATE_NOISE_THRESHOLD";
270
+ result?: any;
271
+ } | {
272
+ error: {
273
+ type: string;
274
+ message: string;
275
+ };
276
+ status: "error";
277
+ action_attempt_id: string;
278
+ result: null;
279
+ action_type: "CREATE_NOISE_THRESHOLD";
280
+ } | {
281
+ error: null;
282
+ status: "pending";
283
+ action_attempt_id: string;
284
+ result: null;
285
+ action_type: "DELETE_NOISE_THRESHOLD";
286
+ } | {
287
+ error: null;
288
+ status: "success";
289
+ action_attempt_id: string;
290
+ action_type: "DELETE_NOISE_THRESHOLD";
291
+ result?: any;
292
+ } | {
293
+ error: {
294
+ type: string;
295
+ message: string;
296
+ };
297
+ status: "error";
298
+ action_attempt_id: string;
299
+ result: null;
300
+ action_type: "DELETE_NOISE_THRESHOLD";
301
+ } | {
302
+ error: null;
303
+ status: "pending";
304
+ action_attempt_id: string;
305
+ result: null;
306
+ action_type: "UPDATE_NOISE_THRESHOLD";
307
+ } | {
308
+ error: null;
309
+ status: "success";
310
+ action_attempt_id: string;
311
+ action_type: "UPDATE_NOISE_THRESHOLD";
312
+ result?: any;
313
+ } | {
314
+ error: {
315
+ type: string;
316
+ message: string;
317
+ };
318
+ status: "error";
319
+ action_attempt_id: string;
320
+ result: null;
321
+ action_type: "UPDATE_NOISE_THRESHOLD";
322
+ }>(actionAttempt: T, actionAttempts: SeamHttpActionAttempts, { timeout, pollingInterval }: ResolveActionAttemptOptions) => Promise<Extract<T, {
323
+ status: 'success';
324
+ }>>;
325
+ export declare const isSeamActionAttemptError: <T extends {
326
+ error: null;
327
+ status: "pending";
328
+ action_attempt_id: string;
329
+ result: null;
330
+ action_type: "LOCK_DOOR";
331
+ } | {
332
+ error: null;
333
+ status: "success";
334
+ action_attempt_id: string;
335
+ result: {};
336
+ action_type: "LOCK_DOOR";
337
+ } | {
338
+ error: {
339
+ type: string;
340
+ message: string;
341
+ };
342
+ status: "error";
343
+ action_attempt_id: string;
344
+ result: null;
345
+ action_type: "LOCK_DOOR";
346
+ } | {
347
+ error: null;
348
+ status: "pending";
349
+ action_attempt_id: string;
350
+ result: null;
351
+ action_type: "UNLOCK_DOOR";
352
+ } | {
353
+ error: null;
354
+ status: "success";
355
+ action_attempt_id: string;
356
+ result: {};
357
+ action_type: "UNLOCK_DOOR";
358
+ } | {
359
+ error: {
360
+ type: string;
361
+ message: string;
362
+ };
363
+ status: "error";
364
+ action_attempt_id: string;
365
+ result: null;
366
+ action_type: "UNLOCK_DOOR";
367
+ } | {
368
+ error: null;
369
+ status: "pending";
370
+ action_attempt_id: string;
371
+ result: null;
372
+ action_type: "RESET_SANDBOX_WORKSPACE";
373
+ } | {
374
+ error: null;
375
+ status: "success";
376
+ action_attempt_id: string;
377
+ result: {};
378
+ action_type: "RESET_SANDBOX_WORKSPACE";
379
+ } | {
380
+ error: {
381
+ type: string;
382
+ message: string;
383
+ };
384
+ status: "error";
385
+ action_attempt_id: string;
386
+ result: null;
387
+ action_type: "RESET_SANDBOX_WORKSPACE";
388
+ } | {
389
+ error: null;
390
+ status: "pending";
391
+ action_attempt_id: string;
392
+ result: null;
393
+ action_type: "SET_COOL";
394
+ } | {
395
+ error: null;
396
+ status: "success";
397
+ action_attempt_id: string;
398
+ result: {};
399
+ action_type: "SET_COOL";
400
+ } | {
401
+ error: {
402
+ type: string;
403
+ message: string;
404
+ };
405
+ status: "error";
406
+ action_attempt_id: string;
407
+ result: null;
408
+ action_type: "SET_COOL";
409
+ } | {
410
+ error: null;
411
+ status: "pending";
412
+ action_attempt_id: string;
413
+ result: null;
414
+ action_type: "SET_HEAT";
415
+ } | {
416
+ error: null;
417
+ status: "success";
418
+ action_attempt_id: string;
419
+ result: {};
420
+ action_type: "SET_HEAT";
421
+ } | {
422
+ error: {
423
+ type: string;
424
+ message: string;
425
+ };
426
+ status: "error";
427
+ action_attempt_id: string;
428
+ result: null;
429
+ action_type: "SET_HEAT";
430
+ } | {
431
+ error: null;
432
+ status: "pending";
433
+ action_attempt_id: string;
434
+ result: null;
435
+ action_type: "SET_HEAT_COOL";
436
+ } | {
437
+ error: null;
438
+ status: "success";
439
+ action_attempt_id: string;
440
+ result: {};
441
+ action_type: "SET_HEAT_COOL";
442
+ } | {
443
+ error: {
444
+ type: string;
445
+ message: string;
446
+ };
447
+ status: "error";
448
+ action_attempt_id: string;
449
+ result: null;
450
+ action_type: "SET_HEAT_COOL";
451
+ } | {
452
+ error: null;
453
+ status: "pending";
454
+ action_attempt_id: string;
455
+ result: null;
456
+ action_type: "SET_FAN_MODE";
457
+ } | {
458
+ error: null;
459
+ status: "success";
460
+ action_attempt_id: string;
461
+ result: {};
462
+ action_type: "SET_FAN_MODE";
463
+ } | {
464
+ error: {
465
+ type: string;
466
+ message: string;
467
+ };
468
+ status: "error";
469
+ action_attempt_id: string;
470
+ result: null;
471
+ action_type: "SET_FAN_MODE";
472
+ } | {
473
+ error: null;
474
+ status: "pending";
475
+ action_attempt_id: string;
476
+ result: null;
477
+ action_type: "SET_THERMOSTAT_OFF";
478
+ } | {
479
+ error: null;
480
+ status: "success";
481
+ action_attempt_id: string;
482
+ result: {};
483
+ action_type: "SET_THERMOSTAT_OFF";
484
+ } | {
485
+ error: {
486
+ type: string;
487
+ message: string;
488
+ };
489
+ status: "error";
490
+ action_attempt_id: string;
491
+ result: null;
492
+ action_type: "SET_THERMOSTAT_OFF";
493
+ } | {
494
+ error: null;
495
+ status: "pending";
496
+ action_attempt_id: string;
497
+ result: null;
498
+ action_type: "SYNC_ACCESS_CODES";
499
+ } | {
500
+ error: null;
501
+ status: "success";
502
+ action_attempt_id: string;
503
+ action_type: "SYNC_ACCESS_CODES";
504
+ result?: any;
505
+ } | {
506
+ error: {
507
+ type: string;
508
+ message: string;
509
+ };
510
+ status: "error";
511
+ action_attempt_id: string;
512
+ result: null;
513
+ action_type: "SYNC_ACCESS_CODES";
514
+ } | {
515
+ error: null;
516
+ status: "pending";
517
+ action_attempt_id: string;
518
+ result: null;
519
+ action_type: "CREATE_ACCESS_CODE";
520
+ } | {
521
+ error: null;
522
+ status: "success";
523
+ action_attempt_id: string;
524
+ action_type: "CREATE_ACCESS_CODE";
525
+ result?: any;
526
+ } | {
527
+ error: {
528
+ type: string;
529
+ message: string;
530
+ };
531
+ status: "error";
532
+ action_attempt_id: string;
533
+ result: null;
534
+ action_type: "CREATE_ACCESS_CODE";
535
+ } | {
536
+ error: null;
537
+ status: "pending";
538
+ action_attempt_id: string;
539
+ result: null;
540
+ action_type: "DELETE_ACCESS_CODE";
541
+ } | {
542
+ error: null;
543
+ status: "success";
544
+ action_attempt_id: string;
545
+ action_type: "DELETE_ACCESS_CODE";
546
+ result?: any;
547
+ } | {
548
+ error: {
549
+ type: string;
550
+ message: string;
551
+ };
552
+ status: "error";
553
+ action_attempt_id: string;
554
+ result: null;
555
+ action_type: "DELETE_ACCESS_CODE";
556
+ } | {
557
+ error: null;
558
+ status: "pending";
559
+ action_attempt_id: string;
560
+ result: null;
561
+ action_type: "UPDATE_ACCESS_CODE";
562
+ } | {
563
+ error: null;
564
+ status: "success";
565
+ action_attempt_id: string;
566
+ action_type: "UPDATE_ACCESS_CODE";
567
+ result?: any;
568
+ } | {
569
+ error: {
570
+ type: string;
571
+ message: string;
572
+ };
573
+ status: "error";
574
+ action_attempt_id: string;
575
+ result: null;
576
+ action_type: "UPDATE_ACCESS_CODE";
577
+ } | {
578
+ error: null;
579
+ status: "pending";
580
+ action_attempt_id: string;
581
+ result: null;
582
+ action_type: "CREATE_NOISE_THRESHOLD";
583
+ } | {
584
+ error: null;
585
+ status: "success";
586
+ action_attempt_id: string;
587
+ action_type: "CREATE_NOISE_THRESHOLD";
588
+ result?: any;
589
+ } | {
590
+ error: {
591
+ type: string;
592
+ message: string;
593
+ };
594
+ status: "error";
595
+ action_attempt_id: string;
596
+ result: null;
597
+ action_type: "CREATE_NOISE_THRESHOLD";
598
+ } | {
599
+ error: null;
600
+ status: "pending";
601
+ action_attempt_id: string;
602
+ result: null;
603
+ action_type: "DELETE_NOISE_THRESHOLD";
604
+ } | {
605
+ error: null;
606
+ status: "success";
607
+ action_attempt_id: string;
608
+ action_type: "DELETE_NOISE_THRESHOLD";
609
+ result?: any;
610
+ } | {
611
+ error: {
612
+ type: string;
613
+ message: string;
614
+ };
615
+ status: "error";
616
+ action_attempt_id: string;
617
+ result: null;
618
+ action_type: "DELETE_NOISE_THRESHOLD";
619
+ } | {
620
+ error: null;
621
+ status: "pending";
622
+ action_attempt_id: string;
623
+ result: null;
624
+ action_type: "UPDATE_NOISE_THRESHOLD";
625
+ } | {
626
+ error: null;
627
+ status: "success";
628
+ action_attempt_id: string;
629
+ action_type: "UPDATE_NOISE_THRESHOLD";
630
+ result?: any;
631
+ } | {
632
+ error: {
633
+ type: string;
634
+ message: string;
635
+ };
636
+ status: "error";
637
+ action_attempt_id: string;
638
+ result: null;
639
+ action_type: "UPDATE_NOISE_THRESHOLD";
640
+ }>(error: unknown) => error is SeamActionAttemptError<T>;
9
641
  export declare class SeamActionAttemptError<T extends ActionAttempt> extends Error {
10
642
  actionAttempt: T;
11
643
  constructor(message: string, actionAttempt: T);
12
644
  }
13
- export declare const isSeamActionAttemptFailedError: <T extends ActionAttempt>(error: unknown) => error is SeamActionAttemptFailedError<T>;
645
+ export declare const isSeamActionAttemptFailedError: <T extends {
646
+ error: null;
647
+ status: "pending";
648
+ action_attempt_id: string;
649
+ result: null;
650
+ action_type: "LOCK_DOOR";
651
+ } | {
652
+ error: null;
653
+ status: "success";
654
+ action_attempt_id: string;
655
+ result: {};
656
+ action_type: "LOCK_DOOR";
657
+ } | {
658
+ error: {
659
+ type: string;
660
+ message: string;
661
+ };
662
+ status: "error";
663
+ action_attempt_id: string;
664
+ result: null;
665
+ action_type: "LOCK_DOOR";
666
+ } | {
667
+ error: null;
668
+ status: "pending";
669
+ action_attempt_id: string;
670
+ result: null;
671
+ action_type: "UNLOCK_DOOR";
672
+ } | {
673
+ error: null;
674
+ status: "success";
675
+ action_attempt_id: string;
676
+ result: {};
677
+ action_type: "UNLOCK_DOOR";
678
+ } | {
679
+ error: {
680
+ type: string;
681
+ message: string;
682
+ };
683
+ status: "error";
684
+ action_attempt_id: string;
685
+ result: null;
686
+ action_type: "UNLOCK_DOOR";
687
+ } | {
688
+ error: null;
689
+ status: "pending";
690
+ action_attempt_id: string;
691
+ result: null;
692
+ action_type: "RESET_SANDBOX_WORKSPACE";
693
+ } | {
694
+ error: null;
695
+ status: "success";
696
+ action_attempt_id: string;
697
+ result: {};
698
+ action_type: "RESET_SANDBOX_WORKSPACE";
699
+ } | {
700
+ error: {
701
+ type: string;
702
+ message: string;
703
+ };
704
+ status: "error";
705
+ action_attempt_id: string;
706
+ result: null;
707
+ action_type: "RESET_SANDBOX_WORKSPACE";
708
+ } | {
709
+ error: null;
710
+ status: "pending";
711
+ action_attempt_id: string;
712
+ result: null;
713
+ action_type: "SET_COOL";
714
+ } | {
715
+ error: null;
716
+ status: "success";
717
+ action_attempt_id: string;
718
+ result: {};
719
+ action_type: "SET_COOL";
720
+ } | {
721
+ error: {
722
+ type: string;
723
+ message: string;
724
+ };
725
+ status: "error";
726
+ action_attempt_id: string;
727
+ result: null;
728
+ action_type: "SET_COOL";
729
+ } | {
730
+ error: null;
731
+ status: "pending";
732
+ action_attempt_id: string;
733
+ result: null;
734
+ action_type: "SET_HEAT";
735
+ } | {
736
+ error: null;
737
+ status: "success";
738
+ action_attempt_id: string;
739
+ result: {};
740
+ action_type: "SET_HEAT";
741
+ } | {
742
+ error: {
743
+ type: string;
744
+ message: string;
745
+ };
746
+ status: "error";
747
+ action_attempt_id: string;
748
+ result: null;
749
+ action_type: "SET_HEAT";
750
+ } | {
751
+ error: null;
752
+ status: "pending";
753
+ action_attempt_id: string;
754
+ result: null;
755
+ action_type: "SET_HEAT_COOL";
756
+ } | {
757
+ error: null;
758
+ status: "success";
759
+ action_attempt_id: string;
760
+ result: {};
761
+ action_type: "SET_HEAT_COOL";
762
+ } | {
763
+ error: {
764
+ type: string;
765
+ message: string;
766
+ };
767
+ status: "error";
768
+ action_attempt_id: string;
769
+ result: null;
770
+ action_type: "SET_HEAT_COOL";
771
+ } | {
772
+ error: null;
773
+ status: "pending";
774
+ action_attempt_id: string;
775
+ result: null;
776
+ action_type: "SET_FAN_MODE";
777
+ } | {
778
+ error: null;
779
+ status: "success";
780
+ action_attempt_id: string;
781
+ result: {};
782
+ action_type: "SET_FAN_MODE";
783
+ } | {
784
+ error: {
785
+ type: string;
786
+ message: string;
787
+ };
788
+ status: "error";
789
+ action_attempt_id: string;
790
+ result: null;
791
+ action_type: "SET_FAN_MODE";
792
+ } | {
793
+ error: null;
794
+ status: "pending";
795
+ action_attempt_id: string;
796
+ result: null;
797
+ action_type: "SET_THERMOSTAT_OFF";
798
+ } | {
799
+ error: null;
800
+ status: "success";
801
+ action_attempt_id: string;
802
+ result: {};
803
+ action_type: "SET_THERMOSTAT_OFF";
804
+ } | {
805
+ error: {
806
+ type: string;
807
+ message: string;
808
+ };
809
+ status: "error";
810
+ action_attempt_id: string;
811
+ result: null;
812
+ action_type: "SET_THERMOSTAT_OFF";
813
+ } | {
814
+ error: null;
815
+ status: "pending";
816
+ action_attempt_id: string;
817
+ result: null;
818
+ action_type: "SYNC_ACCESS_CODES";
819
+ } | {
820
+ error: null;
821
+ status: "success";
822
+ action_attempt_id: string;
823
+ action_type: "SYNC_ACCESS_CODES";
824
+ result?: any;
825
+ } | {
826
+ error: {
827
+ type: string;
828
+ message: string;
829
+ };
830
+ status: "error";
831
+ action_attempt_id: string;
832
+ result: null;
833
+ action_type: "SYNC_ACCESS_CODES";
834
+ } | {
835
+ error: null;
836
+ status: "pending";
837
+ action_attempt_id: string;
838
+ result: null;
839
+ action_type: "CREATE_ACCESS_CODE";
840
+ } | {
841
+ error: null;
842
+ status: "success";
843
+ action_attempt_id: string;
844
+ action_type: "CREATE_ACCESS_CODE";
845
+ result?: any;
846
+ } | {
847
+ error: {
848
+ type: string;
849
+ message: string;
850
+ };
851
+ status: "error";
852
+ action_attempt_id: string;
853
+ result: null;
854
+ action_type: "CREATE_ACCESS_CODE";
855
+ } | {
856
+ error: null;
857
+ status: "pending";
858
+ action_attempt_id: string;
859
+ result: null;
860
+ action_type: "DELETE_ACCESS_CODE";
861
+ } | {
862
+ error: null;
863
+ status: "success";
864
+ action_attempt_id: string;
865
+ action_type: "DELETE_ACCESS_CODE";
866
+ result?: any;
867
+ } | {
868
+ error: {
869
+ type: string;
870
+ message: string;
871
+ };
872
+ status: "error";
873
+ action_attempt_id: string;
874
+ result: null;
875
+ action_type: "DELETE_ACCESS_CODE";
876
+ } | {
877
+ error: null;
878
+ status: "pending";
879
+ action_attempt_id: string;
880
+ result: null;
881
+ action_type: "UPDATE_ACCESS_CODE";
882
+ } | {
883
+ error: null;
884
+ status: "success";
885
+ action_attempt_id: string;
886
+ action_type: "UPDATE_ACCESS_CODE";
887
+ result?: any;
888
+ } | {
889
+ error: {
890
+ type: string;
891
+ message: string;
892
+ };
893
+ status: "error";
894
+ action_attempt_id: string;
895
+ result: null;
896
+ action_type: "UPDATE_ACCESS_CODE";
897
+ } | {
898
+ error: null;
899
+ status: "pending";
900
+ action_attempt_id: string;
901
+ result: null;
902
+ action_type: "CREATE_NOISE_THRESHOLD";
903
+ } | {
904
+ error: null;
905
+ status: "success";
906
+ action_attempt_id: string;
907
+ action_type: "CREATE_NOISE_THRESHOLD";
908
+ result?: any;
909
+ } | {
910
+ error: {
911
+ type: string;
912
+ message: string;
913
+ };
914
+ status: "error";
915
+ action_attempt_id: string;
916
+ result: null;
917
+ action_type: "CREATE_NOISE_THRESHOLD";
918
+ } | {
919
+ error: null;
920
+ status: "pending";
921
+ action_attempt_id: string;
922
+ result: null;
923
+ action_type: "DELETE_NOISE_THRESHOLD";
924
+ } | {
925
+ error: null;
926
+ status: "success";
927
+ action_attempt_id: string;
928
+ action_type: "DELETE_NOISE_THRESHOLD";
929
+ result?: any;
930
+ } | {
931
+ error: {
932
+ type: string;
933
+ message: string;
934
+ };
935
+ status: "error";
936
+ action_attempt_id: string;
937
+ result: null;
938
+ action_type: "DELETE_NOISE_THRESHOLD";
939
+ } | {
940
+ error: null;
941
+ status: "pending";
942
+ action_attempt_id: string;
943
+ result: null;
944
+ action_type: "UPDATE_NOISE_THRESHOLD";
945
+ } | {
946
+ error: null;
947
+ status: "success";
948
+ action_attempt_id: string;
949
+ action_type: "UPDATE_NOISE_THRESHOLD";
950
+ result?: any;
951
+ } | {
952
+ error: {
953
+ type: string;
954
+ message: string;
955
+ };
956
+ status: "error";
957
+ action_attempt_id: string;
958
+ result: null;
959
+ action_type: "UPDATE_NOISE_THRESHOLD";
960
+ }>(error: unknown) => error is SeamActionAttemptFailedError<T>;
14
961
  export declare class SeamActionAttemptFailedError<T extends ActionAttempt> extends SeamActionAttemptError<T> {
15
962
  code: string;
16
963
  constructor(actionAttempt: FailedActionAttempt<T>);
17
964
  }
18
- export declare const isSeamActionAttemptTimeoutError: <T extends ActionAttempt>(error: unknown) => error is SeamActionAttemptTimeoutError<T>;
965
+ export declare const isSeamActionAttemptTimeoutError: <T extends {
966
+ error: null;
967
+ status: "pending";
968
+ action_attempt_id: string;
969
+ result: null;
970
+ action_type: "LOCK_DOOR";
971
+ } | {
972
+ error: null;
973
+ status: "success";
974
+ action_attempt_id: string;
975
+ result: {};
976
+ action_type: "LOCK_DOOR";
977
+ } | {
978
+ error: {
979
+ type: string;
980
+ message: string;
981
+ };
982
+ status: "error";
983
+ action_attempt_id: string;
984
+ result: null;
985
+ action_type: "LOCK_DOOR";
986
+ } | {
987
+ error: null;
988
+ status: "pending";
989
+ action_attempt_id: string;
990
+ result: null;
991
+ action_type: "UNLOCK_DOOR";
992
+ } | {
993
+ error: null;
994
+ status: "success";
995
+ action_attempt_id: string;
996
+ result: {};
997
+ action_type: "UNLOCK_DOOR";
998
+ } | {
999
+ error: {
1000
+ type: string;
1001
+ message: string;
1002
+ };
1003
+ status: "error";
1004
+ action_attempt_id: string;
1005
+ result: null;
1006
+ action_type: "UNLOCK_DOOR";
1007
+ } | {
1008
+ error: null;
1009
+ status: "pending";
1010
+ action_attempt_id: string;
1011
+ result: null;
1012
+ action_type: "RESET_SANDBOX_WORKSPACE";
1013
+ } | {
1014
+ error: null;
1015
+ status: "success";
1016
+ action_attempt_id: string;
1017
+ result: {};
1018
+ action_type: "RESET_SANDBOX_WORKSPACE";
1019
+ } | {
1020
+ error: {
1021
+ type: string;
1022
+ message: string;
1023
+ };
1024
+ status: "error";
1025
+ action_attempt_id: string;
1026
+ result: null;
1027
+ action_type: "RESET_SANDBOX_WORKSPACE";
1028
+ } | {
1029
+ error: null;
1030
+ status: "pending";
1031
+ action_attempt_id: string;
1032
+ result: null;
1033
+ action_type: "SET_COOL";
1034
+ } | {
1035
+ error: null;
1036
+ status: "success";
1037
+ action_attempt_id: string;
1038
+ result: {};
1039
+ action_type: "SET_COOL";
1040
+ } | {
1041
+ error: {
1042
+ type: string;
1043
+ message: string;
1044
+ };
1045
+ status: "error";
1046
+ action_attempt_id: string;
1047
+ result: null;
1048
+ action_type: "SET_COOL";
1049
+ } | {
1050
+ error: null;
1051
+ status: "pending";
1052
+ action_attempt_id: string;
1053
+ result: null;
1054
+ action_type: "SET_HEAT";
1055
+ } | {
1056
+ error: null;
1057
+ status: "success";
1058
+ action_attempt_id: string;
1059
+ result: {};
1060
+ action_type: "SET_HEAT";
1061
+ } | {
1062
+ error: {
1063
+ type: string;
1064
+ message: string;
1065
+ };
1066
+ status: "error";
1067
+ action_attempt_id: string;
1068
+ result: null;
1069
+ action_type: "SET_HEAT";
1070
+ } | {
1071
+ error: null;
1072
+ status: "pending";
1073
+ action_attempt_id: string;
1074
+ result: null;
1075
+ action_type: "SET_HEAT_COOL";
1076
+ } | {
1077
+ error: null;
1078
+ status: "success";
1079
+ action_attempt_id: string;
1080
+ result: {};
1081
+ action_type: "SET_HEAT_COOL";
1082
+ } | {
1083
+ error: {
1084
+ type: string;
1085
+ message: string;
1086
+ };
1087
+ status: "error";
1088
+ action_attempt_id: string;
1089
+ result: null;
1090
+ action_type: "SET_HEAT_COOL";
1091
+ } | {
1092
+ error: null;
1093
+ status: "pending";
1094
+ action_attempt_id: string;
1095
+ result: null;
1096
+ action_type: "SET_FAN_MODE";
1097
+ } | {
1098
+ error: null;
1099
+ status: "success";
1100
+ action_attempt_id: string;
1101
+ result: {};
1102
+ action_type: "SET_FAN_MODE";
1103
+ } | {
1104
+ error: {
1105
+ type: string;
1106
+ message: string;
1107
+ };
1108
+ status: "error";
1109
+ action_attempt_id: string;
1110
+ result: null;
1111
+ action_type: "SET_FAN_MODE";
1112
+ } | {
1113
+ error: null;
1114
+ status: "pending";
1115
+ action_attempt_id: string;
1116
+ result: null;
1117
+ action_type: "SET_THERMOSTAT_OFF";
1118
+ } | {
1119
+ error: null;
1120
+ status: "success";
1121
+ action_attempt_id: string;
1122
+ result: {};
1123
+ action_type: "SET_THERMOSTAT_OFF";
1124
+ } | {
1125
+ error: {
1126
+ type: string;
1127
+ message: string;
1128
+ };
1129
+ status: "error";
1130
+ action_attempt_id: string;
1131
+ result: null;
1132
+ action_type: "SET_THERMOSTAT_OFF";
1133
+ } | {
1134
+ error: null;
1135
+ status: "pending";
1136
+ action_attempt_id: string;
1137
+ result: null;
1138
+ action_type: "SYNC_ACCESS_CODES";
1139
+ } | {
1140
+ error: null;
1141
+ status: "success";
1142
+ action_attempt_id: string;
1143
+ action_type: "SYNC_ACCESS_CODES";
1144
+ result?: any;
1145
+ } | {
1146
+ error: {
1147
+ type: string;
1148
+ message: string;
1149
+ };
1150
+ status: "error";
1151
+ action_attempt_id: string;
1152
+ result: null;
1153
+ action_type: "SYNC_ACCESS_CODES";
1154
+ } | {
1155
+ error: null;
1156
+ status: "pending";
1157
+ action_attempt_id: string;
1158
+ result: null;
1159
+ action_type: "CREATE_ACCESS_CODE";
1160
+ } | {
1161
+ error: null;
1162
+ status: "success";
1163
+ action_attempt_id: string;
1164
+ action_type: "CREATE_ACCESS_CODE";
1165
+ result?: any;
1166
+ } | {
1167
+ error: {
1168
+ type: string;
1169
+ message: string;
1170
+ };
1171
+ status: "error";
1172
+ action_attempt_id: string;
1173
+ result: null;
1174
+ action_type: "CREATE_ACCESS_CODE";
1175
+ } | {
1176
+ error: null;
1177
+ status: "pending";
1178
+ action_attempt_id: string;
1179
+ result: null;
1180
+ action_type: "DELETE_ACCESS_CODE";
1181
+ } | {
1182
+ error: null;
1183
+ status: "success";
1184
+ action_attempt_id: string;
1185
+ action_type: "DELETE_ACCESS_CODE";
1186
+ result?: any;
1187
+ } | {
1188
+ error: {
1189
+ type: string;
1190
+ message: string;
1191
+ };
1192
+ status: "error";
1193
+ action_attempt_id: string;
1194
+ result: null;
1195
+ action_type: "DELETE_ACCESS_CODE";
1196
+ } | {
1197
+ error: null;
1198
+ status: "pending";
1199
+ action_attempt_id: string;
1200
+ result: null;
1201
+ action_type: "UPDATE_ACCESS_CODE";
1202
+ } | {
1203
+ error: null;
1204
+ status: "success";
1205
+ action_attempt_id: string;
1206
+ action_type: "UPDATE_ACCESS_CODE";
1207
+ result?: any;
1208
+ } | {
1209
+ error: {
1210
+ type: string;
1211
+ message: string;
1212
+ };
1213
+ status: "error";
1214
+ action_attempt_id: string;
1215
+ result: null;
1216
+ action_type: "UPDATE_ACCESS_CODE";
1217
+ } | {
1218
+ error: null;
1219
+ status: "pending";
1220
+ action_attempt_id: string;
1221
+ result: null;
1222
+ action_type: "CREATE_NOISE_THRESHOLD";
1223
+ } | {
1224
+ error: null;
1225
+ status: "success";
1226
+ action_attempt_id: string;
1227
+ action_type: "CREATE_NOISE_THRESHOLD";
1228
+ result?: any;
1229
+ } | {
1230
+ error: {
1231
+ type: string;
1232
+ message: string;
1233
+ };
1234
+ status: "error";
1235
+ action_attempt_id: string;
1236
+ result: null;
1237
+ action_type: "CREATE_NOISE_THRESHOLD";
1238
+ } | {
1239
+ error: null;
1240
+ status: "pending";
1241
+ action_attempt_id: string;
1242
+ result: null;
1243
+ action_type: "DELETE_NOISE_THRESHOLD";
1244
+ } | {
1245
+ error: null;
1246
+ status: "success";
1247
+ action_attempt_id: string;
1248
+ action_type: "DELETE_NOISE_THRESHOLD";
1249
+ result?: any;
1250
+ } | {
1251
+ error: {
1252
+ type: string;
1253
+ message: string;
1254
+ };
1255
+ status: "error";
1256
+ action_attempt_id: string;
1257
+ result: null;
1258
+ action_type: "DELETE_NOISE_THRESHOLD";
1259
+ } | {
1260
+ error: null;
1261
+ status: "pending";
1262
+ action_attempt_id: string;
1263
+ result: null;
1264
+ action_type: "UPDATE_NOISE_THRESHOLD";
1265
+ } | {
1266
+ error: null;
1267
+ status: "success";
1268
+ action_attempt_id: string;
1269
+ action_type: "UPDATE_NOISE_THRESHOLD";
1270
+ result?: any;
1271
+ } | {
1272
+ error: {
1273
+ type: string;
1274
+ message: string;
1275
+ };
1276
+ status: "error";
1277
+ action_attempt_id: string;
1278
+ result: null;
1279
+ action_type: "UPDATE_NOISE_THRESHOLD";
1280
+ }>(error: unknown) => error is SeamActionAttemptTimeoutError<T>;
19
1281
  export declare class SeamActionAttemptTimeoutError<T extends ActionAttempt> extends SeamActionAttemptError<T> {
20
1282
  constructor(actionAttempt: T, timeout: number);
21
1283
  }
1284
+ export type SucceededActionAttempt<T extends ActionAttempt> = Extract<T, {
1285
+ status: 'success';
1286
+ }>;
1287
+ export type FailedActionAttempt<T extends ActionAttempt> = Extract<T, {
1288
+ status: 'error';
1289
+ }>;