camstreamerlib 4.0.37 → 5.0.0-20ab5c4

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 (130) hide show
  1. package/README.md +39 -2
  2. package/cjs/CamOverlayAPI.d.ts +204 -204
  3. package/cjs/CamStreamerAPI.d.ts +311 -311
  4. package/cjs/CamStreamerAPI.js +1 -1
  5. package/cjs/CamSwitcherAPI.d.ts +32 -31
  6. package/cjs/CamSwitcherAPI.js +2 -0
  7. package/cjs/PlaneTrackerAPI.d.ts +25 -28
  8. package/cjs/VapixAPI.d.ts +15 -15
  9. package/cjs/VapixAPI.js +2 -2
  10. package/cjs/bin/CreatePackage.js +17 -7
  11. package/cjs/internal/transformers.d.ts +4 -4
  12. package/cjs/internal/utils.js +3 -3
  13. package/cjs/internal/versionCompare.d.ts +2 -2
  14. package/cjs/node/CamOverlayDrawingAPI.d.ts +0 -3
  15. package/cjs/node/CamOverlayPainter/Frame.d.ts +0 -1
  16. package/cjs/node/CamOverlayPainter/ResourceManager.d.ts +2 -2
  17. package/cjs/node/CamOverlayPainter/ResourceManager.js +17 -7
  18. package/cjs/node/CamScripterAPICameraEventsGenerator.d.ts +0 -1
  19. package/cjs/node/DefaultClient.d.ts +0 -2
  20. package/cjs/node/Digest.js +17 -7
  21. package/cjs/node/HttpRequestSender.d.ts +0 -2
  22. package/cjs/node/HttpRequestSender.test.js +17 -7
  23. package/cjs/node/HttpServer.d.ts +0 -2
  24. package/cjs/node/HttpServer.js +17 -7
  25. package/cjs/node/VapixEvents.js +1 -1
  26. package/cjs/node/WsClient.js +1 -1
  27. package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +320 -4097
  28. package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +2 -2
  29. package/cjs/types/CamOverlayAPI/accuweatherSchema.d.ts +12 -67
  30. package/cjs/types/CamOverlayAPI/customGraphicsSchema.d.ts +40 -572
  31. package/cjs/types/CamOverlayAPI/htmlOverlaySchema.d.ts +6 -59
  32. package/cjs/types/CamOverlayAPI/htmlOverlaySchema.js +1 -1
  33. package/cjs/types/CamOverlayAPI/imagesSchema.d.ts +6 -75
  34. package/cjs/types/CamOverlayAPI/infotickerSchema.d.ts +11 -74
  35. package/cjs/types/CamOverlayAPI/pipSchema.d.ts +12 -97
  36. package/cjs/types/CamOverlayAPI/pipSchema.js +2 -2
  37. package/cjs/types/CamOverlayAPI/ptzCompassSchema.d.ts +12 -71
  38. package/cjs/types/CamOverlayAPI/ptzCompassSchema.js +1 -1
  39. package/cjs/types/CamOverlayAPI/ptzSchema.d.ts +8 -99
  40. package/cjs/types/CamOverlayAPI/scoreBoardSchema.d.ts +20 -254
  41. package/cjs/types/CamOverlayAPI/screenSharingSchema.d.ts +5 -43
  42. package/cjs/types/CamOverlayAPI/serviceCommonTypes.d.ts +15 -94
  43. package/cjs/types/CamOverlayAPI/webCameraSharingSchema.d.ts +5 -43
  44. package/cjs/types/CamScripterAPI.d.ts +11 -81
  45. package/cjs/types/CamStreamerAPI/CamStreamerAPI.d.ts +1095 -24193
  46. package/cjs/types/CamStreamerAPI/facebookSchema.d.ts +32 -509
  47. package/cjs/types/CamStreamerAPI/oldStreamSchema.d.ts +8 -143
  48. package/cjs/types/CamStreamerAPI/streamCommonTypes.d.ts +32 -493
  49. package/cjs/types/CamStreamerAPI/streamsSchema.d.ts +425 -7786
  50. package/cjs/types/CamStreamerAPI/windySchema.d.ts +36 -476
  51. package/cjs/types/CamStreamerAPI/youtubeSchema.d.ts +32 -487
  52. package/cjs/types/CamStreamerAPI/youtubeSchema.js +1 -1
  53. package/cjs/types/CamSwitcherAPI.d.ts +75 -700
  54. package/cjs/types/CamSwitcherAPI.js +1 -0
  55. package/cjs/types/GenetecAgent.d.ts +12 -132
  56. package/cjs/types/MilestoneAgent.d.ts +4 -46
  57. package/cjs/types/PlaneTrackerAPI.d.ts +265 -1205
  58. package/cjs/types/PlaneTrackerAPI.js +5 -5
  59. package/cjs/types/VapixAPI.d.ts +129 -1653
  60. package/cjs/types/VapixAPI.js +1 -1
  61. package/cjs/types/common.d.ts +11 -35
  62. package/cjs/types/common.js +1 -1
  63. package/cjs/types/ws/CamOverlayEvents.d.ts +9 -69
  64. package/cjs/types/ws/CamStreamerEvents.d.ts +19 -217
  65. package/cjs/types/ws/CamSwitcherEvents.d.ts +46 -452
  66. package/cjs/types/ws/PlaneTrackerEvents.d.ts +361 -3522
  67. package/cjs/types/ws/PlaneTrackerEvents.js +1 -1
  68. package/cjs/web/WsClient.js +1 -1
  69. package/esm/CamStreamerAPI.js +1 -1
  70. package/esm/CamSwitcherAPI.js +2 -0
  71. package/esm/VapixAPI.js +2 -2
  72. package/esm/node/VapixEvents.js +1 -1
  73. package/esm/node/WsClient.js +1 -1
  74. package/esm/types/CamOverlayAPI/CamOverlayAPI.js +2 -2
  75. package/esm/types/CamOverlayAPI/htmlOverlaySchema.js +1 -1
  76. package/esm/types/CamOverlayAPI/pipSchema.js +2 -2
  77. package/esm/types/CamOverlayAPI/ptzCompassSchema.js +1 -1
  78. package/esm/types/CamStreamerAPI/youtubeSchema.js +1 -1
  79. package/esm/types/CamSwitcherAPI.js +1 -0
  80. package/esm/types/PlaneTrackerAPI.js +5 -5
  81. package/esm/types/VapixAPI.js +1 -1
  82. package/esm/types/common.js +1 -1
  83. package/esm/types/ws/PlaneTrackerEvents.js +1 -1
  84. package/esm/web/WsClient.js +1 -1
  85. package/package.json +106 -107
  86. package/types/CamOverlayAPI.d.ts +204 -204
  87. package/types/CamStreamerAPI.d.ts +311 -311
  88. package/types/CamSwitcherAPI.d.ts +32 -31
  89. package/types/PlaneTrackerAPI.d.ts +25 -28
  90. package/types/VapixAPI.d.ts +15 -15
  91. package/types/internal/transformers.d.ts +4 -4
  92. package/types/internal/versionCompare.d.ts +2 -2
  93. package/types/node/CamOverlayDrawingAPI.d.ts +0 -3
  94. package/types/node/CamOverlayPainter/Frame.d.ts +0 -1
  95. package/types/node/CamOverlayPainter/ResourceManager.d.ts +2 -2
  96. package/types/node/CamScripterAPICameraEventsGenerator.d.ts +0 -1
  97. package/types/node/DefaultClient.d.ts +0 -2
  98. package/types/node/HttpRequestSender.d.ts +0 -2
  99. package/types/node/HttpServer.d.ts +0 -2
  100. package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +320 -4097
  101. package/types/types/CamOverlayAPI/accuweatherSchema.d.ts +12 -67
  102. package/types/types/CamOverlayAPI/customGraphicsSchema.d.ts +40 -572
  103. package/types/types/CamOverlayAPI/htmlOverlaySchema.d.ts +6 -59
  104. package/types/types/CamOverlayAPI/imagesSchema.d.ts +6 -75
  105. package/types/types/CamOverlayAPI/infotickerSchema.d.ts +11 -74
  106. package/types/types/CamOverlayAPI/pipSchema.d.ts +12 -97
  107. package/types/types/CamOverlayAPI/ptzCompassSchema.d.ts +12 -71
  108. package/types/types/CamOverlayAPI/ptzSchema.d.ts +8 -99
  109. package/types/types/CamOverlayAPI/scoreBoardSchema.d.ts +20 -254
  110. package/types/types/CamOverlayAPI/screenSharingSchema.d.ts +5 -43
  111. package/types/types/CamOverlayAPI/serviceCommonTypes.d.ts +15 -94
  112. package/types/types/CamOverlayAPI/webCameraSharingSchema.d.ts +5 -43
  113. package/types/types/CamScripterAPI.d.ts +11 -81
  114. package/types/types/CamStreamerAPI/CamStreamerAPI.d.ts +1095 -24193
  115. package/types/types/CamStreamerAPI/facebookSchema.d.ts +32 -509
  116. package/types/types/CamStreamerAPI/oldStreamSchema.d.ts +8 -143
  117. package/types/types/CamStreamerAPI/streamCommonTypes.d.ts +32 -493
  118. package/types/types/CamStreamerAPI/streamsSchema.d.ts +425 -7786
  119. package/types/types/CamStreamerAPI/windySchema.d.ts +36 -476
  120. package/types/types/CamStreamerAPI/youtubeSchema.d.ts +32 -487
  121. package/types/types/CamSwitcherAPI.d.ts +75 -700
  122. package/types/types/GenetecAgent.d.ts +12 -132
  123. package/types/types/MilestoneAgent.d.ts +4 -46
  124. package/types/types/PlaneTrackerAPI.d.ts +265 -1205
  125. package/types/types/VapixAPI.d.ts +129 -1653
  126. package/types/types/common.d.ts +11 -35
  127. package/types/types/ws/CamOverlayEvents.d.ts +9 -69
  128. package/types/types/ws/CamStreamerEvents.d.ts +19 -217
  129. package/types/types/ws/CamSwitcherEvents.d.ts +46 -452
  130. package/types/types/ws/PlaneTrackerEvents.d.ts +361 -3522
