From 4c50bc169a9ae515d217f48b2e1c77f301fced79 Mon Sep 17 00:00:00 2001 From: Koushik Dutta Date: Sat, 20 Aug 2022 14:45:32 -0700 Subject: [PATCH] sdk: update --- sdk/gen/types.input.ts | 64 +++++++++++++----- sdk/package.json | 2 +- sdk/scrypted_python/scrypted_sdk/types.py | 5 ++ sdk/types/index.d.ts | 54 ++++++++++----- sdk/types/index.js | 12 ++-- sdk/types/index.ts | 66 ++++++++++++++----- sdk/types/package-lock.json | 4 +- sdk/types/package.json | 4 +- .../scrypted_python/scrypted_sdk/types.py | 5 ++ 9 files changed, 158 insertions(+), 58 deletions(-) diff --git a/sdk/gen/types.input.ts b/sdk/gen/types.input.ts index 2da192964..29b3f9050 100644 --- a/sdk/gen/types.input.ts +++ b/sdk/gen/types.input.ts @@ -1225,6 +1225,8 @@ export interface Device { */ providerNativeId?: ScryptedNativeId; room?: string; + + internal?: boolean; } /** * DeviceManifest is passed to DeviceManager.onDevicesChanged to sync a full list of devices from the controller/hub (Hue, SmartThings, etc) @@ -1570,6 +1572,14 @@ export interface RTCSignalingOptions { }; } +/** + * A flexible RTC signaling endpoint, typically a browser, that can handle offer and answer. + * Like Chromecast, etc, which has a Chromecast AppId that can connect to Scrypted. + */ +export interface RTCSignalingClient { + createRTCSignalingSession(): Promise; +} + export interface RTCSessionControl { getRefreshAt(): Promise; extendSession(): Promise; @@ -1580,12 +1590,19 @@ export interface RTCSessionControl { }): Promise; } -/** - * A flexible RTC signaling endpoint, typically a browser, that can handle offer and answer. - * Like Chromecast, etc, which has a Chromecast AppId that can connect to Scrypted. - */ -export interface RTCSignalingClient { - createRTCSignalingSession(): Promise; +export interface RTCMediaObjectTrack { + replace(mediaObject: MediaObject): Promise; + remove(): Promise; + setPlayback(options: { + audio: boolean, + video: boolean, + }): Promise; +} + +export interface RTCConnectionManagement { + negotiateRTCSignalingSession(): Promise; + addTrack(mediaObject: MediaObject): Promise; + close(): Promise; } /** @@ -1597,6 +1614,10 @@ export interface RTCSignalingChannel { startRTCSignalingSession(session: RTCSignalingSession): Promise; } +export interface ScryptedRTCSignalingChannel { + startRTCSignalingSession(session: RTCSignalingSession): Promise; +} + export interface RTCAVSignalingSetup { /** * Mechanism to allow configuration of TURN/STUN servers, etc. @@ -1615,14 +1636,23 @@ export enum ScryptedMimeTypes { Url = 'text/x-uri', InsecureLocalUrl = 'text/x-insecure-local-uri', LocalUrl = 'text/x-local-uri', + PushEndpoint = 'text/x-push-endpoint', - MediaStreamUrl = 'text/x-media-url', - FFmpegInput = 'x-scrypted/x-ffmpeg-input', - FFmpegTranscodeStream = 'x-scrypted/x-ffmpeg-transcode-stream', - RTCSignalingChannel = 'x-scrypted/x-scrypted-rtc-signaling-channel', + SchemePrefix = 'x-scrypted/x-scrypted-scheme-', + + MediaStreamUrl = 'text/x-media-url', MediaObject = 'x-scrypted/x-scrypted-media-object', RequestMediaStream = 'x-scrypted/x-scrypted-request-stream', + ScryptedDevice = 'x-scrypted/x-scrypted-device', + ScryptedDeviceId = 'x-scrypted/x-scrypted-device-id', + + FFmpegInput = 'x-scrypted/x-ffmpeg-input', + FFmpegTranscodeStream = 'x-scrypted/x-ffmpeg-transcode-stream', + + RTCSignalingChannel = 'x-scrypted/x-scrypted-rtc-signaling-channel', + RTCSignalingSession = 'x-scrypted/x-scrypted-rtc-signaling-session', + RTCConnectionManagement = 'x-scrypted/x-scrypted-rtc-connection-management', } export type RequestMediaStream = (options?: RequestMediaStreamOptions) => Promise; @@ -1634,6 +1664,13 @@ export interface FFmpegTranscode { } export type FFmpegTranscodeStream = (options: FFmpegTranscode) => Promise; +export interface PluginFork { + result: Promise; + worker: { + terminate(): Promise; + }; +} + export interface ScryptedStatic { /** * @deprecated @@ -1648,12 +1685,7 @@ export interface ScryptedStatic { pluginHostAPI: any; pluginRemoteAPI: any; - fork?(): { - result: Promise; - worker: { - terminate(): Promise; - }; - }; + fork?(): PluginFork; } export declare interface DeviceState { diff --git a/sdk/package.json b/sdk/package.json index 9dc6203f3..3c752f3f6 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "prepublishOnly": "npm run build && cd types && npm version patch && npm publish", - "prebuild": "typedoc && ts-node gen/build && cd types && npm run build", + "prebuild": "cd types && npm run build", "build": "tsc", "webpack": "webpack-cli --config webpack.config.js", "test": "echo \"Error: no test specified\" && exit 1" diff --git a/sdk/scrypted_python/scrypted_sdk/types.py b/sdk/scrypted_python/scrypted_sdk/types.py index 380c15b0b..f557d4630 100644 --- a/sdk/scrypted_python/scrypted_sdk/types.py +++ b/sdk/scrypted_python/scrypted_sdk/types.py @@ -149,9 +149,13 @@ class ScryptedMimeTypes(Enum): MediaObject = "x-scrypted/x-scrypted-media-object" MediaStreamUrl = "text/x-media-url" PushEndpoint = "text/x-push-endpoint" + RTCConnectionManagement = "x-scrypted/x-scrypted-rtc-connection-management" RTCSignalingChannel = "x-scrypted/x-scrypted-rtc-signaling-channel" + RTCSignalingSession = "x-scrypted/x-scrypted-rtc-signaling-session" RequestMediaStream = "x-scrypted/x-scrypted-request-stream" SchemePrefix = "x-scrypted/x-scrypted-scheme-" + ScryptedDevice = "x-scrypted/x-scrypted-device" + ScryptedDeviceId = "x-scrypted/x-scrypted-device-id" Url = "text/x-uri" class SecuritySystemMode(Enum): @@ -265,6 +269,7 @@ class ColorRgb(TypedDict): class Device(TypedDict): info: DeviceInformation interfaces: list[str] + internal: bool name: str nativeId: str providerNativeId: str diff --git a/sdk/types/index.d.ts b/sdk/types/index.d.ts index 0d24c0772..c22b42ab0 100644 --- a/sdk/types/index.d.ts +++ b/sdk/types/index.d.ts @@ -1,5 +1,5 @@ /// -export declare const TYPES_VERSION = "0.0.70"; +export declare const TYPES_VERSION = "0.0.81"; export interface DeviceState { id?: string; info?: DeviceInformation; @@ -1286,6 +1286,7 @@ export interface Device { */ providerNativeId?: ScryptedNativeId; room?: string; + internal?: boolean; } /** * DeviceManifest is passed to DeviceManager.onDevicesChanged to sync a full list of devices from the controller/hub (Hue, SmartThings, etc) @@ -1600,6 +1601,13 @@ export interface RTCSignalingOptions { height: number; }; } +/** + * A flexible RTC signaling endpoint, typically a browser, that can handle offer and answer. + * Like Chromecast, etc, which has a Chromecast AppId that can connect to Scrypted. + */ +export interface RTCSignalingClient { + createRTCSignalingSession(): Promise; +} export interface RTCSessionControl { getRefreshAt(): Promise; extendSession(): Promise; @@ -1609,12 +1617,18 @@ export interface RTCSessionControl { video: boolean; }): Promise; } -/** - * A flexible RTC signaling endpoint, typically a browser, that can handle offer and answer. - * Like Chromecast, etc, which has a Chromecast AppId that can connect to Scrypted. - */ -export interface RTCSignalingClient { - createRTCSignalingSession(): Promise; +export interface RTCMediaObjectTrack { + replace(mediaObject: MediaObject): Promise; + remove(): Promise; + setPlayback(options: { + audio: boolean; + video: boolean; + }): Promise; +} +export interface RTCConnectionManagement { + negotiateRTCSignalingSession(): Promise; + addTrack(mediaObject: MediaObject): Promise; + close(): Promise; } /** * An inflexible RTC Signaling channel, typically a vendor, like Nest or Ring. @@ -1624,6 +1638,9 @@ export interface RTCSignalingClient { export interface RTCSignalingChannel { startRTCSignalingSession(session: RTCSignalingSession): Promise; } +export interface ScryptedRTCSignalingChannel { + startRTCSignalingSession(session: RTCSignalingSession): Promise; +} export interface RTCAVSignalingSetup { /** * Mechanism to allow configuration of TURN/STUN servers, etc. @@ -1642,13 +1659,17 @@ export declare enum ScryptedMimeTypes { InsecureLocalUrl = "text/x-insecure-local-uri", LocalUrl = "text/x-local-uri", PushEndpoint = "text/x-push-endpoint", + SchemePrefix = "x-scrypted/x-scrypted-scheme-", MediaStreamUrl = "text/x-media-url", + MediaObject = "x-scrypted/x-scrypted-media-object", + RequestMediaStream = "x-scrypted/x-scrypted-request-stream", + ScryptedDevice = "x-scrypted/x-scrypted-device", + ScryptedDeviceId = "x-scrypted/x-scrypted-device-id", FFmpegInput = "x-scrypted/x-ffmpeg-input", FFmpegTranscodeStream = "x-scrypted/x-ffmpeg-transcode-stream", RTCSignalingChannel = "x-scrypted/x-scrypted-rtc-signaling-channel", - SchemePrefix = "x-scrypted/x-scrypted-scheme-", - MediaObject = "x-scrypted/x-scrypted-media-object", - RequestMediaStream = "x-scrypted/x-scrypted-request-stream" + RTCSignalingSession = "x-scrypted/x-scrypted-rtc-signaling-session", + RTCConnectionManagement = "x-scrypted/x-scrypted-rtc-connection-management" } export declare type RequestMediaStream = (options?: RequestMediaStreamOptions) => Promise; export interface FFmpegTranscode { @@ -1657,6 +1678,12 @@ export interface FFmpegTranscode { audioTranscodeArguments?: string[]; } export declare type FFmpegTranscodeStream = (options: FFmpegTranscode) => Promise; +export interface PluginFork { + result: Promise; + worker: { + terminate(): Promise; + }; +} export interface ScryptedStatic { /** * @deprecated @@ -1668,12 +1695,7 @@ export interface ScryptedStatic { systemManager: SystemManager; pluginHostAPI: any; pluginRemoteAPI: any; - fork?(): { - result: Promise; - worker: { - terminate(): Promise; - }; - }; + fork?(): PluginFork; } export declare interface DeviceState { id?: string; diff --git a/sdk/types/index.js b/sdk/types/index.js index e6fe7aa04..0e44831d4 100644 --- a/sdk/types/index.js +++ b/sdk/types/index.js @@ -1,7 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ScryptedMimeTypes = exports.ScryptedInterface = exports.MediaPlayerState = exports.SecuritySystemObstruction = exports.SecuritySystemMode = exports.AirQuality = exports.LockState = exports.ThermostatMode = exports.TemperatureUnit = exports.FanMode = exports.HumidityMode = exports.ScryptedDeviceType = exports.ScryptedInterfaceDescriptors = exports.ScryptedInterfaceProperty = exports.DeviceBase = exports.TYPES_VERSION = void 0; -exports.TYPES_VERSION = "0.0.70"; +exports.TYPES_VERSION = "0.0.81"; class DeviceBase { } exports.DeviceBase = DeviceBase; @@ -843,12 +843,16 @@ var ScryptedMimeTypes; ScryptedMimeTypes["InsecureLocalUrl"] = "text/x-insecure-local-uri"; ScryptedMimeTypes["LocalUrl"] = "text/x-local-uri"; ScryptedMimeTypes["PushEndpoint"] = "text/x-push-endpoint"; + ScryptedMimeTypes["SchemePrefix"] = "x-scrypted/x-scrypted-scheme-"; ScryptedMimeTypes["MediaStreamUrl"] = "text/x-media-url"; + ScryptedMimeTypes["MediaObject"] = "x-scrypted/x-scrypted-media-object"; + ScryptedMimeTypes["RequestMediaStream"] = "x-scrypted/x-scrypted-request-stream"; + ScryptedMimeTypes["ScryptedDevice"] = "x-scrypted/x-scrypted-device"; + ScryptedMimeTypes["ScryptedDeviceId"] = "x-scrypted/x-scrypted-device-id"; ScryptedMimeTypes["FFmpegInput"] = "x-scrypted/x-ffmpeg-input"; ScryptedMimeTypes["FFmpegTranscodeStream"] = "x-scrypted/x-ffmpeg-transcode-stream"; ScryptedMimeTypes["RTCSignalingChannel"] = "x-scrypted/x-scrypted-rtc-signaling-channel"; - ScryptedMimeTypes["SchemePrefix"] = "x-scrypted/x-scrypted-scheme-"; - ScryptedMimeTypes["MediaObject"] = "x-scrypted/x-scrypted-media-object"; - ScryptedMimeTypes["RequestMediaStream"] = "x-scrypted/x-scrypted-request-stream"; + ScryptedMimeTypes["RTCSignalingSession"] = "x-scrypted/x-scrypted-rtc-signaling-session"; + ScryptedMimeTypes["RTCConnectionManagement"] = "x-scrypted/x-scrypted-rtc-connection-management"; })(ScryptedMimeTypes = exports.ScryptedMimeTypes || (exports.ScryptedMimeTypes = {})); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/sdk/types/index.ts b/sdk/types/index.ts index 44a78c54e..462eea711 100644 --- a/sdk/types/index.ts +++ b/sdk/types/index.ts @@ -1,5 +1,5 @@ -export const TYPES_VERSION = "0.0.70"; +export const TYPES_VERSION = "0.0.81"; export interface DeviceState { @@ -2001,6 +2001,8 @@ export interface Device { */ providerNativeId?: ScryptedNativeId; room?: string; + + internal?: boolean; } /** * DeviceManifest is passed to DeviceManager.onDevicesChanged to sync a full list of devices from the controller/hub (Hue, SmartThings, etc) @@ -2346,6 +2348,14 @@ export interface RTCSignalingOptions { }; } +/** + * A flexible RTC signaling endpoint, typically a browser, that can handle offer and answer. + * Like Chromecast, etc, which has a Chromecast AppId that can connect to Scrypted. + */ +export interface RTCSignalingClient { + createRTCSignalingSession(): Promise; +} + export interface RTCSessionControl { getRefreshAt(): Promise; extendSession(): Promise; @@ -2356,12 +2366,19 @@ export interface RTCSessionControl { }): Promise; } -/** - * A flexible RTC signaling endpoint, typically a browser, that can handle offer and answer. - * Like Chromecast, etc, which has a Chromecast AppId that can connect to Scrypted. - */ -export interface RTCSignalingClient { - createRTCSignalingSession(): Promise; +export interface RTCMediaObjectTrack { + replace(mediaObject: MediaObject): Promise; + remove(): Promise; + setPlayback(options: { + audio: boolean, + video: boolean, + }): Promise; +} + +export interface RTCConnectionManagement { + negotiateRTCSignalingSession(): Promise; + addTrack(mediaObject: MediaObject): Promise; + close(): Promise; } /** @@ -2373,6 +2390,10 @@ export interface RTCSignalingChannel { startRTCSignalingSession(session: RTCSignalingSession): Promise; } +export interface ScryptedRTCSignalingChannel { + startRTCSignalingSession(session: RTCSignalingSession): Promise; +} + export interface RTCAVSignalingSetup { /** * Mechanism to allow configuration of TURN/STUN servers, etc. @@ -2391,14 +2412,23 @@ export enum ScryptedMimeTypes { Url = 'text/x-uri', InsecureLocalUrl = 'text/x-insecure-local-uri', LocalUrl = 'text/x-local-uri', + PushEndpoint = 'text/x-push-endpoint', - MediaStreamUrl = 'text/x-media-url', - FFmpegInput = 'x-scrypted/x-ffmpeg-input', - FFmpegTranscodeStream = 'x-scrypted/x-ffmpeg-transcode-stream', - RTCSignalingChannel = 'x-scrypted/x-scrypted-rtc-signaling-channel', + SchemePrefix = 'x-scrypted/x-scrypted-scheme-', + + MediaStreamUrl = 'text/x-media-url', MediaObject = 'x-scrypted/x-scrypted-media-object', RequestMediaStream = 'x-scrypted/x-scrypted-request-stream', + ScryptedDevice = 'x-scrypted/x-scrypted-device', + ScryptedDeviceId = 'x-scrypted/x-scrypted-device-id', + + FFmpegInput = 'x-scrypted/x-ffmpeg-input', + FFmpegTranscodeStream = 'x-scrypted/x-ffmpeg-transcode-stream', + + RTCSignalingChannel = 'x-scrypted/x-scrypted-rtc-signaling-channel', + RTCSignalingSession = 'x-scrypted/x-scrypted-rtc-signaling-session', + RTCConnectionManagement = 'x-scrypted/x-scrypted-rtc-connection-management', } export type RequestMediaStream = (options?: RequestMediaStreamOptions) => Promise; @@ -2410,6 +2440,13 @@ export interface FFmpegTranscode { } export type FFmpegTranscodeStream = (options: FFmpegTranscode) => Promise; +export interface PluginFork { + result: Promise; + worker: { + terminate(): Promise; + }; +} + export interface ScryptedStatic { /** * @deprecated @@ -2424,12 +2461,7 @@ export interface ScryptedStatic { pluginHostAPI: any; pluginRemoteAPI: any; - fork?(): { - result: Promise; - worker: { - terminate(): Promise; - }; - }; + fork?(): PluginFork; } export declare interface DeviceState { diff --git a/sdk/types/package-lock.json b/sdk/types/package-lock.json index 1b0d7f078..01d635fb2 100644 --- a/sdk/types/package-lock.json +++ b/sdk/types/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/types", - "version": "0.0.71", + "version": "0.0.81", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/types", - "version": "0.0.71", + "version": "0.0.81", "license": "ISC", "devDependencies": {} } diff --git a/sdk/types/package.json b/sdk/types/package.json index 5c8221bf5..c82ce4e84 100644 --- a/sdk/types/package.json +++ b/sdk/types/package.json @@ -1,13 +1,13 @@ { "name": "@scrypted/types", - "version": "0.0.71", + "version": "0.0.81", "description": "", "main": "index.js", "author": "", "license": "ISC", "scripts": { "prepublishOnly": "npm run build", - "build": "tsc" + "build": "cd .. && typedoc && cd types && ts-node ../gen/build && tsc" }, "dependencies": {}, "devDependencies": {}, diff --git a/sdk/types/scrypted_python/scrypted_sdk/types.py b/sdk/types/scrypted_python/scrypted_sdk/types.py index 380c15b0b..f557d4630 100644 --- a/sdk/types/scrypted_python/scrypted_sdk/types.py +++ b/sdk/types/scrypted_python/scrypted_sdk/types.py @@ -149,9 +149,13 @@ class ScryptedMimeTypes(Enum): MediaObject = "x-scrypted/x-scrypted-media-object" MediaStreamUrl = "text/x-media-url" PushEndpoint = "text/x-push-endpoint" + RTCConnectionManagement = "x-scrypted/x-scrypted-rtc-connection-management" RTCSignalingChannel = "x-scrypted/x-scrypted-rtc-signaling-channel" + RTCSignalingSession = "x-scrypted/x-scrypted-rtc-signaling-session" RequestMediaStream = "x-scrypted/x-scrypted-request-stream" SchemePrefix = "x-scrypted/x-scrypted-scheme-" + ScryptedDevice = "x-scrypted/x-scrypted-device" + ScryptedDeviceId = "x-scrypted/x-scrypted-device-id" Url = "text/x-uri" class SecuritySystemMode(Enum): @@ -265,6 +269,7 @@ class ColorRgb(TypedDict): class Device(TypedDict): info: DeviceInformation interfaces: list[str] + internal: bool name: str nativeId: str providerNativeId: str