@seamapi/http 2.34.0 → 2.36.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.
- package/lib/resources/access-code.d.ts +1 -1
- package/lib/resources/acs-system.d.ts +1 -1
- package/lib/resources/action-attempt.d.ts +63 -0
- package/lib/resources/camera-live-view-answer.d.ts +9 -0
- package/lib/resources/camera-live-view-answer.js +6 -0
- package/lib/resources/camera-live-view-answer.js.map +1 -0
- package/lib/resources/camera-live-view-session.d.ts +21 -0
- package/lib/resources/camera-live-view-session.js +6 -0
- package/lib/resources/camera-live-view-session.js.map +1 -0
- package/lib/resources/device-provider.d.ts +9 -1
- package/lib/resources/device.d.ts +27 -2
- package/lib/resources/event.d.ts +8 -0
- package/lib/resources/index.d.ts +3 -0
- package/lib/resources/media.d.ts +49 -0
- package/lib/resources/media.js +6 -0
- package/lib/resources/media.js.map +1 -0
- package/lib/resources/unmanaged-access-code.d.ts +1 -1
- package/lib/resources/unmanaged-device.d.ts +10 -2
- package/lib/routes/cameras/cameras.d.ts +19 -0
- package/lib/routes/cameras/cameras.js +89 -0
- package/lib/routes/cameras/cameras.js.map +1 -0
- package/lib/routes/cameras/index.d.ts +2 -0
- package/lib/routes/cameras/index.js +7 -0
- package/lib/routes/cameras/index.js.map +1 -0
- package/lib/routes/cameras/live-views/index.d.ts +1 -0
- package/lib/routes/cameras/live-views/index.js +6 -0
- package/lib/routes/cameras/live-views/index.js.map +1 -0
- package/lib/routes/cameras/live-views/live-views.d.ts +100 -0
- package/lib/routes/cameras/live-views/live-views.js +144 -0
- package/lib/routes/cameras/live-views/live-views.js.map +1 -0
- package/lib/routes/client-sessions/client-sessions.d.ts +2 -2
- package/lib/routes/connect-webviews/connect-webviews.d.ts +1 -1
- package/lib/routes/customers/customers.d.ts +20 -12
- package/lib/routes/devices/devices.d.ts +3 -3
- package/lib/routes/devices/unmanaged/unmanaged.d.ts +3 -3
- package/lib/routes/index.d.ts +2 -0
- package/lib/routes/index.js +2 -0
- package/lib/routes/index.js.map +1 -1
- package/lib/routes/media/index.d.ts +1 -0
- package/lib/routes/media/index.js +6 -0
- package/lib/routes/media/index.js.map +1 -0
- package/lib/routes/media/media.d.ts +41 -0
- package/lib/routes/media/media.js +102 -0
- package/lib/routes/media/media.js.map +1 -0
- package/lib/routes/seam-http-endpoints.d.ts +31 -3
- package/lib/routes/seam-http-endpoints.js +58 -0
- package/lib/routes/seam-http-endpoints.js.map +1 -1
- package/lib/routes/seam-http.d.ts +4 -0
- package/lib/routes/seam-http.js +8 -0
- package/lib/routes/seam-http.js.map +1 -1
- package/lib/routes/thermostats/thermostats.d.ts +18 -0
- package/lib/routes/thermostats/thermostats.js +20 -0
- package/lib/routes/thermostats/thermostats.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
- package/src/lib/resources/access-code.ts +1 -1
- package/src/lib/resources/acs-system.ts +1 -1
- package/src/lib/resources/action-attempt.ts +77 -0
- package/src/lib/resources/camera-live-view-answer.ts +14 -0
- package/src/lib/resources/camera-live-view-session.ts +29 -0
- package/src/lib/resources/device-provider.ts +9 -0
- package/src/lib/resources/device.ts +29 -1
- package/src/lib/resources/event.ts +8 -0
- package/src/lib/resources/index.ts +3 -0
- package/src/lib/resources/media.ts +58 -0
- package/src/lib/resources/unmanaged-access-code.ts +1 -1
- package/src/lib/resources/unmanaged-device.ts +10 -1
- package/src/lib/routes/cameras/cameras.ts +165 -0
- package/src/lib/routes/cameras/index.ts +7 -0
- package/src/lib/routes/cameras/live-views/index.ts +6 -0
- package/src/lib/routes/cameras/live-views/live-views.ts +316 -0
- package/src/lib/routes/client-sessions/client-sessions.ts +2 -2
- package/src/lib/routes/connect-webviews/connect-webviews.ts +1 -0
- package/src/lib/routes/customers/customers.ts +20 -12
- package/src/lib/routes/devices/devices.ts +3 -0
- package/src/lib/routes/devices/unmanaged/unmanaged.ts +3 -0
- package/src/lib/routes/index.ts +2 -0
- package/src/lib/routes/media/index.ts +6 -0
- package/src/lib/routes/media/media.ts +203 -0
- package/src/lib/routes/seam-http-endpoints.ts +112 -0
- package/src/lib/routes/seam-http.ts +10 -0
- package/src/lib/routes/thermostats/thermostats.ts +49 -0
- package/src/lib/version.ts +1 -1
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by codegen/smith.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
getAuthHeadersForClientSessionToken,
|
|
8
|
+
warnOnInsecureuserIdentifierKey,
|
|
9
|
+
} from 'lib/auth.js'
|
|
10
|
+
import { type Client, createClient } from 'lib/client.js'
|
|
11
|
+
import {
|
|
12
|
+
isSeamHttpOptionsWithApiKey,
|
|
13
|
+
isSeamHttpOptionsWithClient,
|
|
14
|
+
isSeamHttpOptionsWithClientSessionToken,
|
|
15
|
+
isSeamHttpOptionsWithConsoleSessionToken,
|
|
16
|
+
isSeamHttpOptionsWithPersonalAccessToken,
|
|
17
|
+
type SeamHttpFromPublishableKeyOptions,
|
|
18
|
+
SeamHttpInvalidOptionsError,
|
|
19
|
+
type SeamHttpOptions,
|
|
20
|
+
type SeamHttpOptionsWithApiKey,
|
|
21
|
+
type SeamHttpOptionsWithClient,
|
|
22
|
+
type SeamHttpOptionsWithClientSessionToken,
|
|
23
|
+
type SeamHttpOptionsWithConsoleSessionToken,
|
|
24
|
+
type SeamHttpOptionsWithPersonalAccessToken,
|
|
25
|
+
type SeamHttpRequestOptions,
|
|
26
|
+
} from 'lib/options.js'
|
|
27
|
+
import {
|
|
28
|
+
limitToSeamHttpRequestOptions,
|
|
29
|
+
parseOptions,
|
|
30
|
+
} from 'lib/parse-options.js'
|
|
31
|
+
import type { Media } from 'lib/resources/media.js'
|
|
32
|
+
import { SeamHttpClientSessions } from 'lib/routes/client-sessions/index.js'
|
|
33
|
+
import {
|
|
34
|
+
SeamHttpRequest,
|
|
35
|
+
type SeamPaginatedRequest,
|
|
36
|
+
} from 'lib/seam-http-request.js'
|
|
37
|
+
import { SeamPaginator } from 'lib/seam-paginator.js'
|
|
38
|
+
|
|
39
|
+
export class SeamHttpMedia {
|
|
40
|
+
client: Client
|
|
41
|
+
readonly defaults: Required<SeamHttpRequestOptions>
|
|
42
|
+
|
|
43
|
+
constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) {
|
|
44
|
+
const options = parseOptions(apiKeyOrOptions)
|
|
45
|
+
this.client = 'client' in options ? options.client : createClient(options)
|
|
46
|
+
this.defaults = limitToSeamHttpRequestOptions(options)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static fromClient(
|
|
50
|
+
client: SeamHttpOptionsWithClient['client'],
|
|
51
|
+
options: Omit<SeamHttpOptionsWithClient, 'client'> = {},
|
|
52
|
+
): SeamHttpMedia {
|
|
53
|
+
const constructorOptions = { ...options, client }
|
|
54
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
55
|
+
throw new SeamHttpInvalidOptionsError('Missing client')
|
|
56
|
+
}
|
|
57
|
+
return new SeamHttpMedia(constructorOptions)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static fromApiKey(
|
|
61
|
+
apiKey: SeamHttpOptionsWithApiKey['apiKey'],
|
|
62
|
+
options: Omit<SeamHttpOptionsWithApiKey, 'apiKey'> = {},
|
|
63
|
+
): SeamHttpMedia {
|
|
64
|
+
const constructorOptions = { ...options, apiKey }
|
|
65
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
66
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey')
|
|
67
|
+
}
|
|
68
|
+
return new SeamHttpMedia(constructorOptions)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static fromClientSessionToken(
|
|
72
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
73
|
+
options: Omit<
|
|
74
|
+
SeamHttpOptionsWithClientSessionToken,
|
|
75
|
+
'clientSessionToken'
|
|
76
|
+
> = {},
|
|
77
|
+
): SeamHttpMedia {
|
|
78
|
+
const constructorOptions = { ...options, clientSessionToken }
|
|
79
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
80
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken')
|
|
81
|
+
}
|
|
82
|
+
return new SeamHttpMedia(constructorOptions)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
static async fromPublishableKey(
|
|
86
|
+
publishableKey: string,
|
|
87
|
+
userIdentifierKey: string,
|
|
88
|
+
options: SeamHttpFromPublishableKeyOptions = {},
|
|
89
|
+
): Promise<SeamHttpMedia> {
|
|
90
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey)
|
|
91
|
+
const clientOptions = parseOptions({ ...options, publishableKey })
|
|
92
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
93
|
+
throw new SeamHttpInvalidOptionsError(
|
|
94
|
+
'The client option cannot be used with SeamHttpMedia.fromPublishableKey',
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
const client = createClient(clientOptions)
|
|
98
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client)
|
|
99
|
+
const { token } = await clientSessions.getOrCreate({
|
|
100
|
+
user_identifier_key: userIdentifierKey,
|
|
101
|
+
})
|
|
102
|
+
return SeamHttpMedia.fromClientSessionToken(token, options)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
static fromConsoleSessionToken(
|
|
106
|
+
consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'],
|
|
107
|
+
workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'],
|
|
108
|
+
options: Omit<
|
|
109
|
+
SeamHttpOptionsWithConsoleSessionToken,
|
|
110
|
+
'consoleSessionToken' | 'workspaceId'
|
|
111
|
+
> = {},
|
|
112
|
+
): SeamHttpMedia {
|
|
113
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId }
|
|
114
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
115
|
+
throw new SeamHttpInvalidOptionsError(
|
|
116
|
+
'Missing consoleSessionToken or workspaceId',
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
return new SeamHttpMedia(constructorOptions)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
static fromPersonalAccessToken(
|
|
123
|
+
personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'],
|
|
124
|
+
workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'],
|
|
125
|
+
options: Omit<
|
|
126
|
+
SeamHttpOptionsWithPersonalAccessToken,
|
|
127
|
+
'personalAccessToken' | 'workspaceId'
|
|
128
|
+
> = {},
|
|
129
|
+
): SeamHttpMedia {
|
|
130
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId }
|
|
131
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
132
|
+
throw new SeamHttpInvalidOptionsError(
|
|
133
|
+
'Missing personalAccessToken or workspaceId',
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
return new SeamHttpMedia(constructorOptions)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(
|
|
140
|
+
request: SeamPaginatedRequest<TResponse, TResponseKey>,
|
|
141
|
+
): SeamPaginator<TResponse, TResponseKey> {
|
|
142
|
+
return new SeamPaginator<TResponse, TResponseKey>(request)
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async updateClientSessionToken(
|
|
146
|
+
clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'],
|
|
147
|
+
): Promise<void> {
|
|
148
|
+
const { headers } = this.client.defaults
|
|
149
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
150
|
+
clientSessionToken,
|
|
151
|
+
})
|
|
152
|
+
for (const key of Object.keys(authHeaders)) {
|
|
153
|
+
if (headers[key] == null) {
|
|
154
|
+
throw new Error(
|
|
155
|
+
'Cannot update a clientSessionToken on a client created without a clientSessionToken',
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
this.client.defaults.headers = { ...headers, ...authHeaders }
|
|
160
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client)
|
|
161
|
+
await clientSessions.get()
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Returns a specified piece of media, such as a video clip or thumbnail image captured for a camera event, with a short-lived URL from which you can download it. Camera events list their media in `media_ids`. This endpoint is in beta.
|
|
166
|
+
*/
|
|
167
|
+
get(
|
|
168
|
+
parameters: MediaGetParameters,
|
|
169
|
+
options: MediaGetOptions = {},
|
|
170
|
+
): MediaGetRequest {
|
|
171
|
+
return new SeamHttpRequest(this, {
|
|
172
|
+
pathname: '/media/get',
|
|
173
|
+
method: 'GET',
|
|
174
|
+
params: parameters,
|
|
175
|
+
parameters,
|
|
176
|
+
hasRequiredParameters: true,
|
|
177
|
+
requiredParameterNames: ['media_id'],
|
|
178
|
+
atLeastOneParameterNames: [],
|
|
179
|
+
responseKey: 'media',
|
|
180
|
+
options,
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export type MediaGetParameters = {
|
|
186
|
+
/**
|
|
187
|
+
* Response format. `json` returns the media object. `redirect` responds with a `302` redirect to the media's download URL, so you can use this endpoint directly as the source of an image or video.
|
|
188
|
+
*/
|
|
189
|
+
format?: 'json' | 'redirect' | undefined
|
|
190
|
+
/**
|
|
191
|
+
* ID of the media that you want to get.
|
|
192
|
+
*/
|
|
193
|
+
media_id: string
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @deprecated Use MediaGetRequest instead.
|
|
198
|
+
*/
|
|
199
|
+
export type MediaGetResponse = { media: Media }
|
|
200
|
+
|
|
201
|
+
export type MediaGetRequest = SeamHttpRequest<MediaGetResponse, 'media'>
|
|
202
|
+
|
|
203
|
+
export interface MediaGetOptions {}
|
|
@@ -319,6 +319,18 @@ import {
|
|
|
319
319
|
type ActionAttemptsListRequest,
|
|
320
320
|
SeamHttpActionAttempts,
|
|
321
321
|
} from './action-attempts/index.js'
|
|
322
|
+
import {
|
|
323
|
+
type CamerasLiveViewsCreateOptions,
|
|
324
|
+
type CamerasLiveViewsCreateParameters,
|
|
325
|
+
type CamerasLiveViewsCreateRequest,
|
|
326
|
+
type CamerasLiveViewsOfferOptions,
|
|
327
|
+
type CamerasLiveViewsOfferParameters,
|
|
328
|
+
type CamerasLiveViewsOfferRequest,
|
|
329
|
+
type CamerasLiveViewsStopOptions,
|
|
330
|
+
type CamerasLiveViewsStopParameters,
|
|
331
|
+
type CamerasLiveViewsStopRequest,
|
|
332
|
+
SeamHttpCamerasLiveViews,
|
|
333
|
+
} from './cameras/live-views/index.js'
|
|
322
334
|
import {
|
|
323
335
|
type ClientSessionsCreateOptions,
|
|
324
336
|
type ClientSessionsCreateParameters,
|
|
@@ -493,6 +505,12 @@ import {
|
|
|
493
505
|
type LocksSimulateManualLockViaKeypadRequest,
|
|
494
506
|
SeamHttpLocksSimulate,
|
|
495
507
|
} from './locks/simulate/index.js'
|
|
508
|
+
import {
|
|
509
|
+
type MediaGetOptions,
|
|
510
|
+
type MediaGetParameters,
|
|
511
|
+
type MediaGetRequest,
|
|
512
|
+
SeamHttpMedia,
|
|
513
|
+
} from './media/index.js'
|
|
496
514
|
import {
|
|
497
515
|
type NoiseSensorsListOptions,
|
|
498
516
|
type NoiseSensorsListParameters,
|
|
@@ -597,6 +615,9 @@ import {
|
|
|
597
615
|
type ThermostatsActivateClimatePresetOptions,
|
|
598
616
|
type ThermostatsActivateClimatePresetParameters,
|
|
599
617
|
type ThermostatsActivateClimatePresetRequest,
|
|
618
|
+
type ThermostatsActivateWeeklyProgramOptions,
|
|
619
|
+
type ThermostatsActivateWeeklyProgramParameters,
|
|
620
|
+
type ThermostatsActivateWeeklyProgramRequest,
|
|
600
621
|
type ThermostatsCoolOptions,
|
|
601
622
|
type ThermostatsCoolParameters,
|
|
602
623
|
type ThermostatsCoolRequest,
|
|
@@ -2244,6 +2265,60 @@ export class SeamHttpEndpoints {
|
|
|
2244
2265
|
}
|
|
2245
2266
|
}
|
|
2246
2267
|
|
|
2268
|
+
/**
|
|
2269
|
+
* Creates a short-lived live view session for a single camera. Pass the returned session ID and token to `/cameras/live_views/offer` to start a WebRTC stream, and to `/cameras/live_views/stop` to end the session.
|
|
2270
|
+
*
|
|
2271
|
+
* Camera live view is in beta. To enable it for your workspace, contact Seam support. To check whether a camera supports live view, use `device.can_stream_live_video`.
|
|
2272
|
+
*/
|
|
2273
|
+
get '/cameras/live_views/create'(): (
|
|
2274
|
+
parameters: CamerasLiveViewsCreateParameters,
|
|
2275
|
+
options?: CamerasLiveViewsCreateOptions,
|
|
2276
|
+
) => CamerasLiveViewsCreateRequest {
|
|
2277
|
+
const { client, defaults } = this
|
|
2278
|
+
return function camerasLiveViewsCreate(
|
|
2279
|
+
...args: Parameters<SeamHttpCamerasLiveViews['create']>
|
|
2280
|
+
): ReturnType<SeamHttpCamerasLiveViews['create']> {
|
|
2281
|
+
const seam = SeamHttpCamerasLiveViews.fromClient(client, defaults)
|
|
2282
|
+
return seam.create(...args)
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
|
|
2286
|
+
/**
|
|
2287
|
+
* Exchanges a WebRTC SDP offer for an SDP answer that starts streaming video from the camera, for a live view session that you created using `/cameras/live_views/create`.
|
|
2288
|
+
*
|
|
2289
|
+
* Camera live view is in beta. To enable it for your workspace, contact Seam support.
|
|
2290
|
+
*/
|
|
2291
|
+
get '/cameras/live_views/offer'(): (
|
|
2292
|
+
parameters: CamerasLiveViewsOfferParameters,
|
|
2293
|
+
options?: CamerasLiveViewsOfferOptions,
|
|
2294
|
+
) => CamerasLiveViewsOfferRequest {
|
|
2295
|
+
const { client, defaults } = this
|
|
2296
|
+
return function camerasLiveViewsOffer(
|
|
2297
|
+
...args: Parameters<SeamHttpCamerasLiveViews['offer']>
|
|
2298
|
+
): ReturnType<SeamHttpCamerasLiveViews['offer']> {
|
|
2299
|
+
const seam = SeamHttpCamerasLiveViews.fromClient(client, defaults)
|
|
2300
|
+
return seam.offer(...args)
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
|
|
2304
|
+
/**
|
|
2305
|
+
* Stops a camera live view session that the current client session owns.
|
|
2306
|
+
*
|
|
2307
|
+
* Camera live view is in beta. To enable it for your workspace, contact Seam support.
|
|
2308
|
+
*/
|
|
2309
|
+
get '/cameras/live_views/stop'(): (
|
|
2310
|
+
parameters: CamerasLiveViewsStopParameters,
|
|
2311
|
+
options?: CamerasLiveViewsStopOptions,
|
|
2312
|
+
) => CamerasLiveViewsStopRequest {
|
|
2313
|
+
const { client, defaults } = this
|
|
2314
|
+
return function camerasLiveViewsStop(
|
|
2315
|
+
...args: Parameters<SeamHttpCamerasLiveViews['stop']>
|
|
2316
|
+
): ReturnType<SeamHttpCamerasLiveViews['stop']> {
|
|
2317
|
+
const seam = SeamHttpCamerasLiveViews.fromClient(client, defaults)
|
|
2318
|
+
return seam.stop(...args)
|
|
2319
|
+
}
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2247
2322
|
/**
|
|
2248
2323
|
* Creates a new [client session](https://www.seam.co/docs/core-concepts/authentication/client-session-tokens).
|
|
2249
2324
|
*/
|
|
@@ -3026,6 +3101,22 @@ export class SeamHttpEndpoints {
|
|
|
3026
3101
|
}
|
|
3027
3102
|
}
|
|
3028
3103
|
|
|
3104
|
+
/**
|
|
3105
|
+
* Returns a specified piece of media, such as a video clip or thumbnail image captured for a camera event, with a short-lived URL from which you can download it. Camera events list their media in `media_ids`. This endpoint is in beta.
|
|
3106
|
+
*/
|
|
3107
|
+
get '/media/get'(): (
|
|
3108
|
+
parameters: MediaGetParameters,
|
|
3109
|
+
options?: MediaGetOptions,
|
|
3110
|
+
) => MediaGetRequest {
|
|
3111
|
+
const { client, defaults } = this
|
|
3112
|
+
return function mediaGet(
|
|
3113
|
+
...args: Parameters<SeamHttpMedia['get']>
|
|
3114
|
+
): ReturnType<SeamHttpMedia['get']> {
|
|
3115
|
+
const seam = SeamHttpMedia.fromClient(client, defaults)
|
|
3116
|
+
return seam.get(...args)
|
|
3117
|
+
}
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3029
3120
|
/**
|
|
3030
3121
|
* Returns a list of all [noise sensors](https://www.seam.co/docs/capability-guides/noise-sensors).
|
|
3031
3122
|
*/
|
|
@@ -3425,6 +3516,22 @@ export class SeamHttpEndpoints {
|
|
|
3425
3516
|
}
|
|
3426
3517
|
}
|
|
3427
3518
|
|
|
3519
|
+
/**
|
|
3520
|
+
* Returns a specified [thermostat](https://www.seam.co/docs/capability-guides/thermostats) to its [weekly program](https://www.seam.co/docs/capability-guides/thermostats/creating-and-managing-thermostat-programs), the schedule that is configured on the device itself, releasing any hold that Seam has set. Seam stops managing the thermostat's climate until you [activate a climate preset](https://www.seam.co/docs/capability-guides/thermostats/configure-current-climate-settings), make a direct climate setting change, or one of the thermostat's [scheduled](https://www.seam.co/docs/capability-guides/thermostats/creating-and-managing-thermostat-schedules) presets reaches its activation time.
|
|
3521
|
+
*/
|
|
3522
|
+
get '/thermostats/activate_weekly_program'(): (
|
|
3523
|
+
parameters: ThermostatsActivateWeeklyProgramParameters,
|
|
3524
|
+
options?: ThermostatsActivateWeeklyProgramOptions,
|
|
3525
|
+
) => ThermostatsActivateWeeklyProgramRequest {
|
|
3526
|
+
const { client, defaults } = this
|
|
3527
|
+
return function thermostatsActivateWeeklyProgram(
|
|
3528
|
+
...args: Parameters<SeamHttpThermostats['activateWeeklyProgram']>
|
|
3529
|
+
): ReturnType<SeamHttpThermostats['activateWeeklyProgram']> {
|
|
3530
|
+
const seam = SeamHttpThermostats.fromClient(client, defaults)
|
|
3531
|
+
return seam.activateWeeklyProgram(...args)
|
|
3532
|
+
}
|
|
3533
|
+
}
|
|
3534
|
+
|
|
3428
3535
|
/**
|
|
3429
3536
|
* Sets a specified [thermostat](https://www.seam.co/docs/capability-guides/thermostats) to [cool mode](https://www.seam.co/docs/capability-guides/thermostats/configure-current-climate-settings).
|
|
3430
3537
|
*/
|
|
@@ -4307,6 +4414,7 @@ export type SeamHttpEndpointQueryPaths =
|
|
|
4307
4414
|
| '/instant_keys/list'
|
|
4308
4415
|
| '/locks/get'
|
|
4309
4416
|
| '/locks/list'
|
|
4417
|
+
| '/media/get'
|
|
4310
4418
|
| '/noise_sensors/list'
|
|
4311
4419
|
| '/noise_sensors/noise_thresholds/get'
|
|
4312
4420
|
| '/noise_sensors/noise_thresholds/list'
|
|
@@ -4397,6 +4505,9 @@ export type SeamHttpEndpointMutationPaths =
|
|
|
4397
4505
|
| '/acs/users/suspend'
|
|
4398
4506
|
| '/acs/users/unsuspend'
|
|
4399
4507
|
| '/acs/users/update'
|
|
4508
|
+
| '/cameras/live_views/create'
|
|
4509
|
+
| '/cameras/live_views/offer'
|
|
4510
|
+
| '/cameras/live_views/stop'
|
|
4400
4511
|
| '/client_sessions/create'
|
|
4401
4512
|
| '/client_sessions/delete'
|
|
4402
4513
|
| '/client_sessions/get_or_create'
|
|
@@ -4442,6 +4553,7 @@ export type SeamHttpEndpointMutationPaths =
|
|
|
4442
4553
|
| '/spaces/remove_devices'
|
|
4443
4554
|
| '/spaces/update'
|
|
4444
4555
|
| '/thermostats/activate_climate_preset'
|
|
4556
|
+
| '/thermostats/activate_weekly_program'
|
|
4445
4557
|
| '/thermostats/cool'
|
|
4446
4558
|
| '/thermostats/create_climate_preset'
|
|
4447
4559
|
| '/thermostats/delete_climate_preset'
|
|
@@ -36,6 +36,7 @@ import { SeamHttpAccessGrants } from './access-grants/index.js'
|
|
|
36
36
|
import { SeamHttpAccessMethods } from './access-methods/index.js'
|
|
37
37
|
import { SeamHttpAcs } from './acs/index.js'
|
|
38
38
|
import { SeamHttpActionAttempts } from './action-attempts/index.js'
|
|
39
|
+
import { SeamHttpCameras } from './cameras/index.js'
|
|
39
40
|
import { SeamHttpClientSessions } from './client-sessions/index.js'
|
|
40
41
|
import { SeamHttpConnectWebviews } from './connect-webviews/index.js'
|
|
41
42
|
import { SeamHttpConnectedAccounts } from './connected-accounts/index.js'
|
|
@@ -44,6 +45,7 @@ import { SeamHttpDevices } from './devices/index.js'
|
|
|
44
45
|
import { SeamHttpEvents } from './events/index.js'
|
|
45
46
|
import { SeamHttpInstantKeys } from './instant-keys/index.js'
|
|
46
47
|
import { SeamHttpLocks } from './locks/index.js'
|
|
48
|
+
import { SeamHttpMedia } from './media/index.js'
|
|
47
49
|
import { SeamHttpNoiseSensors } from './noise-sensors/index.js'
|
|
48
50
|
import { SeamHttpPhones } from './phones/index.js'
|
|
49
51
|
import { SeamHttpSpaces } from './spaces/index.js'
|
|
@@ -197,6 +199,10 @@ export class SeamHttp {
|
|
|
197
199
|
return SeamHttpActionAttempts.fromClient(this.client, this.defaults)
|
|
198
200
|
}
|
|
199
201
|
|
|
202
|
+
get cameras(): SeamHttpCameras {
|
|
203
|
+
return SeamHttpCameras.fromClient(this.client, this.defaults)
|
|
204
|
+
}
|
|
205
|
+
|
|
200
206
|
get clientSessions(): SeamHttpClientSessions {
|
|
201
207
|
return SeamHttpClientSessions.fromClient(this.client, this.defaults)
|
|
202
208
|
}
|
|
@@ -229,6 +235,10 @@ export class SeamHttp {
|
|
|
229
235
|
return SeamHttpLocks.fromClient(this.client, this.defaults)
|
|
230
236
|
}
|
|
231
237
|
|
|
238
|
+
get media(): SeamHttpMedia {
|
|
239
|
+
return SeamHttpMedia.fromClient(this.client, this.defaults)
|
|
240
|
+
}
|
|
241
|
+
|
|
232
242
|
get noiseSensors(): SeamHttpNoiseSensors {
|
|
233
243
|
return SeamHttpNoiseSensors.fromClient(this.client, this.defaults)
|
|
234
244
|
}
|
|
@@ -207,6 +207,31 @@ export class SeamHttpThermostats {
|
|
|
207
207
|
})
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
+
/**
|
|
211
|
+
* Returns a specified [thermostat](https://www.seam.co/docs/capability-guides/thermostats) to its [weekly program](https://www.seam.co/docs/capability-guides/thermostats/creating-and-managing-thermostat-programs), the schedule that is configured on the device itself, releasing any hold that Seam has set. Seam stops managing the thermostat's climate until you [activate a climate preset](https://www.seam.co/docs/capability-guides/thermostats/configure-current-climate-settings), make a direct climate setting change, or one of the thermostat's [scheduled](https://www.seam.co/docs/capability-guides/thermostats/creating-and-managing-thermostat-schedules) presets reaches its activation time.
|
|
212
|
+
*/
|
|
213
|
+
activateWeeklyProgram(
|
|
214
|
+
parameters: ThermostatsActivateWeeklyProgramParameters,
|
|
215
|
+
options: ThermostatsActivateWeeklyProgramOptions = {},
|
|
216
|
+
): ThermostatsActivateWeeklyProgramRequest {
|
|
217
|
+
return new SeamHttpRequest(this, {
|
|
218
|
+
pathname: '/thermostats/activate_weekly_program',
|
|
219
|
+
method: 'POST',
|
|
220
|
+
body: parameters,
|
|
221
|
+
parameters,
|
|
222
|
+
hasRequiredParameters: true,
|
|
223
|
+
requiredParameterNames: ['device_id'],
|
|
224
|
+
atLeastOneParameterNames: [],
|
|
225
|
+
responseKey: 'action_attempt',
|
|
226
|
+
options,
|
|
227
|
+
actionAttempts: () =>
|
|
228
|
+
SeamHttpActionAttempts.fromClient(this.client, {
|
|
229
|
+
...this.defaults,
|
|
230
|
+
waitForActionAttempt: false,
|
|
231
|
+
}),
|
|
232
|
+
})
|
|
233
|
+
}
|
|
234
|
+
|
|
210
235
|
/**
|
|
211
236
|
* Sets a specified [thermostat](https://www.seam.co/docs/capability-guides/thermostats) to [cool mode](https://www.seam.co/docs/capability-guides/thermostats/configure-current-climate-settings).
|
|
212
237
|
*/
|
|
@@ -532,6 +557,30 @@ export type ThermostatsActivateClimatePresetOptions = Pick<
|
|
|
532
557
|
'waitForActionAttempt'
|
|
533
558
|
>
|
|
534
559
|
|
|
560
|
+
export type ThermostatsActivateWeeklyProgramParameters = {
|
|
561
|
+
/**
|
|
562
|
+
* ID of the thermostat device that you want to return to its weekly program.
|
|
563
|
+
*/
|
|
564
|
+
device_id: string
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* @deprecated Use ThermostatsActivateWeeklyProgramRequest instead.
|
|
569
|
+
*/
|
|
570
|
+
export type ThermostatsActivateWeeklyProgramResponse = {
|
|
571
|
+
action_attempt: ActionAttempt
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
export type ThermostatsActivateWeeklyProgramRequest = SeamHttpRequest<
|
|
575
|
+
ThermostatsActivateWeeklyProgramResponse,
|
|
576
|
+
'action_attempt'
|
|
577
|
+
>
|
|
578
|
+
|
|
579
|
+
export type ThermostatsActivateWeeklyProgramOptions = Pick<
|
|
580
|
+
SeamHttpRequestOptions,
|
|
581
|
+
'waitForActionAttempt'
|
|
582
|
+
>
|
|
583
|
+
|
|
535
584
|
export type ThermostatsCoolParameters = {
|
|
536
585
|
/**
|
|
537
586
|
* [Cooling set point](https://www.seam.co/docs/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °C that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters.
|
package/src/lib/version.ts
CHANGED