@awarevue/api-types 2.0.152 → 2.0.154
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/dist/api/agent-protocol/protocol.d.ts +6 -0
- package/dist/api/error.d.ts +11 -0
- package/dist/api/error.js +8 -1
- package/dist/api/events/all.d.ts +15 -0
- package/dist/api/events/camera.d.ts +43 -0
- package/dist/api/events/camera.js +38 -4
- package/dist/api/rest/layout.d.ts +238 -1
- package/dist/api/rest/layout.js +38 -8
- package/dist/api/rest/trackables.d.ts +36 -0
- package/dist/api/ws/trackables.d.ts +12 -0
- package/dist/objects/layout.d.ts +324 -2
- package/dist/objects/layout.js +116 -5
- package/dist/objects/trackable-retention-policy.d.ts +6 -0
- package/dist/objects/trackable.d.ts +12 -0
- package/dist/objects/trackable.js +7 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/api/rest/layout.js
CHANGED
|
@@ -3,25 +3,55 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.sUpdateLayoutRequest = exports.sAddLayoutRequest = void 0;
|
|
6
|
+
exports.sUpdateLayoutRequest = exports.sAddLayoutRequest = exports.sAddImageOrMapLayoutRequest = exports.sAddMapLayoutRequest = exports.sAddImageLayoutRequest = void 0;
|
|
7
7
|
const layout_1 = require("../../objects/layout");
|
|
8
8
|
const zod_1 = __importDefault(require("zod"));
|
|
9
|
-
|
|
9
|
+
const sAddLayoutBase = zod_1.default.object({
|
|
10
10
|
name: zod_1.default.string().nonempty(),
|
|
11
|
-
thumbnailId: zod_1.default.string().nonempty(),
|
|
12
|
-
imageId: zod_1.default.string().nonempty(),
|
|
13
11
|
order: zod_1.default.number().optional(),
|
|
14
12
|
devices: zod_1.default.array(layout_1.sLayoutDeviceDto),
|
|
15
13
|
colorize: zod_1.default.boolean(),
|
|
16
|
-
map: zod_1.default.boolean(),
|
|
17
14
|
});
|
|
15
|
+
exports.sAddImageLayoutRequest = sAddLayoutBase.extend({
|
|
16
|
+
kind: zod_1.default.literal('image'),
|
|
17
|
+
thumbnailId: zod_1.default.string().nonempty(),
|
|
18
|
+
imageId: zod_1.default.string().nonempty(),
|
|
19
|
+
});
|
|
20
|
+
exports.sAddMapLayoutRequest = sAddLayoutBase.extend({
|
|
21
|
+
kind: zod_1.default.literal('map'),
|
|
22
|
+
});
|
|
23
|
+
/** An image layout, or a map layout when `map` is true, chosen by a flag rather than by `kind`. */
|
|
24
|
+
exports.sAddImageOrMapLayoutRequest = sAddLayoutBase.extend({
|
|
25
|
+
thumbnailId: zod_1.default.string().nonempty(),
|
|
26
|
+
imageId: zod_1.default.string().nonempty(),
|
|
27
|
+
map: zod_1.default.boolean().describe('True for a map layout, false for an image layout'),
|
|
28
|
+
});
|
|
29
|
+
/** `3d` layouts are created by importing their model (POST /layouts/models). */
|
|
30
|
+
exports.sAddLayoutRequest = zod_1.default.union([
|
|
31
|
+
zod_1.default.discriminatedUnion('kind', [exports.sAddImageLayoutRequest, exports.sAddMapLayoutRequest]),
|
|
32
|
+
exports.sAddImageOrMapLayoutRequest,
|
|
33
|
+
]);
|
|
18
34
|
exports.sUpdateLayoutRequest = zod_1.default.object({
|
|
19
35
|
name: zod_1.default.string().optional(),
|
|
20
|
-
thumbnailId: zod_1.default
|
|
21
|
-
|
|
36
|
+
thumbnailId: zod_1.default
|
|
37
|
+
.string()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe('Not for 3d layouts, which have no image'),
|
|
40
|
+
imageId: zod_1.default
|
|
41
|
+
.string()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe('Not for 3d layouts, which have no image'),
|
|
22
44
|
order: zod_1.default.number().optional(),
|
|
23
45
|
isDefault: zod_1.default.boolean().optional(),
|
|
24
46
|
devices: zod_1.default.array(layout_1.sLayoutDeviceDto).optional(),
|
|
47
|
+
placementsRev: zod_1.default
|
|
48
|
+
.number()
|
|
49
|
+
.int()
|
|
50
|
+
.optional()
|
|
51
|
+
.describe("The layout's placementsRev the devices were edited from. When sent with devices, the save is refused if someone else saved meanwhile."),
|
|
25
52
|
colorize: zod_1.default.boolean().optional(),
|
|
26
|
-
map: zod_1.default
|
|
53
|
+
map: zod_1.default
|
|
54
|
+
.boolean()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe('Ignored: a layout keeps the kind it was made with'),
|
|
27
57
|
});
|
|
@@ -6,6 +6,12 @@ export declare const sTrackableProfileSnapshot: z.ZodObject<{
|
|
|
6
6
|
"base-station": "base-station";
|
|
7
7
|
"aid-to-navigation": "aid-to-navigation";
|
|
8
8
|
"sar-aircraft": "sar-aircraft";
|
|
9
|
+
aircraft: "aircraft";
|
|
10
|
+
helicopter: "helicopter";
|
|
11
|
+
glider: "glider";
|
|
12
|
+
balloon: "balloon";
|
|
13
|
+
drone: "drone";
|
|
14
|
+
"ground-vehicle": "ground-vehicle";
|
|
9
15
|
}>>;
|
|
10
16
|
}, z.core.$strip>;
|
|
11
17
|
export declare const sSetTrackableFavoriteRequest: z.ZodObject<{
|
|
@@ -15,6 +21,12 @@ export declare const sSetTrackableFavoriteRequest: z.ZodObject<{
|
|
|
15
21
|
"base-station": "base-station";
|
|
16
22
|
"aid-to-navigation": "aid-to-navigation";
|
|
17
23
|
"sar-aircraft": "sar-aircraft";
|
|
24
|
+
aircraft: "aircraft";
|
|
25
|
+
helicopter: "helicopter";
|
|
26
|
+
glider: "glider";
|
|
27
|
+
balloon: "balloon";
|
|
28
|
+
drone: "drone";
|
|
29
|
+
"ground-vehicle": "ground-vehicle";
|
|
18
30
|
}>>;
|
|
19
31
|
}, z.core.$strip>;
|
|
20
32
|
export type SetTrackableFavoriteRequest = z.infer<typeof sSetTrackableFavoriteRequest>;
|
|
@@ -25,6 +37,12 @@ export declare const sCreateTrackableRequest: z.ZodObject<{
|
|
|
25
37
|
"base-station": "base-station";
|
|
26
38
|
"aid-to-navigation": "aid-to-navigation";
|
|
27
39
|
"sar-aircraft": "sar-aircraft";
|
|
40
|
+
aircraft: "aircraft";
|
|
41
|
+
helicopter: "helicopter";
|
|
42
|
+
glider: "glider";
|
|
43
|
+
balloon: "balloon";
|
|
44
|
+
drone: "drone";
|
|
45
|
+
"ground-vehicle": "ground-vehicle";
|
|
28
46
|
}>>;
|
|
29
47
|
objectId: z.ZodString;
|
|
30
48
|
}, z.core.$strip>;
|
|
@@ -36,6 +54,12 @@ export declare const sUpdateTrackableRequest: z.ZodObject<{
|
|
|
36
54
|
"base-station": "base-station";
|
|
37
55
|
"aid-to-navigation": "aid-to-navigation";
|
|
38
56
|
"sar-aircraft": "sar-aircraft";
|
|
57
|
+
aircraft: "aircraft";
|
|
58
|
+
helicopter: "helicopter";
|
|
59
|
+
glider: "glider";
|
|
60
|
+
balloon: "balloon";
|
|
61
|
+
drone: "drone";
|
|
62
|
+
"ground-vehicle": "ground-vehicle";
|
|
39
63
|
}>>;
|
|
40
64
|
}, z.core.$strip>;
|
|
41
65
|
export type UpdateTrackableRequest = z.infer<typeof sUpdateTrackableRequest>;
|
|
@@ -46,6 +70,12 @@ export declare const sAttachTrackableImageRequest: z.ZodObject<{
|
|
|
46
70
|
"base-station": "base-station";
|
|
47
71
|
"aid-to-navigation": "aid-to-navigation";
|
|
48
72
|
"sar-aircraft": "sar-aircraft";
|
|
73
|
+
aircraft: "aircraft";
|
|
74
|
+
helicopter: "helicopter";
|
|
75
|
+
glider: "glider";
|
|
76
|
+
balloon: "balloon";
|
|
77
|
+
drone: "drone";
|
|
78
|
+
"ground-vehicle": "ground-vehicle";
|
|
49
79
|
}>>;
|
|
50
80
|
imageId: z.ZodUUID;
|
|
51
81
|
reviewed: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -63,6 +93,12 @@ export declare const sCreateTrackableRetentionPolicyRequest: z.ZodObject<{
|
|
|
63
93
|
"base-station": "base-station";
|
|
64
94
|
"aid-to-navigation": "aid-to-navigation";
|
|
65
95
|
"sar-aircraft": "sar-aircraft";
|
|
96
|
+
aircraft: "aircraft";
|
|
97
|
+
helicopter: "helicopter";
|
|
98
|
+
glider: "glider";
|
|
99
|
+
balloon: "balloon";
|
|
100
|
+
drone: "drone";
|
|
101
|
+
"ground-vehicle": "ground-vehicle";
|
|
66
102
|
}>;
|
|
67
103
|
}, z.core.$strip>;
|
|
68
104
|
export type CreateTrackableRetentionPolicyRequest = z.infer<typeof sCreateTrackableRetentionPolicyRequest>;
|
|
@@ -9,6 +9,12 @@ export declare const sTrackableUpdate: z.ZodObject<{
|
|
|
9
9
|
"base-station": "base-station";
|
|
10
10
|
"aid-to-navigation": "aid-to-navigation";
|
|
11
11
|
"sar-aircraft": "sar-aircraft";
|
|
12
|
+
aircraft: "aircraft";
|
|
13
|
+
helicopter: "helicopter";
|
|
14
|
+
glider: "glider";
|
|
15
|
+
balloon: "balloon";
|
|
16
|
+
drone: "drone";
|
|
17
|
+
"ground-vehicle": "ground-vehicle";
|
|
12
18
|
}>>;
|
|
13
19
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
14
20
|
longitude: z.ZodOptional<z.ZodNumber>;
|
|
@@ -36,6 +42,12 @@ export declare const sTrackableUpdatePayload: z.ZodObject<{
|
|
|
36
42
|
"base-station": "base-station";
|
|
37
43
|
"aid-to-navigation": "aid-to-navigation";
|
|
38
44
|
"sar-aircraft": "sar-aircraft";
|
|
45
|
+
aircraft: "aircraft";
|
|
46
|
+
helicopter: "helicopter";
|
|
47
|
+
glider: "glider";
|
|
48
|
+
balloon: "balloon";
|
|
49
|
+
drone: "drone";
|
|
50
|
+
"ground-vehicle": "ground-vehicle";
|
|
39
51
|
}>>;
|
|
40
52
|
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
41
53
|
longitude: z.ZodOptional<z.ZodNumber>;
|
package/dist/objects/layout.d.ts
CHANGED
|
@@ -1,4 +1,51 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* What a layout's document is, fixed when the layout is created:
|
|
4
|
+
* - `image`: a plan image (SVG/PNG); devices are placed on the image.
|
|
5
|
+
* - `map`: the world map; devices are placed on the map.
|
|
6
|
+
* - `3d`: a 3D model (model.json plus plan images); devices are placed on the model's levels, in metres.
|
|
7
|
+
*/
|
|
8
|
+
export declare const sLayoutKind: z.ZodEnum<{
|
|
9
|
+
map: "map";
|
|
10
|
+
image: "image";
|
|
11
|
+
"3d": "3d";
|
|
12
|
+
}>;
|
|
13
|
+
export type LayoutKind = z.infer<typeof sLayoutKind>;
|
|
14
|
+
/** Four points in a camera's picture, as fractions of its width and height, and the four level points they show. */
|
|
15
|
+
export declare const sCameraCalibration: z.ZodObject<{
|
|
16
|
+
img: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
17
|
+
level: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export type CameraCalibration = z.infer<typeof sCameraCalibration>;
|
|
20
|
+
/** Placement attributes that only some device types use. Absent keys take the device type's defaults. */
|
|
21
|
+
export declare const sLayoutDeviceExtras: z.ZodObject<{
|
|
22
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
hinge: z.ZodOptional<z.ZodEnum<{
|
|
24
|
+
start: "start";
|
|
25
|
+
end: "end";
|
|
26
|
+
}>>;
|
|
27
|
+
opens: z.ZodOptional<z.ZodEnum<{
|
|
28
|
+
right: "right";
|
|
29
|
+
left: "left";
|
|
30
|
+
}>>;
|
|
31
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
room: z.ZodOptional<z.ZodString>;
|
|
33
|
+
viewId: z.ZodOptional<z.ZodString>;
|
|
34
|
+
calibration: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
img: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
36
|
+
level: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
zoneRooms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type LayoutDeviceExtras = z.infer<typeof sLayoutDeviceExtras>;
|
|
41
|
+
/**
|
|
42
|
+
* A device placed on a layout. What x, y and rotation mean depends on the layout's kind:
|
|
43
|
+
* - `image` and `map`: a position on the image or map, as the layout editor stores it.
|
|
44
|
+
* - `3d`: metres on the level, x along the model's x axis (towards the bow) and y along its z axis; rotation is the
|
|
45
|
+
* heading in degrees, 0 towards +x and 90 towards +y; scale is 1.
|
|
46
|
+
*
|
|
47
|
+
* In requests, `level`, `height` and `extras` left out keep their stored values, and null clears them.
|
|
48
|
+
*/
|
|
2
49
|
export declare const sLayoutDeviceDto: z.ZodObject<{
|
|
3
50
|
deviceId: z.ZodString;
|
|
4
51
|
x: z.ZodNumber;
|
|
@@ -8,13 +55,77 @@ export declare const sLayoutDeviceDto: z.ZodObject<{
|
|
|
8
55
|
fov: z.ZodNumber;
|
|
9
56
|
far: z.ZodNumber;
|
|
10
57
|
displayAs: z.ZodNullable<z.ZodString>;
|
|
58
|
+
level: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
60
|
+
extras: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
61
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
62
|
+
hinge: z.ZodOptional<z.ZodEnum<{
|
|
63
|
+
start: "start";
|
|
64
|
+
end: "end";
|
|
65
|
+
}>>;
|
|
66
|
+
opens: z.ZodOptional<z.ZodEnum<{
|
|
67
|
+
right: "right";
|
|
68
|
+
left: "left";
|
|
69
|
+
}>>;
|
|
70
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
room: z.ZodOptional<z.ZodString>;
|
|
72
|
+
viewId: z.ZodOptional<z.ZodString>;
|
|
73
|
+
calibration: z.ZodOptional<z.ZodObject<{
|
|
74
|
+
img: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
75
|
+
level: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
76
|
+
}, z.core.$strip>>;
|
|
77
|
+
zoneRooms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
78
|
+
}, z.core.$strip>>>;
|
|
11
79
|
}, z.core.$strip>;
|
|
12
80
|
export type LayoutDeviceDto = z.infer<typeof sLayoutDeviceDto>;
|
|
13
|
-
export declare const
|
|
81
|
+
export declare const sImageLayoutDto: z.ZodObject<{
|
|
14
82
|
id: z.ZodString;
|
|
15
83
|
name: z.ZodString;
|
|
16
|
-
|
|
84
|
+
order: z.ZodNumber;
|
|
85
|
+
isDefault: z.ZodBoolean;
|
|
86
|
+
devices: z.ZodArray<z.ZodObject<{
|
|
87
|
+
deviceId: z.ZodString;
|
|
88
|
+
x: z.ZodNumber;
|
|
89
|
+
y: z.ZodNumber;
|
|
90
|
+
scale: z.ZodNumber;
|
|
91
|
+
rotation: z.ZodNumber;
|
|
92
|
+
fov: z.ZodNumber;
|
|
93
|
+
far: z.ZodNumber;
|
|
94
|
+
displayAs: z.ZodNullable<z.ZodString>;
|
|
95
|
+
level: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
96
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
97
|
+
extras: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
98
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
99
|
+
hinge: z.ZodOptional<z.ZodEnum<{
|
|
100
|
+
start: "start";
|
|
101
|
+
end: "end";
|
|
102
|
+
}>>;
|
|
103
|
+
opens: z.ZodOptional<z.ZodEnum<{
|
|
104
|
+
right: "right";
|
|
105
|
+
left: "left";
|
|
106
|
+
}>>;
|
|
107
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
room: z.ZodOptional<z.ZodString>;
|
|
109
|
+
viewId: z.ZodOptional<z.ZodString>;
|
|
110
|
+
calibration: z.ZodOptional<z.ZodObject<{
|
|
111
|
+
img: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
112
|
+
level: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
113
|
+
}, z.core.$strip>>;
|
|
114
|
+
zoneRooms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
115
|
+
}, z.core.$strip>>>;
|
|
116
|
+
}, z.core.$strip>>;
|
|
117
|
+
colorize: z.ZodBoolean;
|
|
118
|
+
placementsRev: z.ZodNumber;
|
|
119
|
+
map: z.ZodBoolean;
|
|
120
|
+
createdOn: z.ZodString;
|
|
121
|
+
lastModifiedOn: z.ZodString;
|
|
122
|
+
kind: z.ZodLiteral<"image">;
|
|
17
123
|
imageUrl: z.ZodString;
|
|
124
|
+
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
export declare const sMapLayoutDto: z.ZodObject<{
|
|
127
|
+
id: z.ZodString;
|
|
128
|
+
name: z.ZodString;
|
|
18
129
|
order: z.ZodNumber;
|
|
19
130
|
isDefault: z.ZodBoolean;
|
|
20
131
|
devices: z.ZodArray<z.ZodObject<{
|
|
@@ -26,10 +137,221 @@ export declare const sLayoutDto: z.ZodObject<{
|
|
|
26
137
|
fov: z.ZodNumber;
|
|
27
138
|
far: z.ZodNumber;
|
|
28
139
|
displayAs: z.ZodNullable<z.ZodString>;
|
|
140
|
+
level: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
141
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
142
|
+
extras: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
143
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
hinge: z.ZodOptional<z.ZodEnum<{
|
|
145
|
+
start: "start";
|
|
146
|
+
end: "end";
|
|
147
|
+
}>>;
|
|
148
|
+
opens: z.ZodOptional<z.ZodEnum<{
|
|
149
|
+
right: "right";
|
|
150
|
+
left: "left";
|
|
151
|
+
}>>;
|
|
152
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
room: z.ZodOptional<z.ZodString>;
|
|
154
|
+
viewId: z.ZodOptional<z.ZodString>;
|
|
155
|
+
calibration: z.ZodOptional<z.ZodObject<{
|
|
156
|
+
img: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
157
|
+
level: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
158
|
+
}, z.core.$strip>>;
|
|
159
|
+
zoneRooms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
160
|
+
}, z.core.$strip>>>;
|
|
29
161
|
}, z.core.$strip>>;
|
|
30
162
|
colorize: z.ZodBoolean;
|
|
163
|
+
placementsRev: z.ZodNumber;
|
|
31
164
|
map: z.ZodBoolean;
|
|
32
165
|
createdOn: z.ZodString;
|
|
33
166
|
lastModifiedOn: z.ZodString;
|
|
167
|
+
kind: z.ZodLiteral<"map">;
|
|
168
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
169
|
+
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
34
170
|
}, z.core.$strip>;
|
|
171
|
+
export declare const sModelLayoutDto: z.ZodObject<{
|
|
172
|
+
id: z.ZodString;
|
|
173
|
+
name: z.ZodString;
|
|
174
|
+
order: z.ZodNumber;
|
|
175
|
+
isDefault: z.ZodBoolean;
|
|
176
|
+
devices: z.ZodArray<z.ZodObject<{
|
|
177
|
+
deviceId: z.ZodString;
|
|
178
|
+
x: z.ZodNumber;
|
|
179
|
+
y: z.ZodNumber;
|
|
180
|
+
scale: z.ZodNumber;
|
|
181
|
+
rotation: z.ZodNumber;
|
|
182
|
+
fov: z.ZodNumber;
|
|
183
|
+
far: z.ZodNumber;
|
|
184
|
+
displayAs: z.ZodNullable<z.ZodString>;
|
|
185
|
+
level: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
186
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
187
|
+
extras: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
188
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
hinge: z.ZodOptional<z.ZodEnum<{
|
|
190
|
+
start: "start";
|
|
191
|
+
end: "end";
|
|
192
|
+
}>>;
|
|
193
|
+
opens: z.ZodOptional<z.ZodEnum<{
|
|
194
|
+
right: "right";
|
|
195
|
+
left: "left";
|
|
196
|
+
}>>;
|
|
197
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
198
|
+
room: z.ZodOptional<z.ZodString>;
|
|
199
|
+
viewId: z.ZodOptional<z.ZodString>;
|
|
200
|
+
calibration: z.ZodOptional<z.ZodObject<{
|
|
201
|
+
img: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
202
|
+
level: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
203
|
+
}, z.core.$strip>>;
|
|
204
|
+
zoneRooms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
205
|
+
}, z.core.$strip>>>;
|
|
206
|
+
}, z.core.$strip>>;
|
|
207
|
+
colorize: z.ZodBoolean;
|
|
208
|
+
placementsRev: z.ZodNumber;
|
|
209
|
+
map: z.ZodBoolean;
|
|
210
|
+
createdOn: z.ZodString;
|
|
211
|
+
lastModifiedOn: z.ZodString;
|
|
212
|
+
kind: z.ZodLiteral<"3d">;
|
|
213
|
+
}, z.core.$strip>;
|
|
214
|
+
export declare const sLayoutDto: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
215
|
+
id: z.ZodString;
|
|
216
|
+
name: z.ZodString;
|
|
217
|
+
order: z.ZodNumber;
|
|
218
|
+
isDefault: z.ZodBoolean;
|
|
219
|
+
devices: z.ZodArray<z.ZodObject<{
|
|
220
|
+
deviceId: z.ZodString;
|
|
221
|
+
x: z.ZodNumber;
|
|
222
|
+
y: z.ZodNumber;
|
|
223
|
+
scale: z.ZodNumber;
|
|
224
|
+
rotation: z.ZodNumber;
|
|
225
|
+
fov: z.ZodNumber;
|
|
226
|
+
far: z.ZodNumber;
|
|
227
|
+
displayAs: z.ZodNullable<z.ZodString>;
|
|
228
|
+
level: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
229
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
230
|
+
extras: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
231
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
232
|
+
hinge: z.ZodOptional<z.ZodEnum<{
|
|
233
|
+
start: "start";
|
|
234
|
+
end: "end";
|
|
235
|
+
}>>;
|
|
236
|
+
opens: z.ZodOptional<z.ZodEnum<{
|
|
237
|
+
right: "right";
|
|
238
|
+
left: "left";
|
|
239
|
+
}>>;
|
|
240
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
241
|
+
room: z.ZodOptional<z.ZodString>;
|
|
242
|
+
viewId: z.ZodOptional<z.ZodString>;
|
|
243
|
+
calibration: z.ZodOptional<z.ZodObject<{
|
|
244
|
+
img: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
245
|
+
level: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
246
|
+
}, z.core.$strip>>;
|
|
247
|
+
zoneRooms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
248
|
+
}, z.core.$strip>>>;
|
|
249
|
+
}, z.core.$strip>>;
|
|
250
|
+
colorize: z.ZodBoolean;
|
|
251
|
+
placementsRev: z.ZodNumber;
|
|
252
|
+
map: z.ZodBoolean;
|
|
253
|
+
createdOn: z.ZodString;
|
|
254
|
+
lastModifiedOn: z.ZodString;
|
|
255
|
+
kind: z.ZodLiteral<"image">;
|
|
256
|
+
imageUrl: z.ZodString;
|
|
257
|
+
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
258
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
259
|
+
id: z.ZodString;
|
|
260
|
+
name: z.ZodString;
|
|
261
|
+
order: z.ZodNumber;
|
|
262
|
+
isDefault: z.ZodBoolean;
|
|
263
|
+
devices: z.ZodArray<z.ZodObject<{
|
|
264
|
+
deviceId: z.ZodString;
|
|
265
|
+
x: z.ZodNumber;
|
|
266
|
+
y: z.ZodNumber;
|
|
267
|
+
scale: z.ZodNumber;
|
|
268
|
+
rotation: z.ZodNumber;
|
|
269
|
+
fov: z.ZodNumber;
|
|
270
|
+
far: z.ZodNumber;
|
|
271
|
+
displayAs: z.ZodNullable<z.ZodString>;
|
|
272
|
+
level: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
273
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
274
|
+
extras: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
275
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
276
|
+
hinge: z.ZodOptional<z.ZodEnum<{
|
|
277
|
+
start: "start";
|
|
278
|
+
end: "end";
|
|
279
|
+
}>>;
|
|
280
|
+
opens: z.ZodOptional<z.ZodEnum<{
|
|
281
|
+
right: "right";
|
|
282
|
+
left: "left";
|
|
283
|
+
}>>;
|
|
284
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
285
|
+
room: z.ZodOptional<z.ZodString>;
|
|
286
|
+
viewId: z.ZodOptional<z.ZodString>;
|
|
287
|
+
calibration: z.ZodOptional<z.ZodObject<{
|
|
288
|
+
img: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
289
|
+
level: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
290
|
+
}, z.core.$strip>>;
|
|
291
|
+
zoneRooms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
292
|
+
}, z.core.$strip>>>;
|
|
293
|
+
}, z.core.$strip>>;
|
|
294
|
+
colorize: z.ZodBoolean;
|
|
295
|
+
placementsRev: z.ZodNumber;
|
|
296
|
+
map: z.ZodBoolean;
|
|
297
|
+
createdOn: z.ZodString;
|
|
298
|
+
lastModifiedOn: z.ZodString;
|
|
299
|
+
kind: z.ZodLiteral<"map">;
|
|
300
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
301
|
+
thumbnailUrl: z.ZodOptional<z.ZodString>;
|
|
302
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
303
|
+
id: z.ZodString;
|
|
304
|
+
name: z.ZodString;
|
|
305
|
+
order: z.ZodNumber;
|
|
306
|
+
isDefault: z.ZodBoolean;
|
|
307
|
+
devices: z.ZodArray<z.ZodObject<{
|
|
308
|
+
deviceId: z.ZodString;
|
|
309
|
+
x: z.ZodNumber;
|
|
310
|
+
y: z.ZodNumber;
|
|
311
|
+
scale: z.ZodNumber;
|
|
312
|
+
rotation: z.ZodNumber;
|
|
313
|
+
fov: z.ZodNumber;
|
|
314
|
+
far: z.ZodNumber;
|
|
315
|
+
displayAs: z.ZodNullable<z.ZodString>;
|
|
316
|
+
level: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
317
|
+
height: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
318
|
+
extras: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
319
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
320
|
+
hinge: z.ZodOptional<z.ZodEnum<{
|
|
321
|
+
start: "start";
|
|
322
|
+
end: "end";
|
|
323
|
+
}>>;
|
|
324
|
+
opens: z.ZodOptional<z.ZodEnum<{
|
|
325
|
+
right: "right";
|
|
326
|
+
left: "left";
|
|
327
|
+
}>>;
|
|
328
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
329
|
+
room: z.ZodOptional<z.ZodString>;
|
|
330
|
+
viewId: z.ZodOptional<z.ZodString>;
|
|
331
|
+
calibration: z.ZodOptional<z.ZodObject<{
|
|
332
|
+
img: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
333
|
+
level: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>>;
|
|
334
|
+
}, z.core.$strip>>;
|
|
335
|
+
zoneRooms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
336
|
+
}, z.core.$strip>>>;
|
|
337
|
+
}, z.core.$strip>>;
|
|
338
|
+
colorize: z.ZodBoolean;
|
|
339
|
+
placementsRev: z.ZodNumber;
|
|
340
|
+
map: z.ZodBoolean;
|
|
341
|
+
createdOn: z.ZodString;
|
|
342
|
+
lastModifiedOn: z.ZodString;
|
|
343
|
+
kind: z.ZodLiteral<"3d">;
|
|
344
|
+
}, z.core.$strip>], "kind">;
|
|
345
|
+
export type ImageLayoutDto = z.infer<typeof sImageLayoutDto>;
|
|
346
|
+
export type MapLayoutDto = z.infer<typeof sMapLayoutDto>;
|
|
347
|
+
export type ModelLayoutDto = z.infer<typeof sModelLayoutDto>;
|
|
35
348
|
export type LayoutDto = z.infer<typeof sLayoutDto>;
|
|
349
|
+
/** The document of a `3d` layout: its model definition and the plan images the definition names. */
|
|
350
|
+
export declare const sLayoutModelDto: z.ZodObject<{
|
|
351
|
+
definition: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
352
|
+
plans: z.ZodArray<z.ZodObject<{
|
|
353
|
+
name: z.ZodString;
|
|
354
|
+
url: z.ZodString;
|
|
355
|
+
}, z.core.$strip>>;
|
|
356
|
+
}, z.core.$strip>;
|
|
357
|
+
export type LayoutModelDto = z.infer<typeof sLayoutModelDto>;
|
package/dist/objects/layout.js
CHANGED
|
@@ -1,7 +1,69 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sLayoutDto = exports.sLayoutDeviceDto = void 0;
|
|
3
|
+
exports.sLayoutModelDto = exports.sLayoutDto = exports.sModelLayoutDto = exports.sMapLayoutDto = exports.sImageLayoutDto = exports.sLayoutDeviceDto = exports.sLayoutDeviceExtras = exports.sCameraCalibration = exports.sLayoutKind = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* What a layout's document is, fixed when the layout is created:
|
|
7
|
+
* - `image`: a plan image (SVG/PNG); devices are placed on the image.
|
|
8
|
+
* - `map`: the world map; devices are placed on the map.
|
|
9
|
+
* - `3d`: a 3D model (model.json plus plan images); devices are placed on the model's levels, in metres.
|
|
10
|
+
*/
|
|
11
|
+
exports.sLayoutKind = zod_1.z.enum(['image', 'map', '3d']);
|
|
12
|
+
const sPoint = zod_1.z.tuple([zod_1.z.number(), zod_1.z.number()]);
|
|
13
|
+
/** Four points in a camera's picture, as fractions of its width and height, and the four level points they show. */
|
|
14
|
+
exports.sCameraCalibration = zod_1.z.object({
|
|
15
|
+
img: zod_1.z.array(sPoint).length(4),
|
|
16
|
+
level: zod_1.z.array(sPoint).length(4),
|
|
17
|
+
});
|
|
18
|
+
/** Placement attributes that only some device types use. Absent keys take the device type's defaults. */
|
|
19
|
+
exports.sLayoutDeviceExtras = zod_1.z.object({
|
|
20
|
+
width: zod_1.z
|
|
21
|
+
.number()
|
|
22
|
+
.min(0.4)
|
|
23
|
+
.max(4)
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('Door: width of the doorway in metres'),
|
|
26
|
+
hinge: zod_1.z
|
|
27
|
+
.enum(['start', 'end'])
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('Door: the end of the doorway, along its rotation, the hinge is at (default start)'),
|
|
30
|
+
opens: zod_1.z
|
|
31
|
+
.enum(['right', 'left'])
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('Door: the side of the doorway, looking along its rotation, the door swings to (default right)'),
|
|
34
|
+
size: zod_1.z
|
|
35
|
+
.number()
|
|
36
|
+
.min(0.3)
|
|
37
|
+
.max(6)
|
|
38
|
+
.optional()
|
|
39
|
+
.describe('Size of the device marker in metres'),
|
|
40
|
+
room: zod_1.z
|
|
41
|
+
.string()
|
|
42
|
+
.min(1)
|
|
43
|
+
.max(64)
|
|
44
|
+
.optional()
|
|
45
|
+
.describe("Room of the layout's document the device belongs to, when not the one it stands in"),
|
|
46
|
+
viewId: zod_1.z
|
|
47
|
+
.string()
|
|
48
|
+
.nonempty()
|
|
49
|
+
.optional()
|
|
50
|
+
.describe('View to open from the device'),
|
|
51
|
+
calibration: exports.sCameraCalibration
|
|
52
|
+
.optional()
|
|
53
|
+
.describe("Camera: maps points in the camera's picture to its level"),
|
|
54
|
+
zoneRooms: zod_1.z
|
|
55
|
+
.record(zod_1.z.string().min(1).max(128), zod_1.z.string().min(1).max(64))
|
|
56
|
+
.optional()
|
|
57
|
+
.describe("Camera: the detection provider's zone names, to rooms of the layout's document"),
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* A device placed on a layout. What x, y and rotation mean depends on the layout's kind:
|
|
61
|
+
* - `image` and `map`: a position on the image or map, as the layout editor stores it.
|
|
62
|
+
* - `3d`: metres on the level, x along the model's x axis (towards the bow) and y along its z axis; rotation is the
|
|
63
|
+
* heading in degrees, 0 towards +x and 90 towards +y; scale is 1.
|
|
64
|
+
*
|
|
65
|
+
* In requests, `level`, `height` and `extras` left out keep their stored values, and null clears them.
|
|
66
|
+
*/
|
|
5
67
|
exports.sLayoutDeviceDto = zod_1.z.object({
|
|
6
68
|
deviceId: zod_1.z.string(),
|
|
7
69
|
x: zod_1.z.number(),
|
|
@@ -11,17 +73,66 @@ exports.sLayoutDeviceDto = zod_1.z.object({
|
|
|
11
73
|
fov: zod_1.z.number(),
|
|
12
74
|
far: zod_1.z.number(),
|
|
13
75
|
displayAs: zod_1.z.string().nullable(),
|
|
76
|
+
level: zod_1.z
|
|
77
|
+
.string()
|
|
78
|
+
.min(1)
|
|
79
|
+
.max(64)
|
|
80
|
+
.nullable()
|
|
81
|
+
.optional()
|
|
82
|
+
.describe("Level of the layout's document the device is on (3d: the model's deck id)"),
|
|
83
|
+
height: zod_1.z
|
|
84
|
+
.number()
|
|
85
|
+
.min(0)
|
|
86
|
+
.max(100)
|
|
87
|
+
.nullable()
|
|
88
|
+
.optional()
|
|
89
|
+
.describe('Metres above the level'),
|
|
90
|
+
extras: exports.sLayoutDeviceExtras.nullable().optional(),
|
|
14
91
|
});
|
|
15
|
-
|
|
92
|
+
const sLayoutBase = zod_1.z.object({
|
|
16
93
|
id: zod_1.z.string(),
|
|
17
94
|
name: zod_1.z.string(),
|
|
18
|
-
thumbnailUrl: zod_1.z.string(),
|
|
19
|
-
imageUrl: zod_1.z.string(),
|
|
20
95
|
order: zod_1.z.number(),
|
|
21
96
|
isDefault: zod_1.z.boolean(),
|
|
22
97
|
devices: zod_1.z.array(exports.sLayoutDeviceDto),
|
|
23
98
|
colorize: zod_1.z.boolean(),
|
|
24
|
-
|
|
99
|
+
placementsRev: zod_1.z
|
|
100
|
+
.number()
|
|
101
|
+
.int()
|
|
102
|
+
.describe('Revision of the placements. Send it back when saving devices, to be refused if someone else saved meanwhile.'),
|
|
103
|
+
map: zod_1.z.boolean().describe('True when kind is map'),
|
|
25
104
|
createdOn: zod_1.z.string(),
|
|
26
105
|
lastModifiedOn: zod_1.z.string(),
|
|
27
106
|
});
|
|
107
|
+
exports.sImageLayoutDto = sLayoutBase.extend({
|
|
108
|
+
kind: zod_1.z.literal('image'),
|
|
109
|
+
imageUrl: zod_1.z.string(),
|
|
110
|
+
thumbnailUrl: zod_1.z.string().optional(),
|
|
111
|
+
});
|
|
112
|
+
exports.sMapLayoutDto = sLayoutBase.extend({
|
|
113
|
+
kind: zod_1.z.literal('map'),
|
|
114
|
+
imageUrl: zod_1.z
|
|
115
|
+
.string()
|
|
116
|
+
.optional()
|
|
117
|
+
.describe('Present when the map layout was created with an image'),
|
|
118
|
+
thumbnailUrl: zod_1.z
|
|
119
|
+
.string()
|
|
120
|
+
.optional()
|
|
121
|
+
.describe('Present when the map layout was created with an image'),
|
|
122
|
+
});
|
|
123
|
+
exports.sModelLayoutDto = sLayoutBase.extend({
|
|
124
|
+
kind: zod_1.z.literal('3d'),
|
|
125
|
+
});
|
|
126
|
+
exports.sLayoutDto = zod_1.z.discriminatedUnion('kind', [
|
|
127
|
+
exports.sImageLayoutDto,
|
|
128
|
+
exports.sMapLayoutDto,
|
|
129
|
+
exports.sModelLayoutDto,
|
|
130
|
+
]);
|
|
131
|
+
/** The document of a `3d` layout: its model definition and the plan images the definition names. */
|
|
132
|
+
exports.sLayoutModelDto = zod_1.z.object({
|
|
133
|
+
definition: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()),
|
|
134
|
+
plans: zod_1.z.array(zod_1.z.object({
|
|
135
|
+
name: zod_1.z.string().describe('Name the definition refers to the plan by'),
|
|
136
|
+
url: zod_1.z.string(),
|
|
137
|
+
})),
|
|
138
|
+
});
|
|
@@ -6,6 +6,12 @@ export declare const sTrackableRetentionPolicyDto: z.ZodObject<{
|
|
|
6
6
|
"base-station": "base-station";
|
|
7
7
|
"aid-to-navigation": "aid-to-navigation";
|
|
8
8
|
"sar-aircraft": "sar-aircraft";
|
|
9
|
+
aircraft: "aircraft";
|
|
10
|
+
helicopter: "helicopter";
|
|
11
|
+
glider: "glider";
|
|
12
|
+
balloon: "balloon";
|
|
13
|
+
drone: "drone";
|
|
14
|
+
"ground-vehicle": "ground-vehicle";
|
|
9
15
|
}>>;
|
|
10
16
|
ttlSeconds: z.ZodNumber;
|
|
11
17
|
outOfDateSeconds: z.ZodNumber;
|