ring-client-api 14.1.0 → 14.3.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/api.d.ts +2 -2
- package/lib/api.js +1 -0
- package/lib/ring-camera.js +4 -0
- package/lib/ring-chime.d.ts +1 -0
- package/lib/ring-chime.js +13 -1
- package/lib/ring-intercom.d.ts +6 -6
- package/lib/ring-types.d.ts +21 -5
- package/lib/ring-types.js +1 -0
- package/lib/streaming/simple-webrtc-session.js +4 -0
- package/package.json +8 -8
package/lib/api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RefreshTokenAuth, SessionOptions } from './rest-client.ts';
|
|
2
2
|
import { RingRestClient } from './rest-client.ts';
|
|
3
3
|
import { Location } from './location.ts';
|
|
4
|
-
import type { BaseStation, BeamBridge, CameraData, ChimeData,
|
|
4
|
+
import type { BaseStation, BeamBridge, CameraData, ChimeData, IntercomHandsetData, OnvifCameraData, ProfileResponse, ThirdPartyGarageDoorOpener, UnknownDevice, UserLocation } from './ring-types.ts';
|
|
5
5
|
import type { AnyCameraData } from './ring-camera.ts';
|
|
6
6
|
import { RingCamera } from './ring-camera.ts';
|
|
7
7
|
import { Subscribed } from './subscribed.ts';
|
|
@@ -35,7 +35,7 @@ export declare class RingApi extends Subscribed {
|
|
|
35
35
|
beamBridges: BeamBridge[];
|
|
36
36
|
onvifCameras: OnvifCameraData[];
|
|
37
37
|
thirdPartyGarageDoorOpeners: ThirdPartyGarageDoorOpener[];
|
|
38
|
-
intercoms:
|
|
38
|
+
intercoms: IntercomHandsetData[];
|
|
39
39
|
unknownDevices: UnknownDevice[];
|
|
40
40
|
}>;
|
|
41
41
|
private listenForDeviceUpdates;
|
package/lib/api.js
CHANGED
package/lib/ring-camera.js
CHANGED
|
@@ -275,6 +275,10 @@ export class RingCamera extends Subscribed {
|
|
|
275
275
|
return new WebrtcConnection(response.ticket, this, options);
|
|
276
276
|
}
|
|
277
277
|
async startLiveCall(options = {}) {
|
|
278
|
+
// Check if live view is disabled by camera settings/modes
|
|
279
|
+
if (this.data.settings?.live_view_disabled === true) {
|
|
280
|
+
throw new Error(`Live view is currently disabled for ${this.name}. This camera has been disabled via mode settings in the Ring app. Enable live view for this camera in the Ring app to start streaming.`);
|
|
281
|
+
}
|
|
278
282
|
const connection = await this.createStreamingConnection(options);
|
|
279
283
|
return new StreamingSession(this, connection);
|
|
280
284
|
}
|
package/lib/ring-chime.d.ts
CHANGED
package/lib/ring-chime.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChimeModel } from "./ring-types.js";
|
|
2
|
-
import { clientApi } from "./rest-client.js";
|
|
2
|
+
import { clientApi, deviceApi } from "./rest-client.js";
|
|
3
3
|
import { BehaviorSubject, Subject } from 'rxjs';
|
|
4
4
|
const settingsWhichRequireReboot = [
|
|
5
5
|
'ding_audio_id',
|
|
@@ -107,4 +107,16 @@ export class RingChime {
|
|
|
107
107
|
});
|
|
108
108
|
return response.device_health;
|
|
109
109
|
}
|
|
110
|
+
async setNightlightEnabled(enabled) {
|
|
111
|
+
await this.restClient.request({
|
|
112
|
+
url: deviceApi(`devices/${this.id}/settings`),
|
|
113
|
+
method: 'PATCH',
|
|
114
|
+
json: {
|
|
115
|
+
night_light_settings: {
|
|
116
|
+
light_sensor_enabled: enabled,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
this.requestUpdate();
|
|
121
|
+
}
|
|
110
122
|
}
|
package/lib/ring-intercom.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IntercomHandsetData, PushNotification } from './ring-types.ts';
|
|
2
2
|
import type { RingRestClient } from './rest-client.ts';
|
|
3
3
|
import { BehaviorSubject, Subject } from 'rxjs';
|
|
4
4
|
export declare class RingIntercom {
|
|
5
5
|
id: number;
|
|
6
|
-
deviceType: "intercom_handset_audio";
|
|
7
|
-
onData: BehaviorSubject<
|
|
6
|
+
deviceType: "intercom_handset_audio" | "intercom_handset_video";
|
|
7
|
+
onData: BehaviorSubject<IntercomHandsetData>;
|
|
8
8
|
onRequestUpdate: Subject<unknown>;
|
|
9
9
|
onBatteryLevel: import("rxjs").Observable<number | null>;
|
|
10
10
|
onDing: Subject<void>;
|
|
11
11
|
onUnlocked: Subject<void>;
|
|
12
12
|
private initialData;
|
|
13
13
|
private restClient;
|
|
14
|
-
constructor(initialData:
|
|
15
|
-
updateData(update:
|
|
14
|
+
constructor(initialData: IntercomHandsetData, restClient: RingRestClient);
|
|
15
|
+
updateData(update: IntercomHandsetData): void;
|
|
16
16
|
requestUpdate(): void;
|
|
17
|
-
get data():
|
|
17
|
+
get data(): IntercomHandsetData;
|
|
18
18
|
get name(): string;
|
|
19
19
|
get isOffline(): boolean;
|
|
20
20
|
get batteryLevel(): number | null;
|
package/lib/ring-types.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ export declare const RingDeviceType: {
|
|
|
43
43
|
readonly OnvifCamera: "onvif_camera";
|
|
44
44
|
readonly ThirdPartyGarageDoorOpener: "third_party_gdo";
|
|
45
45
|
readonly IntercomHandsetAudio: "intercom_handset_audio";
|
|
46
|
+
readonly IntercomHandsetVideo: "intercom_handset_video";
|
|
46
47
|
readonly WaterValve: "valve.water";
|
|
47
48
|
readonly KiddeSmokeCoAlarm: "comp.bluejay.sensor_bluejay_wsc";
|
|
48
49
|
};
|
|
@@ -157,10 +158,18 @@ export interface RingDeviceData {
|
|
|
157
158
|
};
|
|
158
159
|
alarmStatus?: 'active';
|
|
159
160
|
co?: {
|
|
160
|
-
alarmStatus?: 'active';
|
|
161
|
+
alarmStatus?: 'active' | 'inactive';
|
|
161
162
|
};
|
|
162
163
|
smoke?: {
|
|
163
|
-
alarmStatus?: 'active';
|
|
164
|
+
alarmStatus?: 'active' | 'inactive';
|
|
165
|
+
};
|
|
166
|
+
components?: {
|
|
167
|
+
'alarm.co'?: {
|
|
168
|
+
alarmStatus?: 'active' | 'inactive';
|
|
169
|
+
};
|
|
170
|
+
'alarm.smoke'?: {
|
|
171
|
+
alarmStatus?: 'active' | 'inactive';
|
|
172
|
+
};
|
|
164
173
|
};
|
|
165
174
|
flood?: {
|
|
166
175
|
faulted?: boolean;
|
|
@@ -257,7 +266,11 @@ export interface ChimeData {
|
|
|
257
266
|
ding_audio_id: string;
|
|
258
267
|
motion_audio_user_id: string;
|
|
259
268
|
motion_audio_id: string;
|
|
269
|
+
night_light_settings?: {
|
|
270
|
+
light_sensor_enabled: boolean;
|
|
271
|
+
};
|
|
260
272
|
};
|
|
273
|
+
night_light_state?: string;
|
|
261
274
|
features: {
|
|
262
275
|
ringtones_enabled: boolean;
|
|
263
276
|
};
|
|
@@ -291,6 +304,9 @@ export interface ChimeUpdate {
|
|
|
291
304
|
ding_audio_id?: string;
|
|
292
305
|
motion_audio_user_id?: string;
|
|
293
306
|
motion_audio_id?: string;
|
|
307
|
+
night_light_settings?: {
|
|
308
|
+
light_sensor_enabled?: boolean;
|
|
309
|
+
};
|
|
294
310
|
};
|
|
295
311
|
}
|
|
296
312
|
export interface RingtoneOptions {
|
|
@@ -540,11 +556,11 @@ export interface ThirdPartyGarageDoorOpener {
|
|
|
540
556
|
ring_net_id: null;
|
|
541
557
|
is_sidewalk_gateway: boolean;
|
|
542
558
|
}
|
|
543
|
-
export interface
|
|
559
|
+
export interface IntercomHandsetData {
|
|
544
560
|
id: number;
|
|
545
561
|
description: string;
|
|
546
562
|
device_id: string;
|
|
547
|
-
kind: typeof RingDeviceType.IntercomHandsetAudio;
|
|
563
|
+
kind: typeof RingDeviceType.IntercomHandsetAudio | typeof RingDeviceType.IntercomHandsetVideo;
|
|
548
564
|
function: {
|
|
549
565
|
name: null;
|
|
550
566
|
};
|
|
@@ -906,7 +922,7 @@ export interface PushNotificationDingV2 {
|
|
|
906
922
|
device: {
|
|
907
923
|
e2ee_enabled: boolean;
|
|
908
924
|
id: number;
|
|
909
|
-
kind: RingCameraKind | typeof RingDeviceType.IntercomHandsetAudio;
|
|
925
|
+
kind: RingCameraKind | typeof RingDeviceType.IntercomHandsetAudio | typeof RingDeviceType.IntercomHandsetVideo;
|
|
910
926
|
name: string;
|
|
911
927
|
};
|
|
912
928
|
event: {
|
package/lib/ring-types.js
CHANGED
|
@@ -42,6 +42,7 @@ export const RingDeviceType = {
|
|
|
42
42
|
OnvifCamera: 'onvif_camera',
|
|
43
43
|
ThirdPartyGarageDoorOpener: 'third_party_gdo',
|
|
44
44
|
IntercomHandsetAudio: 'intercom_handset_audio',
|
|
45
|
+
IntercomHandsetVideo: 'intercom_handset_video',
|
|
45
46
|
WaterValve: 'valve.water',
|
|
46
47
|
KiddeSmokeCoAlarm: 'comp.bluejay.sensor_bluejay_wsc',
|
|
47
48
|
};
|
|
@@ -11,6 +11,10 @@ export class SimpleWebRtcSession {
|
|
|
11
11
|
this.restClient = restClient;
|
|
12
12
|
}
|
|
13
13
|
async start(sdp) {
|
|
14
|
+
// Check if live view is disabled by camera settings/modes
|
|
15
|
+
if (this.camera.data.settings?.live_view_disabled === true) {
|
|
16
|
+
throw new Error(`Live view is currently disabled for ${this.camera.name}. This camera has been disabled via mode settings in the Ring app. Enable live view for this camera in the Ring app to start streaming.`);
|
|
17
|
+
}
|
|
14
18
|
const response = await this.restClient.request({
|
|
15
19
|
method: 'POST',
|
|
16
20
|
url: liveViewUrl('start'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ring-client-api",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.3.0",
|
|
4
4
|
"description": "Unofficial API for Ring doorbells, cameras, security alarm system and smart lighting",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -24,22 +24,22 @@
|
|
|
24
24
|
"debug": "^4.4.3",
|
|
25
25
|
"json-bigint": "^1.0.0",
|
|
26
26
|
"rxjs": "^7.8.2",
|
|
27
|
-
"systeminformation": "^5.
|
|
28
|
-
"undici": "^7.
|
|
27
|
+
"systeminformation": "^5.30.7",
|
|
28
|
+
"undici": "^7.19.2",
|
|
29
29
|
"uuid": "^13.0.0",
|
|
30
|
-
"werift": "0.22.
|
|
30
|
+
"werift": "0.22.4"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/debug": "4.1.12",
|
|
34
34
|
"@types/json-bigint": "^1.0.4",
|
|
35
|
-
"@types/node": "
|
|
35
|
+
"@types/node": "25.1.0",
|
|
36
36
|
"@types/uuid": "11.0.0",
|
|
37
37
|
"@types/ws": "^8.18.1",
|
|
38
38
|
"eslint-config-shared": "*",
|
|
39
|
-
"msw": "^2.
|
|
39
|
+
"msw": "^2.12.7",
|
|
40
40
|
"tsconfig": "*",
|
|
41
|
-
"typescript": "5.9.
|
|
42
|
-
"vitest": "^
|
|
41
|
+
"typescript": "5.9.3",
|
|
42
|
+
"vitest": "^4.0.18"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": "^20 || ^22 || ^24"
|