sdk: fix python gen path

This commit is contained in:
Koushik Dutta
2022-09-27 19:21:19 -07:00
parent 9e71ce224f
commit 68bf00d713
13 changed files with 21 additions and 17 deletions

View File

@@ -1,4 +1,8 @@
__pycache__
developer.scrypted.app
.vscode
types/*
types/gen/schema.json
types/dist
types/node_modules
types/package*
typedoc.*

View File

@@ -6,13 +6,13 @@
"configurations": [
{
"autoAttachChildProcesses": false,
"type": "pwa-node",
"type": "node",
"request": "launch",
"name": "Launch Build TS Node",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/gen/build.ts",
"program": "${workspaceFolder}/types/src/build.ts",
"runtimeArgs": [
"--expose-gc",
"--nolazy",

View File

@@ -36,7 +36,7 @@ if (fs.existsSync(path.resolve(cwd, 'src/main.py'))) {
zip.addLocalFolder(resolved);
const sdk = path.join(__dirname, '../scrypted_python/scrypted_sdk');
const sdk = path.join(__dirname, '../types/scrypted_python/scrypted_sdk');
zip.addLocalFolder(sdk, 'scrypted_sdk', filename => !filename.endsWith('.pyc'));
const zipfs = path.join(cwd, 'fs');

4
sdk/package-lock.json generated
View File

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

View File

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

View File

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

View File

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

View File

@@ -415,7 +415,7 @@ class ObjectDetectionTypes(TypedDict):
pass
class ObjectsDetected(TypedDict):
detectionId: Any
detectionId: str
detections: list[ObjectDetectionResult]
eventId: Any
inputDimensions: tuple[float, float]
@@ -450,6 +450,7 @@ class RecordedEventOptions(TypedDict):
class RecordingStreamThumbnailOptions(TypedDict):
crop: Any
detectionId: str
resize: Any
pass
@@ -794,7 +795,7 @@ class ObjectDetection:
pass
class ObjectDetector:
async def getDetectionInput(self, detectionId: Any, eventId: Any = None) -> MediaObject:
async def getDetectionInput(self, detectionId: str, eventId: Any = None) -> MediaObject:
pass
async def getObjectTypes(self) -> ObjectDetectionTypes:
pass

View File

@@ -252,6 +252,4 @@ ${pythonEnums}
${python}
`
fs.writeFileSync(path.join(__dirname, '../../scrypted_python/scrypted_sdk/types.py'), pythonTypes);
fs.writeFileSync(path.join(__dirname, '../../scrypted_python/scrypted_sdk/types.py'), pythonTypes);
fs.copyFileSync(path.join(__dirname, '../../scrypted_python/scrypted_sdk/other.py'), path.join(__dirname, '../../scrypted_python/scrypted_sdk/other.py'));
fs.writeFileSync(path.join(__dirname, '../scrypted_python/scrypted_sdk/types.py'), pythonTypes);

View File

@@ -527,6 +527,7 @@ export interface RequestRecordingStreamOptions extends RequestMediaStreamOptions
}
export interface RecordingStreamThumbnailOptions {
detectionId?: string;
resize?: {
width?: number;
height?: number;
@@ -1042,7 +1043,7 @@ export interface ObjectsDetected {
/**
* The id for the detection session.
*/
detectionId?: any;
detectionId?: string;
/**
* The id for this specific event/frame within a detection video session.
* Will be undefined for single image detections.
@@ -1067,7 +1068,7 @@ export interface ObjectDetector {
* Get the media (image or video) that contains this detection.
* @param detectionId
*/
getDetectionInput(detectionId: any, eventId?: any): Promise<MediaObject>;
getDetectionInput(detectionId: string, eventId?: any): Promise<MediaObject>;
getObjectTypes(): Promise<ObjectDetectionTypes>;
}
export interface ObjectDetectionSession {