@scrypted/server 0.7.57 → 0.7.59

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.

Potentially problematic release.


This version of @scrypted/server might be problematic. Click here for more details.

package/dist/rpc.d.ts CHANGED
@@ -3,7 +3,20 @@ export declare function startPeriodicGarbageCollection(): NodeJS.Timer;
3
3
  export interface RpcMessage {
4
4
  type: 'apply' | 'result' | 'finalize' | 'param';
5
5
  }
6
- interface RpcResult extends RpcMessage {
6
+ export interface RpcParam extends RpcMessage {
7
+ type: 'param';
8
+ id: string;
9
+ param: string;
10
+ }
11
+ export interface RpcApply extends RpcMessage {
12
+ type: 'apply';
13
+ id: string | undefined;
14
+ proxyId: string;
15
+ args: any[];
16
+ method: string;
17
+ oneway?: boolean;
18
+ }
19
+ export interface RpcResult extends RpcMessage {
7
20
  type: 'result';
8
21
  id: string;
9
22
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scrypted/server",
3
- "version": "0.7.57",
3
+ "version": "0.7.59",
4
4
  "description": "",
5
5
  "dependencies": {
6
6
  "@mapbox/node-pre-gyp": "^1.0.10",
@@ -309,7 +309,7 @@ class PluginRemote:
309
309
  clusterPeers: Mapping[int, asyncio.Future[rpc.RpcPeer]] = {}
310
310
  async def connectRPCObject(value):
311
311
  clusterObject = getattr(value, '__cluster')
312
- if not clusterObject:
312
+ if type(clusterObject) is not dict:
313
313
  return value
314
314
 
315
315
  if clusterObject.get('id', None) != clusterId:
@@ -1,7 +1,7 @@
1
1
  import { EventListener, EventListenerOptions, EventListenerRegister, Logger, ScryptedDevice, ScryptedDeviceType, ScryptedInterface, ScryptedInterfaceDescriptor, ScryptedInterfaceDescriptors, ScryptedInterfaceProperty, SystemDeviceState, SystemManager } from "@scrypted/types";
2
2
  import { EventRegistry } from "../event-registry";
3
3
  import { PrimitiveProxyHandler, RpcPeer } from '../rpc';
4
- import type { PluginComponent } from "../services/plugin";
4
+ // import type { PluginComponent } from "../services/plugin";
5
5
  import { getInterfaceMethods, getInterfaceProperties, getPropertyInterfaces, isValidInterfaceMethod, propertyInterfaces } from "./descriptor";
6
6
  import { PluginAPI } from "./plugin-api";
7
7
 
@@ -122,7 +122,7 @@ class DeviceProxyHandler implements PrimitiveProxyHandler<any>, ScryptedDevice {
122
122
  }
123
123
 
124
124
  async setMixins(mixins: string[]) {
125
- const plugins = await this.systemManager.getComponent('plugins') as PluginComponent;
125
+ const plugins = await this.systemManager.getComponent('plugins');// as PluginComponent;
126
126
  await plugins.setMixins(this.id, mixins);
127
127
  }
128
128
 
package/src/rpc.ts CHANGED
@@ -33,13 +33,13 @@ export interface RpcMessage {
33
33
  type: 'apply' | 'result' | 'finalize' | 'param';
34
34
  }
35
35
 
36
- interface RpcParam extends RpcMessage {
36
+ export interface RpcParam extends RpcMessage {
37
37
  type: 'param';
38
38
  id: string;
39
39
  param: string;
40
40
  }
41
41
 
42
- interface RpcApply extends RpcMessage {
42
+ export interface RpcApply extends RpcMessage {
43
43
  type: 'apply';
44
44
  id: string | undefined;
45
45
  proxyId: string;
@@ -48,7 +48,7 @@ interface RpcApply extends RpcMessage {
48
48
  oneway?: boolean;
49
49
  }
50
50
 
51
- interface RpcResult extends RpcMessage {
51
+ export interface RpcResult extends RpcMessage {
52
52
  type: 'result';
53
53
  id: string;
54
54
  // TODO 3/2/2023