@@ -78,7 +78,7 @@ var EUserActions;
78
78
  EUserActions["UNLOCK_API"] = "unlockApi.cgi";
79
79
  })(EUserActions || (exports.EUserActions = EUserActions = {}));
80
80
  const eventsDataSchema = zod_1.z.union([
81
- zod_1.z.object({ type: zod_1.z.literal('CAMERA_POSITION') }).merge(wsCameraPositionDataSchema),
81
+ zod_1.z.object({ type: zod_1.z.literal('CAMERA_POSITION') }).extend(wsCameraPositionDataSchema.shape),
82
82
  zod_1.z.object({
83
83
  type: zod_1.z.literal('TRACKING_START'),
84
84
  icao: zod_1.z.string(),
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WsClient = void 0;
4
- const REFRESH_TIMEOUT = 5000;
4
+ const REFRESH_TIMEOUT = 5_000;
5
5
  class WsClient {
6
6
  getUrl;
7
7
  isDestroyed = false;
@@ -98,7 +98,7 @@ export class CamStreamerAPI extends BasicAPI {
98
98
  if (newStream.success) {
99
99
  return newStream.data;
100
100
  }
101
- const oldStream = oldStringStreamSchema.passthrough().parse(res.data);
101
+ const oldStream = oldStringStreamSchema.loose().parse(res.data);
102
102
  throw new MigrationError([], [{ streamId, ...parseCameraStreamResponse(oldStream) }], [], []);
103
103
  }
104
104
  async setStream(streamId, streamData, options) {
@@ -153,6 +153,7 @@ export class CamSwitcherAPI extends BasicAPI {
153
153
  audio: {
154
154
  sampleRate: data.audioSampleRate,
155
155
  channelCount: data.audioChannelCount,
156
+ bitrate: data.audioBitrate,
156
157
  },
157
158
  keyboard: data.keyboard,
158
159
  };
@@ -204,6 +205,7 @@ export class CamSwitcherAPI extends BasicAPI {
204
205
  const settings = {
205
206
  audioSampleRate: saveData.audio?.sampleRate,
206
207
  audioChannelCount: saveData.audio?.channelCount,
208
+ audioBitrate: saveData.audio?.bitrate,
207
209
  keyboard: saveData.keyboard,
208
210
  fps: saveData.video.fps,
209
211
  resolution: saveData.video.resolution,
package/esm/VapixAPI.js CHANGED
@@ -196,7 +196,7 @@ export class VapixAPI extends BasicAPI {
196
196
  async getHeaders(options) {
197
197
  const data = { apiVersion: '1.0', method: 'list' };
198
198
  const res = await this._postJsonEncoded('/axis-cgi/customhttpheader.cgi', data, undefined, options);
199
- return z.object({ data: z.record(z.string()) }).parse(await res.json()).data;
199
+ return z.object({ data: z.record(z.string(), z.string()) }).parse(await res.json()).data;
200
200
  }
201
201
  async setHeaders(headers, options) {
202
202
  const data = { apiVersion: '1.0', method: 'set', params: headers };
@@ -633,7 +633,7 @@ export class VapixAPI extends BasicAPI {
633
633
  headers: {
634
634
  contentType: 'application/octet-stream',
635
635
  },
636
- timeout: options?.timeout ?? 300000,
636
+ timeout: options?.timeout ?? 300_000,
637
637
  });
638
638
  if (!res.ok) {
639
639
  throw new ErrorWithResponse(res);
@@ -43,7 +43,7 @@ export class VapixEvents extends EventEmitter {
43
43
  const topics = [];
44
44
  const eventNames = this.eventNames();
45
45
  for (const eventName of eventNames) {
46
- if (!this.isReservedEventName(eventName)) {
46
+ if (typeof eventName === 'string' && !this.isReservedEventName(eventName)) {
47
47
  const topic = {
48
48
  topicFilter: eventName,
49
49
  };
@@ -22,7 +22,7 @@ export class WsClient {
22
22
  const protocol = tls ? 'wss' : 'ws';
23
23
  this.address = `${protocol}://${host}:${port}${options.address}`;
24
24
  this.digestAddress = options.address;
25
- this.pingInterval = options.pingInterval ?? 30000;
25
+ this.pingInterval = options.pingInterval ?? 30_000;
26
26
  this.protocol = options.protocol;
27
27
  this.wsOptions = {
28
28
  auth: `${this.user}:${this.pass}`,
@@ -84,12 +84,12 @@ export const getStorageResponseSchema = (fileType) => {
84
84
  };
85
85
  export const imageFileSchema = z.object({
86
86
  name: z.string(),
87
- path: z.string().url(),
87
+ path: z.url(),
88
88
  storage: imageFileStorageTypeSchema,
89
89
  });
90
90
  export const fontFileSchema = z.object({
91
91
  name: z.string(),
92
- path: z.string().url(),
92
+ path: z.url(),
93
93
  storage: fontFileStorageTypeSchema,
94
94
  });
95
95
  export const getFileSchema = (fileType) => {
@@ -5,7 +5,7 @@ export const htmlOverlaySchema = serviceCommonSchema.extend({
5
5
  pos_x: z.number().nonnegative(),
6
6
  pos_y: z.number().nonnegative(),
7
7
  coordSystem: coordinateSystemSchema,
8
- url: z.string().url().or(z.literal('')).default(''),
8
+ url: z.url().or(z.literal('')).default(''),
9
9
  pageWidth: z.number().nonnegative(),
10
10
  pageHeight: z.number().nonnegative(),
11
11
  fps: z.number().nonnegative(),
@@ -9,8 +9,8 @@ export const pipSchema = serviceCommonSchema.extend({
9
9
  compression: z.number().nonnegative(),
10
10
  screenSize: z.number().nonnegative(),
11
11
  source_type: z.union([z.literal('axis_camera'), z.literal('mjpeg_url')]),
12
- mjpeg_url: z.union([z.string().url(), z.literal('')]),
13
- camera_ip: z.union([z.string().ip(), z.literal('')]),
12
+ mjpeg_url: z.union([z.url(), z.literal('')]),
13
+ camera_ip: z.union([z.ipv4(), z.ipv6(), z.literal('')]),
14
14
  camera_port: z.number().nonnegative(),
15
15
  camera_user: z.string(),
16
16
  camera_pass: z.string(),
@@ -7,7 +7,7 @@ export const ptzCompassSchema = serviceCommonSchema.extend({
7
7
  coordSystem: coordinateSystemSchema,
8
8
  scale: z.number().nonnegative(),
9
9
  type: z.union([z.literal('compass'), z.literal('map'), z.literal('image')]),
10
- image: z.union([z.string().url(), z.literal('')]),
10
+ image: z.union([z.url(), z.literal('')]),
11
11
  northPan: z.number(),
12
12
  cameraPosX: z.number(),
13
13
  cameraPosY: z.number(),
@@ -5,7 +5,7 @@ export const youtubeSchema = streamCommonSchema.extend({
5
5
  description: z.string().optional(),
6
6
  playlists: z.array(z.string()),
7
7
  tags: z.array(z.string()),
8
- notificationEmails: z.array(z.string().email()),
8
+ notificationEmails: z.array(z.email()),
9
9
  streamPrivacy: z.union([z.literal('public'), z.literal('unlisted'), z.literal('private')]),
10
10
  latency: z.union([z.literal('normal'), z.literal('low'), z.literal('ultra_low')]),
11
11
  afterEndStatus: z.union([z.literal('no_change'), z.literal('public'), z.literal('unlisted'), z.literal('private')]),
@@ -142,6 +142,7 @@ export const cameraOptionsSchema = bitrateVapixParamsSchema
142
142
  bitrateVapixParams: z.string().nullable(),
143
143
  audioSampleRate: z.number(),
144
144
  audioChannelCount: audioChannelCountSchema,
145
+ audioBitrate: z.number().int().nonnegative(),
145
146
  keyboard: z.object({
146
147
  fromSource: keyboardShortcutSchema,
147
148
  none: keyboardShortcutSchema,
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export const connectionSchema = z.object({
3
3
  protocol: z.union([z.literal('http'), z.literal('https'), z.literal('https_insecure')]),
4
- ip: z.union([z.string().ip(), z.literal('')]),
4
+ ip: z.union([z.ipv4(), z.ipv6(), z.literal('')]),
5
5
  port: z.number().positive().lt(65535),
6
6
  user: z.string(),
7
7
  pass: z.string(),
@@ -91,7 +91,7 @@ export const cameraSettingsSchema = z.object({
91
91
  adsbSource: z
92
92
  .object({
93
93
  enabled: z.boolean().default(true),
94
- ip: z.union([z.string().ip(), z.literal('')]),
94
+ ip: z.union([z.ipv4(), z.ipv6(), z.literal('')]),
95
95
  port: z.number().positive().lt(65535),
96
96
  useSystemTime: z.boolean().default(false),
97
97
  })
@@ -160,7 +160,7 @@ export const cameraSettingsSchema = z.object({
160
160
  guardTourEnabled: z.boolean().default(false),
161
161
  guardTourId: z.number().int().nonnegative().default(0),
162
162
  })
163
- .default({ prioritizeEmergency: true, guardTourEnabled: false, guardTourId: 0 }),
163
+ .default({ prioritizeEmergency: true, trackingZoneWeightIncrease: 0, guardTourEnabled: false, guardTourId: 0 }),
164
164
  overlayText: z
165
165
  .object({
166
166
  displayIcao: z.boolean().optional(),
@@ -236,7 +236,7 @@ export const cameraSettingsSchema = z.object({
236
236
  .object({
237
237
  enabled: z.boolean().default(false),
238
238
  priority: z.number().int().positive().default(2),
239
- ip: z.union([z.string().ip(), z.literal('')]).default(''),
239
+ ip: z.union([z.ipv4(), z.ipv6(), z.literal('')]).default(''),
240
240
  port: z.number().positive().lt(65535).default(80),
241
241
  })
242
242
  .default({
@@ -436,7 +436,7 @@ const domainDescriptorSchema = z.object({
436
436
  icon: categoryIconSchema,
437
437
  categoryList: z.array(categoryDescriptorSchema),
438
438
  });
439
- export const domainListSchema = z.record(domainIdSchema, domainDescriptorSchema);
439
+ export const domainListSchema = z.partialRecord(domainIdSchema, domainDescriptorSchema);
440
440
  export const ADSB_CATEGORY_IDS = {
441
441
  A_LIGHT: 'A_LIGHT',
442
442
  A_SMALL: 'A_SMALL',
@@ -195,6 +195,6 @@ export const portSequenceStateSchema = z.object({
195
195
  export const recordingConfigItemSchema = z.object({
196
196
  diskid: z.string(),
197
197
  eventid: z.string(),
198
- options: z.record(z.string()),
198
+ options: z.record(z.string(), z.string()),
199
199
  profile: z.string(),
200
200
  });
@@ -11,7 +11,7 @@ export const networkCameraListSchema = z.array(z.object({
11
11
  ip: z.string(),
12
12
  }));
13
13
  export const keyboardShortcutSchema = z.string().nullable();
14
- export const keyboardShortcutsSchema = z.record(keyboardShortcutSchema);
14
+ export const keyboardShortcutsSchema = z.record(z.string(), keyboardShortcutSchema);
15
15
  export const wsAliasResponseSchema = z.object({
16
16
  alias: z.string(),
17
17
  ws: z.string(),
@@ -75,7 +75,7 @@ export var EUserActions;
75
75
  EUserActions["UNLOCK_API"] = "unlockApi.cgi";
76
76
  })(EUserActions || (EUserActions = {}));
77
77
  const eventsDataSchema = z.union([
78
- z.object({ type: z.literal('CAMERA_POSITION') }).merge(wsCameraPositionDataSchema),
78
+ z.object({ type: z.literal('CAMERA_POSITION') }).extend(wsCameraPositionDataSchema.shape),
79
79
  z.object({
80
80
  type: z.literal('TRACKING_START'),
81
81
  icao: z.string(),
@@ -1,4 +1,4 @@
1
- const REFRESH_TIMEOUT = 5000;
1
+ const REFRESH_TIMEOUT = 5_000;
2
2
  export class WsClient {
3
3
  getUrl;
4
4
  isDestroyed = false;
package/package.json CHANGED
@@ -1,114 +1,113 @@
1
1
  {
2
- "name": "camstreamerlib",
3
- "version": "4.0.37",
4
- "description": "Helper library for CamStreamer ACAP applications.",
5
- "prettier": "@camstreamer/prettier-config",
6
- "engine": {
7
- "node": ">=18.0.0"
2
+ "name": "camstreamerlib",
3
+ "version": "5.0.0-20ab5c4",
4
+ "description": "Helper library for CamStreamer ACAP applications.",
5
+ "prettier": "@camstreamer/prettier-config",
6
+ "engines": {
7
+ "node": ">=18"
8
+ },
9
+ "dependencies": {
10
+ "adm-zip": "^0.6.0",
11
+ "eventemitter2": "^6.4.9",
12
+ "fast-xml-parser": "^5.3.6",
13
+ "type-fest": "^5.10.0",
14
+ "undici": "^6.28.1",
15
+ "ws": "^8.18.0",
16
+ "zod": "^4.6.7"
17
+ },
18
+ "devDependencies": {
19
+ "@camstreamer/eslint-config": "^1.0.10",
20
+ "@camstreamer/prettier-config": "^2.0.4",
21
+ "@eslint/js": "^10.0.1",
22
+ "@types/jest": "^30.0.0",
23
+ "@types/node": "^18.19.127",
24
+ "@types/ws": "^8.5.10",
25
+ "esbuild": "^0.28.2",
26
+ "eslint": "^10.12.0",
27
+ "eslint-plugin-unused-imports": "^4.4.1",
28
+ "globals": "^17.13.0",
29
+ "jest": "^30.5.2",
30
+ "npm-run-all": "^4.1.5",
31
+ "prettier": "^2.7.1",
32
+ "ts-jest": "^29.4.14",
33
+ "ts-node": "^10.7.0",
34
+ "typescript": "^5.9.3",
35
+ "typescript-eslint": "^8.71.2"
36
+ },
37
+ "overrides": {
38
+ "js-yaml": "^4.3.2",
39
+ "browserslist": "^4.28.7"
40
+ },
41
+ "scripts": {
42
+ "clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
43
+ "build": "npm-run-all clean build:cjs build:esm copyPackage",
44
+ "build:cjs": "tsc --project tsconfig.cjs.json",
45
+ "build:esm": "tsc --project tsconfig.esm.json",
46
+ "build:browser": "esbuild src/browser.index.ts --bundle --format=esm --platform=browser --target=es2022 --outfile=examples/camstreamerlib.js",
47
+ "copyPackage": "cp -f LICENSE dist/ && cp -f README.md dist/ && cp -f package.json dist/ && cp -r -f examples dist/",
48
+ "publishPackage": "./publish.sh",
49
+ "lint": "eslint \"src/**/*.ts\"",
50
+ "lint:fix": "eslint \"src/**/*.ts\" --fix",
51
+ "pretty": "prettier --write \"./{{src,doc}/**/*.{ts,tsx,md},README.md}\"",
52
+ "pretty:check": "prettier --check \"./{{src,doc}/**/*.{ts,tsx,md},README.md}\"",
53
+ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
54
+ "audit": "npm audit --audit-level=high"
55
+ },
56
+ "files": [
57
+ "/**/*.js",
58
+ "/**/*.ts",
59
+ "/examples/**/*"
60
+ ],
61
+ "main": "./cjs/index.js",
62
+ "module": "./esm/index.js",
63
+ "types": "types/index.d.ts",
64
+ "exports": {
65
+ ".": {
66
+ "import": "./esm/index.js",
67
+ "require": "./cjs/index.js",
68
+ "types": "./types/index.d.ts"
8
69
  },
9
- "dependencies": {
10
- "adm-zip": "^0.6.0",
11
- "eventemitter2": "^5.0.1",
12
- "fast-xml-parser": "^5.3.6",
13
- "type-fest": "^4.41.0",
14
- "undici": "^6.28.1",
15
- "ws": "^8.18.0",
16
- "zod": "^3.25.76"
70
+ "./web": {
71
+ "import": "./esm/web/index.js",
72
+ "require": "./cjs/web/index.js",
73
+ "types": "./types/web/index.d.ts"
17
74
  },
18
- "devDependencies": {
19
- "@camstreamer/eslint-config": "^1.0.10",
20
- "@camstreamer/prettier-config": "^2.0.4",
21
- "@eslint/js": "^10.0.1",
22
- "@types/adm-zip": "^0.5.5",
23
- "@types/jest": "^30.0.0",
24
- "@types/node": "^18.19.127",
25
- "@types/ws": "^8.5.10",
26
- "esbuild": "^0.28.2",
27
- "eslint": "^10.12.0",
28
- "eslint-plugin-unused-imports": "^4.4.1",
29
- "globals": "^17.13.0",
30
- "jest": "^30.5.2",
31
- "npm-run-all": "^4.1.5",
32
- "prettier": "^2.7.1",
33
- "ts-jest": "^29.4.14",
34
- "ts-node": "^10.7.0",
35
- "typescript": "5.3.3",
36
- "typescript-eslint": "^8.71.2"
75
+ "./node": {
76
+ "import": "./esm/node/index.js",
77
+ "require": "./cjs/node/index.js",
78
+ "types": "./types/node/index.d.ts"
37
79
  },
38
- "overrides": {
39
- "js-yaml": "^4.3.2",
40
- "browserslist": "^4.28.7"
80
+ "./cjs/index": {
81
+ "import": "./esm/index.js",
82
+ "require": "./cjs/index.js",
83
+ "types": "./types/index.d.ts"
41
84
  },
42
- "scripts": {
43
- "clean": "node -e \"require('fs').rmSync('dist', { recursive: true, force: true })\"",
44
- "build": "npm-run-all clean build:cjs build:esm copyPackage",
45
- "build:cjs": "tsc --project tsconfig.cjs.json",
46
- "build:esm": "tsc --project tsconfig.esm.json",
47
- "build:browser": "esbuild src/browser.index.ts --bundle --format=esm --platform=browser --target=es2022 --outfile=examples/camstreamerlib.js",
48
- "copyPackage": "cp -f LICENSE dist/ && cp -f README.md dist/ && cp -f package.json dist/ && cp -r -f examples dist/",
49
- "publishPackage": "./publish.sh",
50
- "lint": "eslint \"src/**/*.ts\"",
51
- "lint:fix": "eslint \"src/**/*.ts\" --fix",
52
- "pretty": "prettier --write \"./{{src,doc}/**/*.{ts,tsx,md},README.md}\"",
53
- "pretty:check": "prettier --check \"./{{src,doc}/**/*.{ts,tsx,md},README.md}\"",
54
- "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
55
- "audit": "npm audit --audit-level=high"
85
+ "./cjs/node": {
86
+ "import": "./esm/node/index.js",
87
+ "require": "./cjs/node/index.js",
88
+ "types": "./types/node/index.js"
56
89
  },
57
- "files": [
58
- "/**/*.js",
59
- "/**/*.ts",
60
- "/examples/**/*"
61
- ],
62
- "main": "./cjs/index.js",
63
- "module": "./esm/index.js",
64
- "types": "types/index.d.ts",
65
- "exports": {
66
- ".": {
67
- "import": "./esm/index.js",
68
- "require": "./cjs/index.js",
69
- "types": "./types/index.d.ts"
70
- },
71
- "./web": {
72
- "import": "./esm/web/index.js",
73
- "require": "./cjs/web/index.js",
74
- "types": "./types/web/index.d.ts"
75
- },
76
- "./node": {
77
- "import": "./esm/node/index.js",
78
- "require": "./cjs/node/index.js",
79
- "types": "./types/node/index.d.ts"
80
- },
81
- "./cjs/index": {
82
- "import": "./esm/index.js",
83
- "require": "./cjs/index.js",
84
- "types": "./types/index.d.ts"
85
- },
86
- "./cjs/node": {
87
- "import": "./esm/node/index.js",
88
- "require": "./cjs/node/index.js",
89
- "types": "./types/node/index.js"
90
- },
91
- "./cjs/node/index": {
92
- "import": "./esm/node/index.js",
93
- "require": "./cjs/node/index.js",
94
- "types": "./types/node/index.js"
95
- }
96
- },
97
- "repository": {
98
- "type": "git",
99
- "url": "git+https://github.com/CamStreamer/CamStreamerLib.git"
100
- },
101
- "keywords": [
102
- "CamStreamer",
103
- "CamOverlay",
104
- "CamScripter",
105
- "Camera",
106
- "Axis"
107
- ],
108
- "author": "CamStreamer s.r.o",
109
- "license": "ISC",
110
- "bugs": {
111
- "url": "https://github.com/CamStreamer/CamStreamerLib/issues"
112
- },
113
- "homepage": "https://github.com/CamStreamer/CamStreamerLib#readme"
90
+ "./cjs/node/index": {
91
+ "import": "./esm/node/index.js",
92
+ "require": "./cjs/node/index.js",
93
+ "types": "./types/node/index.js"
94
+ }
95
+ },
96
+ "repository": {
97
+ "type": "git",
98
+ "url": "git+https://github.com/CamStreamer/CamStreamerLib.git"
99
+ },
100
+ "keywords": [
101
+ "CamStreamer",
102
+ "CamOverlay",
103
+ "CamScripter",
104
+ "Camera",
105
+ "Axis"
106
+ ],
107
+ "author": "CamStreamer s.r.o",
108
+ "license": "ISC",
109
+ "bugs": {
110
+ "url": "https://github.com/CamStreamer/CamStreamerLib/issues"
111
+ },
112
+ "homepage": "https://github.com/CamStreamer/CamStreamerLib#readme"
114
113
  }