ring-client-api 13.0.0-beta.3 → 13.0.0-beta.5
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 +7 -4
- package/lib/device-data.js +2 -2
- package/lib/ring-camera.js +7 -2
- package/package.json +2 -2
package/lib/api.js
CHANGED
|
@@ -123,14 +123,15 @@ class RingApi extends subscribed_1.Subscribed {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
async registerPushReceiver(cameras, intercoms) {
|
|
126
|
-
const credentials = this.restClient._internalOnly_pushNotificationCredentials
|
|
126
|
+
const credentials = this.restClient._internalOnly_pushNotificationCredentials?.config &&
|
|
127
|
+
this.restClient._internalOnly_pushNotificationCredentials, pushReceiver = new push_receiver_1.default({
|
|
127
128
|
firebase: {
|
|
128
129
|
apiKey: 'AIzaSyCv-hdFBmmdBBJadNy-TFwB-xN_H5m3Bk8',
|
|
129
130
|
projectId: 'ring-17770',
|
|
130
131
|
messagingSenderId: '876313859327', // for Ring android app. 703521446232 for ring-site
|
|
131
132
|
appId: '1:876313859327:android:e10ec6ddb3c81f39',
|
|
132
133
|
},
|
|
133
|
-
credentials
|
|
134
|
+
credentials,
|
|
134
135
|
debug: false,
|
|
135
136
|
}), devicesById = {}, sendToDevice = (id, notification) => {
|
|
136
137
|
devicesById[id]?.processPushNotification(notification);
|
|
@@ -224,8 +225,10 @@ class RingApi extends subscribed_1.Subscribed {
|
|
|
224
225
|
(0, util_1.logError)(e);
|
|
225
226
|
}
|
|
226
227
|
});
|
|
227
|
-
// If we already have credentials, use them immediately
|
|
228
|
-
if (credentials
|
|
228
|
+
// If we already have credentials and they haven't been changed during registration, use them immediately
|
|
229
|
+
if (credentials &&
|
|
230
|
+
credentials?.fcm?.token ===
|
|
231
|
+
this.restClient._internalOnly_pushNotificationCredentials?.fcm?.token) {
|
|
229
232
|
onPushNotificationToken.next(credentials.fcm.token);
|
|
230
233
|
}
|
|
231
234
|
}
|
package/lib/device-data.js
CHANGED
|
@@ -39,11 +39,11 @@ function stripSensitiveFields(input) {
|
|
|
39
39
|
else {
|
|
40
40
|
const data = input[key];
|
|
41
41
|
if (key.length === 36) {
|
|
42
|
-
input[key.
|
|
42
|
+
input[key.slice(0, 13) + '-uuid'] = data;
|
|
43
43
|
delete input[key];
|
|
44
44
|
}
|
|
45
45
|
if (typeof data === 'string' && data.length === 36) {
|
|
46
|
-
input[key] = data.
|
|
46
|
+
input[key] = data.slice(0, 13) + '-uuid';
|
|
47
47
|
}
|
|
48
48
|
stripSensitiveFields(data);
|
|
49
49
|
}
|
package/lib/ring-camera.js
CHANGED
|
@@ -79,8 +79,13 @@ class RingCamera extends subscribed_1.Subscribed {
|
|
|
79
79
|
this.onActiveNotifications = new rxjs_1.BehaviorSubject([]);
|
|
80
80
|
this.onDoorbellPressed = this.onNewNotification.pipe((0, operators_1.filter)((notification) => notification.android_config.category === ring_types_1.PushNotificationAction.Ding), (0, operators_1.share)());
|
|
81
81
|
this.onMotionDetected = this.onActiveNotifications.pipe((0, operators_1.map)((notifications) => notifications.some((notification) => notification.android_config.category ===
|
|
82
|
-
ring_types_1.PushNotificationAction.Motion)), (0, operators_1.distinctUntilChanged)(), (0, operators_1.
|
|
83
|
-
|
|
82
|
+
ring_types_1.PushNotificationAction.Motion)), (0, operators_1.distinctUntilChanged)(), (0, operators_1.share)({
|
|
83
|
+
connector: () => new rxjs_1.ReplaySubject(1),
|
|
84
|
+
resetOnError: false,
|
|
85
|
+
resetOnComplete: false,
|
|
86
|
+
resetOnRefCountZero: false,
|
|
87
|
+
}));
|
|
88
|
+
this.onMotionStarted = this.onMotionDetected.pipe((0, operators_1.filter)((currentlyDetected) => currentlyDetected), (0, operators_1.map)(() => null), // no value needed, event is what matters
|
|
84
89
|
(0, operators_1.share)());
|
|
85
90
|
this.lastSnapshotTimestamp = 0;
|
|
86
91
|
this.lastSnapshotTimestampLocal = 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ring-client-api",
|
|
3
|
-
"version": "13.0.0-beta.
|
|
3
|
+
"version": "13.0.0-beta.5",
|
|
4
4
|
"description": "Unofficial API for Ring doorbells, cameras, security alarm system and smart lighting",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"test:watch": "jest --watch"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@eneris/push-receiver": "
|
|
20
|
+
"@eneris/push-receiver": "4.1.3",
|
|
21
21
|
"@homebridge/camera-utils": "^2.2.6",
|
|
22
22
|
"@types/socket.io-client": "1.4.36",
|
|
23
23
|
"colors": "1.4.0",
|