ring-client-api 11.7.6 → 11.7.7
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.js +2 -1
- package/lib/ring-camera.js +5 -5
- package/lib/ring-types.d.ts +1 -1
- package/package.json +3 -1
package/lib/api.js
CHANGED
|
@@ -16,6 +16,7 @@ const ffmpeg_1 = require("./ffmpeg");
|
|
|
16
16
|
const subscribed_1 = require("./subscribed");
|
|
17
17
|
const push_receiver_1 = __importDefault(require("@eneris/push-receiver"));
|
|
18
18
|
const ring_intercom_1 = require("./ring-intercom");
|
|
19
|
+
const json_bigint_1 = __importDefault(require("json-bigint"));
|
|
19
20
|
class RingApi extends subscribed_1.Subscribed {
|
|
20
21
|
constructor(options) {
|
|
21
22
|
super();
|
|
@@ -162,7 +163,7 @@ class RingApi extends subscribed_1.Subscribed {
|
|
|
162
163
|
pushReceiver.onNotification(({ message }) => {
|
|
163
164
|
const dataJson = message.data?.gcmData;
|
|
164
165
|
try {
|
|
165
|
-
const notification =
|
|
166
|
+
const notification = (0, json_bigint_1.default)({ storeAsString: true }).parse(dataJson);
|
|
166
167
|
if ('ding' in notification) {
|
|
167
168
|
sendToDevice(notification.ding.doorbot_id, notification);
|
|
168
169
|
}
|
package/lib/ring-camera.js
CHANGED
|
@@ -99,18 +99,18 @@ class RingCamera extends subscribed_1.Subscribed {
|
|
|
99
99
|
this.onInHomeDoorbellStatus = this.onData.pipe((0, operators_1.map)(({ settings: { chime_settings } }) => {
|
|
100
100
|
return Boolean(chime_settings?.enable);
|
|
101
101
|
}), (0, operators_1.distinctUntilChanged)());
|
|
102
|
-
|
|
102
|
+
this.addSubscriptions(this.restClient.onSession.subscribe(() => {
|
|
103
103
|
this.subscribeToDingEvents().catch((e) => {
|
|
104
104
|
(0, util_1.logError)('Failed to subscribe ' + initialData.description + ' to ding events');
|
|
105
105
|
(0, util_1.logError)(e);
|
|
106
106
|
});
|
|
107
|
-
}
|
|
108
|
-
if (!initialData.subscribed_motions) {
|
|
109
107
|
this.subscribeToMotionEvents().catch((e) => {
|
|
110
|
-
(0, util_1.logError)('Failed to subscribe ' +
|
|
108
|
+
(0, util_1.logError)('Failed to subscribe ' +
|
|
109
|
+
initialData.description +
|
|
110
|
+
' to motion events');
|
|
111
111
|
(0, util_1.logError)(e);
|
|
112
112
|
});
|
|
113
|
-
}
|
|
113
|
+
}));
|
|
114
114
|
}
|
|
115
115
|
updateData(update) {
|
|
116
116
|
this.onData.next(update);
|
package/lib/ring-types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ring-client-api",
|
|
3
|
-
"version": "11.7.
|
|
3
|
+
"version": "11.7.7",
|
|
4
4
|
"description": "Unofficial API for Ring doorbells, cameras, security alarm system and smart lighting",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"colors": "1.4.0",
|
|
26
26
|
"debug": "^4.3.4",
|
|
27
27
|
"got": "^11.8.5",
|
|
28
|
+
"json-bigint": "^1.0.0",
|
|
28
29
|
"msw": "^1.2.1",
|
|
29
30
|
"rxjs": "^7.8.0",
|
|
30
31
|
"socket.io-client": "^2.5.0",
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@types/debug": "4.1.7",
|
|
39
40
|
"@types/jest": "29.5.0",
|
|
41
|
+
"@types/json-bigint": "^1.0.1",
|
|
40
42
|
"@types/node": "18.15.9",
|
|
41
43
|
"@types/uuid": "9.0.1",
|
|
42
44
|
"@types/ws": "^8.5.4",
|