sdk: update

This commit is contained in:
Koushik Dutta
2022-11-25 14:00:18 -08:00
parent 5dbb81d26b
commit 2e7055aaa3
6 changed files with 87 additions and 48 deletions

4
sdk/package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/sdk",
"version": "0.2.12",
"version": "0.2.14",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/sdk",
"version": "0.2.12",
"version": "0.2.14",
"license": "ISC",
"dependencies": {
"@babel/preset-typescript": "^7.16.7",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/sdk",
"version": "0.2.12",
"version": "0.2.14",
"description": "",
"main": "dist/src/index.js",
"exports": {

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/types",
"version": "0.2.10",
"version": "0.2.11",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/types",
"version": "0.2.10",
"version": "0.2.11",
"license": "ISC",
"devDependencies": {
"@types/rimraf": "^3.0.2",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/types",
"version": "0.2.10",
"version": "0.2.11",
"description": "",
"main": "dist/index.js",
"author": "",

View File

@@ -1145,17 +1145,29 @@ class MediaManager:
pass
class EndpointManager:
async def deliverPush(self, endpoint: str, request: HttpRequest) -> None:
async def deliverPush(self, id: str, request: HttpRequest) -> None:
pass
async def getAuthenticatedPath(self) -> str:
async def getAuthenticatedPath(self, nativeId: str = None) -> str:
pass
async def getInsecurePublicLocalEndpoint(self) -> str:
async def getCloudEndpoint(self, nativeId: str = None, options: Any = None) -> str:
pass
async def getPublicCloudEndpoint(self) -> str:
async def getCloudPushEndpoint(self, nativeId: str = None) -> str:
pass
async def getPublicLocalEndpoint(self) -> str:
async def getInsecurePublicLocalEndpoint(self, nativeId: str = None) -> str:
pass
async def getPublicPushEndpoint(self) -> str:
def getLocalAddresses(self) -> list[str]:
pass
async def getLocalEndpoint(self, nativeId: str = None, options: Any = None) -> str:
pass
async def getPath(self, nativeId: str = None, options: Any = None) -> str:
pass
async def getPublicCloudEndpoint(self, nativeId: str = None) -> str:
pass
async def getPublicLocalEndpoint(self, nativeId: str = None) -> str:
pass
async def getPublicPushEndpoint(self, nativeId: str = None) -> str:
pass
async def setLocalAddresses(self, addresses: list[str]) -> None:
pass
pass

View File

@@ -511,7 +511,7 @@ export interface RequestMediaStreamOptions extends MediaStreamOptions {
* Request an adaptive bitrate stream, if available. The destination
* will need to report packet loss indication.
*/
adaptive?: boolean;
adaptive?: boolean;
}
export interface MediaStreamPacketLoss {
@@ -1329,60 +1329,87 @@ export interface Device {
*/
export interface EndpointManager {
/**
* Get an URL pathname that can be accessed on your local network or cloud while authenticated. This is an absolute path that requires cookie authentication, and generally used only in browser contexts.
*/
getAuthenticatedPath(): Promise<string>;
/**
* Get an URL pathname that can be accessed on your local network or cloud while authenticated. This is an absolute path that requires cookie authentication, and generally used only in browser contexts.
* Get an URL pathname for a device that can be accessed with authentication. This is a relative path that can be used in browser sessions.
* @deprecated
*/
getAuthenticatedPath(nativeId?: ScryptedNativeId): Promise<string>;
/**
* Get an URL that can only be accessed on your local network by anyone with the link. HTTP requests and responses are without any encryption. Plugin implementation is responsible for authentication.
*/
getInsecurePublicLocalEndpoint(): Promise<string>;
/**
* Get an URL that can only be accessed on your local network by anyone with the link. HTTP requests and responses are without any encryption. Plugin implementation is responsible for authentication.
*/
* Get an URL that can only be accessed on your local network by anyone with the link. HTTP requests and responses are without any encryption. Plugin implementation is responsible for authentication.
* @deprecated
*/
getInsecurePublicLocalEndpoint(nativeId?: ScryptedNativeId): Promise<string>;
/**
* Get an URL that can be externally accessed by anyone with the link. Plugin implementation is responsible for authentication.
*/
getPublicCloudEndpoint(): Promise<string>;
/**
* Get an URL that can be externally accessed by anyone with the link. Plugin implementation is responsible for authentication.
*/
getPublicCloudEndpoint(nativeId?: ScryptedNativeId): Promise<string>;
/**
* Get an URL that can only be accessed on your local network by anyone with the link. HTTP requests and responses are over SSL with a self signed certificate. Plugin implementation is responsible for authentication.
*/
getPublicLocalEndpoint(): Promise<string>;
/**
* Get an URL that can only be accessed on your local network by anyone with the link. HTTP requests and responses are over SSL with a self signed certificate. Plugin implementation is responsible for authentication.
* @deprecated
*/
getPublicLocalEndpoint(nativeId?: ScryptedNativeId): Promise<string>;
/**
* Get an URL that can be used to send a push message to the client. This differs from a cloud endpoint, in that, the Plugin does not send a response back. Plugin implementation is responsible for authentication.
*/
getPublicPushEndpoint(): Promise<string>;
/**
* Get an URL that can be used to send a push message to the client. This differs from a cloud endpoint, in that, the Plugin does not send a response back. Plugin implementation is responsible for authentication.
* @deprecated
*/
getPublicPushEndpoint(nativeId?: ScryptedNativeId): Promise<string>;
/**
* Deliver a push notification to the system.
* Get an URL that can be externally accessed by anyone with the link. Plugin implementation is responsible for authentication.
* @deprecated
*/
deliverPush(endpoint: string, request: HttpRequest): Promise<void>;
getPublicCloudEndpoint(nativeId?: ScryptedNativeId): Promise<string>;
/**
* Get an URL pathname for a device that can be accessed without authentication. This is a relative path that can be used in browser sessions.
*/
getPath(nativeId?: ScryptedNativeId, options?: {
public?: boolean,
}): Promise<string>;
/**
* Get an URL that can only be accessed on your local network by anyone with the link.
*/
getLocalEndpoint(nativeId?: string, options?: {
/**
* A public endpoint that does not require authentication with the local Scrypted server.
*/
public?: boolean,
/**
* An insecure endpoint served by http, not https.
*/
insecure?: boolean,
}): Promise<string>;
/**
* Get an URL that can be externally accessed by anyone with the link. Plugin implementation is responsible for authentication.
* @deprecated
*/
getCloudEndpoint(nativeId?: ScryptedNativeId, options?: {
/**
* A public endpoint that does not require authentication with the local Scrypted server.
*/
public?: boolean,
}): Promise<string>;
/**
* Get an URL that can be used to send a push message to the client. This differs from a cloud endpoint, in that, the Plugin does not send a response back.
*/
getCloudPushEndpoint(nativeId?: ScryptedNativeId): Promise<string>;
/**
* Deliver a push notification to a device. Used by push providers.
*/
deliverPush(id: string, request: HttpRequest): Promise<void>;
/**
* Set the recommended local addresses used by Scrypted plugins that listen for incoming connections.
* @param addresses
*/
setLocalAddresses(...addresses: string[]): Promise<void>;
/**
* Get the recommended local addresess used by Scrypted plugins that listen for incoming connections.
*/
getLocalAddresses(): Promise<string>[];
}
/**
* SystemManager is used by scripts to query device state and access devices.