@seamapi/http 2.34.0 → 2.35.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/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 +8 -0
- package/lib/resources/device.d.ts +8 -0
- package/lib/resources/event.d.ts +8 -0
- package/lib/resources/index.d.ts +3 -0
- package/lib/resources/media.d.ts +45 -0
- package/lib/resources/media.js +6 -0
- package/lib/resources/media.js.map +1 -0
- package/lib/resources/unmanaged-device.d.ts +8 -0
- 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/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/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 +8 -0
- package/src/lib/resources/device.ts +8 -0
- package/src/lib/resources/event.ts +8 -0
- package/src/lib/resources/index.ts +3 -0
- package/src/lib/resources/media.ts +54 -0
- package/src/lib/resources/unmanaged-device.ts +8 -0
- 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/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
|
@@ -1465,6 +1465,69 @@ export type ActionAttempt = {
|
|
|
1465
1465
|
*/
|
|
1466
1466
|
result: null;
|
|
1467
1467
|
status: 'error';
|
|
1468
|
+
} | {
|
|
1469
|
+
/**
|
|
1470
|
+
* ID of the action attempt.
|
|
1471
|
+
*/
|
|
1472
|
+
action_attempt_id: string;
|
|
1473
|
+
/**
|
|
1474
|
+
* Action attempt to track the status of returning a thermostat to its weekly program.
|
|
1475
|
+
*/
|
|
1476
|
+
action_type: 'ACTIVATE_WEEKLY_PROGRAM';
|
|
1477
|
+
/**
|
|
1478
|
+
* Error associated with the action.
|
|
1479
|
+
*/
|
|
1480
|
+
error: null;
|
|
1481
|
+
/**
|
|
1482
|
+
* Result of the action.
|
|
1483
|
+
*/
|
|
1484
|
+
result: {};
|
|
1485
|
+
status: 'success';
|
|
1486
|
+
} | {
|
|
1487
|
+
/**
|
|
1488
|
+
* ID of the action attempt.
|
|
1489
|
+
*/
|
|
1490
|
+
action_attempt_id: string;
|
|
1491
|
+
/**
|
|
1492
|
+
* Action attempt to track the status of returning a thermostat to its weekly program.
|
|
1493
|
+
*/
|
|
1494
|
+
action_type: 'ACTIVATE_WEEKLY_PROGRAM';
|
|
1495
|
+
/**
|
|
1496
|
+
* Error associated with the action.
|
|
1497
|
+
*/
|
|
1498
|
+
error: null;
|
|
1499
|
+
/**
|
|
1500
|
+
* Result of the action.
|
|
1501
|
+
*/
|
|
1502
|
+
result: null;
|
|
1503
|
+
status: 'pending';
|
|
1504
|
+
} | {
|
|
1505
|
+
/**
|
|
1506
|
+
* ID of the action attempt.
|
|
1507
|
+
*/
|
|
1508
|
+
action_attempt_id: string;
|
|
1509
|
+
/**
|
|
1510
|
+
* Action attempt to track the status of returning a thermostat to its weekly program.
|
|
1511
|
+
*/
|
|
1512
|
+
action_type: 'ACTIVATE_WEEKLY_PROGRAM';
|
|
1513
|
+
/**
|
|
1514
|
+
* Error associated with the action.
|
|
1515
|
+
*/
|
|
1516
|
+
error: {
|
|
1517
|
+
/**
|
|
1518
|
+
* Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
|
|
1519
|
+
*/
|
|
1520
|
+
message: string;
|
|
1521
|
+
/**
|
|
1522
|
+
* Type of the error.
|
|
1523
|
+
*/
|
|
1524
|
+
type: string;
|
|
1525
|
+
};
|
|
1526
|
+
/**
|
|
1527
|
+
* Result of the action.
|
|
1528
|
+
*/
|
|
1529
|
+
result: null;
|
|
1530
|
+
status: 'error';
|
|
1468
1531
|
} | {
|
|
1469
1532
|
/**
|
|
1470
1533
|
* ID of the action attempt.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-live-view-answer.js","sourceRoot":"","sources":["../../src/lib/resources/camera-live-view-answer.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a short-lived live view session for a single camera. Use the session ID and token to start a WebRTC stream and to stop the session.
|
|
3
|
+
*/
|
|
4
|
+
export type CameraLiveViewSession = {
|
|
5
|
+
/**
|
|
6
|
+
* ID of the camera live view session.
|
|
7
|
+
*/
|
|
8
|
+
camera_live_view_session_id: string;
|
|
9
|
+
/**
|
|
10
|
+
* ID of the camera.
|
|
11
|
+
*/
|
|
12
|
+
device_id: string;
|
|
13
|
+
/**
|
|
14
|
+
* Date and time at which the live view session expires.
|
|
15
|
+
*/
|
|
16
|
+
expires_at: string;
|
|
17
|
+
/**
|
|
18
|
+
* Token that authorizes the offer and stop requests for this session.
|
|
19
|
+
*/
|
|
20
|
+
token: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-live-view-session.js","sourceRoot":"","sources":["../../src/lib/resources/camera-live-view-session.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export type DeviceProvider = {
|
|
2
|
+
/**
|
|
3
|
+
* Indicates whether the thermostat can be returned to its weekly program, the schedule that is configured on the device itself, releasing any hold that Seam has set.
|
|
4
|
+
*/
|
|
5
|
+
can_activate_weekly_program?: boolean | undefined;
|
|
2
6
|
/**
|
|
3
7
|
* Indicates whether the lock supports configuring automatic locking.
|
|
4
8
|
*/
|
|
@@ -71,6 +75,10 @@ export type DeviceProvider = {
|
|
|
71
75
|
* Indicates whether the device supports simulating removal in a sandbox.
|
|
72
76
|
*/
|
|
73
77
|
can_simulate_removal?: boolean | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Indicates whether the camera supports streaming live video through a camera live view session.
|
|
80
|
+
*/
|
|
81
|
+
can_stream_live_video?: boolean | undefined;
|
|
74
82
|
/**
|
|
75
83
|
* Indicates whether the thermostat can be turned off.
|
|
76
84
|
*/
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Represents a [device](https://www.seam.co/docs/core-concepts/devices) that has been connected to Seam.
|
|
3
3
|
*/
|
|
4
4
|
export type Device = {
|
|
5
|
+
/**
|
|
6
|
+
* Indicates whether the thermostat can be returned to its weekly program, the schedule that is configured on the device itself, releasing any hold that Seam has set.
|
|
7
|
+
*/
|
|
8
|
+
can_activate_weekly_program?: boolean | undefined;
|
|
5
9
|
/**
|
|
6
10
|
* Indicates whether the lock supports configuring automatic locking.
|
|
7
11
|
*/
|
|
@@ -74,6 +78,10 @@ export type Device = {
|
|
|
74
78
|
* Indicates whether the device supports simulating removal in a sandbox.
|
|
75
79
|
*/
|
|
76
80
|
can_simulate_removal?: boolean | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Indicates whether the camera supports streaming live video through a camera live view session.
|
|
83
|
+
*/
|
|
84
|
+
can_stream_live_video?: boolean | undefined;
|
|
77
85
|
/**
|
|
78
86
|
* Indicates whether the thermostat can be turned off.
|
|
79
87
|
*/
|
package/lib/resources/event.d.ts
CHANGED
|
@@ -5319,6 +5319,10 @@ export type SeamEvent = {
|
|
|
5319
5319
|
* URL to a thumbnail image captured at the time of activation.
|
|
5320
5320
|
*/
|
|
5321
5321
|
image_url?: string | undefined;
|
|
5322
|
+
/**
|
|
5323
|
+
* IDs of the media, such as a video clip and a thumbnail image, captured for this activation. Use `/media/get` to retrieve each one.
|
|
5324
|
+
*/
|
|
5325
|
+
media_ids?: Array<string> | undefined;
|
|
5322
5326
|
/**
|
|
5323
5327
|
* Sub-type of motion detected, if available.
|
|
5324
5328
|
*/
|
|
@@ -5373,6 +5377,10 @@ export type SeamEvent = {
|
|
|
5373
5377
|
* URL to a thumbnail image captured at the time the doorbell was pressed.
|
|
5374
5378
|
*/
|
|
5375
5379
|
image_url?: string | undefined;
|
|
5380
|
+
/**
|
|
5381
|
+
* IDs of the media, such as a video clip and a thumbnail image, captured when the doorbell was pressed. Use `/media/get` to retrieve each one.
|
|
5382
|
+
*/
|
|
5383
|
+
media_ids?: Array<string> | undefined;
|
|
5376
5384
|
/**
|
|
5377
5385
|
* Date and time at which the event occurred.
|
|
5378
5386
|
*/
|
package/lib/resources/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export type { AcsSystem } from './acs-system.js';
|
|
|
9
9
|
export type { AcsUser } from './acs-user.js';
|
|
10
10
|
export type { ActionAttempt } from './action-attempt.js';
|
|
11
11
|
export type { Batch } from './batch.js';
|
|
12
|
+
export type { CameraLiveViewAnswer } from './camera-live-view-answer.js';
|
|
13
|
+
export type { CameraLiveViewSession } from './camera-live-view-session.js';
|
|
12
14
|
export type { ClientSession } from './client-session.js';
|
|
13
15
|
export type { ConnectWebview } from './connect-webview.js';
|
|
14
16
|
export type { ConnectedAccount } from './connected-account.js';
|
|
@@ -17,6 +19,7 @@ export type { Device } from './device.js';
|
|
|
17
19
|
export type { DeviceProvider } from './device-provider.js';
|
|
18
20
|
export type { SeamEvent } from './event.js';
|
|
19
21
|
export type { InstantKey } from './instant-key.js';
|
|
22
|
+
export type { Media } from './media.js';
|
|
20
23
|
export type { NoiseThreshold } from './noise-threshold.js';
|
|
21
24
|
export type { Phone } from './phone.js';
|
|
22
25
|
export type { Space } from './space.js';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a piece of media, such as a video clip or a thumbnail image, that a device captured for an event. Media is in beta.
|
|
3
|
+
*/
|
|
4
|
+
export type Media = {
|
|
5
|
+
/**
|
|
6
|
+
* MIME type of the media, such as `video/mp4` or `image/jpeg`.
|
|
7
|
+
*/
|
|
8
|
+
content_type: string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Date and time at which the media was created.
|
|
11
|
+
*/
|
|
12
|
+
created_at: string;
|
|
13
|
+
/**
|
|
14
|
+
* ID of the device that captured the media.
|
|
15
|
+
*/
|
|
16
|
+
device_id: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* ID of the event that the media belongs to.
|
|
19
|
+
*/
|
|
20
|
+
event_id: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Date and time at which the media stops being available. Null when Seam does not know when the media expires.
|
|
23
|
+
*/
|
|
24
|
+
expires_at: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* ID of the media.
|
|
27
|
+
*/
|
|
28
|
+
media_id: string;
|
|
29
|
+
/**
|
|
30
|
+
* Type of the media: a video clip or a still image.
|
|
31
|
+
*/
|
|
32
|
+
media_type: 'video' | 'image';
|
|
33
|
+
/**
|
|
34
|
+
* Status of the media. `pending` means that Seam is still retrieving the media. `available` means that `url` can be used to download it. `unavailable` means that no media exists for the event, and `failed` means that Seam could not retrieve it.
|
|
35
|
+
*/
|
|
36
|
+
status: 'pending' | 'available' | 'unavailable' | 'failed';
|
|
37
|
+
/**
|
|
38
|
+
* Short-lived URL from which you can download the media. Null unless `status` is `available`. The URL expires after about five minutes. Call `/media/get` again for a new URL.
|
|
39
|
+
*/
|
|
40
|
+
url: string | null;
|
|
41
|
+
/**
|
|
42
|
+
* ID of the workspace that contains the media.
|
|
43
|
+
*/
|
|
44
|
+
workspace_id: string;
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/lib/resources/media.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Represents an [unmanaged device](https://www.seam.co/docs/core-concepts/devices/managed-and-unmanaged-devices). An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any [access codes](https://www.seam.co/docs/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://www.seam.co/docs/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed).
|
|
3
3
|
*/
|
|
4
4
|
export type UnmanagedDevice = {
|
|
5
|
+
/**
|
|
6
|
+
* Indicates whether the thermostat can be returned to its weekly program, the schedule that is configured on the device itself, releasing any hold that Seam has set.
|
|
7
|
+
*/
|
|
8
|
+
can_activate_weekly_program?: boolean | undefined;
|
|
5
9
|
/**
|
|
6
10
|
* Indicates whether the lock supports configuring automatic locking.
|
|
7
11
|
*/
|
|
@@ -74,6 +78,10 @@ export type UnmanagedDevice = {
|
|
|
74
78
|
* Indicates whether the device supports simulating removal in a sandbox.
|
|
75
79
|
*/
|
|
76
80
|
can_simulate_removal?: boolean | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* Indicates whether the camera supports streaming live video through a camera live view session.
|
|
83
|
+
*/
|
|
84
|
+
can_stream_live_video?: boolean | undefined;
|
|
77
85
|
/**
|
|
78
86
|
* Indicates whether the thermostat can be turned off.
|
|
79
87
|
*/
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Client } from '../../client.js';
|
|
2
|
+
import { type SeamHttpFromPublishableKeyOptions, type SeamHttpOptions, type SeamHttpOptionsWithApiKey, type SeamHttpOptionsWithClient, type SeamHttpOptionsWithClientSessionToken, type SeamHttpOptionsWithConsoleSessionToken, type SeamHttpOptionsWithPersonalAccessToken, type SeamHttpRequestOptions } from '../../options.js';
|
|
3
|
+
import type { SeamPaginatedRequest } from '../../seam-http-request.js';
|
|
4
|
+
import { SeamPaginator } from '../../seam-paginator.js';
|
|
5
|
+
import { SeamHttpCamerasLiveViews } from './live-views/index.js';
|
|
6
|
+
export declare class SeamHttpCameras {
|
|
7
|
+
client: Client;
|
|
8
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
9
|
+
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
10
|
+
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpCameras;
|
|
11
|
+
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpCameras;
|
|
12
|
+
static fromClientSessionToken(clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], options?: Omit<SeamHttpOptionsWithClientSessionToken, 'clientSessionToken'>): SeamHttpCameras;
|
|
13
|
+
static fromPublishableKey(publishableKey: string, userIdentifierKey: string, options?: SeamHttpFromPublishableKeyOptions): Promise<SeamHttpCameras>;
|
|
14
|
+
static fromConsoleSessionToken(consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], options?: Omit<SeamHttpOptionsWithConsoleSessionToken, 'consoleSessionToken' | 'workspaceId'>): SeamHttpCameras;
|
|
15
|
+
static fromPersonalAccessToken(personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], options?: Omit<SeamHttpOptionsWithPersonalAccessToken, 'personalAccessToken' | 'workspaceId'>): SeamHttpCameras;
|
|
16
|
+
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(request: SeamPaginatedRequest<TResponse, TResponseKey>): SeamPaginator<TResponse, TResponseKey>;
|
|
17
|
+
updateClientSessionToken(clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken']): Promise<void>;
|
|
18
|
+
get liveViews(): SeamHttpCamerasLiveViews;
|
|
19
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Automatically generated by codegen/smith.ts.
|
|
3
|
+
* Do not edit this file or add other files to this directory.
|
|
4
|
+
*/
|
|
5
|
+
import { getAuthHeadersForClientSessionToken, warnOnInsecureuserIdentifierKey, } from '../../auth.js';
|
|
6
|
+
import { createClient } from '../../client.js';
|
|
7
|
+
import { isSeamHttpOptionsWithApiKey, isSeamHttpOptionsWithClient, isSeamHttpOptionsWithClientSessionToken, isSeamHttpOptionsWithConsoleSessionToken, isSeamHttpOptionsWithPersonalAccessToken, SeamHttpInvalidOptionsError, } from '../../options.js';
|
|
8
|
+
import { limitToSeamHttpRequestOptions, parseOptions, } from '../../parse-options.js';
|
|
9
|
+
import { SeamHttpClientSessions } from '../../routes/client-sessions/index.js';
|
|
10
|
+
import { SeamPaginator } from '../../seam-paginator.js';
|
|
11
|
+
import { SeamHttpCamerasLiveViews } from './live-views/index.js';
|
|
12
|
+
export class SeamHttpCameras {
|
|
13
|
+
client;
|
|
14
|
+
defaults;
|
|
15
|
+
constructor(apiKeyOrOptions = {}) {
|
|
16
|
+
const options = parseOptions(apiKeyOrOptions);
|
|
17
|
+
this.client = 'client' in options ? options.client : createClient(options);
|
|
18
|
+
this.defaults = limitToSeamHttpRequestOptions(options);
|
|
19
|
+
}
|
|
20
|
+
static fromClient(client, options = {}) {
|
|
21
|
+
const constructorOptions = { ...options, client };
|
|
22
|
+
if (!isSeamHttpOptionsWithClient(constructorOptions)) {
|
|
23
|
+
throw new SeamHttpInvalidOptionsError('Missing client');
|
|
24
|
+
}
|
|
25
|
+
return new SeamHttpCameras(constructorOptions);
|
|
26
|
+
}
|
|
27
|
+
static fromApiKey(apiKey, options = {}) {
|
|
28
|
+
const constructorOptions = { ...options, apiKey };
|
|
29
|
+
if (!isSeamHttpOptionsWithApiKey(constructorOptions)) {
|
|
30
|
+
throw new SeamHttpInvalidOptionsError('Missing apiKey');
|
|
31
|
+
}
|
|
32
|
+
return new SeamHttpCameras(constructorOptions);
|
|
33
|
+
}
|
|
34
|
+
static fromClientSessionToken(clientSessionToken, options = {}) {
|
|
35
|
+
const constructorOptions = { ...options, clientSessionToken };
|
|
36
|
+
if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) {
|
|
37
|
+
throw new SeamHttpInvalidOptionsError('Missing clientSessionToken');
|
|
38
|
+
}
|
|
39
|
+
return new SeamHttpCameras(constructorOptions);
|
|
40
|
+
}
|
|
41
|
+
static async fromPublishableKey(publishableKey, userIdentifierKey, options = {}) {
|
|
42
|
+
warnOnInsecureuserIdentifierKey(userIdentifierKey);
|
|
43
|
+
const clientOptions = parseOptions({ ...options, publishableKey });
|
|
44
|
+
if (isSeamHttpOptionsWithClient(clientOptions)) {
|
|
45
|
+
throw new SeamHttpInvalidOptionsError('The client option cannot be used with SeamHttpCameras.fromPublishableKey');
|
|
46
|
+
}
|
|
47
|
+
const client = createClient(clientOptions);
|
|
48
|
+
const clientSessions = SeamHttpClientSessions.fromClient(client);
|
|
49
|
+
const { token } = await clientSessions.getOrCreate({
|
|
50
|
+
user_identifier_key: userIdentifierKey,
|
|
51
|
+
});
|
|
52
|
+
return SeamHttpCameras.fromClientSessionToken(token, options);
|
|
53
|
+
}
|
|
54
|
+
static fromConsoleSessionToken(consoleSessionToken, workspaceId, options = {}) {
|
|
55
|
+
const constructorOptions = { ...options, consoleSessionToken, workspaceId };
|
|
56
|
+
if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) {
|
|
57
|
+
throw new SeamHttpInvalidOptionsError('Missing consoleSessionToken or workspaceId');
|
|
58
|
+
}
|
|
59
|
+
return new SeamHttpCameras(constructorOptions);
|
|
60
|
+
}
|
|
61
|
+
static fromPersonalAccessToken(personalAccessToken, workspaceId, options = {}) {
|
|
62
|
+
const constructorOptions = { ...options, personalAccessToken, workspaceId };
|
|
63
|
+
if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) {
|
|
64
|
+
throw new SeamHttpInvalidOptionsError('Missing personalAccessToken or workspaceId');
|
|
65
|
+
}
|
|
66
|
+
return new SeamHttpCameras(constructorOptions);
|
|
67
|
+
}
|
|
68
|
+
createPaginator(request) {
|
|
69
|
+
return new SeamPaginator(request);
|
|
70
|
+
}
|
|
71
|
+
async updateClientSessionToken(clientSessionToken) {
|
|
72
|
+
const { headers } = this.client.defaults;
|
|
73
|
+
const authHeaders = getAuthHeadersForClientSessionToken({
|
|
74
|
+
clientSessionToken,
|
|
75
|
+
});
|
|
76
|
+
for (const key of Object.keys(authHeaders)) {
|
|
77
|
+
if (headers[key] == null) {
|
|
78
|
+
throw new Error('Cannot update a clientSessionToken on a client created without a clientSessionToken');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
this.client.defaults.headers = { ...headers, ...authHeaders };
|
|
82
|
+
const clientSessions = SeamHttpClientSessions.fromClient(this.client);
|
|
83
|
+
await clientSessions.get();
|
|
84
|
+
}
|
|
85
|
+
get liveViews() {
|
|
86
|
+
return SeamHttpCamerasLiveViews.fromClient(this.client, this.defaults);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=cameras.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cameras.js","sourceRoot":"","sources":["../../../src/lib/routes/cameras/cameras.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,mCAAmC,EACnC,+BAA+B,GAChC,MAAM,aAAa,CAAA;AACpB,OAAO,EAAe,YAAY,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,uCAAuC,EACvC,wCAAwC,EACxC,wCAAwC,EAExC,2BAA2B,GAQ5B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,6BAA6B,EAC7B,YAAY,GACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAA;AAE5E,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAErD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAEhE,MAAM,OAAO,eAAe;IAC1B,MAAM,CAAQ;IACL,QAAQ,CAAkC;IAEnD,YAAY,kBAA4C,EAAE;QACxD,MAAM,OAAO,GAAG,YAAY,CAAC,eAAe,CAAC,CAAA;QAC7C,IAAI,CAAC,MAAM,GAAG,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC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C,wBAAwB,CAC5B,kBAA+E;QAE/E,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAA;QACxC,MAAM,WAAW,GAAG,mCAAmC,CAAC;YACtD,kBAAkB;SACnB,CAAC,CAAA;QACF,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YAC3C,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;gBACzB,MAAM,IAAI,KAAK,CACb,qFAAqF,CACtF,CAAA;YACH,CAAC;QACH,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,GAAG,EAAE,GAAG,OAAO,EAAE,GAAG,WAAW,EAAE,CAAA;QAC7D,MAAM,cAAc,GAAG,sBAAsB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACrE,MAAM,cAAc,CAAC,GAAG,EAAE,CAAA;IAC5B,CAAC;IAED,IAAI,SAAS;QACX,OAAO,wBAAwB,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;IACxE,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/lib/routes/cameras/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './live-views.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/routes/cameras/live-views/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { type Client } from '../../../client.js';
|
|
2
|
+
import { type SeamHttpFromPublishableKeyOptions, type SeamHttpOptions, type SeamHttpOptionsWithApiKey, type SeamHttpOptionsWithClient, type SeamHttpOptionsWithClientSessionToken, type SeamHttpOptionsWithConsoleSessionToken, type SeamHttpOptionsWithPersonalAccessToken, type SeamHttpRequestOptions } from '../../../options.js';
|
|
3
|
+
import type { CameraLiveViewAnswer } from '../../../resources/camera-live-view-answer.js';
|
|
4
|
+
import type { CameraLiveViewSession } from '../../../resources/camera-live-view-session.js';
|
|
5
|
+
import { SeamHttpRequest, type SeamPaginatedRequest } from '../../../seam-http-request.js';
|
|
6
|
+
import { SeamPaginator } from '../../../seam-paginator.js';
|
|
7
|
+
export declare class SeamHttpCamerasLiveViews {
|
|
8
|
+
client: Client;
|
|
9
|
+
readonly defaults: Required<SeamHttpRequestOptions>;
|
|
10
|
+
constructor(apiKeyOrOptions?: string | SeamHttpOptions);
|
|
11
|
+
static fromClient(client: SeamHttpOptionsWithClient['client'], options?: Omit<SeamHttpOptionsWithClient, 'client'>): SeamHttpCamerasLiveViews;
|
|
12
|
+
static fromApiKey(apiKey: SeamHttpOptionsWithApiKey['apiKey'], options?: Omit<SeamHttpOptionsWithApiKey, 'apiKey'>): SeamHttpCamerasLiveViews;
|
|
13
|
+
static fromClientSessionToken(clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], options?: Omit<SeamHttpOptionsWithClientSessionToken, 'clientSessionToken'>): SeamHttpCamerasLiveViews;
|
|
14
|
+
static fromPublishableKey(publishableKey: string, userIdentifierKey: string, options?: SeamHttpFromPublishableKeyOptions): Promise<SeamHttpCamerasLiveViews>;
|
|
15
|
+
static fromConsoleSessionToken(consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], options?: Omit<SeamHttpOptionsWithConsoleSessionToken, 'consoleSessionToken' | 'workspaceId'>): SeamHttpCamerasLiveViews;
|
|
16
|
+
static fromPersonalAccessToken(personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], options?: Omit<SeamHttpOptionsWithPersonalAccessToken, 'personalAccessToken' | 'workspaceId'>): SeamHttpCamerasLiveViews;
|
|
17
|
+
createPaginator<const TResponse, const TResponseKey extends keyof TResponse>(request: SeamPaginatedRequest<TResponse, TResponseKey>): SeamPaginator<TResponse, TResponseKey>;
|
|
18
|
+
updateClientSessionToken(clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken']): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* 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.
|
|
21
|
+
*
|
|
22
|
+
* 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`.
|
|
23
|
+
*/
|
|
24
|
+
create(parameters: CamerasLiveViewsCreateParameters, options?: CamerasLiveViewsCreateOptions): CamerasLiveViewsCreateRequest;
|
|
25
|
+
/**
|
|
26
|
+
* 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`.
|
|
27
|
+
*
|
|
28
|
+
* Camera live view is in beta. To enable it for your workspace, contact Seam support.
|
|
29
|
+
*/
|
|
30
|
+
offer(parameters: CamerasLiveViewsOfferParameters, options?: CamerasLiveViewsOfferOptions): CamerasLiveViewsOfferRequest;
|
|
31
|
+
/**
|
|
32
|
+
* Stops a camera live view session that the current client session owns.
|
|
33
|
+
*
|
|
34
|
+
* Camera live view is in beta. To enable it for your workspace, contact Seam support.
|
|
35
|
+
*/
|
|
36
|
+
stop(parameters: CamerasLiveViewsStopParameters, options?: CamerasLiveViewsStopOptions): CamerasLiveViewsStopRequest;
|
|
37
|
+
}
|
|
38
|
+
export type CamerasLiveViewsCreateParameters = {
|
|
39
|
+
/**
|
|
40
|
+
* ID of the camera to view.
|
|
41
|
+
*/
|
|
42
|
+
device_id: string;
|
|
43
|
+
/**
|
|
44
|
+
* Number of seconds for which the live view session is valid, up to 600.
|
|
45
|
+
*/
|
|
46
|
+
duration_seconds?: number | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Indicates whether to include the camera's audio.
|
|
49
|
+
*/
|
|
50
|
+
include_audio?: boolean | undefined;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* @deprecated Use CamerasLiveViewsCreateRequest instead.
|
|
54
|
+
*/
|
|
55
|
+
export type CamerasLiveViewsCreateResponse = {
|
|
56
|
+
camera_live_view_session: CameraLiveViewSession;
|
|
57
|
+
};
|
|
58
|
+
export type CamerasLiveViewsCreateRequest = SeamHttpRequest<CamerasLiveViewsCreateResponse, 'camera_live_view_session'>;
|
|
59
|
+
export interface CamerasLiveViewsCreateOptions {
|
|
60
|
+
}
|
|
61
|
+
export type CamerasLiveViewsOfferParameters = {
|
|
62
|
+
/**
|
|
63
|
+
* ID of the camera live view session.
|
|
64
|
+
*/
|
|
65
|
+
camera_live_view_session_id: string;
|
|
66
|
+
/**
|
|
67
|
+
* WebRTC SDP offer from the viewer, limited to 64 KiB of UTF-8 data.
|
|
68
|
+
*/
|
|
69
|
+
sdp_offer: string;
|
|
70
|
+
/**
|
|
71
|
+
* Token returned when the camera live view session was created.
|
|
72
|
+
*/
|
|
73
|
+
token: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated Use CamerasLiveViewsOfferRequest instead.
|
|
77
|
+
*/
|
|
78
|
+
export type CamerasLiveViewsOfferResponse = {
|
|
79
|
+
camera_live_view_answer: CameraLiveViewAnswer;
|
|
80
|
+
};
|
|
81
|
+
export type CamerasLiveViewsOfferRequest = SeamHttpRequest<CamerasLiveViewsOfferResponse, 'camera_live_view_answer'>;
|
|
82
|
+
export interface CamerasLiveViewsOfferOptions {
|
|
83
|
+
}
|
|
84
|
+
export type CamerasLiveViewsStopParameters = {
|
|
85
|
+
/**
|
|
86
|
+
* ID of the camera live view session.
|
|
87
|
+
*/
|
|
88
|
+
camera_live_view_session_id: string;
|
|
89
|
+
/**
|
|
90
|
+
* Token returned when the camera live view session was created.
|
|
91
|
+
*/
|
|
92
|
+
token: string;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated Use CamerasLiveViewsStopRequest instead.
|
|
96
|
+
*/
|
|
97
|
+
export type CamerasLiveViewsStopResponse = void;
|
|
98
|
+
export type CamerasLiveViewsStopRequest = SeamHttpRequest<void, undefined>;
|
|
99
|
+
export interface CamerasLiveViewsStopOptions {
|
|
100
|
+
}
|