@cpzxrobot/sdk 1.3.63 → 1.3.65
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/camera_gateway.ts +20 -0
- package/dist/camera_gateway.js +13 -0
- package/package.json +1 -1
- package/types.d.ts +1 -0
- package/unit_gateway.ts +5 -5
package/camera_gateway.ts
CHANGED
|
@@ -76,4 +76,24 @@ export class CameraGateway extends Object {
|
|
|
76
76
|
const response = await axios.get(url);
|
|
77
77
|
return response.data;
|
|
78
78
|
}
|
|
79
|
+
|
|
80
|
+
// 获取摄像头历史视频回放地址
|
|
81
|
+
async playback(
|
|
82
|
+
data: {
|
|
83
|
+
id: number;
|
|
84
|
+
start?: string;
|
|
85
|
+
end?: string;
|
|
86
|
+
}
|
|
87
|
+
): Promise<any> {
|
|
88
|
+
var axios = await this.context.ready;
|
|
89
|
+
var url = `/api/v1/camera/${data.id}/playback`;
|
|
90
|
+
if (data.start) {
|
|
91
|
+
url += `?start=${encodeURIComponent(data.start)}`;
|
|
92
|
+
}
|
|
93
|
+
if (data.end) {
|
|
94
|
+
url += `${data.start ? '&' : '?'}end=${encodeURIComponent(data.end)}`;
|
|
95
|
+
}
|
|
96
|
+
const response = await axios.get(url);
|
|
97
|
+
return response.data;
|
|
98
|
+
}
|
|
79
99
|
}
|
package/dist/camera_gateway.js
CHANGED
|
@@ -44,5 +44,18 @@ class CameraGateway extends Object {
|
|
|
44
44
|
const response = await axios.get(url);
|
|
45
45
|
return response.data;
|
|
46
46
|
}
|
|
47
|
+
// 获取摄像头历史视频回放地址
|
|
48
|
+
async playback(data) {
|
|
49
|
+
var axios = await this.context.ready;
|
|
50
|
+
var url = `/api/v1/camera/${data.id}/playback`;
|
|
51
|
+
if (data.start) {
|
|
52
|
+
url += `?start=${encodeURIComponent(data.start)}`;
|
|
53
|
+
}
|
|
54
|
+
if (data.end) {
|
|
55
|
+
url += `${data.start ? '&' : '?'}end=${encodeURIComponent(data.end)}`;
|
|
56
|
+
}
|
|
57
|
+
const response = await axios.get(url);
|
|
58
|
+
return response.data;
|
|
59
|
+
}
|
|
47
60
|
}
|
|
48
61
|
exports.CameraGateway = CameraGateway;
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
package/unit_gateway.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Cpzxrobot, type Unit } from "./types";
|
|
1
|
+
import { Cpzxrobot, type Unit, type UnitConfigType } from "./types";
|
|
2
2
|
|
|
3
3
|
export class UnitGateway extends Object {
|
|
4
4
|
context: Cpzxrobot;
|
|
@@ -16,7 +16,7 @@ export class UnitGateway extends Object {
|
|
|
16
16
|
return {
|
|
17
17
|
add: (
|
|
18
18
|
unit: Unit,
|
|
19
|
-
type:
|
|
19
|
+
type: UnitConfigType,
|
|
20
20
|
config: {
|
|
21
21
|
[key: string]: any;
|
|
22
22
|
}
|
|
@@ -31,7 +31,7 @@ export class UnitGateway extends Object {
|
|
|
31
31
|
},
|
|
32
32
|
update: (
|
|
33
33
|
unit: Unit,
|
|
34
|
-
type:
|
|
34
|
+
type: UnitConfigType,
|
|
35
35
|
config: {
|
|
36
36
|
[key: string]: any;
|
|
37
37
|
}
|
|
@@ -44,7 +44,7 @@ export class UnitGateway extends Object {
|
|
|
44
44
|
});
|
|
45
45
|
});
|
|
46
46
|
},
|
|
47
|
-
get: (unit: Unit, type:
|
|
47
|
+
get: (unit: Unit, type: UnitConfigType) => {
|
|
48
48
|
return this.context.ready.then((axios) => {
|
|
49
49
|
return axios.get(`/api/v2/unit/config`, {
|
|
50
50
|
params: {
|
|
@@ -57,7 +57,7 @@ export class UnitGateway extends Object {
|
|
|
57
57
|
delete: (
|
|
58
58
|
unit: Unit,
|
|
59
59
|
config: string,
|
|
60
|
-
type:
|
|
60
|
+
type: UnitConfigType
|
|
61
61
|
) => {
|
|
62
62
|
return this.context.ready.then((axios) => {
|
|
63
63
|
return axios.get(`/api/v2/unit/config/delete`, {
|