camstreamerlib 4.0.0-beta.30 → 4.0.0-beta.32

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.
Files changed (91) hide show
  1. package/cjs/CamOverlayAPI.d.ts +4 -15
  2. package/cjs/CamOverlayAPI.js +10 -21
  3. package/cjs/CamScripterAPI.d.ts +3 -2
  4. package/cjs/CamScripterAPI.js +5 -5
  5. package/cjs/CamStreamerAPI.d.ts +3 -2
  6. package/cjs/CamStreamerAPI.js +4 -4
  7. package/cjs/CamSwitcherAPI.d.ts +3 -2
  8. package/cjs/CamSwitcherAPI.js +7 -7
  9. package/cjs/PlaneTrackerAPI.d.ts +3 -2
  10. package/cjs/PlaneTrackerAPI.js +15 -15
  11. package/cjs/VapixAPI.d.ts +3 -2
  12. package/cjs/VapixAPI.js +13 -13
  13. package/cjs/events/AxisCameraStationEvents.d.ts +4 -2
  14. package/cjs/events/AxisCameraStationEvents.js +4 -4
  15. package/cjs/index.d.ts +0 -1
  16. package/cjs/index.js +0 -1
  17. package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +708 -521
  18. package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +35 -82
  19. package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +7 -37
  20. package/cjs/types/CamOverlayAPI/accuweatherSchema.js +8 -11
  21. package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +63 -146
  22. package/cjs/types/CamOverlayAPI/customGraphicsSchema.js +6 -9
  23. package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +8 -35
  24. package/cjs/types/CamOverlayAPI/imagesSchema.js +5 -8
  25. package/cjs/types/CamOverlayAPI/index.d.ts +2 -0
  26. package/cjs/types/CamOverlayAPI/index.js +2 -0
  27. package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +9 -43
  28. package/cjs/types/CamOverlayAPI/infotickerSchema.js +7 -10
  29. package/cjs/types/CamOverlayAPI/pipSchema.d.ts +5 -46
  30. package/cjs/types/CamOverlayAPI/pipSchema.js +5 -8
  31. package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +7 -40
  32. package/cjs/types/CamOverlayAPI/ptzCompassSchema.js +5 -8
  33. package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +10 -38
  34. package/cjs/types/CamOverlayAPI/ptzSchema.js +5 -8
  35. package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +3 -24
  36. package/cjs/types/CamOverlayAPI/screenSharingSchema.js +4 -7
  37. package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +3 -24
  38. package/cjs/types/CamOverlayAPI/webCameraSharingSchema.js +4 -7
  39. package/cjs/types/CamOverlayAPI/widgetCommonTypes.d.ts +141 -0
  40. package/cjs/types/CamOverlayAPI/widgetCommonTypes.js +87 -0
  41. package/cjs/types/CamStreamerAPI.d.ts +4 -4
  42. package/cjs/types/CamSwitcherAPI.d.ts +0 -2
  43. package/cjs/types/VapixAPI.d.ts +0 -2
  44. package/esm/CamOverlayAPI.d.ts +4 -15
  45. package/esm/CamOverlayAPI.js +9 -20
  46. package/esm/CamScripterAPI.d.ts +3 -2
  47. package/esm/CamScripterAPI.js +5 -5
  48. package/esm/CamStreamerAPI.d.ts +3 -2
  49. package/esm/CamStreamerAPI.js +4 -4
  50. package/esm/CamSwitcherAPI.d.ts +3 -2
  51. package/esm/CamSwitcherAPI.js +7 -7
  52. package/esm/PlaneTrackerAPI.d.ts +3 -2
  53. package/esm/PlaneTrackerAPI.js +15 -15
  54. package/esm/VapixAPI.d.ts +3 -2
  55. package/esm/VapixAPI.js +13 -13
  56. package/esm/events/AxisCameraStationEvents.d.ts +4 -2
  57. package/esm/events/AxisCameraStationEvents.js +4 -4
  58. package/esm/index.d.ts +0 -1
  59. package/esm/index.js +0 -1
  60. package/esm/types/CamOverlayAPI/CamOverlayAPI.d.ts +708 -521
  61. package/esm/types/CamOverlayAPI/CamOverlayAPI.js +17 -73
  62. package/esm/types/CamOverlayAPI/accuweatherSchema.d.ts +7 -37
  63. package/esm/types/CamOverlayAPI/accuweatherSchema.js +1 -3
  64. package/esm/types/CamOverlayAPI/customGraphicsSchema.d.ts +63 -146
  65. package/esm/types/CamOverlayAPI/customGraphicsSchema.js +1 -3
  66. package/esm/types/CamOverlayAPI/imagesSchema.d.ts +8 -35
  67. package/esm/types/CamOverlayAPI/imagesSchema.js +1 -3
  68. package/esm/types/CamOverlayAPI/index.d.ts +2 -0
  69. package/esm/types/CamOverlayAPI/index.js +2 -0
  70. package/esm/types/CamOverlayAPI/infotickerSchema.d.ts +9 -43
  71. package/esm/types/CamOverlayAPI/infotickerSchema.js +1 -3
  72. package/esm/types/CamOverlayAPI/pipSchema.d.ts +5 -46
  73. package/esm/types/CamOverlayAPI/pipSchema.js +1 -3
  74. package/esm/types/CamOverlayAPI/ptzCompassSchema.d.ts +7 -40
  75. package/esm/types/CamOverlayAPI/ptzCompassSchema.js +1 -3
  76. package/esm/types/CamOverlayAPI/ptzSchema.d.ts +10 -38
  77. package/esm/types/CamOverlayAPI/ptzSchema.js +1 -3
  78. package/esm/types/CamOverlayAPI/screenSharingSchema.d.ts +3 -24
  79. package/esm/types/CamOverlayAPI/screenSharingSchema.js +1 -3
  80. package/esm/types/CamOverlayAPI/webCameraSharingSchema.d.ts +3 -24
  81. package/esm/types/CamOverlayAPI/webCameraSharingSchema.js +1 -3
  82. package/esm/types/CamOverlayAPI/widgetCommonTypes.d.ts +141 -0
  83. package/esm/types/CamOverlayAPI/widgetCommonTypes.js +84 -0
  84. package/esm/types/CamStreamerAPI.d.ts +4 -4
  85. package/esm/types/CamSwitcherAPI.d.ts +0 -2
  86. package/esm/types/VapixAPI.d.ts +0 -2
  87. package/package.json +2 -2
  88. package/cjs/node/WsEventClient.d.ts +0 -13
  89. package/cjs/node/WsEventClient.js +0 -22
  90. package/esm/node/WsEventClient.d.ts +0 -13
  91. package/esm/node/WsEventClient.js +0 -18
