@camera.ui/camera-ui-ring 0.0.47 → 0.0.48

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/bundle.zip ADDED
Binary file
package/package.json CHANGED
@@ -1,48 +1,34 @@
1
1
  {
2
2
  "displayName": "Ring",
3
3
  "name": "@camera.ui/camera-ui-ring",
4
- "version": "0.0.47",
4
+ "version": "0.0.48",
5
5
  "description": "camera.ui ring plugin",
6
6
  "author": "seydx (https://github.com/seydx/camera.ui)",
7
7
  "main": "./dist/index.js",
8
- "type": "module",
8
+ "type": "commonjs",
9
9
  "scripts": {
10
- "build": "rimraf dist && tsc",
11
- "format": "prettier --write 'src/' --ignore-unknown --no-error-on-unmatched-pattern",
12
- "lint": "eslint --fix --ext .js,.ts .",
13
- "update": "updates --update ./",
10
+ "build": "rimraf dist && npm run build:ring-client-api && tsc",
11
+ "build:ring-client-api": "cd ../../externals/ring-client-api && npm run build && cd ../../plugins/camera-ui-ring",
12
+ "bundle": "npm run format && npm run lint && npm run build && cui bundle",
13
+ "format": "prettier --write \"src/\" --ignore-unknown --no-error-on-unmatched-pattern",
14
14
  "install-updates": "npm i --save",
15
- "prepublishOnly": "npm i --package-lock-only && npm run lint && npm run format && npm run build"
15
+ "lint": "eslint .",
16
+ "lint:fix": "eslint --fix .",
17
+ "prepublishOnly": "node -e \"if(!process.env.SAFE_PUBLISH){console.error('Error: Please use @camera.ui/cli to publish the plugin:\\n npm run publish:alpha\\n npm run publish:beta\\n npm run publish:latest\\n');process.exit(1)}\"",
18
+ "publish:alpha": "cui publish --alpha",
19
+ "publish:beta": "cui publish --beta",
20
+ "publish:latest": "cui publish --latest",
21
+ "update": "updates --update ./"
16
22
  },
17
- "dependencies": {
18
- "@camera.ui/rtsp": "^0.0.40",
19
- "ring-client-api": "^13.1.0",
20
- "rxjs": "^7.8.1",
21
- "werift": "^0.20.0",
22
- "ws": "^8.18.0"
23
- },
24
- "devDependencies": {
25
- "@camera.ui/types": "^0.0.77",
26
- "@rushstack/eslint-patch": "^1.10.4",
27
- "@types/node": "^22.7.6",
28
- "@types/ws": "^8.5.12",
29
- "@typescript-eslint/eslint-plugin": "^8.10.0",
30
- "@typescript-eslint/parser": "^8.10.0",
31
- "concurrently": "^9.0.1",
32
- "eslint": "8.57.0",
33
- "eslint-config-prettier": "^9.1.0",
34
- "eslint-plugin-prettier": "^5.2.1",
35
- "prettier": "^3.3.3",
36
- "rimraf": "^6.0.1",
37
- "typescript": "^5.6.3",
38
- "updates": "^16.4.0"
23
+ "overrides": {
24
+ "@shinyoshiaki/binary-data": "npm:@seydx/binary-data@0.6.1"
39
25
  },
40
26
  "bugs": {
41
27
  "url": "https://github.com/seydx/camera.ui/issues"
42
28
  },
43
29
  "engines": {
44
- "camera.ui": ">=0.0.34-alpha.2",
45
- "node": ">=20.17.0"
30
+ "camera.ui": ">=0.0.34-alpha.4",
31
+ "node": ">=20.18.0"
46
32
  },
47
33
  "homepage": "https://github.com/seydx/camera.ui#readme",
48
34
  "keywords": [
@@ -62,6 +48,7 @@
62
48
  "dependencies": [],
63
49
  "options": {
64
50
  "extendedMotionDetection": false
65
- }
51
+ },
52
+ "bundled": true
66
53
  }
67
- }
54
+ }
package/CHANGELOG.md DELETED
@@ -1,8 +0,0 @@
1
- All notable changes to this project will be documented in this file.
2
-
3
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
-
6
- ## [X.X.X] - ???
7
-
8
- - Initial Release
package/CONTRIBUTING.md DELETED
@@ -1 +0,0 @@
1
- # Contributing
package/LICENSE.md DELETED
@@ -1,22 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2023-2024 seydx <dev@seydx.com>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md DELETED
@@ -1 +0,0 @@
1
- # @camera.ui/camera-ui-ring
@@ -1,67 +0,0 @@
1
- {
2
- "schema": {
3
- "homes": {
4
- "type": "array",
5
- "key": "homes",
6
- "title": "Homes",
7
- "description": "Ring Homes",
8
- "items": {
9
- "type": "object",
10
- "title": "Home",
11
- "description": "Ring Home",
12
- "required": true,
13
- "properties": {
14
- "name": {
15
- "type": "string",
16
- "title": "Home Name",
17
- "description": "Name of the home",
18
- "required": true,
19
- "store": true
20
- },
21
- "email": {
22
- "type": "string",
23
- "title": "Login Email",
24
- "description": "Email for the login",
25
- "format": "email",
26
- "required": false,
27
- "store": true
28
- },
29
- "password": {
30
- "type": "string",
31
- "title": "Login Password",
32
- "description": "Password for the login",
33
- "format": "password",
34
- "required": false,
35
- "store": true
36
- },
37
- "token": {
38
- "type": "string",
39
- "title": "Refresh Token",
40
- "description": "Refresh Token",
41
- "hidden": true,
42
- "store": true
43
- },
44
- "locationIds": {
45
- "type": "array",
46
- "title": "Location Ids",
47
- "description": "Location Ids",
48
- "items": {
49
- "type": "string",
50
- "title": "Location Id",
51
- "description": "Location Id"
52
- },
53
- "required": false,
54
- "defaultValue": [],
55
- "store": true
56
- }
57
- },
58
- "buttons": [
59
- {
60
- "label": "Login",
61
- "onSubmit": "onLogin"
62
- }
63
- ]
64
- }
65
- }
66
- }
67
- }
package/dist/camera.d.ts DELETED
@@ -1,27 +0,0 @@
1
- import { StreamDelegate } from '@camera.ui/rtsp';
2
- import type { SdpConfig } from '@camera.ui/rtsp';
3
- import type { CameraDelegate, CameraDevice, LoggerService } from '@camera.ui/types';
4
- import type { RingCamera } from 'ring-client-api';
5
- import type { RtpPacket } from 'werift';
6
- import type Ring from './index.js';
7
- import type { RingHome } from './types.js';
8
- export declare class Camera extends StreamDelegate implements CameraDelegate {
9
- cameraDevice: CameraDevice;
10
- private platform;
11
- private home;
12
- private ringCamera;
13
- private logger;
14
- private cameraLogger;
15
- private session?;
16
- private rtspServer;
17
- constructor(platform: Ring, home: RingHome, ringCamera: RingCamera, logger: LoggerService);
18
- prepareStream(): Promise<SdpConfig>;
19
- startStream(sendRtp: (type: 'audio' | 'video', rtp: RtpPacket | Buffer) => void): Promise<void>;
20
- stopStream(): Promise<void>;
21
- onTalkback(rtp: Buffer): void;
22
- createCameraDevice(): Promise<void>;
23
- snapshot(): Promise<ArrayBuffer | undefined>;
24
- reboot(): Promise<void>;
25
- private createRTSPServer;
26
- private checkStates;
27
- }
package/dist/camera.js DELETED
@@ -1,204 +0,0 @@
1
- import { RTSPSingleServer, StreamDelegate } from '@camera.ui/rtsp';
2
- import { CustomPeerConnection } from './peer.js';
3
- export class Camera extends StreamDelegate {
4
- cameraDevice;
5
- platform;
6
- home;
7
- ringCamera;
8
- logger;
9
- cameraLogger;
10
- session;
11
- rtspServer;
12
- constructor(platform, home, ringCamera, logger) {
13
- super();
14
- this.platform = platform;
15
- this.home = home;
16
- this.ringCamera = ringCamera;
17
- this.logger = logger;
18
- this.cameraLogger = logger;
19
- }
20
- async prepareStream() {
21
- this.cameraLogger.debug('Preparing stream...');
22
- let closed = false;
23
- const cleanup = () => {
24
- if (!closed) {
25
- this.cameraLogger.log('Stream stopped!');
26
- closed = true;
27
- }
28
- clearTimeout(timeout);
29
- this.events.emit('close');
30
- this.session?.liveCall.stop();
31
- this.session?.customPeerConnection.onAudioRtcp.unsubscribe();
32
- this.session?.customPeerConnection.onVideoRtcp.unsubscribe();
33
- this.session?.customPeerConnection.close();
34
- this.session = undefined;
35
- };
36
- const timeout = setTimeout(() => {
37
- this.cameraLogger.warn('Connection timeout!');
38
- cleanup();
39
- }, 10000);
40
- const customPeerConnection = new CustomPeerConnection();
41
- const liveCall = await this.ringCamera.startLiveCall({
42
- createPeerConnection: () => customPeerConnection,
43
- });
44
- if (!liveCall.cameraSpeakerActivated) {
45
- liveCall.activateCameraSpeaker();
46
- }
47
- liveCall.onCallEnded.subscribe(() => {
48
- cleanup();
49
- });
50
- customPeerConnection.onConnectionState.subscribe((state) => {
51
- if (state === 'connected') {
52
- clearTimeout(timeout);
53
- this.cameraLogger.log('Stream started!');
54
- }
55
- else if (state === 'disconnected' || state === 'failed' || state === 'closed') {
56
- cleanup();
57
- }
58
- });
59
- this.session = { liveCall, customPeerConnection };
60
- const offer = await customPeerConnection.createOffer();
61
- return { sdp: offer.sdp, splitTracks: true };
62
- }
63
- async startStream(sendRtp) {
64
- if (!this.session) {
65
- throw new Error('No session');
66
- }
67
- this.session.customPeerConnection.onAudioRtp.subscribe((rtp) => {
68
- sendRtp('audio', rtp);
69
- });
70
- this.session.customPeerConnection.onVideoRtp.subscribe((rtp) => {
71
- sendRtp('video', rtp);
72
- });
73
- }
74
- async stopStream() {
75
- this.cameraLogger.debug('Stopping stream...');
76
- this.session?.liveCall.stop();
77
- }
78
- onTalkback(rtp) {
79
- this.session?.customPeerConnection.returnAudioTrack.writeRtp(rtp);
80
- }
81
- async createCameraDevice() {
82
- await this.createRTSPServer();
83
- const cameraDevice = Array.from(this.platform.cameras.values()).find((camera) => camera.nativeId === this.ringCamera.id.toString());
84
- if (!cameraDevice) {
85
- this.logger.log(this.home.name, 'Adding camera', this.ringCamera.name);
86
- this.cameraDevice = await this.platform.api.deviceManager.createCamera({
87
- name: this.ringCamera.name,
88
- nativeId: this.ringCamera.id.toString(),
89
- isCloud: true,
90
- hasSiren: this.ringCamera.hasSiren,
91
- hasLight: this.ringCamera.hasLight,
92
- hasBinarySensor: this.ringCamera.hasInHomeDoorbell,
93
- hasBattery: this.ringCamera.hasBattery,
94
- info: {
95
- manufacturer: 'Ring',
96
- model: this.ringCamera.model ?? '',
97
- hardware: this.ringCamera.data.kind ?? '',
98
- serialNumber: this.ringCamera.data.device_id ?? '',
99
- firmwareVersion: this.ringCamera.data.health.firmware_version ?? '',
100
- supportUrl: 'https://support.ring.com/',
101
- },
102
- sources: [
103
- {
104
- name: 'P2P',
105
- roles: ['high-resolution'],
106
- urls: [this.rtspServer.streamUrl],
107
- },
108
- ],
109
- });
110
- }
111
- else {
112
- this.cameraDevice = cameraDevice;
113
- await this.cameraDevice.updateCameraSource(cameraDevice.streamSource._id, { urls: [this.rtspServer.streamUrl] });
114
- }
115
- this.cameraLogger = this.cameraDevice.logger;
116
- this.cameraDevice.setDelegate('cameraDelegate', this);
117
- const ffmpegPath = await this.platform.api.coreManager.getFFmpegPath();
118
- this.rtspServer.changeFFmpegPath(ffmpegPath);
119
- await this.cameraDevice.connect();
120
- this.checkStates();
121
- }
122
- async snapshot() {
123
- this.cameraLogger.debug('Snapshot requested');
124
- return await this.ringCamera.getSnapshot();
125
- }
126
- async reboot() {
127
- return;
128
- }
129
- async createRTSPServer() {
130
- const stream = {
131
- name: 'Ring',
132
- delegate: this,
133
- addBackchannel: true,
134
- };
135
- const rtspLogger = {
136
- // log: this.cameraLogger.log.bind(this.logger),
137
- warn: (...args) => {
138
- this.cameraLogger.warn(...args);
139
- },
140
- error: (...args) => {
141
- this.cameraLogger.error(...args);
142
- },
143
- // debug: this.cameraLogger.trace.bind(this.logger),
144
- };
145
- console.log('INITIALIZE RTSP SERVER');
146
- this.rtspServer = await RTSPSingleServer.initialize({ stream }, rtspLogger);
147
- await this.rtspServer.listen();
148
- // this.logger.log(this.ringCamera.name, 'RTSP URL:', this.rtspServer.streamUrl);
149
- }
150
- checkStates() {
151
- if (this.ringCamera.hasInHomeDoorbell) {
152
- this.ringCamera.onDoorbellPressed.subscribe(async (ding) => {
153
- try {
154
- this.cameraLogger.log('onDoorbellPressed', ding);
155
- await this.cameraDevice.updateState('doorbell', { state: true });
156
- }
157
- catch (error) {
158
- this.cameraLogger.error('Failed to update motion state', error);
159
- }
160
- });
161
- }
162
- this.ringCamera.onMotionDetected.subscribe(async (motionDetected) => {
163
- try {
164
- this.cameraLogger.log('onMotionDetected', motionDetected);
165
- await this.cameraDevice.updateState('motion', { state: motionDetected, detections: [] });
166
- }
167
- catch (error) {
168
- this.cameraLogger.error('Failed to update motion state', error);
169
- }
170
- });
171
- if (this.ringCamera.hasBattery) {
172
- this.ringCamera.onBatteryLevel.subscribe(async (batteryLevel) => {
173
- try {
174
- this.cameraLogger.log('battery', batteryLevel ?? 100);
175
- await this.cameraDevice.updateState('battery', { level: batteryLevel ?? 100 });
176
- }
177
- catch (error) {
178
- this.cameraLogger.error('Failed to update battery state', error);
179
- }
180
- });
181
- }
182
- this.ringCamera.onData.subscribe(async (data) => {
183
- if (this.ringCamera.hasLight && data.led_status) {
184
- try {
185
- this.cameraLogger.log('light', data.led_status == 'on');
186
- await this.cameraDevice.updateState('light', { state: data.led_status == 'on' });
187
- }
188
- catch (error) {
189
- this.cameraLogger.error('Failed to update light state', error);
190
- }
191
- }
192
- if (this.ringCamera.hasSiren && data.siren_status) {
193
- try {
194
- this.cameraLogger.log('siren', data.siren_status.seconds_remaining > 0);
195
- await this.cameraDevice.updateState('siren', { state: data.siren_status.seconds_remaining > 0 });
196
- }
197
- catch (error) {
198
- this.cameraLogger.error('Failed to update siren state', error);
199
- }
200
- }
201
- });
202
- }
203
- }
204
- //# sourceMappingURL=camera.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"camera.js","sourceRoot":"","sources":["../src/camera.ts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ACxE,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,iBAAiB,GAAG,CAAC,EAAE,CAAC,CAAC;gBACnG,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;gBACjE,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
package/dist/index.d.ts DELETED
@@ -1,22 +0,0 @@
1
- import type { BasePlugin, CameraDevice, FormSubmitResponse, LoggerService, PluginAPI } from '@camera.ui/types';
2
- import type { Config, FormAction, RingHome } from './types.js';
3
- export default class RingPlugin implements BasePlugin {
4
- config: Config;
5
- logger: LoggerService;
6
- api: PluginAPI;
7
- cameras: Map<string, CameraDevice>;
8
- private restClient;
9
- private ringConnections;
10
- private ringCamerasMap;
11
- constructor(logger: LoggerService, api: PluginAPI);
12
- configureCameras(cameras: CameraDevice[]): void;
13
- onFormSubmit(actionId: FormAction, home: RingHome & {
14
- twoFactorCode?: string;
15
- }): Promise<FormSubmitResponse | void>;
16
- private start;
17
- private stop;
18
- private connectHome;
19
- private generateCode;
20
- private generateToken;
21
- private refreshConfig;
22
- }
package/dist/index.js DELETED
@@ -1,223 +0,0 @@
1
- import { RingApi } from 'ring-client-api';
2
- import { RingRestClient } from 'ring-client-api/rest-client';
3
- import { Camera } from './camera.js';
4
- export default class RingPlugin {
5
- config;
6
- logger;
7
- api;
8
- cameras = new Map();
9
- restClient = new Map();
10
- ringConnections = new Map();
11
- ringCamerasMap = new Map();
12
- constructor(logger, api) {
13
- this.logger = logger;
14
- this.api = api;
15
- this.config = api.configService.all();
16
- this.config.homes = api.configService.get('homes', [], (value) => Array.isArray(value), false, true);
17
- this.api.on('finishLaunching', this.start.bind(this));
18
- this.api.on('shutdown', this.stop.bind(this));
19
- }
20
- configureCameras(cameras) {
21
- for (const camera of cameras) {
22
- this.cameras.set(camera.id, camera);
23
- }
24
- }
25
- async onFormSubmit(actionId, home) {
26
- switch (actionId) {
27
- case 'onLogin':
28
- case 'on2FA':
29
- if (home.twoFactorCode) {
30
- try {
31
- const response = await this.generateToken(home.name, home.email, home.password, home.twoFactorCode);
32
- if (response?.refreshToken) {
33
- this.restClient.delete(home.name);
34
- home.token = response.refreshToken;
35
- this.refreshConfig(home);
36
- this.connectHome(home);
37
- const formResponse = {
38
- toast: {
39
- message: 'Logged in',
40
- type: 'success',
41
- },
42
- };
43
- return formResponse;
44
- }
45
- else {
46
- throw new Error('Failed to Login');
47
- }
48
- }
49
- catch (error) {
50
- const message = `Failed to Link Account. Reason: ${error.message}. Trying to login again...`;
51
- this.logger.error(home.name, message);
52
- }
53
- }
54
- // token was not valid, login again
55
- try {
56
- const response = await this.generateCode(home.name, home.email, home.password);
57
- if (!response) {
58
- throw new Error('Failed to get code');
59
- }
60
- if ('refreshToken' in response) {
61
- this.restClient.delete(home.name);
62
- home.token = response.refreshToken;
63
- this.refreshConfig(home);
64
- this.connectHome(home);
65
- const formResponse = {
66
- toast: {
67
- message: 'Logged in!',
68
- type: 'success',
69
- },
70
- };
71
- return formResponse;
72
- }
73
- else {
74
- const formResponse = {
75
- schema: {
76
- config: {
77
- type: 'object',
78
- title: 'Two-Factor Authentication (2FA)',
79
- description: 'Enter the 2FA code',
80
- required: true,
81
- opened: true,
82
- properties: {
83
- twoFactorCode: {
84
- type: 'string',
85
- key: 'twoFactorCode',
86
- title: 'Two-Factor Code',
87
- description: 'Enter the two-factor code',
88
- required: true,
89
- },
90
- },
91
- buttons: [
92
- {
93
- label: 'Authenticate',
94
- onSubmit: 'on2FA',
95
- },
96
- ],
97
- },
98
- },
99
- toast: {
100
- message: 'Two-Factor Authentication (2FA) Required!',
101
- type: 'warning',
102
- },
103
- };
104
- return formResponse;
105
- }
106
- }
107
- catch (error) {
108
- const message = `Failed to Link Account. Reason: ${error.message}`;
109
- this.logger.error(home.name, message);
110
- const formResponse = {
111
- toast: {
112
- message,
113
- type: 'error',
114
- },
115
- };
116
- return formResponse;
117
- }
118
- default:
119
- const message = `Unknown actionId: ${actionId}`;
120
- this.logger.warn(home.name, message);
121
- const formResponse = {
122
- toast: {
123
- message,
124
- type: 'error',
125
- },
126
- };
127
- return formResponse;
128
- }
129
- }
130
- async start() {
131
- for (const home of this.config.homes) {
132
- await this.connectHome(home);
133
- }
134
- // Remove orphaned cameras
135
- // for (const [cameraId, cameraDevice] of this.cameras) {
136
- // const ringCameraId = cameraDevice.nativeId!;
137
- // if (!this.ringCamerasMap.get(ringCameraId)) {
138
- // this.logger.warn('Removing camera', cameraDevice.name);
139
- // this.cameras.delete(cameraId);
140
- // await this.api.deviceManager.removeCameraById(cameraDevice.id);
141
- // }
142
- // }
143
- }
144
- stop() {
145
- this.ringCamerasMap.forEach((ringCamera) => ringCamera.disconnect());
146
- this.ringConnections.forEach((ringApi) => ringApi.disconnect());
147
- this.restClient.clear();
148
- this.ringConnections.clear();
149
- this.ringCamerasMap.clear();
150
- }
151
- async connectHome(home) {
152
- try {
153
- if (home.token) {
154
- const api = new RingApi({ refreshToken: home.token, locationIds: home.locationIds });
155
- this.ringConnections.set(home.name, api);
156
- api.onRefreshTokenUpdated.subscribe(async (refreshToken) => {
157
- home.token = refreshToken.newRefreshToken;
158
- this.refreshConfig(home);
159
- });
160
- const ringCameras = await api.getCameras();
161
- for (const ringCamera of ringCameras) {
162
- try {
163
- const ringCameraId = ringCamera.id.toString();
164
- this.ringCamerasMap.set(ringCameraId, ringCamera);
165
- const camera = new Camera(this, home, ringCamera, this.logger);
166
- await camera.createCameraDevice();
167
- this.cameras.set(camera.cameraDevice.id, camera.cameraDevice);
168
- }
169
- catch (error) {
170
- this.logger.error(home.name, 'Failed to create camera:', error);
171
- }
172
- }
173
- }
174
- else {
175
- throw new Error('No refresh token, please login again!');
176
- }
177
- }
178
- catch (error) {
179
- this.logger.error(home.name, error);
180
- }
181
- }
182
- async generateCode(homeName, email, password) {
183
- this.logger.log(homeName, `Logging in with email '${email}'`);
184
- const ringClient = new RingRestClient({
185
- email,
186
- password,
187
- });
188
- this.restClient.set(homeName, ringClient);
189
- try {
190
- const { refresh_token } = await ringClient.getCurrentAuth();
191
- return { refreshToken: refresh_token };
192
- }
193
- catch (error) {
194
- if (ringClient.promptFor2fa) {
195
- this.logger.log(homeName, ringClient.promptFor2fa);
196
- return { codePrompt: ringClient.promptFor2fa };
197
- }
198
- this.logger.error(homeName, error);
199
- }
200
- }
201
- async generateToken(homeName, email, password, code) {
202
- let restClient = this.restClient.get(homeName);
203
- if (!restClient) {
204
- restClient = new RingRestClient({ email, password });
205
- this.restClient.set(homeName, restClient);
206
- }
207
- this.logger.log(homeName, `Getting token for ${email} with code ${code}`);
208
- try {
209
- const authResponse = await restClient.getAuth(code);
210
- return { refreshToken: authResponse.refresh_token };
211
- }
212
- catch (error) {
213
- this.logger.error(homeName, 'Incorrect 2fa Code. Please check the code and try again', error);
214
- }
215
- }
216
- refreshConfig(home) {
217
- if ('twoFactorCode' in home) {
218
- delete home.twoFactorCode;
219
- }
220
- this.api.configService.replaceOrAddItem('homes', 'name', home.name, home, true);
221
- }
222
- }
223
- //# sourceMappingURL=index.js.map
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAMrC,MAAM,CAAC,OAAO,OAAO,UAAU;IACtB,MAAM,CAAS;IACf,MAAM,CAAgB;IACtB,GAAG,CAAY;IACf,OAAO,GAAG,IAAI,GAAG,EAAwB,CAAC;IAEzC,UAAU,GAAG,IAAI,GAAG,EAA0B,CAAC;IAC/C,eAAe,GAAG,IAAI,GAAG,EAAmB,C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AAY,EAAE,YAAY,CAAC,aAAa,EAAE,CAAC;QACtD,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,yDAAyD,EAAE,KAAK,CAAC,CAAC;QAChG,CAAC;IACH,CAAC;IAEO,aAAa,CAAC,IAAc;QAClC,IAAI,eAAe,IAAI,IAAI,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,aAAa,CAAC;QAC5B,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAClF,CAAC;CACF"}
package/dist/peer.d.ts DELETED
@@ -1,22 +0,0 @@
1
- import { ReplaySubject, Subject } from 'rxjs';
2
- import { MediaStreamTrack } from 'werift';
3
- import type { BasicPeerConnection } from '@camera.ui/types';
4
- import type { RTCIceCandidate, RTCSessionDescription, RtcpPacket, RtpPacket } from 'werift';
5
- export declare class CustomPeerConnection implements BasicPeerConnection {
6
- private pc;
7
- onAudioRtp: Subject<RtpPacket>;
8
- onAudioRtcp: Subject<RtcpPacket>;
9
- onVideoRtp: Subject<RtpPacket>;
10
- onVideoRtcp: Subject<RtcpPacket>;
11
- onIceCandidate: Subject<RTCIceCandidate>;
12
- onConnectionState: ReplaySubject<"closed" | "failed" | "disconnected" | "new" | "connecting" | "connected">;
13
- returnAudioTrack: MediaStreamTrack;
14
- constructor();
15
- createOffer(): Promise<RTCSessionDescription>;
16
- acceptAnswer(answer: {
17
- type: 'answer';
18
- sdp: string;
19
- }): Promise<void>;
20
- addIceCandidate(candidate: RTCIceCandidate): Promise<void>;
21
- close(): void;
22
- }
package/dist/peer.js DELETED
@@ -1,105 +0,0 @@
1
- import { ReplaySubject, Subject } from 'rxjs';
2
- import { MediaStreamTrack, RTCPeerConnection, RTCRtpCodecParameters } from 'werift';
3
- const ringIceServers = [
4
- 'stun:stun.kinesisvideo.us-east-1.amazonaws.com:443',
5
- 'stun:stun.kinesisvideo.us-east-2.amazonaws.com:443',
6
- 'stun:stun.kinesisvideo.us-west-2.amazonaws.com:443',
7
- 'stun:stun.l.google.com:19302',
8
- 'stun:stun1.l.google.com:19302',
9
- 'stun:stun2.l.google.com:19302',
10
- 'stun:stun3.l.google.com:19302',
11
- 'stun:stun4.l.google.com:19302',
12
- ];
13
- export class CustomPeerConnection {
14
- pc;
15
- onAudioRtp = new Subject();
16
- onAudioRtcp = new Subject();
17
- onVideoRtp = new Subject();
18
- onVideoRtcp = new Subject();
19
- onIceCandidate = new Subject();
20
- onConnectionState = new ReplaySubject(1);
21
- returnAudioTrack = new MediaStreamTrack({ kind: 'audio' });
22
- constructor() {
23
- const pc = (this.pc = new RTCPeerConnection({
24
- codecs: {
25
- audio: [
26
- new RTCRtpCodecParameters({
27
- mimeType: 'audio/opus',
28
- clockRate: 48000,
29
- channels: 2,
30
- }),
31
- new RTCRtpCodecParameters({
32
- mimeType: 'audio/PCMU',
33
- clockRate: 8000,
34
- channels: 1,
35
- payloadType: 0,
36
- }),
37
- ],
38
- video: [
39
- new RTCRtpCodecParameters({
40
- mimeType: 'video/H264',
41
- clockRate: 90000,
42
- rtcpFeedback: [{ type: 'transport-cc' }, { type: 'ccm', parameter: 'fir' }, { type: 'nack' }, { type: 'nack', parameter: 'pli' }, { type: 'goog-remb' }],
43
- parameters: 'packetization-mode=1;profile-level-id=640029;level-asymmetry-allowed=1',
44
- }),
45
- ],
46
- },
47
- iceServers: ringIceServers.map((server) => ({ urls: server })),
48
- iceTransportPolicy: 'all',
49
- bundlePolicy: 'disable',
50
- }));
51
- const audioTransceiver = pc.addTransceiver(this.returnAudioTrack, {
52
- direction: 'sendrecv',
53
- });
54
- const videoTransceiver = pc.addTransceiver('video', {
55
- direction: 'recvonly',
56
- });
57
- audioTransceiver.onTrack.subscribe((track) => {
58
- track.onReceiveRtp.subscribe((rtp) => {
59
- this.onAudioRtp.next(rtp);
60
- });
61
- track.onReceiveRtcp.subscribe((rtcp) => {
62
- this.onAudioRtcp.next(rtcp);
63
- });
64
- });
65
- videoTransceiver.onTrack.subscribe((track) => {
66
- track.onReceiveRtp.subscribe((rtp) => {
67
- this.onVideoRtp.next(rtp);
68
- });
69
- track.onReceiveRtcp.subscribe((rtcp) => {
70
- this.onVideoRtcp.next(rtcp);
71
- });
72
- track.onReceiveRtp.once(() => {
73
- setInterval(() => videoTransceiver.receiver.sendRtcpPLI(track.ssrc), 4000);
74
- });
75
- });
76
- this.pc.onIceCandidate.subscribe((iceCandidate) => {
77
- if (iceCandidate) {
78
- this.onIceCandidate.next(iceCandidate);
79
- }
80
- });
81
- pc.iceConnectionStateChange.subscribe(() => {
82
- if (pc.iceConnectionState === 'closed') {
83
- this.onConnectionState.next('closed');
84
- }
85
- });
86
- pc.connectionStateChange.subscribe(() => {
87
- this.onConnectionState.next(pc.connectionState);
88
- });
89
- }
90
- async createOffer() {
91
- const offer = await this.pc.createOffer();
92
- await this.pc.setLocalDescription(offer);
93
- return offer;
94
- }
95
- async acceptAnswer(answer) {
96
- await this.pc.setRemoteDescription(answer);
97
- }
98
- async addIceCandidate(candidate) {
99
- await this.pc.addIceCandidate(candidate);
100
- }
101
- close() {
102
- this.pc.close().catch(() => { });
103
- }
104
- }
105
- //# sourceMappingURL=peer.js.map
package/dist/peer.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"peer.js","sourceRoot":"","sources":["../src/peer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAKpF,MAAM,cAAc,GAAG;IACrB,oDAAoD;IACpD,oDAAoD;IACpD,oDAAoD;IACpD,8BAA8B;IAC9B,+BAA+B;IAC/B,+BAA+B;IAC/B,+BAA+B;IAC/B,+BAA+B;C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C,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAClC,CAAC;CACF"}
package/dist/types.d.ts DELETED
@@ -1,11 +0,0 @@
1
- export interface RingHome {
2
- name: string;
3
- email: string;
4
- password: string;
5
- token?: string;
6
- locationIds: string[];
7
- }
8
- export interface Config {
9
- homes: RingHome[];
10
- }
11
- export type FormAction = 'onLogin' | 'on2FA';
package/dist/types.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=types.js.map
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}