camstreamerlib 4.0.0-beta.2 → 4.0.0-beta.21
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/README.md +5 -1
- package/cjs/CamOverlayAPI.d.ts +629 -0
- package/cjs/CamOverlayAPI.js +255 -0
- package/{CamOverlayDrawingAPI.d.ts → cjs/CamOverlayDrawingAPI.d.ts} +1 -1
- package/cjs/CamOverlayDrawingAPI.js +235 -0
- package/cjs/CamOverlayPainter/Frame.js +301 -0
- package/{CamOverlayPainter → cjs/CamOverlayPainter}/Painter.d.ts +14 -3
- package/cjs/CamOverlayPainter/Painter.js +171 -0
- package/cjs/CamOverlayPainter/ResourceManager.js +46 -0
- package/cjs/CamScripterAPI.d.ts +36 -0
- package/cjs/CamScripterAPI.js +73 -0
- package/{CamScripterAPICameraEventsGenerator.d.ts → cjs/CamScripterAPICameraEventsGenerator.d.ts} +1 -1
- package/cjs/CamScripterAPICameraEventsGenerator.js +162 -0
- package/{CamStreamerAPI.d.ts → cjs/CamStreamerAPI.d.ts} +5 -5
- package/cjs/CamStreamerAPI.js +59 -0
- package/{CamSwitcherAPI.d.ts → cjs/CamSwitcherAPI.d.ts} +10 -6
- package/cjs/CamSwitcherAPI.js +351 -0
- package/{CamSwitcherEvents.d.ts → cjs/CamSwitcherEvents.d.ts} +2 -2
- package/cjs/CamSwitcherEvents.js +67 -0
- package/cjs/CreatePackage.js +106 -0
- package/cjs/PlaneTrackerAPI.d.ts +47 -0
- package/cjs/PlaneTrackerAPI.js +176 -0
- package/{VapixAPI.d.ts → cjs/VapixAPI.d.ts} +19 -7
- package/cjs/VapixAPI.js +491 -0
- package/{VapixEvents.d.ts → cjs/VapixEvents.d.ts} +1 -1
- package/cjs/VapixEvents.js +88 -0
- package/{errors → cjs/errors}/errors.d.ts +3 -0
- package/cjs/errors/errors.js +86 -0
- package/{events → cjs/events}/AxisCameraStationEvents.d.ts +3 -2
- package/cjs/events/AxisCameraStationEvents.js +48 -0
- package/{events → cjs/events}/GenetecAgent.d.ts +4 -3
- package/cjs/events/GenetecAgent.js +123 -0
- package/cjs/index.d.ts +18 -0
- package/cjs/index.js +42 -0
- package/cjs/internal/Digest.js +42 -0
- package/cjs/internal/ProxyClient.d.ts +11 -0
- package/cjs/internal/ProxyClient.js +46 -0
- package/cjs/internal/constants.js +4 -0
- package/cjs/internal/transformers.js +32 -0
- package/cjs/internal/types.d.ts +35 -0
- package/cjs/internal/types.js +2 -0
- package/{internal → cjs/internal}/utils.d.ts +5 -1
- package/cjs/internal/utils.js +69 -0
- package/{internal → cjs/internal}/versionCompare.d.ts +2 -2
- package/cjs/internal/versionCompare.js +53 -0
- package/cjs/models/CamOverlayAPI/accuweatherSchema.d.ts +84 -0
- package/cjs/models/CamOverlayAPI/accuweatherSchema.js +48 -0
- package/cjs/models/CamOverlayAPI/constants.d.ts +11 -0
- package/cjs/models/CamOverlayAPI/constants.js +14 -0
- package/cjs/models/CamOverlayAPI/customGraphicsSchema.d.ts +699 -0
- package/cjs/models/CamOverlayAPI/customGraphicsSchema.js +73 -0
- package/cjs/models/CamOverlayAPI/fileSchema.d.ts +28 -0
- package/cjs/models/CamOverlayAPI/fileSchema.js +17 -0
- package/cjs/models/CamOverlayAPI/imagesSchema.d.ts +95 -0
- package/cjs/models/CamOverlayAPI/imagesSchema.js +10 -0
- package/cjs/models/CamOverlayAPI/index.d.ts +13 -0
- package/cjs/models/CamOverlayAPI/index.js +29 -0
- package/cjs/models/CamOverlayAPI/infotickerSchema.d.ts +96 -0
- package/cjs/models/CamOverlayAPI/infotickerSchema.js +27 -0
- package/cjs/models/CamOverlayAPI/pipSchema.d.ts +125 -0
- package/cjs/models/CamOverlayAPI/pipSchema.js +40 -0
- package/cjs/models/CamOverlayAPI/ptzCompassSchema.d.ts +93 -0
- package/cjs/models/CamOverlayAPI/ptzCompassSchema.js +26 -0
- package/cjs/models/CamOverlayAPI/ptzSchema.d.ts +118 -0
- package/cjs/models/CamOverlayAPI/ptzSchema.js +13 -0
- package/cjs/models/CamOverlayAPI/screenSharingSchema.d.ts +58 -0
- package/cjs/models/CamOverlayAPI/screenSharingSchema.js +9 -0
- package/cjs/models/CamOverlayAPI/webCameraSharingSchema.d.ts +58 -0
- package/cjs/models/CamOverlayAPI/webCameraSharingSchema.js +9 -0
- package/cjs/models/CamOverlayAPI/widgetCommonSchema.d.ts +126 -0
- package/cjs/models/CamOverlayAPI/widgetCommonSchema.js +76 -0
- package/cjs/models/CamOverlayAPI/widgetsSchema.d.ts +2823 -0
- package/cjs/models/CamOverlayAPI/widgetsSchema.js +27 -0
- package/cjs/node/DefaultClient.d.ts +16 -0
- package/cjs/node/DefaultClient.js +56 -0
- package/cjs/node/HttpRequestSender.js +89 -0
- package/cjs/node/HttpServer.js +96 -0
- package/{node → cjs/node}/WsClient.d.ts +1 -1
- package/cjs/node/WsClient.js +149 -0
- package/{node → cjs/node}/WsEventClient.d.ts +1 -1
- package/cjs/node/WsEventClient.js +22 -0
- package/cjs/node/index.d.ts +2 -0
- package/cjs/node/index.js +7 -0
- package/cjs/types/CamOverlayAPI.d.ts +328 -0
- package/cjs/types/CamOverlayAPI.js +26 -0
- package/{types → cjs/types}/CamScripterAPI.d.ts +66 -7
- package/cjs/types/CamScripterAPI.js +35 -0
- package/{types → cjs/types}/CamStreamerAPI.d.ts +16 -5
- package/cjs/types/CamStreamerAPI.js +32 -0
- package/{types → cjs/types}/CamSwitcherAPI.d.ts +5 -5
- package/cjs/types/CamSwitcherAPI.js +137 -0
- package/{types/CamswitcherEvents.d.ts → cjs/types/CamSwitcherEvents.d.ts} +77 -0
- package/cjs/types/CamSwitcherEvents.js +70 -0
- package/cjs/types/PlaneTrackerAPI.d.ts +2 -0
- package/cjs/types/PlaneTrackerAPI.js +2 -0
- package/{types → cjs/types}/VapixAPI.d.ts +479 -519
- package/cjs/types/VapixAPI.js +139 -0
- package/cjs/types/common.js +14 -0
- package/cjs/web/DefaultClient.d.ts +6 -0
- package/cjs/web/DefaultClient.js +22 -0
- package/cjs/web/WsClient.js +62 -0
- package/cjs/web/index.d.ts +2 -0
- package/cjs/web/index.js +7 -0
- package/esm/CamOverlayAPI.d.ts +629 -0
- package/esm/CamOverlayAPI.js +251 -0
- package/esm/CamOverlayDrawingAPI.d.ts +86 -0
- package/{CamOverlayDrawingAPI.js → esm/CamOverlayDrawingAPI.js} +6 -3
- package/esm/CamOverlayPainter/Frame.d.ts +96 -0
- package/esm/CamOverlayPainter/Painter.d.ts +48 -0
- package/{CamOverlayPainter → esm/CamOverlayPainter}/Painter.js +4 -1
- package/esm/CamOverlayPainter/ResourceManager.d.ts +14 -0
- package/{CamOverlayPainter → esm/CamOverlayPainter}/ResourceManager.js +6 -10
- package/esm/CamScripterAPI.d.ts +36 -0
- package/esm/CamScripterAPI.js +69 -0
- package/esm/CamScripterAPICameraEventsGenerator.d.ts +74 -0
- package/{CamScripterAPICameraEventsGenerator.js → esm/CamScripterAPICameraEventsGenerator.js} +6 -3
- package/esm/CamStreamerAPI.d.ts +16 -0
- package/{CamStreamerAPI.js → esm/CamStreamerAPI.js} +4 -10
- package/esm/CamSwitcherAPI.d.ts +52 -0
- package/{CamSwitcherAPI.js → esm/CamSwitcherAPI.js} +24 -27
- package/esm/CamSwitcherEvents.d.ts +18 -0
- package/{CamSwitcherEvents.js → esm/CamSwitcherEvents.js} +1 -1
- package/esm/CreatePackage.d.ts +1 -0
- package/esm/PlaneTrackerAPI.d.ts +47 -0
- package/esm/PlaneTrackerAPI.js +172 -0
- package/esm/VapixAPI.d.ts +78 -0
- package/{VapixAPI.js → esm/VapixAPI.js} +93 -60
- package/esm/VapixEvents.d.ts +43 -0
- package/{VapixEvents.js → esm/VapixEvents.js} +3 -3
- package/esm/errors/errors.d.ts +37 -0
- package/{errors → esm/errors}/errors.js +6 -0
- package/esm/events/AxisCameraStationEvents.d.ts +10 -0
- package/{events → esm/events}/AxisCameraStationEvents.js +1 -1
- package/esm/events/GenetecAgent.d.ts +175 -0
- package/{events → esm/events}/GenetecAgent.js +5 -5
- package/esm/index.d.ts +18 -0
- package/esm/index.js +18 -0
- package/esm/internal/Digest.d.ts +4 -0
- package/{internal → esm/internal}/Digest.js +6 -6
- package/esm/internal/ProxyClient.d.ts +11 -0
- package/{internal → esm/internal}/ProxyClient.js +6 -4
- package/esm/internal/constants.d.ts +1 -0
- package/esm/internal/transformers.d.ts +5 -0
- package/esm/internal/types.d.ts +35 -0
- package/esm/internal/types.js +1 -0
- package/esm/internal/utils.d.ts +15 -0
- package/{internal → esm/internal}/utils.js +20 -1
- package/esm/internal/versionCompare.d.ts +6 -0
- package/esm/models/CamOverlayAPI/accuweatherSchema.d.ts +84 -0
- package/esm/models/CamOverlayAPI/accuweatherSchema.js +45 -0
- package/esm/models/CamOverlayAPI/constants.d.ts +11 -0
- package/esm/models/CamOverlayAPI/constants.js +11 -0
- package/esm/models/CamOverlayAPI/customGraphicsSchema.d.ts +699 -0
- package/esm/models/CamOverlayAPI/customGraphicsSchema.js +70 -0
- package/esm/models/CamOverlayAPI/fileSchema.d.ts +28 -0
- package/esm/models/CamOverlayAPI/fileSchema.js +14 -0
- package/esm/models/CamOverlayAPI/imagesSchema.d.ts +95 -0
- package/esm/models/CamOverlayAPI/imagesSchema.js +7 -0
- package/esm/models/CamOverlayAPI/index.d.ts +13 -0
- package/esm/models/CamOverlayAPI/index.js +13 -0
- package/esm/models/CamOverlayAPI/infotickerSchema.d.ts +96 -0
- package/esm/models/CamOverlayAPI/infotickerSchema.js +24 -0
- package/esm/models/CamOverlayAPI/pipSchema.d.ts +125 -0
- package/esm/models/CamOverlayAPI/pipSchema.js +37 -0
- package/esm/models/CamOverlayAPI/ptzCompassSchema.d.ts +93 -0
- package/esm/models/CamOverlayAPI/ptzCompassSchema.js +23 -0
- package/esm/models/CamOverlayAPI/ptzSchema.d.ts +118 -0
- package/esm/models/CamOverlayAPI/ptzSchema.js +10 -0
- package/esm/models/CamOverlayAPI/screenSharingSchema.d.ts +58 -0
- package/esm/models/CamOverlayAPI/screenSharingSchema.js +6 -0
- package/esm/models/CamOverlayAPI/webCameraSharingSchema.d.ts +58 -0
- package/esm/models/CamOverlayAPI/webCameraSharingSchema.js +6 -0
- package/esm/models/CamOverlayAPI/widgetCommonSchema.d.ts +126 -0
- package/esm/models/CamOverlayAPI/widgetCommonSchema.js +73 -0
- package/esm/models/CamOverlayAPI/widgetsSchema.d.ts +2823 -0
- package/esm/models/CamOverlayAPI/widgetsSchema.js +24 -0
- package/esm/node/DefaultClient.d.ts +16 -0
- package/{node → esm/node}/DefaultClient.js +9 -7
- package/esm/node/HttpRequestSender.d.ts +28 -0
- package/esm/node/HttpServer.d.ts +21 -0
- package/{node → esm/node}/HttpServer.js +1 -1
- package/esm/node/WsClient.d.ts +39 -0
- package/esm/node/WsEventClient.d.ts +13 -0
- package/esm/node/index.d.ts +2 -0
- package/esm/node/index.js +2 -0
- package/esm/types/CamOverlayAPI.d.ts +328 -0
- package/esm/types/CamOverlayAPI.js +14 -0
- package/esm/types/CamScripterAPI.d.ts +126 -0
- package/esm/types/CamScripterAPI.js +32 -0
- package/esm/types/CamStreamerAPI.d.ts +150 -0
- package/{types → esm/types}/CamStreamerAPI.js +4 -0
- package/esm/types/CamSwitcherAPI.d.ts +814 -0
- package/esm/types/CamSwitcherEvents.d.ts +568 -0
- package/{types/CamswitcherEvents.js → esm/types/CamSwitcherEvents.js} +8 -0
- package/esm/types/PlaneTrackerAPI.d.ts +2 -0
- package/esm/types/PlaneTrackerAPI.js +1 -0
- package/esm/types/VapixAPI.d.ts +1664 -0
- package/{types → esm/types}/VapixAPI.js +30 -23
- package/esm/types/common.d.ts +37 -0
- package/esm/web/DefaultClient.d.ts +6 -0
- package/{web → esm/web}/DefaultClient.js +6 -4
- package/esm/web/WsClient.d.ts +13 -0
- package/{web → esm/web}/WsClient.js +2 -2
- package/esm/web/index.d.ts +2 -0
- package/esm/web/index.js +2 -0
- package/package.json +6 -6
- package/CamOverlayAPI.d.ts +0 -31
- package/CamOverlayAPI.js +0 -172
- package/CamScripterAPI.d.ts +0 -19
- package/CamScripterAPI.js +0 -66
- package/internal/ProxyClient.d.ts +0 -11
- package/internal/common.d.ts +0 -40
- package/internal/common.js +0 -23
- package/node/DefaultClient.d.ts +0 -15
- package/types/CamOverlayAPI.d.ts +0 -188
- package/types/CamOverlayAPI.js +0 -44
- package/types/CamScripterAPI.js +0 -17
- package/web/DefaultClient.d.ts +0 -6
- package/{CamOverlayPainter → cjs/CamOverlayPainter}/Frame.d.ts +0 -0
- package/{CamOverlayPainter → cjs/CamOverlayPainter}/ResourceManager.d.ts +0 -0
- package/{CreatePackage.d.ts → cjs/CreatePackage.d.ts} +0 -0
- package/{internal → cjs/internal}/Digest.d.ts +0 -0
- package/{internal → cjs/internal}/constants.d.ts +0 -0
- package/{internal → cjs/internal}/transformers.d.ts +0 -0
- package/{node → cjs/node}/HttpRequestSender.d.ts +0 -0
- package/{node → cjs/node}/HttpServer.d.ts +0 -0
- package/{types → cjs/types}/common.d.ts +2 -2
- /package/{web → cjs/web}/WsClient.d.ts +0 -0
- /package/{CamOverlayPainter → esm/CamOverlayPainter}/Frame.js +0 -0
- /package/{CreatePackage.js → esm/CreatePackage.js} +0 -0
- /package/{internal → esm/internal}/constants.js +0 -0
- /package/{internal → esm/internal}/transformers.js +0 -0
- /package/{internal → esm/internal}/versionCompare.js +0 -0
- /package/{node → esm/node}/HttpRequestSender.js +0 -0
- /package/{node → esm/node}/WsClient.js +0 -0
- /package/{node → esm/node}/WsEventClient.js +0 -0
- /package/{types → esm/types}/CamSwitcherAPI.js +0 -0
- /package/{types → esm/types}/common.js +0 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const cameraGuidsResponseSchema: z.ZodObject<{
|
|
3
|
+
Rsp: z.ZodObject<{
|
|
4
|
+
Status: z.ZodString;
|
|
5
|
+
Result: z.ZodArray<z.ZodObject<{
|
|
6
|
+
Guid: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
Guid: string;
|
|
9
|
+
}, {
|
|
10
|
+
Guid: string;
|
|
11
|
+
}>, "many">;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
Status: string;
|
|
14
|
+
Result: {
|
|
15
|
+
Guid: string;
|
|
16
|
+
}[];
|
|
17
|
+
}, {
|
|
18
|
+
Status: string;
|
|
19
|
+
Result: {
|
|
20
|
+
Guid: string;
|
|
21
|
+
}[];
|
|
22
|
+
}>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
Rsp: {
|
|
25
|
+
Status: string;
|
|
26
|
+
Result: {
|
|
27
|
+
Guid: string;
|
|
28
|
+
}[];
|
|
29
|
+
};
|
|
30
|
+
}, {
|
|
31
|
+
Rsp: {
|
|
32
|
+
Status: string;
|
|
33
|
+
Result: {
|
|
34
|
+
Guid: string;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
}>;
|
|
38
|
+
export type TCameraGuidsResponse = z.infer<typeof cameraGuidsResponseSchema>;
|
|
39
|
+
declare const connectionResponseSchema: z.ZodObject<{
|
|
40
|
+
Rsp: z.ZodObject<{
|
|
41
|
+
Status: z.ZodString;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
Status: string;
|
|
44
|
+
}, {
|
|
45
|
+
Status: string;
|
|
46
|
+
}>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
Rsp: {
|
|
49
|
+
Status: string;
|
|
50
|
+
};
|
|
51
|
+
}, {
|
|
52
|
+
Rsp: {
|
|
53
|
+
Status: string;
|
|
54
|
+
};
|
|
55
|
+
}>;
|
|
56
|
+
export type TConnectionResponse = z.infer<typeof connectionResponseSchema>;
|
|
57
|
+
export declare const cameraDetailSchema: z.ZodObject<{
|
|
58
|
+
Guid: z.ZodOptional<z.ZodString>;
|
|
59
|
+
Name: z.ZodOptional<z.ZodString>;
|
|
60
|
+
EntityType: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
Name?: string | undefined;
|
|
63
|
+
Guid?: string | undefined;
|
|
64
|
+
EntityType?: string | undefined;
|
|
65
|
+
}, {
|
|
66
|
+
Name?: string | undefined;
|
|
67
|
+
Guid?: string | undefined;
|
|
68
|
+
EntityType?: string | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
export declare const cameraDetailsResponseSchema: z.ZodObject<{
|
|
71
|
+
Rsp: z.ZodObject<{
|
|
72
|
+
Status: z.ZodString;
|
|
73
|
+
Result: z.ZodUnion<[z.ZodArray<z.ZodObject<{
|
|
74
|
+
Guid: z.ZodOptional<z.ZodString>;
|
|
75
|
+
Name: z.ZodOptional<z.ZodString>;
|
|
76
|
+
EntityType: z.ZodOptional<z.ZodString>;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
Name?: string | undefined;
|
|
79
|
+
Guid?: string | undefined;
|
|
80
|
+
EntityType?: string | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
Name?: string | undefined;
|
|
83
|
+
Guid?: string | undefined;
|
|
84
|
+
EntityType?: string | undefined;
|
|
85
|
+
}>, "many">, z.ZodObject<{
|
|
86
|
+
Guid: z.ZodOptional<z.ZodString>;
|
|
87
|
+
Name: z.ZodOptional<z.ZodString>;
|
|
88
|
+
EntityType: z.ZodOptional<z.ZodString>;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
Name?: string | undefined;
|
|
91
|
+
Guid?: string | undefined;
|
|
92
|
+
EntityType?: string | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
Name?: string | undefined;
|
|
95
|
+
Guid?: string | undefined;
|
|
96
|
+
EntityType?: string | undefined;
|
|
97
|
+
}>]>;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
Status: string;
|
|
100
|
+
Result: {
|
|
101
|
+
Name?: string | undefined;
|
|
102
|
+
Guid?: string | undefined;
|
|
103
|
+
EntityType?: string | undefined;
|
|
104
|
+
} | {
|
|
105
|
+
Name?: string | undefined;
|
|
106
|
+
Guid?: string | undefined;
|
|
107
|
+
EntityType?: string | undefined;
|
|
108
|
+
}[];
|
|
109
|
+
}, {
|
|
110
|
+
Status: string;
|
|
111
|
+
Result: {
|
|
112
|
+
Name?: string | undefined;
|
|
113
|
+
Guid?: string | undefined;
|
|
114
|
+
EntityType?: string | undefined;
|
|
115
|
+
} | {
|
|
116
|
+
Name?: string | undefined;
|
|
117
|
+
Guid?: string | undefined;
|
|
118
|
+
EntityType?: string | undefined;
|
|
119
|
+
}[];
|
|
120
|
+
}>;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
122
|
+
Rsp: {
|
|
123
|
+
Status: string;
|
|
124
|
+
Result: {
|
|
125
|
+
Name?: string | undefined;
|
|
126
|
+
Guid?: string | undefined;
|
|
127
|
+
EntityType?: string | undefined;
|
|
128
|
+
} | {
|
|
129
|
+
Name?: string | undefined;
|
|
130
|
+
Guid?: string | undefined;
|
|
131
|
+
EntityType?: string | undefined;
|
|
132
|
+
}[];
|
|
133
|
+
};
|
|
134
|
+
}, {
|
|
135
|
+
Rsp: {
|
|
136
|
+
Status: string;
|
|
137
|
+
Result: {
|
|
138
|
+
Name?: string | undefined;
|
|
139
|
+
Guid?: string | undefined;
|
|
140
|
+
EntityType?: string | undefined;
|
|
141
|
+
} | {
|
|
142
|
+
Name?: string | undefined;
|
|
143
|
+
Guid?: string | undefined;
|
|
144
|
+
EntityType?: string | undefined;
|
|
145
|
+
}[];
|
|
146
|
+
};
|
|
147
|
+
}>;
|
|
148
|
+
export type TCameraDetailsResponse = z.infer<typeof cameraDetailsResponseSchema>;
|
|
149
|
+
export type TCameraDetail = z.infer<typeof cameraDetailSchema>;
|
|
150
|
+
export type TParams = Array<'Guid' | 'Name' | 'EntityType'>;
|
|
151
|
+
export type TProtocol = 'http' | 'https' | 'https_insecure';
|
|
152
|
+
export type GenetecAgentOptions = {
|
|
153
|
+
protocol?: TProtocol;
|
|
154
|
+
ip?: string;
|
|
155
|
+
port?: number;
|
|
156
|
+
baseUri?: string;
|
|
157
|
+
user?: string;
|
|
158
|
+
pass?: string;
|
|
159
|
+
appId?: string;
|
|
160
|
+
};
|
|
161
|
+
export declare class GenetecAgent {
|
|
162
|
+
private settings;
|
|
163
|
+
private baseUrl;
|
|
164
|
+
private credentials;
|
|
165
|
+
constructor(options?: GenetecAgentOptions);
|
|
166
|
+
checkConnection(): Promise<TConnectionResponse>;
|
|
167
|
+
getAllCameraGuids(): Promise<TCameraGuidsResponse>;
|
|
168
|
+
getCameraDetails(guids: {
|
|
169
|
+
Guid: string;
|
|
170
|
+
}[], parameters: TParams): Promise<TCameraDetail[]>;
|
|
171
|
+
sendBookmark(guids: string[], bookmarkText: string): Promise<Response>;
|
|
172
|
+
private getRequestOptions;
|
|
173
|
+
private getTimeStamp;
|
|
174
|
+
}
|
|
175
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { responseStringify, pad } from '../internal/
|
|
2
|
+
import { responseStringify, pad } from '../internal/utils';
|
|
3
3
|
const ACTION = 'AddCameraBookmark';
|
|
4
4
|
const GET_CAMERAS_URL = 'report/EntityConfiguration?q=EntityTypes@Camera';
|
|
5
5
|
const GET_CAMERAS_DETAILS_URL = '/entity?q=';
|
|
@@ -34,13 +34,13 @@ export class GenetecAgent {
|
|
|
34
34
|
protocol: options.protocol ?? 'http',
|
|
35
35
|
ip: options.ip ?? '127.0.0.1',
|
|
36
36
|
port: options.port ?? 80,
|
|
37
|
-
|
|
37
|
+
baseUri: options.baseUri ?? 'WebSdk',
|
|
38
38
|
user: options.user ?? 'root',
|
|
39
39
|
pass: options.pass ?? '',
|
|
40
|
-
|
|
40
|
+
appId: options.appId ?? '',
|
|
41
41
|
};
|
|
42
|
-
this.baseUrl = `${this.settings.protocol}://${this.settings.ip}:${this.settings.port}/${this.settings.
|
|
43
|
-
this.credentials = btoa(`${this.settings.user};${this.settings.
|
|
42
|
+
this.baseUrl = `${this.settings.protocol}://${this.settings.ip}:${this.settings.port}/${this.settings.baseUri}`;
|
|
43
|
+
this.credentials = btoa(`${this.settings.user};${this.settings.appId}:${this.settings.pass}`);
|
|
44
44
|
}
|
|
45
45
|
async checkConnection() {
|
|
46
46
|
const requestOptions = this.getRequestOptions('GET');
|
package/esm/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './internal/types';
|
|
2
|
+
export * from './internal/constants';
|
|
3
|
+
export * from './internal/utils';
|
|
4
|
+
export * from './internal/versionCompare';
|
|
5
|
+
export * from './types/common';
|
|
6
|
+
export { CamSwitcherAPI } from './CamSwitcherAPI';
|
|
7
|
+
export { CamSwitcherEvents } from './CamSwitcherEvents';
|
|
8
|
+
export { VapixAPI } from './VapixAPI';
|
|
9
|
+
export { CamOverlayAPI } from './CamOverlayAPI';
|
|
10
|
+
export { CamScripterAPI } from './CamScripterAPI';
|
|
11
|
+
export { CamStreamerAPI } from './CamStreamerAPI';
|
|
12
|
+
export { PlaneTrackerAPI } from './PlaneTrackerAPI';
|
|
13
|
+
export * from './types/CamSwitcherEvents';
|
|
14
|
+
export * from './types/CamSwitcherAPI';
|
|
15
|
+
export * from './types/VapixAPI';
|
|
16
|
+
export * from './types/CamOverlayAPI';
|
|
17
|
+
export * from './models/CamOverlayAPI';
|
|
18
|
+
export * from './types/PlaneTrackerAPI';
|
package/esm/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './internal/types';
|
|
2
|
+
export * from './internal/constants';
|
|
3
|
+
export * from './internal/utils';
|
|
4
|
+
export * from './internal/versionCompare';
|
|
5
|
+
export * from './types/common';
|
|
6
|
+
export { CamSwitcherAPI } from './CamSwitcherAPI';
|
|
7
|
+
export { CamSwitcherEvents } from './CamSwitcherEvents';
|
|
8
|
+
export { VapixAPI } from './VapixAPI';
|
|
9
|
+
export { CamOverlayAPI } from './CamOverlayAPI';
|
|
10
|
+
export { CamScripterAPI } from './CamScripterAPI';
|
|
11
|
+
export { CamStreamerAPI } from './CamStreamerAPI';
|
|
12
|
+
export { PlaneTrackerAPI } from './PlaneTrackerAPI';
|
|
13
|
+
export * from './types/CamSwitcherEvents';
|
|
14
|
+
export * from './types/CamSwitcherAPI';
|
|
15
|
+
export * from './types/VapixAPI';
|
|
16
|
+
export * from './types/CamOverlayAPI';
|
|
17
|
+
export * from './models/CamOverlayAPI';
|
|
18
|
+
export * from './types/PlaneTrackerAPI';
|
|
@@ -4,17 +4,17 @@ export class Digest {
|
|
|
4
4
|
getAuthHeader(user, pass, method, uri, wwwAuthenticateHeader) {
|
|
5
5
|
const digestItems = {};
|
|
6
6
|
const digestArr = wwwAuthenticateHeader.substring(wwwAuthenticateHeader.indexOf('Digest') + 6).split(',');
|
|
7
|
-
for (
|
|
8
|
-
const pos =
|
|
9
|
-
const key =
|
|
10
|
-
const value =
|
|
7
|
+
for (const arg of digestArr) {
|
|
8
|
+
const pos = arg.indexOf('=');
|
|
9
|
+
const key = arg.substring(0, pos).trim();
|
|
10
|
+
const value = arg.substring(pos + 1).trim();
|
|
11
11
|
digestItems[key] = value.replace(/"/g, '');
|
|
12
12
|
}
|
|
13
13
|
const HA1 = crypto.createHash('md5').update(`${user}:${digestItems['realm']}:${pass}`).digest('hex');
|
|
14
14
|
const HA2 = crypto.createHash('md5').update(`${method}:${uri}`).digest('hex');
|
|
15
15
|
const ncValue = ('00000000' + this.nonceCount.toString(16)).slice(-8);
|
|
16
16
|
let response;
|
|
17
|
-
if (digestItems['qop']) {
|
|
17
|
+
if (digestItems['qop'] !== undefined) {
|
|
18
18
|
response = crypto
|
|
19
19
|
.createHash('md5')
|
|
20
20
|
.update(`${HA1}:${digestItems['nonce']}:${ncValue}:162d50aa594e9648:auth:${HA2}`)
|
|
@@ -29,7 +29,7 @@ export class Digest {
|
|
|
29
29
|
`nonce="${digestItems['nonce']}",` +
|
|
30
30
|
`uri="${uri}",` +
|
|
31
31
|
`response="${response}"`;
|
|
32
|
-
if (digestItems['qop']) {
|
|
32
|
+
if (digestItems['qop'] !== undefined) {
|
|
33
33
|
header += `,qop=auth,nc=${ncValue},cnonce="162d50aa594e9648"`;
|
|
34
34
|
}
|
|
35
35
|
this.nonceCount++;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IClient, TResponse } from './types';
|
|
3
|
+
import { TProxyParam } from '../types/common';
|
|
4
|
+
export declare class ProxyClient<Client extends IClient<TResponse> = IClient<TResponse>> {
|
|
5
|
+
client: Client;
|
|
6
|
+
getProxyUrl: () => string;
|
|
7
|
+
constructor(client: Client, getProxyUrl: () => string);
|
|
8
|
+
get: (proxy: TProxyParam, url: string, parameters?: import("./types").TParameters | undefined, headers?: Record<string, string> | undefined) => Promise<TResponse>;
|
|
9
|
+
post: (proxy: TProxyParam, url: string, data: string | Buffer | FormData, parameters?: import("./types").TParameters | undefined, headers?: Record<string, string> | undefined) => Promise<TResponse>;
|
|
10
|
+
private getReal;
|
|
11
|
+
}
|
|
@@ -6,12 +6,14 @@ export class ProxyClient {
|
|
|
6
6
|
this.client = client;
|
|
7
7
|
this.getProxyUrl = getProxyUrl;
|
|
8
8
|
}
|
|
9
|
-
get = (proxy,
|
|
9
|
+
get = (proxy, ...args) => {
|
|
10
|
+
const [path, parameters, headers] = args;
|
|
10
11
|
const url = addParametersToPath(path, parameters);
|
|
11
12
|
const { realUrl, realHeaders } = this.getReal(proxy, url, headers);
|
|
12
13
|
return this.client.get(realUrl, {}, realHeaders);
|
|
13
14
|
};
|
|
14
|
-
post = (proxy,
|
|
15
|
+
post = (proxy, ...args) => {
|
|
16
|
+
const [path, data, parameters, headers] = args;
|
|
15
17
|
const url = addParametersToPath(path, parameters);
|
|
16
18
|
const { realUrl, realHeaders } = this.getReal(proxy, url, headers);
|
|
17
19
|
return this.client.post(realUrl, data, {}, realHeaders);
|
|
@@ -27,8 +29,8 @@ export class ProxyClient {
|
|
|
27
29
|
'x-target-camera-ip': proxy.ip,
|
|
28
30
|
'x-target-camera-mdns': proxy.mdnsName,
|
|
29
31
|
'x-target-camera-port': String(proxy.port),
|
|
30
|
-
'x-target-camera-pass':
|
|
31
|
-
'x-target-camera-user':
|
|
32
|
+
'x-target-camera-pass': proxy.pass,
|
|
33
|
+
'x-target-camera-user': proxy.user,
|
|
32
34
|
},
|
|
33
35
|
};
|
|
34
36
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FIRMWARE_WITH_BITRATE_MODES_SUPPORT = "11.11.73";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CamelCasedProperties, CamelCasedPropertiesDeep, SnakeCasedProperties, SnakeCasedPropertiesDeep } from 'type-fest';
|
|
2
|
+
export declare const toCamelCase: <T extends object>(o: T) => CamelCasedProperties<T>;
|
|
3
|
+
export declare const toCamelCaseDeep: <T extends object>(o: T) => CamelCasedPropertiesDeep<T>;
|
|
4
|
+
export declare const toSnakeCase: <T extends object>(o: T) => SnakeCasedProperties<T>;
|
|
5
|
+
export declare const toSnakeCaseDeep: <T extends object>(o: T) => SnakeCasedPropertiesDeep<T>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Response as UndiciResponse } from 'undici';
|
|
3
|
+
export type Options = {
|
|
4
|
+
ip?: string;
|
|
5
|
+
port?: number;
|
|
6
|
+
user?: string;
|
|
7
|
+
pass?: string;
|
|
8
|
+
tls?: boolean;
|
|
9
|
+
tlsInsecure?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type HttpOptions = Options & {
|
|
12
|
+
keepAlive?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export type WsOptions = Options;
|
|
15
|
+
export type TParameters = Record<string, string | number | boolean | null | undefined>;
|
|
16
|
+
export type TResponse = Response | UndiciResponse;
|
|
17
|
+
export type TGetParams = [url: string, parameters?: TParameters, headers?: Record<string, string>];
|
|
18
|
+
export type TPostParams = [
|
|
19
|
+
url: string,
|
|
20
|
+
data: string | Buffer | FormData,
|
|
21
|
+
parameters?: TParameters,
|
|
22
|
+
headers?: Record<string, string>
|
|
23
|
+
];
|
|
24
|
+
export interface IClient<TRes extends TResponse> {
|
|
25
|
+
get: (...params: TGetParams) => Promise<TRes>;
|
|
26
|
+
post: (...params: TPostParams) => Promise<TRes>;
|
|
27
|
+
}
|
|
28
|
+
export type TBlobResponse<Client extends IClient<TResponse>> = Awaited<ReturnType<Awaited<ReturnType<Client['get']>>['blob']>>;
|
|
29
|
+
export interface IWebsocket<Event extends {
|
|
30
|
+
readonly data: string;
|
|
31
|
+
}> {
|
|
32
|
+
destroy: () => void;
|
|
33
|
+
onmessage: null | ((event: Event) => void);
|
|
34
|
+
send: (data: string) => void;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TPlaylistPlayType } from '../types/CamSwitcherAPI';
|
|
2
|
+
import { IClient, Options, TParameters, TResponse } from './types';
|
|
3
|
+
export declare const addParametersToPath: (path: string, params?: TParameters) => string;
|
|
4
|
+
export declare const paramToUrl: (params?: TParameters) => string;
|
|
5
|
+
export declare const arrayToUrl: (arr: string | string[]) => string;
|
|
6
|
+
export declare const isCamera: (id?: string) => boolean;
|
|
7
|
+
export declare const isStream: (id?: string) => boolean;
|
|
8
|
+
export declare const isClip: (id?: string) => boolean;
|
|
9
|
+
export declare const isTracker: (id?: string) => boolean;
|
|
10
|
+
export declare const isPlaylist: (id?: string) => boolean;
|
|
11
|
+
export declare const isLoopPlayType: (playType: TPlaylistPlayType) => boolean;
|
|
12
|
+
export declare function isClient(arg?: Options | IClient<TResponse>): arg is IClient<TResponse>;
|
|
13
|
+
export declare function responseStringify(res: TResponse): Promise<string>;
|
|
14
|
+
export declare function pad(num: number, size: number): string;
|
|
15
|
+
export declare function isNullish<T>(value: T | undefined | null): value is undefined | null;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { isNullish } from './common';
|
|
2
1
|
export const addParametersToPath = (path, params) => {
|
|
3
2
|
if (params === undefined || Object.keys(params).length === 0) {
|
|
4
3
|
return path;
|
|
@@ -32,3 +31,23 @@ export const isClip = (id) => id?.charAt(0) === 's';
|
|
|
32
31
|
export const isTracker = (id) => id?.charAt(0) === 't';
|
|
33
32
|
export const isPlaylist = (id) => id?.charAt(0) === 'p';
|
|
34
33
|
export const isLoopPlayType = (playType) => playType.includes('LOOP');
|
|
34
|
+
export function isClient(arg = {}) {
|
|
35
|
+
return 'get' in arg && 'post' in arg;
|
|
36
|
+
}
|
|
37
|
+
export async function responseStringify(res) {
|
|
38
|
+
return JSON.stringify({
|
|
39
|
+
status: res.status,
|
|
40
|
+
body: await res.text(),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
export function pad(num, size) {
|
|
44
|
+
const sign = Math.sign(num) === -1 ? '-' : '';
|
|
45
|
+
return (sign +
|
|
46
|
+
new Array(size)
|
|
47
|
+
.concat([Math.abs(num)])
|
|
48
|
+
.join('0')
|
|
49
|
+
.slice(-size));
|
|
50
|
+
}
|
|
51
|
+
export function isNullish(value) {
|
|
52
|
+
return value === null || value === undefined;
|
|
53
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const assertVersionString: (s: string, msg?: string) => void;
|
|
2
|
+
export declare const isFirmwareVersionAtLeast: (version: string, compareVersion: string) => boolean;
|
|
3
|
+
export declare const isVersionAtLeast: (version: string, compareVersion: string) => boolean;
|
|
4
|
+
export declare const firmwareVersionCompare: (a: string, b: string) => 0 | 1 | -1;
|
|
5
|
+
export declare const versionCompare: (a: string, b: string) => 0 | 1 | -1;
|
|
6
|
+
export declare const fixVersionToDots: (version: string) => string;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const accuweatherSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodNumber;
|
|
4
|
+
enabled: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
|
|
5
|
+
automationType: z.ZodUnion<[z.ZodLiteral<"time">, z.ZodLiteral<"manual">, z.ZodLiteral<"schedule">, z.ZodType<`input${number}`, z.ZodTypeDef, `input${number}`>]>;
|
|
6
|
+
invertInput: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
cameraList: z.ZodArray<z.ZodNumber, "many">;
|
|
8
|
+
camera: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
schedule: z.ZodOptional<z.ZodString>;
|
|
10
|
+
customName: z.ZodString;
|
|
11
|
+
zIndex: z.ZodOptional<z.ZodNumber>;
|
|
12
|
+
width: z.ZodNumber;
|
|
13
|
+
height: z.ZodNumber;
|
|
14
|
+
} & {
|
|
15
|
+
name: z.ZodLiteral<"accuweather">;
|
|
16
|
+
location: z.ZodString;
|
|
17
|
+
locationName: z.ZodString;
|
|
18
|
+
title: z.ZodString;
|
|
19
|
+
bgStartColor: z.ZodUnion<[z.ZodLiteral<"237,143,73,0.93">, z.ZodLiteral<"0,0,0,0.75">, z.ZodLiteral<"31,32,73,0.9">, z.ZodLiteral<"76,94,127,0.95">]>;
|
|
20
|
+
bgEndColor: z.ZodUnion<[z.ZodLiteral<"234,181,89,0.93">, z.ZodLiteral<"0,0,0,0.75">, z.ZodLiteral<"73,96,213,0.9">, z.ZodLiteral<"140,150,168,0.95">]>;
|
|
21
|
+
clockType: z.ZodUnion<[z.ZodLiteral<"12h">, z.ZodLiteral<"24h">]>;
|
|
22
|
+
lang: z.ZodUnion<[z.ZodLiteral<"en-us">, z.ZodLiteral<"fr-fr">, z.ZodLiteral<"ja-jp">, z.ZodLiteral<"pt-pt">, z.ZodLiteral<"es-es">, z.ZodLiteral<"de-de">, z.ZodLiteral<"ko-kr">, z.ZodLiteral<"zh-hk">, z.ZodLiteral<"zh-cn">, z.ZodLiteral<"nl-nl">, z.ZodLiteral<"cs-cz">, z.ZodLiteral<"ru-ru">, z.ZodLiteral<"sv-se">]>;
|
|
23
|
+
font: z.ZodUnion<[z.ZodLiteral<"classic">, z.ZodLiteral<"digital">, z.ZodType<string, z.ZodTypeDef, string>]>;
|
|
24
|
+
units: z.ZodUnion<[z.ZodLiteral<"Metric">, z.ZodLiteral<"Imperial">]>;
|
|
25
|
+
pos_x: z.ZodNumber;
|
|
26
|
+
pos_y: z.ZodNumber;
|
|
27
|
+
coordSystem: z.ZodUnion<[z.ZodLiteral<"top_left">, z.ZodLiteral<"top">, z.ZodLiteral<"top_right">, z.ZodLiteral<"left">, z.ZodLiteral<"center">, z.ZodLiteral<"right">, z.ZodLiteral<"bottom_left">, z.ZodLiteral<"bottom">, z.ZodLiteral<"bottom_right">]>;
|
|
28
|
+
layout: z.ZodUnion<[z.ZodLiteral<"0">, z.ZodLiteral<"1">, z.ZodLiteral<"2">, z.ZodLiteral<"3">, z.ZodLiteral<"4">, z.ZodLiteral<"5">, z.ZodLiteral<"6">, z.ZodLiteral<"7">, z.ZodLiteral<"8">, z.ZodLiteral<"9">, z.ZodLiteral<"10">, z.ZodLiteral<"11">, z.ZodLiteral<"12">, z.ZodLiteral<"13">]>;
|
|
29
|
+
scale: z.ZodNumber;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
name: "accuweather";
|
|
32
|
+
enabled: 0 | 1;
|
|
33
|
+
id: number;
|
|
34
|
+
width: number;
|
|
35
|
+
height: number;
|
|
36
|
+
automationType: "time" | "manual" | "schedule" | `input${number}`;
|
|
37
|
+
cameraList: number[];
|
|
38
|
+
customName: string;
|
|
39
|
+
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
40
|
+
pos_x: number;
|
|
41
|
+
pos_y: number;
|
|
42
|
+
scale: number;
|
|
43
|
+
font: string;
|
|
44
|
+
location: string;
|
|
45
|
+
locationName: string;
|
|
46
|
+
title: string;
|
|
47
|
+
bgStartColor: "237,143,73,0.93" | "0,0,0,0.75" | "31,32,73,0.9" | "76,94,127,0.95";
|
|
48
|
+
bgEndColor: "0,0,0,0.75" | "234,181,89,0.93" | "73,96,213,0.9" | "140,150,168,0.95";
|
|
49
|
+
clockType: "12h" | "24h";
|
|
50
|
+
lang: "en-us" | "fr-fr" | "ja-jp" | "pt-pt" | "es-es" | "de-de" | "ko-kr" | "zh-hk" | "zh-cn" | "nl-nl" | "cs-cz" | "ru-ru" | "sv-se";
|
|
51
|
+
units: "Metric" | "Imperial";
|
|
52
|
+
layout: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13";
|
|
53
|
+
schedule?: string | undefined;
|
|
54
|
+
invertInput?: boolean | undefined;
|
|
55
|
+
camera?: number | undefined;
|
|
56
|
+
zIndex?: number | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
name: "accuweather";
|
|
59
|
+
enabled: 0 | 1;
|
|
60
|
+
id: number;
|
|
61
|
+
width: number;
|
|
62
|
+
height: number;
|
|
63
|
+
automationType: "time" | "manual" | "schedule" | `input${number}`;
|
|
64
|
+
cameraList: number[];
|
|
65
|
+
customName: string;
|
|
66
|
+
coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
|
|
67
|
+
pos_x: number;
|
|
68
|
+
pos_y: number;
|
|
69
|
+
scale: number;
|
|
70
|
+
font: string;
|
|
71
|
+
location: string;
|
|
72
|
+
locationName: string;
|
|
73
|
+
title: string;
|
|
74
|
+
bgStartColor: "237,143,73,0.93" | "0,0,0,0.75" | "31,32,73,0.9" | "76,94,127,0.95";
|
|
75
|
+
bgEndColor: "0,0,0,0.75" | "234,181,89,0.93" | "73,96,213,0.9" | "140,150,168,0.95";
|
|
76
|
+
clockType: "12h" | "24h";
|
|
77
|
+
lang: "en-us" | "fr-fr" | "ja-jp" | "pt-pt" | "es-es" | "de-de" | "ko-kr" | "zh-hk" | "zh-cn" | "nl-nl" | "cs-cz" | "ru-ru" | "sv-se";
|
|
78
|
+
units: "Metric" | "Imperial";
|
|
79
|
+
layout: "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "13";
|
|
80
|
+
schedule?: string | undefined;
|
|
81
|
+
invertInput?: boolean | undefined;
|
|
82
|
+
camera?: number | undefined;
|
|
83
|
+
zIndex?: number | undefined;
|
|
84
|
+
}>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { allowedWidgetNames } from './constants';
|
|
2
|
+
import { coordinateSystemSchema, fontSchema, languageSchema, weatherUnitSchema, widgetCommonSchema, } from './widgetCommonSchema';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
export const accuweatherSchema = widgetCommonSchema.extend({
|
|
5
|
+
name: z.literal(allowedWidgetNames.accuweather),
|
|
6
|
+
location: z.string(),
|
|
7
|
+
locationName: z.string(),
|
|
8
|
+
title: z.string(),
|
|
9
|
+
bgStartColor: z.union([
|
|
10
|
+
z.literal('237,143,73,0.93'),
|
|
11
|
+
z.literal('0,0,0,0.75'),
|
|
12
|
+
z.literal('31,32,73,0.9'),
|
|
13
|
+
z.literal('76,94,127,0.95'),
|
|
14
|
+
]),
|
|
15
|
+
bgEndColor: z.union([
|
|
16
|
+
z.literal('234,181,89,0.93'),
|
|
17
|
+
z.literal('0,0,0,0.75'),
|
|
18
|
+
z.literal('73,96,213,0.9'),
|
|
19
|
+
z.literal('140,150,168,0.95'),
|
|
20
|
+
]),
|
|
21
|
+
clockType: z.union([z.literal('12h'), z.literal('24h')]),
|
|
22
|
+
lang: languageSchema,
|
|
23
|
+
font: fontSchema,
|
|
24
|
+
units: weatherUnitSchema,
|
|
25
|
+
pos_x: z.number(),
|
|
26
|
+
pos_y: z.number(),
|
|
27
|
+
coordSystem: coordinateSystemSchema,
|
|
28
|
+
layout: z.union([
|
|
29
|
+
z.literal('0'),
|
|
30
|
+
z.literal('1'),
|
|
31
|
+
z.literal('2'),
|
|
32
|
+
z.literal('3'),
|
|
33
|
+
z.literal('4'),
|
|
34
|
+
z.literal('5'),
|
|
35
|
+
z.literal('6'),
|
|
36
|
+
z.literal('7'),
|
|
37
|
+
z.literal('8'),
|
|
38
|
+
z.literal('9'),
|
|
39
|
+
z.literal('10'),
|
|
40
|
+
z.literal('11'),
|
|
41
|
+
z.literal('12'),
|
|
42
|
+
z.literal('13'),
|
|
43
|
+
]),
|
|
44
|
+
scale: z.number().nonnegative(),
|
|
45
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const allowedWidgetNames: {
|
|
2
|
+
readonly accuweather: "accuweather";
|
|
3
|
+
readonly infoticker: "infoticker";
|
|
4
|
+
readonly customGraphics: "customGraphics";
|
|
5
|
+
readonly ptzCompass: "ptzCompass";
|
|
6
|
+
readonly images: "images";
|
|
7
|
+
readonly ptz: "ptz";
|
|
8
|
+
readonly pip: "pip";
|
|
9
|
+
readonly screenSharing: "screenSharing";
|
|
10
|
+
readonly web_camera: "web_camera";
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const allowedWidgetNames = {
|
|
2
|
+
accuweather: 'accuweather',
|
|
3
|
+
infoticker: 'infoticker',
|
|
4
|
+
customGraphics: 'customGraphics',
|
|
5
|
+
ptzCompass: 'ptzCompass',
|
|
6
|
+
images: 'images',
|
|
7
|
+
ptz: 'ptz',
|
|
8
|
+
pip: 'pip',
|
|
9
|
+
screenSharing: 'screenSharing',
|
|
10
|
+
web_camera: 'web_camera',
|
|
11
|
+
};
|