@@ -0,0 +1,141 @@
1
+ import { z } from 'zod';
2
+ export declare const allowedWidgetNames: {
3
+ readonly accuweather: "accuweather";
4
+ readonly infoticker: "infoticker";
5
+ readonly customGraphics: "customGraphics";
6
+ readonly ptzCompass: "ptzCompass";
7
+ readonly images: "images";
8
+ readonly ptz: "ptz";
9
+ readonly pip: "pip";
10
+ readonly screenSharing: "screenSharing";
11
+ readonly web_camera: "web_camera";
12
+ };
13
+ export declare const coordinateSystemSchema: 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">]>;
14
+ export type TCoordinates = z.infer<typeof coordinateSystemSchema> | '';
15
+ export declare const languageSchema: 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">]>;
16
+ export type TLanguage = z.infer<typeof languageSchema>;
17
+ export declare const fontSchema: z.ZodUnion<[z.ZodLiteral<"classic">, z.ZodLiteral<"digital">, z.ZodType<string, z.ZodTypeDef, string>]>;
18
+ export type TFont = z.infer<typeof fontSchema>;
19
+ export declare const weatherUnitSchema: z.ZodUnion<[z.ZodLiteral<"Metric">, z.ZodLiteral<"Imperial">]>;
20
+ export type TWeatherUnit = z.infer<typeof weatherUnitSchema>;
21
+ export declare const widgetCommonSchema: z.ZodObject<{
22
+ id: z.ZodNumber;
23
+ enabled: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
24
+ automationType: z.ZodUnion<[z.ZodLiteral<"time">, z.ZodLiteral<"manual">, z.ZodLiteral<"schedule">, z.ZodType<`input${number}`, z.ZodTypeDef, `input${number}`>]>;
25
+ invertInput: z.ZodOptional<z.ZodBoolean>;
26
+ cameraList: z.ZodArray<z.ZodNumber, "many">;
27
+ camera: z.ZodOptional<z.ZodNumber>;
28
+ schedule: z.ZodOptional<z.ZodString>;
29
+ customName: z.ZodString;
30
+ zIndex: z.ZodOptional<z.ZodNumber>;
31
+ width: z.ZodNumber;
32
+ height: z.ZodNumber;
33
+ }, "strip", z.ZodTypeAny, {
34
+ enabled: 0 | 1;
35
+ id: number;
36
+ width: number;
37
+ height: number;
38
+ automationType: "time" | "manual" | "schedule" | `input${number}`;
39
+ cameraList: number[];
40
+ customName: string;
41
+ camera?: number | undefined;
42
+ schedule?: string | undefined;
43
+ invertInput?: boolean | undefined;
44
+ zIndex?: number | undefined;
45
+ }, {
46
+ enabled: 0 | 1;
47
+ id: number;
48
+ width: number;
49
+ height: number;
50
+ automationType: "time" | "manual" | "schedule" | `input${number}`;
51
+ cameraList: number[];
52
+ customName: string;
53
+ camera?: number | undefined;
54
+ schedule?: string | undefined;
55
+ invertInput?: boolean | undefined;
56
+ zIndex?: number | undefined;
57
+ }>;
58
+ export declare const sharingSchema: z.ZodObject<{
59
+ id: z.ZodNumber;
60
+ enabled: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
61
+ automationType: z.ZodUnion<[z.ZodLiteral<"time">, z.ZodLiteral<"manual">, z.ZodLiteral<"schedule">, z.ZodType<`input${number}`, z.ZodTypeDef, `input${number}`>]>;
62
+ invertInput: z.ZodOptional<z.ZodBoolean>;
63
+ cameraList: z.ZodArray<z.ZodNumber, "many">;
64
+ camera: z.ZodOptional<z.ZodNumber>;
65
+ schedule: z.ZodOptional<z.ZodString>;
66
+ customName: z.ZodString;
67
+ zIndex: z.ZodOptional<z.ZodNumber>;
68
+ width: z.ZodNumber;
69
+ height: z.ZodNumber;
70
+ } & {
71
+ pos_x: z.ZodNumber;
72
+ pos_y: z.ZodNumber;
73
+ 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">]>;
74
+ screenSize: z.ZodNumber;
75
+ fps: z.ZodNumber;
76
+ }, "strip", z.ZodTypeAny, {
77
+ enabled: 0 | 1;
78
+ id: number;
79
+ width: number;
80
+ height: number;
81
+ fps: number;
82
+ automationType: "time" | "manual" | "schedule" | `input${number}`;
83
+ cameraList: number[];
84
+ customName: string;
85
+ pos_x: number;
86
+ pos_y: number;
87
+ coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
88
+ screenSize: number;
89
+ camera?: number | undefined;
90
+ schedule?: string | undefined;
91
+ invertInput?: boolean | undefined;
92
+ zIndex?: number | undefined;
93
+ }, {
94
+ enabled: 0 | 1;
95
+ id: number;
96
+ width: number;
97
+ height: number;
98
+ fps: number;
99
+ automationType: "time" | "manual" | "schedule" | `input${number}`;
100
+ cameraList: number[];
101
+ customName: string;
102
+ pos_x: number;
103
+ pos_y: number;
104
+ coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
105
+ screenSize: number;
106
+ camera?: number | undefined;
107
+ schedule?: string | undefined;
108
+ invertInput?: boolean | undefined;
109
+ zIndex?: number | undefined;
110
+ }>;
111
+ export declare const overlaySchema: z.ZodObject<{
112
+ active: z.ZodBoolean;
113
+ 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">]>;
114
+ pos_x: z.ZodNumber;
115
+ pos_y: z.ZodNumber;
116
+ imgPath: z.ZodString;
117
+ imgName: z.ZodString;
118
+ duration: z.ZodNumber;
119
+ scale: z.ZodNumber;
120
+ fps: z.ZodOptional<z.ZodNumber>;
121
+ }, "strip", z.ZodTypeAny, {
122
+ duration: number;
123
+ pos_x: number;
124
+ pos_y: number;
125
+ coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
126
+ active: boolean;
127
+ imgPath: string;
128
+ imgName: string;
129
+ scale: number;
130
+ fps?: number | undefined;
131
+ }, {
132
+ duration: number;
133
+ pos_x: number;
134
+ pos_y: number;
135
+ coordSystem: "top_left" | "top" | "top_right" | "left" | "center" | "right" | "bottom_left" | "bottom" | "bottom_right";
136
+ active: boolean;
137
+ imgPath: string;
138
+ imgName: string;
139
+ scale: number;
140
+ fps?: number | undefined;
141
+ }>;
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.overlaySchema = exports.sharingSchema = exports.widgetCommonSchema = exports.weatherUnitSchema = exports.fontSchema = exports.languageSchema = exports.coordinateSystemSchema = exports.allowedWidgetNames = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.allowedWidgetNames = {
6
+ accuweather: 'accuweather',
7
+ infoticker: 'infoticker',
8
+ customGraphics: 'customGraphics',
9
+ ptzCompass: 'ptzCompass',
10
+ images: 'images',
11
+ ptz: 'ptz',
12
+ pip: 'pip',
13
+ screenSharing: 'screenSharing',
14
+ web_camera: 'web_camera',
15
+ };
16
+ exports.coordinateSystemSchema = zod_1.z.union([
17
+ zod_1.z.literal('top_left'),
18
+ zod_1.z.literal('top'),
19
+ zod_1.z.literal('top_right'),
20
+ zod_1.z.literal('left'),
21
+ zod_1.z.literal('center'),
22
+ zod_1.z.literal('right'),
23
+ zod_1.z.literal('bottom_left'),
24
+ zod_1.z.literal('bottom'),
25
+ zod_1.z.literal('bottom_right'),
26
+ ]);
27
+ exports.languageSchema = zod_1.z.union([
28
+ zod_1.z.literal('en-us'),
29
+ zod_1.z.literal('fr-fr'),
30
+ zod_1.z.literal('ja-jp'),
31
+ zod_1.z.literal('pt-pt'),
32
+ zod_1.z.literal('es-es'),
33
+ zod_1.z.literal('de-de'),
34
+ zod_1.z.literal('ko-kr'),
35
+ zod_1.z.literal('zh-hk'),
36
+ zod_1.z.literal('zh-cn'),
37
+ zod_1.z.literal('nl-nl'),
38
+ zod_1.z.literal('cs-cz'),
39
+ zod_1.z.literal('ru-ru'),
40
+ zod_1.z.literal('sv-se'),
41
+ ]);
42
+ exports.fontSchema = zod_1.z.union([
43
+ zod_1.z.literal('classic'),
44
+ zod_1.z.literal('digital'),
45
+ zod_1.z.custom((val) => {
46
+ return typeof val === 'string';
47
+ }),
48
+ ]);
49
+ exports.weatherUnitSchema = zod_1.z.union([zod_1.z.literal('Metric'), zod_1.z.literal('Imperial')]);
50
+ exports.widgetCommonSchema = zod_1.z.object({
51
+ id: zod_1.z.number().nonnegative(),
52
+ enabled: zod_1.z.union([zod_1.z.literal(0), zod_1.z.literal(1)]),
53
+ automationType: zod_1.z.union([
54
+ zod_1.z.literal('time'),
55
+ zod_1.z.literal('manual'),
56
+ zod_1.z.literal('schedule'),
57
+ zod_1.z.custom((val) => {
58
+ return typeof val === 'string' ? /^input\d+$/.test(val) : false;
59
+ }),
60
+ ]),
61
+ invertInput: zod_1.z.boolean().optional(),
62
+ cameraList: zod_1.z.array(zod_1.z.number()),
63
+ camera: zod_1.z.number().nonnegative().optional(),
64
+ schedule: zod_1.z.string().optional(),
65
+ customName: zod_1.z.string(),
66
+ zIndex: zod_1.z.number().optional(),
67
+ width: zod_1.z.number().nonnegative(),
68
+ height: zod_1.z.number().nonnegative(),
69
+ });
70
+ exports.sharingSchema = exports.widgetCommonSchema.extend({
71
+ pos_x: zod_1.z.number().nonnegative(),
72
+ pos_y: zod_1.z.number().nonnegative(),
73
+ coordSystem: exports.coordinateSystemSchema,
74
+ screenSize: zod_1.z.number().positive(),
75
+ fps: zod_1.z.number(),
76
+ });
77
+ exports.overlaySchema = zod_1.z.object({
78
+ active: zod_1.z.boolean(),
79
+ coordSystem: exports.coordinateSystemSchema,
80
+ pos_x: zod_1.z.number(),
81
+ pos_y: zod_1.z.number(),
82
+ imgPath: zod_1.z.string(),
83
+ imgName: zod_1.z.string(),
84
+ duration: zod_1.z.number(),
85
+ scale: zod_1.z.number(),
86
+ fps: zod_1.z.number().optional(),
87
+ });
@@ -25,8 +25,8 @@ export declare const streamAttributesSchema: z.ZodObject<{
25
25
  stopTime: z.ZodString;
26
26
  }, "strip", z.ZodTypeAny, {
27
27
  enabled: string;
28
- active: string;
29
28
  schedule: string;
29
+ active: string;
30
30
  audioSource: string;
31
31
  avSyncMsec: string;
32
32
  internalVapixParameters: string;
@@ -47,8 +47,8 @@ export declare const streamAttributesSchema: z.ZodObject<{
47
47
  stopTime: string;
48
48
  }, {
49
49
  enabled: string;
50
- active: string;
51
50
  schedule: string;
51
+ active: string;
52
52
  audioSource: string;
53
53
  avSyncMsec: string;
54
54
  internalVapixParameters: string;
@@ -93,8 +93,8 @@ export declare const streamListSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
93
93
  stopTime: z.ZodString;
94
94
  }, "strip", z.ZodTypeAny, {
95
95
  enabled: string;
96
- active: string;
97
96
  schedule: string;
97
+ active: string;
98
98
  audioSource: string;
99
99
  avSyncMsec: string;
100
100
  internalVapixParameters: string;
@@ -115,8 +115,8 @@ export declare const streamListSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
115
115
  stopTime: string;
116
116
  }, {
117
117
  enabled: string;
118
- active: string;
119
118
  schedule: string;
119
+ active: string;
120
120
  audioSource: string;
121
121
  avSyncMsec: string;
122
122
  internalVapixParameters: string;
@@ -1,7 +1,5 @@
1
- import { HttpOptions } from '../internal/types';
2
1
  import { z } from 'zod';
3
2
  import { TH264Profile, TAudioChannelCount, TKeyboardShortcut } from './common';
4
- export type CamSwitcherAPIOptions = HttpOptions;
5
3
  declare const channelTypeSchema: z.ZodUnion<[z.ZodLiteral<"audio">, z.ZodLiteral<"video">, z.ZodLiteral<"av">]>;
6
4
  export type TChannelType = z.infer<typeof channelTypeSchema>;
7
5
  declare const playlistPlayTypeSchema: z.ZodUnion<[z.ZodLiteral<"PLAY_ALL">, z.ZodLiteral<"PLAY_ALL_LOOP">, z.ZodLiteral<"PLAY_ALL_SHUFFLED">, z.ZodLiteral<"PLAY_ALL_LOOP_SHUFFLED">, z.ZodLiteral<"PLAY_ONE_RANDOM">]>;
@@ -1,6 +1,4 @@
1
- import { HttpOptions } from '../internal/types';
2
1
  import { z } from 'zod';
3
- export type CameraVapixOptions = HttpOptions;
4
2
  export declare const applicationSchema: z.ZodObject<{
5
3
  Name: z.ZodString;
6
4
  NiceName: z.ZodString;
@@ -1,26 +1,16 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
3
  import { IClient, TBlobResponse, TResponse } from './internal/types';
4
- import { THttpRequestOptions, TNetworkCamera } from './types/common';
5
- import { ImageType, TCoordinates, TFile, TFileList, TFileType, TStorage, TStorageDataList, TWidget } from './types/CamOverlayAPI/CamOverlayAPI';
6
- import { TField } from './types/CamOverlayAPI';
7
- export declare const allowedWidgetNames: {
8
- readonly accuweather: "accuweather";
9
- readonly infoticker: "infoticker";
10
- readonly customGraphics: "customGraphics";
11
- readonly ptzCompass: "ptzCompass";
12
- readonly images: "images";
13
- readonly ptz: "ptz";
14
- readonly pip: "pip";
15
- readonly screenSharing: "screenSharing";
16
- readonly web_camera: "web_camera";
17
- };
4
+ import { THttpRequestOptions, TProxyParams, TNetworkCamera } from './types/common';
5
+ import { ProxyClient } from './internal/ProxyClient';
6
+ import { ImageType, TCoordinates, TField, TFile, TFileList, TFileType, TStorage, TStorageDataList, TWidget } from './types/CamOverlayAPI';
18
7
  export declare class CamOverlayAPI<Client extends IClient<TResponse> = IClient<TResponse>> {
19
8
  private client;
20
9
  constructor(client: Client);
21
10
  static getBasePath: () => string;
22
11
  static getProxyPath: () => string;
23
12
  static getFilePreviewPath: (path: string) => string;
13
+ getClient(proxyParams?: TProxyParams): Client | ProxyClient<Client>;
24
14
  checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
25
15
  getNetworkCameraList(options?: THttpRequestOptions): Promise<TNetworkCamera[]>;
26
16
  wsAuthorization(options?: THttpRequestOptions): Promise<string>;
@@ -48,5 +38,4 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse> = IClient<T
48
38
  private parseBlobResponse;
49
39
  private _postUrlEncoded;
50
40
  private _postJsonEncoded;
51
- private getAgent;
52
41
  }
@@ -3,18 +3,7 @@ import { ParsingBlobError, ServiceNotFoundError } from './errors/errors';
3
3
  import { networkCameraListSchema } from './types/common';
4
4
  import { z } from 'zod';
5
5
  import { ProxyClient } from './internal/ProxyClient';
6
- import { fileListSchema, ImageType, storageDataListSchema, widgetsSchema, WSResponseSchema, } from './types/CamOverlayAPI/CamOverlayAPI';
7
- export const allowedWidgetNames = {
8
- accuweather: 'accuweather',
9
- infoticker: 'infoticker',
10
- customGraphics: 'customGraphics',
11
- ptzCompass: 'ptzCompass',
12
- images: 'images',
13
- ptz: 'ptz',
14
- pip: 'pip',
15
- screenSharing: 'screenSharing',
16
- web_camera: 'web_camera',
17
- };
6
+ import { fileListSchema, ImageType, storageDataListSchema, widgetsSchema, WSResponseSchema, } from './types/CamOverlayAPI';
18
7
  const BASE_PATH = '/local/camoverlay/api';
19
8
  export class CamOverlayAPI {
20
9
  client;
@@ -24,6 +13,9 @@ export class CamOverlayAPI {
24
13
  static getBasePath = () => BASE_PATH;
25
14
  static getProxyPath = () => `${BASE_PATH}/proxy.cgi`;
26
15
  static getFilePreviewPath = (path) => `${BASE_PATH}/image.cgi?path=${encodeURIComponent(path)}`;
16
+ getClient(proxyParams) {
17
+ return proxyParams ? new ProxyClient(this.client, proxyParams) : this.client;
18
+ }
27
19
  async checkCameraTime(options) {
28
20
  const response = await this._get({ path: `${BASE_PATH}/camera_time.cgi` }, options);
29
21
  return z.boolean().parse(response.state);
@@ -89,7 +81,7 @@ export class CamOverlayAPI {
89
81
  await this._post({ path: `${BASE_PATH}/enabled.cgi?id_${serviceId}=${enabled ? 1 : 0}`, data: '' }, options);
90
82
  }
91
83
  async isEnabled(serviceId, options) {
92
- const agent = this.getAgent(options?.proxyParams);
84
+ const agent = this.getClient(options?.proxyParams);
93
85
  const res = await agent.get({ path: `${BASE_PATH}/services.cgi?action=get`, timeout: options?.timeout });
94
86
  if (res.ok) {
95
87
  const data = JSON.parse(await res.text());
@@ -186,7 +178,7 @@ export class CamOverlayAPI {
186
178
  if (contentType !== undefined && data) {
187
179
  headers = { 'Content-Type': contentType };
188
180
  }
189
- const agent = this.getAgent(options?.proxyParams);
181
+ const agent = this.getClient(options?.proxyParams);
190
182
  const res = await agent.post({
191
183
  path,
192
184
  data: data ?? '',
@@ -203,7 +195,7 @@ export class CamOverlayAPI {
203
195
  }
204
196
  }
205
197
  async _get(params, options) {
206
- const agent = this.getAgent(options?.proxyParams);
198
+ const agent = this.getClient(options?.proxyParams);
207
199
  const res = await agent.get({ ...params, timeout: options?.timeout });
208
200
  if (res.ok) {
209
201
  return (await res.json());
@@ -213,7 +205,7 @@ export class CamOverlayAPI {
213
205
  }
214
206
  }
215
207
  async _post(params, options) {
216
- const agent = this.getAgent(options?.proxyParams);
208
+ const agent = this.getClient(options?.proxyParams);
217
209
  const res = await agent.post({ ...params, timeout: options?.timeout });
218
210
  if (res.ok) {
219
211
  return (await res.json());
@@ -223,7 +215,7 @@ export class CamOverlayAPI {
223
215
  }
224
216
  }
225
217
  async _getBlob(params, options) {
226
- const agent = this.getAgent(options?.proxyParams);
218
+ const agent = this.getClient(options?.proxyParams);
227
219
  const res = await agent.get({ ...params, timeout: options?.timeout });
228
220
  if (res.ok) {
229
221
  return await this.parseBlobResponse(res);
@@ -249,7 +241,4 @@ export class CamOverlayAPI {
249
241
  const baseHeaders = { 'Accept': 'application/json', 'Content-Type': 'application/json' };
250
242
  return this._post({ path, data, parameters, headers: { ...baseHeaders, ...headers } }, options);
251
243
  }
252
- getAgent(proxyParams) {
253
- return proxyParams ? new ProxyClient(this.client, proxyParams) : this.client;
254
- }
255
244
  }
@@ -1,10 +1,12 @@
1
+ import { ProxyClient } from './internal/ProxyClient';
1
2
  import { IClient, TResponse } from './internal/types';
2
3
  import { TNodeState, TPackageInfoList, TStorage, TStorageType } from './types/CamScripterAPI';
3
- import { THttpRequestOptions, TNetworkCamera } from './types/common';
4
+ import { THttpRequestOptions, TNetworkCamera, TProxyParams } from './types/common';
4
5
  export declare class CamScripterAPI<Client extends IClient<TResponse> = IClient<TResponse>> {
5
6
  client: Client;
6
7
  constructor(client: Client);
7
8
  static getProxyUrlPath: () => string;
9
+ getClient(proxyParams?: TProxyParams): Client | ProxyClient<Client>;
8
10
  checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
9
11
  getNetworkCameraList(options?: THttpRequestOptions): Promise<TNetworkCamera[]>;
10
12
  getStorageInfo(options?: THttpRequestOptions): Promise<TStorage>;
@@ -32,5 +34,4 @@ export declare class CamScripterAPI<Client extends IClient<TResponse> = IClient<
32
34
  }>;
33
35
  private get;
34
36
  private post;
35
- private getAgent;
36
37
  }
@@ -9,6 +9,9 @@ export class CamScripterAPI {
9
9
  this.client = client;
10
10
  }
11
11
  static getProxyUrlPath = () => `${BASE_PATH}/proxy.cgi`;
12
+ getClient(proxyParams) {
13
+ return proxyParams ? new ProxyClient(this.client, proxyParams) : this.client;
14
+ }
12
15
  async checkCameraTime(options) {
13
16
  const data = await this.get(`${BASE_PATH}/camera_time.cgi`, undefined, options);
14
17
  return cameraTimeResponseSchema.parse(data).state;
@@ -50,7 +53,7 @@ export class CamScripterAPI {
50
53
  return camscripterApiResponseSchema.parse(data);
51
54
  }
52
55
  async get(path, parameters, options) {
53
- const agent = this.getAgent(options?.proxyParams);
56
+ const agent = this.getClient(options?.proxyParams);
54
57
  const res = await agent.get({ path, parameters, timeout: options?.timeout });
55
58
  if (res.ok) {
56
59
  return await res.json();
@@ -60,7 +63,7 @@ export class CamScripterAPI {
60
63
  }
61
64
  }
62
65
  async post(path, data, parameters, options) {
63
- const agent = this.getAgent(options?.proxyParams);
66
+ const agent = this.getClient(options?.proxyParams);
64
67
  const res = await agent.post({ path, data, parameters, timeout: options?.timeout });
65
68
  if (res.ok) {
66
69
  return await res.json();
@@ -69,7 +72,4 @@ export class CamScripterAPI {
69
72
  throw new Error(await responseStringify(res));
70
73
  }
71
74
  }
72
- getAgent(proxyParams) {
73
- return proxyParams ? new ProxyClient(this.client, proxyParams) : this.client;
74
- }
75
75
  }
@@ -1,9 +1,11 @@
1
+ import { ProxyClient } from './internal/ProxyClient';
1
2
  import { IClient, TResponse } from './internal/types';
2
3
  import { TStreamAttributes, TStreamList } from './types/CamStreamerAPI';
3
- import { THttpRequestOptions } from './types/common';
4
+ import { THttpRequestOptions, TProxyParams } from './types/common';
4
5
  export declare class CamStreamerAPI<Client extends IClient<TResponse> = IClient<TResponse>> {
5
6
  client: Client;
6
7
  constructor(client: Client);
8
+ getClient(proxyParams?: TProxyParams): Client | ProxyClient<Client>;
7
9
  getStreamList(options?: THttpRequestOptions): Promise<TStreamList>;
8
10
  getStream(streamId: string, options?: THttpRequestOptions): Promise<TStreamAttributes>;
9
11
  getStreamParameter(streamId: string, paramName: string, options?: THttpRequestOptions): Promise<string>;
@@ -14,5 +16,4 @@ export declare class CamStreamerAPI<Client extends IClient<TResponse> = IClient<
14
16
  wsAuthorization(options?: THttpRequestOptions): Promise<string>;
15
17
  getUtcTime(options?: THttpRequestOptions): Promise<number>;
16
18
  private get;
17
- private getAgent;
18
19
  }
@@ -7,6 +7,9 @@ export class CamStreamerAPI {
7
7
  constructor(client) {
8
8
  this.client = client;
9
9
  }
10
+ getClient(proxyParams) {
11
+ return proxyParams ? new ProxyClient(this.client, proxyParams) : this.client;
12
+ }
10
13
  async getStreamList(options) {
11
14
  const streamListRes = await this.get(`${BASE_PATH}/stream/list.cgi`, undefined, options);
12
15
  return streamListSchema.parse(streamListRes.data);
@@ -46,7 +49,7 @@ export class CamStreamerAPI {
46
49
  return await this.get(`${BASE_PATH}/get_utc_time.cgi`, undefined, options);
47
50
  }
48
51
  async get(path, parameters, options) {
49
- const agent = this.getAgent(options?.proxyParams);
52
+ const agent = this.getClient(options?.proxyParams);
50
53
  const res = await agent.get({ path, parameters, timeout: options?.timeout });
51
54
  if (res.ok) {
52
55
  return await res.json();
@@ -55,7 +58,4 @@ export class CamStreamerAPI {
55
58
  throw new Error(await responseStringify(res));
56
59
  }
57
60
  }
58
- getAgent(proxyParams) {
59
- return proxyParams ? new ProxyClient(this.client, proxyParams) : this.client;
60
- }
61
61
  }
@@ -1,6 +1,7 @@
1
1
  import { IClient, TResponse } from './internal/types';
2
2
  import { TAudioPushInfo, TOutputInfo, TStorageInfo, TStreamSaveList, TClipList, TStreamSaveLoadList, TClipSaveLoadList, TPlaylistSaveLoadList, TTrackerSaveList, TrackerSaveLoadList, TClipSaveList, TPlaylistSaveList, TCameraOptions, TGlobalAudioSettings, TSecondaryAudioSettings } from './types/CamSwitcherAPI';
3
- import { TAudioChannel, THttpRequestOptions, TNetworkCamera, TStorageType } from './types/common';
3
+ import { TAudioChannel, THttpRequestOptions, TNetworkCamera, TProxyParams, TStorageType } from './types/common';
4
+ import { ProxyClient } from './internal/ProxyClient';
4
5
  export declare class CamSwitcherAPI<Client extends IClient<TResponse> = IClient<TResponse>> {
5
6
  client: Client;
6
7
  private CustomFormData;
@@ -12,6 +13,7 @@ export declare class CamSwitcherAPI<Client extends IClient<TResponse> = IClient<
12
13
  static getProxyUrlPath: () => string;
13
14
  static getWsEventsUrlPath: () => string;
14
15
  static getClipPreviewUrlPath: (id: string, storage: TStorageType) => string;
16
+ getClient(proxyParams?: TProxyParams): Client | ProxyClient<Client>;
15
17
  generateSilence(sampleRate: number, channels: TAudioChannel, options?: THttpRequestOptions): Promise<void>;
16
18
  checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
17
19
  getNetworkCameraList(options?: THttpRequestOptions): Promise<TNetworkCamera[]>;
@@ -49,5 +51,4 @@ export declare class CamSwitcherAPI<Client extends IClient<TResponse> = IClient<
49
51
  private set;
50
52
  private setParamFromCameraJSON;
51
53
  private getParamFromCameraAndJSONParse;
52
- private getAgent;
53
54
  }
@@ -20,8 +20,11 @@ export class CamSwitcherAPI {
20
20
  static getProxyUrlPath = () => `${BASE_PATH}/proxy.cgi`;
21
21
  static getWsEventsUrlPath = () => `/local/camswitcher/events`;
22
22
  static getClipPreviewUrlPath = (id, storage) => `${BASE_PATH}/clip_preview.cgi?clip_name=${id}&storage=${storage}`;
23
+ getClient(proxyParams) {
24
+ return proxyParams ? new ProxyClient(this.client, proxyParams) : this.client;
25
+ }
23
26
  async generateSilence(sampleRate, channels, options) {
24
- const agent = this.getAgent(options?.proxyParams);
27
+ const agent = this.getClient(options?.proxyParams);
25
28
  await agent.get({
26
29
  path: `${BASE_PATH}/generate_silence.cgi`,
27
30
  parameters: {
@@ -111,7 +114,7 @@ export class CamSwitcherAPI {
111
114
  formData.append('clip_name', id);
112
115
  formData.append('clip_type', clipType);
113
116
  formData.append('file', file, fileName);
114
- const agent = this.getAgent(options?.proxyParams);
117
+ const agent = this.getClient(options?.proxyParams);
115
118
  const res = await agent.post({ path, data: formData, timeout: options?.timeout });
116
119
  const output = (await res.json());
117
120
  if (output.status !== 200) {
@@ -244,7 +247,7 @@ export class CamSwitcherAPI {
244
247
  return res[paramName] ?? '';
245
248
  }
246
249
  async get(path, parameters, options) {
247
- const agent = this.getAgent(options?.proxyParams);
250
+ const agent = this.getClient(options?.proxyParams);
248
251
  const res = await agent.get({ path, parameters, timeout: options?.timeout });
249
252
  if (res.ok) {
250
253
  const d = (await res.json());
@@ -255,7 +258,7 @@ export class CamSwitcherAPI {
255
258
  }
256
259
  }
257
260
  async set(path, data, parameters, options) {
258
- const agent = this.getAgent(options?.proxyParams);
261
+ const agent = this.getClient(options?.proxyParams);
259
262
  const res = await agent.post({ path, data: JSON.stringify(data), parameters, timeout: options?.timeout });
260
263
  if (res.ok) {
261
264
  const parsed = await res.json();
@@ -287,9 +290,6 @@ export class CamSwitcherAPI {
287
290
  }
288
291
  throw new Error("Error: no parametr '" + paramName + "' was found");
289
292
  }
290
- getAgent(proxyParams) {
291
- return proxyParams ? new ProxyClient(this.client, proxyParams) : this.client;
292
- }
293
293
  }
294
294
  const CSW_PARAM_NAMES = {
295
295
  SETTINGS: 'Camswitcher.Settings',
@@ -1,11 +1,13 @@
1
1
  import { IClient, TBlobResponse, TParameters, TResponse } from './internal/types';
2
2
  import { ICAO, TApiUser, TExportDataType, TImportDataType } from './types/PlaneTrackerAPI';
3
- import { THttpRequestOptions } from './types/common';
3
+ import { THttpRequestOptions, TProxyParams } from './types/common';
4
+ import { ProxyClient } from './internal/ProxyClient';
4
5
  export declare class PlaneTrackerAPI<Client extends IClient<TResponse> = IClient<TResponse>> {
5
6
  private client;
6
7
  private apiUser;
7
8
  constructor(client: Client, apiUser: TApiUser);
8
9
  static getProxyUrlPath: () => string;
10
+ getClient(proxyParams?: TProxyParams): Client | ProxyClient<Client>;
9
11
  checkCameraTime(options?: THttpRequestOptions): Promise<boolean>;
10
12
  resetPtzCalibration: (options?: THttpRequestOptions) => Promise<TResponse>;
11
13
  resetFocusCalibration: (options?: THttpRequestOptions) => Promise<TResponse>;
@@ -38,5 +40,4 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse> = IClient
38
40
  private parseBlobResponse;
39
41
  private _postJsonEncoded;
40
42
  private _postUrlEncoded;
41
- private getAgent;
42
43
  }