@seamapi/http 2.17.0 → 2.19.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/index.d.ts +5 -0
  2. package/index.js +5 -0
  3. package/index.js.map +1 -1
  4. package/lib/client.d.ts +12 -0
  5. package/lib/client.js.map +1 -1
  6. package/lib/index.d.ts +1 -1
  7. package/lib/index.js.map +1 -1
  8. package/lib/options.d.ts +105 -0
  9. package/lib/options.js +54 -0
  10. package/lib/options.js.map +1 -1
  11. package/lib/request-options.d.ts +13 -0
  12. package/lib/request-options.js +3 -0
  13. package/lib/request-options.js.map +1 -1
  14. package/lib/resolve-action-attempt.d.ts +47 -0
  15. package/lib/resolve-action-attempt.js +29 -0
  16. package/lib/resolve-action-attempt.js.map +1 -1
  17. package/lib/resources/access-code.d.ts +87 -0
  18. package/lib/resources/device.d.ts +0 -12
  19. package/lib/resources/unmanaged-access-code.d.ts +87 -0
  20. package/lib/routes/events/events.d.ts +2 -2
  21. package/lib/seam-http-error.d.ts +34 -0
  22. package/lib/seam-http-error.js +34 -0
  23. package/lib/seam-http-error.js.map +1 -1
  24. package/lib/seam-http-request.d.ts +31 -0
  25. package/lib/seam-http-request.js +31 -0
  26. package/lib/seam-http-request.js.map +1 -1
  27. package/lib/seam-paginator.d.ts +28 -0
  28. package/lib/seam-paginator.js +25 -0
  29. package/lib/seam-paginator.js.map +1 -1
  30. package/lib/version.d.ts +1 -1
  31. package/lib/version.js +1 -1
  32. package/package.json +3 -2
  33. package/src/index.ts +5 -0
  34. package/src/lib/client.ts +14 -0
  35. package/src/lib/index.ts +3 -0
  36. package/src/lib/options.ts +105 -0
  37. package/src/lib/request-options.ts +13 -0
  38. package/src/lib/resolve-action-attempt.ts +48 -0
  39. package/src/lib/resources/access-code.ts +100 -0
  40. package/src/lib/resources/device.ts +0 -12
  41. package/src/lib/resources/unmanaged-access-code.ts +100 -0
  42. package/src/lib/routes/events/events.ts +12 -0
  43. package/src/lib/seam-http-error.ts +38 -0
  44. package/src/lib/seam-http-request.ts +31 -0
  45. package/src/lib/seam-paginator.ts +28 -0
  46. package/src/lib/version.ts +1 -1
package/src/lib/index.ts CHANGED
@@ -3,12 +3,15 @@ export * from './error-interceptor.js'
3
3
  export * from './openapi.js'
4
4
  export * from './options.js'
5
5
  export {
6
+ type FailedActionAttempt,
6
7
  isSeamActionAttemptError,
7
8
  isSeamActionAttemptFailedError,
8
9
  isSeamActionAttemptTimeoutError,
10
+ type ResolveActionAttemptOptions,
9
11
  SeamActionAttemptError,
10
12
  SeamActionAttemptFailedError,
11
13
  SeamActionAttemptTimeoutError,
14
+ type SucceededActionAttempt,
12
15
  } from './resolve-action-attempt.js'
13
16
  export * from './resources/index.js'
14
17
  export * from './routes/index.js'
@@ -6,12 +6,19 @@ import {
6
6
 
7
7
  export type { SeamHttpRequestOptions } from './request-options.js'
8
8
 
9
+ /**
10
+ * Options for creating a SeamHttpWithoutWorkspace client,
11
+ * which is not scoped to a single workspace.
12
+ */
9
13
  export type SeamHttpWithoutWorkspaceOptions =
10
14
  | SeamHttpWithoutWorkspaceOptionsFromEnv
11
15
  | SeamHttpWithoutWorkspaceOptionsWithClient
12
16
  | SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken
13
17
  | SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken
14
18
 
19
+ /**
20
+ * Options for creating a SeamHttp client.
21
+ */
15
22
  export type SeamHttpOptions =
16
23
  | SeamHttpOptionsFromEnv
17
24
  | SeamHttpOptionsWithClient
@@ -21,28 +28,62 @@ export type SeamHttpOptions =
21
28
  | SeamHttpOptionsWithPersonalAccessToken
22
29
 
23
30
  interface SeamHttpCommonOptions extends ClientOptions, SeamHttpRequestOptions {
31
+ /**
32
+ * The Seam API endpoint, e.g., `https://connect.getseam.com`.
33
+ * Defaults to the SEAM_ENDPOINT or SEAM_API_URL environment variable, if set.
34
+ */
24
35
  endpoint?: string
25
36
  }
26
37
 
38
+ /**
39
+ * Options for creating a SeamHttp client with `SeamHttp.fromPublishableKey`.
40
+ */
27
41
  export interface SeamHttpFromPublishableKeyOptions extends SeamHttpCommonOptions {}
28
42
 
43
+ /**
44
+ * Options for creating a SeamHttp client that reads its configuration
45
+ * from the environment, e.g., the SEAM_API_KEY environment variable.
46
+ */
29
47
  export interface SeamHttpOptionsFromEnv extends SeamHttpCommonOptions {}
30
48
 
49
+ /**
50
+ * Options for creating a SeamHttpWithoutWorkspace client that reads
51
+ * its configuration from the environment,
52
+ * e.g., the SEAM_PERSONAL_ACCESS_TOKEN environment variable.
53
+ */
31
54
  export interface SeamHttpWithoutWorkspaceOptionsFromEnv extends SeamHttpCommonOptions {}
32
55
 
56
+ /**
57
+ * Options for creating a SeamHttpWithoutWorkspace client from an existing client.
58
+ */
33
59
  export interface SeamHttpWithoutWorkspaceOptionsWithClient extends SeamHttpCommonOptions {
34
60
  client: Client
35
61
  }
36
62
 
63
+ /**
64
+ * Returns true if the options include a client.
65
+ *
66
+ * @throws {@link SeamHttpInvalidOptionsError} if the client option
67
+ * is used with any other option.
68
+ */
37
69
  export const isSeamHttpWithoutWorkspaceOptionsWithClient = (
38
70
  options: SeamHttpOptions,
39
71
  ): options is SeamHttpWithoutWorkspaceOptionsWithClient =>
40
72
  isSeamHttpOptionsWithClient(options)
41
73
 
74
+ /**
75
+ * Options for creating a SeamHttp client from an existing client.
76
+ */
42
77
  export interface SeamHttpOptionsWithClient extends SeamHttpRequestOptions {
43
78
  client: Client
44
79
  }
45
80
 
81
+ /**
82
+ * Returns true if the options include a client.
83
+ *
84
+ * @throws {@link SeamHttpInvalidOptionsError} if the client option
85
+ * is used with any other option.
86
+ */
46
87
  export const isSeamHttpOptionsWithClient = (
47
88
  options: SeamHttpOptions,
48
89
  ): options is SeamHttpOptionsWithClient => {
@@ -61,10 +102,19 @@ export const isSeamHttpOptionsWithClient = (
61
102
  return true
62
103
  }
63
104
 
105
+ /**
106
+ * Options for creating a SeamHttp client authenticated with an API key.
107
+ */
64
108
  export interface SeamHttpOptionsWithApiKey extends SeamHttpCommonOptions {
65
109
  apiKey: string
66
110
  }
67
111
 
112
+ /**
113
+ * Returns true if the options include an apiKey.
114
+ *
115
+ * @throws {@link SeamHttpInvalidOptionsError} if the apiKey option
116
+ * is used with another authentication option.
117
+ */
68
118
  export const isSeamHttpOptionsWithApiKey = (
69
119
  options: SeamHttpOptions,
70
120
  ): options is SeamHttpOptionsWithApiKey => {
@@ -92,10 +142,19 @@ export const isSeamHttpOptionsWithApiKey = (
92
142
  return true
93
143
  }
94
144
 
145
+ /**
146
+ * Options for creating a SeamHttp client authenticated with a client session token.
147
+ */
95
148
  export interface SeamHttpOptionsWithClientSessionToken extends SeamHttpCommonOptions {
96
149
  clientSessionToken: string
97
150
  }
98
151
 
152
+ /**
153
+ * Returns true if the options include a clientSessionToken.
154
+ *
155
+ * @throws {@link SeamHttpInvalidOptionsError} if the clientSessionToken option
156
+ * is used with another authentication option.
157
+ */
99
158
  export const isSeamHttpOptionsWithClientSessionToken = (
100
159
  options: SeamHttpOptions,
101
160
  ): options is SeamHttpOptionsWithClientSessionToken => {
@@ -123,10 +182,20 @@ export const isSeamHttpOptionsWithClientSessionToken = (
123
182
  return true
124
183
  }
125
184
 
185
+ /**
186
+ * Options for creating a SeamHttpWithoutWorkspace client
187
+ * authenticated with a console session token.
188
+ */
126
189
  export interface SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken extends SeamHttpCommonOptions {
127
190
  consoleSessionToken: string
128
191
  }
129
192
 
193
+ /**
194
+ * Returns true if the options include a consoleSessionToken.
195
+ *
196
+ * @throws {@link SeamHttpInvalidOptionsError} if the consoleSessionToken option
197
+ * is used with another authentication option.
198
+ */
130
199
  export const isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken = (
131
200
  options: SeamHttpOptions,
132
201
  ): options is SeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken => {
@@ -154,11 +223,21 @@ export const isSeamHttpWithoutWorkspaceOptionsWithConsoleSessionToken = (
154
223
  return true
155
224
  }
156
225
 
226
+ /**
227
+ * Options for creating a SeamHttp client
228
+ * authenticated with a console session token and scoped to a workspace.
229
+ */
157
230
  export interface SeamHttpOptionsWithConsoleSessionToken extends SeamHttpCommonOptions {
158
231
  consoleSessionToken: string
159
232
  workspaceId: string
160
233
  }
161
234
 
235
+ /**
236
+ * Returns true if the options include a consoleSessionToken and a workspaceId.
237
+ *
238
+ * @throws {@link SeamHttpInvalidOptionsError} if the consoleSessionToken option
239
+ * is used with another authentication option or without the workspaceId option.
240
+ */
162
241
  export const isSeamHttpOptionsWithConsoleSessionToken = (
163
242
  options: SeamHttpOptions,
164
243
  ): options is SeamHttpOptionsWithConsoleSessionToken => {
@@ -175,10 +254,20 @@ export const isSeamHttpOptionsWithConsoleSessionToken = (
175
254
  return true
176
255
  }
177
256
 
257
+ /**
258
+ * Options for creating a SeamHttpWithoutWorkspace client
259
+ * authenticated with a personal access token.
260
+ */
178
261
  export interface SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken extends SeamHttpCommonOptions {
179
262
  personalAccessToken: string
180
263
  }
181
264
 
265
+ /**
266
+ * Returns true if the options include a personalAccessToken.
267
+ *
268
+ * @throws {@link SeamHttpInvalidOptionsError} if the personalAccessToken option
269
+ * is used with another authentication option.
270
+ */
182
271
  export const isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken = (
183
272
  options: SeamHttpOptions,
184
273
  ): options is SeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken => {
@@ -206,11 +295,21 @@ export const isSeamHttpWithoutWorkspaceOptionsWithPersonalAccessToken = (
206
295
  return true
207
296
  }
208
297
 
298
+ /**
299
+ * Options for creating a SeamHttp client
300
+ * authenticated with a personal access token and scoped to a workspace.
301
+ */
209
302
  export interface SeamHttpOptionsWithPersonalAccessToken extends SeamHttpCommonOptions {
210
303
  personalAccessToken: string
211
304
  workspaceId: string
212
305
  }
213
306
 
307
+ /**
308
+ * Returns true if the options include a personalAccessToken and a workspaceId.
309
+ *
310
+ * @throws {@link SeamHttpInvalidOptionsError} if the personalAccessToken option
311
+ * is used with another authentication option or without the workspaceId option.
312
+ */
214
313
  export const isSeamHttpOptionsWithPersonalAccessToken = (
215
314
  options: SeamHttpOptions,
216
315
  ): options is SeamHttpOptionsWithPersonalAccessToken => {
@@ -227,6 +326,9 @@ export const isSeamHttpOptionsWithPersonalAccessToken = (
227
326
  return true
228
327
  }
229
328
 
329
+ /**
330
+ * Error thrown when a SeamHttp client is created with invalid options.
331
+ */
230
332
  export class SeamHttpInvalidOptionsError extends Error {
231
333
  constructor(message: string) {
232
334
  super(`SeamHttp received invalid options: ${message}`)
@@ -234,6 +336,9 @@ export class SeamHttpInvalidOptionsError extends Error {
234
336
  }
235
337
  }
236
338
 
339
+ /**
340
+ * Error thrown when a SeamHttpWithoutWorkspace client is created with invalid options.
341
+ */
237
342
  export class SeamHttpWithoutWorkspaceInvalidOptionsError extends Error {
238
343
  constructor(message: string) {
239
344
  super(`SeamHttpWithoutWorkspace received invalid options: ${message}`)
@@ -1,9 +1,22 @@
1
1
  import type { ResolveActionAttemptOptions } from './resolve-action-attempt.js'
2
2
 
3
+ /**
4
+ * Options for how a {@link SeamHttpRequest} is executed.
5
+ */
3
6
  export interface SeamHttpRequestOptions {
7
+ /**
8
+ * Controls whether to wait for the action attempt to resolve
9
+ * when a request returns an action attempt.
10
+ * Pass a boolean to toggle waiting,
11
+ * or {@link ResolveActionAttemptOptions} to also configure
12
+ * the timeout and polling interval.
13
+ */
4
14
  waitForActionAttempt?: boolean | ResolveActionAttemptOptions
5
15
  }
6
16
 
17
+ /**
18
+ * Returns true if the key is the name of a {@link SeamHttpRequestOptions} property.
19
+ */
7
20
  export const isSeamHttpRequestOption = (
8
21
  key: string,
9
22
  ): key is keyof SeamHttpRequestOptions => {
@@ -1,14 +1,35 @@
1
1
  import type { ActionAttempt } from './resources/action-attempt.js'
2
2
 
3
+ /**
4
+ * Client used to poll action attempts by id, e.g., `SeamHttpActionAttempts`.
5
+ */
3
6
  export interface ActionAttemptsClient {
4
7
  get(parameters: { action_attempt_id: string }): PromiseLike<ActionAttempt>
5
8
  }
6
9
 
10
+ /**
11
+ * Options for waiting until an action attempt resolves.
12
+ */
7
13
  export interface ResolveActionAttemptOptions {
14
+ /**
15
+ * Maximum time in milliseconds to wait for the action attempt to resolve.
16
+ */
8
17
  timeout?: number
18
+
19
+ /**
20
+ * Time in milliseconds to wait between polls of the action attempt.
21
+ */
9
22
  pollingInterval?: number
10
23
  }
11
24
 
25
+ /**
26
+ * Polls a pending action attempt until it succeeds, fails, or times out.
27
+ *
28
+ * @returns The succeeded action attempt.
29
+ * @throws {@link SeamActionAttemptFailedError} if the action attempt fails.
30
+ * @throws {@link SeamActionAttemptTimeoutError} if the action attempt
31
+ * does not resolve within the timeout.
32
+ */
12
33
  export const resolveActionAttempt = async <T extends ActionAttempt>(
13
34
  actionAttempt: T,
14
35
  actionAttempts: ActionAttemptsClient,
@@ -59,12 +80,18 @@ const pollActionAttempt = async <T extends ActionAttempt>(
59
80
  )
60
81
  }
61
82
 
83
+ /**
84
+ * Returns true if the error is a {@link SeamActionAttemptError}.
85
+ */
62
86
  export const isSeamActionAttemptError = <T extends ActionAttempt>(
63
87
  error: unknown,
64
88
  ): error is SeamActionAttemptError<T> => {
65
89
  return error instanceof SeamActionAttemptError
66
90
  }
67
91
 
92
+ /**
93
+ * Error relating to an action attempt.
94
+ */
68
95
  export class SeamActionAttemptError<T extends ActionAttempt> extends Error {
69
96
  actionAttempt: T
70
97
 
@@ -75,15 +102,24 @@ export class SeamActionAttemptError<T extends ActionAttempt> extends Error {
75
102
  }
76
103
  }
77
104
 
105
+ /**
106
+ * Returns true if the error is a {@link SeamActionAttemptFailedError}.
107
+ */
78
108
  export const isSeamActionAttemptFailedError = <T extends ActionAttempt>(
79
109
  error: unknown,
80
110
  ): error is SeamActionAttemptFailedError<T> => {
81
111
  return error instanceof SeamActionAttemptFailedError
82
112
  }
83
113
 
114
+ /**
115
+ * Error thrown when an action attempt fails.
116
+ */
84
117
  export class SeamActionAttemptFailedError<
85
118
  T extends ActionAttempt,
86
119
  > extends SeamActionAttemptError<T> {
120
+ /**
121
+ * Error type returned by the Seam API for the failed action attempt.
122
+ */
87
123
  code: string
88
124
 
89
125
  constructor(actionAttempt: FailedActionAttempt<T>) {
@@ -93,12 +129,18 @@ export class SeamActionAttemptFailedError<
93
129
  }
94
130
  }
95
131
 
132
+ /**
133
+ * Returns true if the error is a {@link SeamActionAttemptTimeoutError}.
134
+ */
96
135
  export const isSeamActionAttemptTimeoutError = <T extends ActionAttempt>(
97
136
  error: unknown,
98
137
  ): error is SeamActionAttemptTimeoutError<T> => {
99
138
  return error instanceof SeamActionAttemptTimeoutError
100
139
  }
101
140
 
141
+ /**
142
+ * Error thrown when an action attempt does not resolve within the timeout.
143
+ */
102
144
  export class SeamActionAttemptTimeoutError<
103
145
  T extends ActionAttempt,
104
146
  > extends SeamActionAttemptError<T> {
@@ -120,10 +162,16 @@ const isFailedActionAttempt = <T extends ActionAttempt>(
120
162
  actionAttempt: T,
121
163
  ): actionAttempt is FailedActionAttempt<T> => actionAttempt.status === 'error'
122
164
 
165
+ /**
166
+ * An action attempt that has succeeded.
167
+ */
123
168
  export type SucceededActionAttempt<T extends ActionAttempt> = T & {
124
169
  status: 'success'
125
170
  }
126
171
 
172
+ /**
173
+ * An action attempt that has failed.
174
+ */
127
175
  export type FailedActionAttempt<T extends ActionAttempt> = T & {
128
176
  status: 'error'
129
177
  }
@@ -292,6 +292,72 @@ export type AccessCode = {
292
292
  */
293
293
  is_access_code_error: true
294
294
 
295
+ /**
296
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
297
+ */
298
+ message: string
299
+ } /**
300
+ * Seam was unable to issue this access code before its start time, so the recipient may be unable to unlock the device. This usually points to a problem that needs attention, such as an offline or disconnected device. Seam keeps retrying, and this error clears automatically if the access code is eventually issued.
301
+ */
302
+ | {
303
+ /**
304
+ * Date and time at which Seam created the error.
305
+ */
306
+ created_at?: string | undefined
307
+ /**
308
+ * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
309
+ */
310
+ error_code: 'failed_to_issue'
311
+
312
+ /**
313
+ * Indicates that this is an access code error.
314
+ */
315
+ is_access_code_error: true
316
+
317
+ /**
318
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
319
+ */
320
+ message: string
321
+ } /**
322
+ * Seam was unable to apply this access code's pending mutations to the device, so the code on the device does not match its requested state. Seam keeps retrying, and this error clears automatically once the mutations are applied.
323
+ */
324
+ | {
325
+ /**
326
+ * Date and time at which Seam created the error.
327
+ */
328
+ created_at?: string | undefined
329
+ /**
330
+ * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
331
+ */
332
+ error_code: 'failed_to_apply_mutations'
333
+
334
+ /**
335
+ * Indicates that this is an access code error.
336
+ */
337
+ is_access_code_error: true
338
+
339
+ /**
340
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
341
+ */
342
+ message: string
343
+ } /**
344
+ * This access code is still active on the device even though its `ends_at` has passed, so the recipient may still be able to unlock the device after their access window ended. Seam is attempting to remove it, and this error clears automatically once the access code is no longer active.
345
+ */
346
+ | {
347
+ /**
348
+ * Date and time at which Seam created the error.
349
+ */
350
+ created_at?: string | undefined
351
+ /**
352
+ * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
353
+ */
354
+ error_code: 'failed_to_expire'
355
+
356
+ /**
357
+ * Indicates that this is an access code error.
358
+ */
359
+ is_access_code_error: true
360
+
295
361
  /**
296
362
  * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
297
363
  */
@@ -1005,6 +1071,40 @@ export type AccessCode = {
1005
1071
  */
1006
1072
  warning_code: 'delay_in_removing_from_device'
1007
1073
  } /**
1074
+ * Seam has not yet issued this access code, even though its start time is approaching, so access may not be ready when the recipient arrives. Seam is still attempting to issue it, and this warning clears automatically once issuance succeeds.
1075
+ */
1076
+ | {
1077
+ /**
1078
+ * Date and time at which Seam created the warning.
1079
+ */
1080
+ created_at?: string | undefined
1081
+ /**
1082
+ * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.
1083
+ */
1084
+ message: string
1085
+
1086
+ /**
1087
+ * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.
1088
+ */
1089
+ warning_code: 'delay_in_issuing'
1090
+ } /**
1091
+ * Seam has not yet applied this access code's pending mutations to the device, so the code on the device does not yet match its requested state. Seam is still attempting to apply them, and this warning clears automatically once the mutations are applied.
1092
+ */
1093
+ | {
1094
+ /**
1095
+ * Date and time at which Seam created the warning.
1096
+ */
1097
+ created_at?: string | undefined
1098
+ /**
1099
+ * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.
1100
+ */
1101
+ message: string
1102
+
1103
+ /**
1104
+ * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.
1105
+ */
1106
+ warning_code: 'delay_in_applying_mutations'
1107
+ } /**
1008
1108
  * Third-party integration detected that may cause access codes to fail.
1009
1109
  */
1010
1110
  | {
@@ -1716,18 +1716,6 @@ export type Device = {
1716
1716
  * Set to true when the device does not support the /dual-setpoints API endpoint.
1717
1717
  */
1718
1718
  dual_setpoints_not_supported?: boolean | undefined
1719
- /**
1720
- * Enforced cooling setpoint range in Celsius for a Sensi device, derived from an OutOfRange API error.
1721
- */
1722
- enforced_cooling_setpoint_range_celsius?: Array<number> | undefined
1723
- /**
1724
- * Enforced heating setpoint range in Celsius for a Sensi device, derived from an OutOfRange API error.
1725
- */
1726
- enforced_heating_setpoint_range_celsius?: Array<number> | undefined
1727
- /**
1728
- * Legacy combined enforced setpoint range in Celsius for a Sensi device, derived from an OutOfRange API error. Read as a fallback for the per-mode ranges below; no longer written.
1729
- */
1730
- enforced_setpoint_range_celsius?: Array<number> | undefined
1731
1719
  /**
1732
1720
  * Product type for a Sensi device.
1733
1721
  */
@@ -298,6 +298,72 @@ export type UnmanagedAccessCode = {
298
298
  */
299
299
  is_access_code_error: true
300
300
 
301
+ /**
302
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
303
+ */
304
+ message: string
305
+ } /**
306
+ * Seam was unable to issue this access code before its start time, so the recipient may be unable to unlock the device. This usually points to a problem that needs attention, such as an offline or disconnected device. Seam keeps retrying, and this error clears automatically if the access code is eventually issued.
307
+ */
308
+ | {
309
+ /**
310
+ * Date and time at which Seam created the error.
311
+ */
312
+ created_at?: string | undefined
313
+ /**
314
+ * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
315
+ */
316
+ error_code: 'failed_to_issue'
317
+
318
+ /**
319
+ * Indicates that this is an access code error.
320
+ */
321
+ is_access_code_error: true
322
+
323
+ /**
324
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
325
+ */
326
+ message: string
327
+ } /**
328
+ * Seam was unable to apply this access code's pending mutations to the device, so the code on the device does not match its requested state. Seam keeps retrying, and this error clears automatically once the mutations are applied.
329
+ */
330
+ | {
331
+ /**
332
+ * Date and time at which Seam created the error.
333
+ */
334
+ created_at?: string | undefined
335
+ /**
336
+ * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
337
+ */
338
+ error_code: 'failed_to_apply_mutations'
339
+
340
+ /**
341
+ * Indicates that this is an access code error.
342
+ */
343
+ is_access_code_error: true
344
+
345
+ /**
346
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
347
+ */
348
+ message: string
349
+ } /**
350
+ * This access code is still active on the device even though its `ends_at` has passed, so the recipient may still be able to unlock the device after their access window ended. Seam is attempting to remove it, and this error clears automatically once the access code is no longer active.
351
+ */
352
+ | {
353
+ /**
354
+ * Date and time at which Seam created the error.
355
+ */
356
+ created_at?: string | undefined
357
+ /**
358
+ * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
359
+ */
360
+ error_code: 'failed_to_expire'
361
+
362
+ /**
363
+ * Indicates that this is an access code error.
364
+ */
365
+ is_access_code_error: true
366
+
301
367
  /**
302
368
  * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
303
369
  */
@@ -787,6 +853,40 @@ export type UnmanagedAccessCode = {
787
853
  */
788
854
  warning_code: 'delay_in_removing_from_device'
789
855
  } /**
856
+ * Seam has not yet issued this access code, even though its start time is approaching, so access may not be ready when the recipient arrives. Seam is still attempting to issue it, and this warning clears automatically once issuance succeeds.
857
+ */
858
+ | {
859
+ /**
860
+ * Date and time at which Seam created the warning.
861
+ */
862
+ created_at?: string | undefined
863
+ /**
864
+ * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.
865
+ */
866
+ message: string
867
+
868
+ /**
869
+ * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.
870
+ */
871
+ warning_code: 'delay_in_issuing'
872
+ } /**
873
+ * Seam has not yet applied this access code's pending mutations to the device, so the code on the device does not yet match its requested state. Seam is still attempting to apply them, and this warning clears automatically once the mutations are applied.
874
+ */
875
+ | {
876
+ /**
877
+ * Date and time at which Seam created the warning.
878
+ */
879
+ created_at?: string | undefined
880
+ /**
881
+ * Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.
882
+ */
883
+ message: string
884
+
885
+ /**
886
+ * Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.
887
+ */
888
+ warning_code: 'delay_in_applying_mutations'
889
+ } /**
790
890
  * Third-party integration detected that may cause access codes to fail.
791
891
  */
792
892
  | {
@@ -318,6 +318,12 @@ export type EventsListParameters = RequireAtLeastOne<{
318
318
  | 'access_code.removed_from_device'
319
319
  | 'access_code.delay_in_setting_on_device'
320
320
  | 'access_code.failed_to_set_on_device'
321
+ | 'access_code.issued'
322
+ | 'access_code.delay_in_issuing'
323
+ | 'access_code.failed_to_issue'
324
+ | 'access_code.delay_in_applying_mutations'
325
+ | 'access_code.failed_to_apply_mutations'
326
+ | 'access_code.failed_to_expire'
321
327
  | 'access_code.deleted'
322
328
  | 'access_code.delay_in_removing_from_device'
323
329
  | 'access_code.failed_to_remove_from_device'
@@ -433,6 +439,12 @@ export type EventsListParameters = RequireAtLeastOne<{
433
439
  | 'access_code.removed_from_device'
434
440
  | 'access_code.delay_in_setting_on_device'
435
441
  | 'access_code.failed_to_set_on_device'
442
+ | 'access_code.issued'
443
+ | 'access_code.delay_in_issuing'
444
+ | 'access_code.failed_to_issue'
445
+ | 'access_code.delay_in_applying_mutations'
446
+ | 'access_code.failed_to_apply_mutations'
447
+ | 'access_code.failed_to_expire'
436
448
  | 'access_code.deleted'
437
449
  | 'access_code.delay_in_removing_from_device'
438
450
  | 'access_code.failed_to_remove_from_device'