camstreamerlib 4.0.9 → 4.0.10

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/cjs/VapixAPI.d.ts CHANGED
@@ -27,9 +27,9 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> extends Ba
27
27
  dstEnabled: boolean;
28
28
  localDateTime: string;
29
29
  posixTimeZone: string;
30
- maxYearSupported: number;
31
30
  timeZones: string[];
32
31
  timeZone?: string | undefined;
32
+ maxYearSupported?: number | undefined;
33
33
  };
34
34
  }>;
35
35
  getDateTimeInfo(options?: THttpRequestOptions): Promise<{
package/cjs/VapixAPI.js CHANGED
@@ -154,7 +154,8 @@ class VapixAPI extends BasicAPI_1.BasicAPI {
154
154
  }
155
155
  const data = await this.getAllDateTimeInfo(options);
156
156
  if (data.data.timeZone === undefined) {
157
- throw new errors_1.TimezoneNotSetupError();
157
+ console.warn('Timezone not set up on the camera, using POSIX time zone as fallback');
158
+ return zod_1.z.string().parse(data.data.posixTimeZone);
158
159
  }
159
160
  return zod_1.z.string().parse(data.data.timeZone);
160
161
  }
@@ -1584,24 +1584,24 @@ export declare const allDateTimeInfoSchema: z.ZodObject<{
1584
1584
  posixTimeZone: z.ZodString;
1585
1585
  timeZone: z.ZodOptional<z.ZodString>;
1586
1586
  } & {
1587
- maxYearSupported: z.ZodNumber;
1587
+ maxYearSupported: z.ZodOptional<z.ZodNumber>;
1588
1588
  timeZones: z.ZodArray<z.ZodString, "many">;
1589
1589
  }, "strip", z.ZodTypeAny, {
1590
1590
  dateTime: string;
1591
1591
  dstEnabled: boolean;
1592
1592
  localDateTime: string;
1593
1593
  posixTimeZone: string;
1594
- maxYearSupported: number;
1595
1594
  timeZones: string[];
1596
1595
  timeZone?: string | undefined;
1596
+ maxYearSupported?: number | undefined;
1597
1597
  }, {
1598
1598
  dateTime: string;
1599
1599
  dstEnabled: boolean;
1600
1600
  localDateTime: string;
1601
1601
  posixTimeZone: string;
1602
- maxYearSupported: number;
1603
1602
  timeZones: string[];
1604
1603
  timeZone?: string | undefined;
1604
+ maxYearSupported?: number | undefined;
1605
1605
  }>;
1606
1606
  }, "strip", z.ZodTypeAny, {
1607
1607
  data: {
@@ -1609,9 +1609,9 @@ export declare const allDateTimeInfoSchema: z.ZodObject<{
1609
1609
  dstEnabled: boolean;
1610
1610
  localDateTime: string;
1611
1611
  posixTimeZone: string;
1612
- maxYearSupported: number;
1613
1612
  timeZones: string[];
1614
1613
  timeZone?: string | undefined;
1614
+ maxYearSupported?: number | undefined;
1615
1615
  };
1616
1616
  }, {
1617
1617
  data: {
@@ -1619,9 +1619,9 @@ export declare const allDateTimeInfoSchema: z.ZodObject<{
1619
1619
  dstEnabled: boolean;
1620
1620
  localDateTime: string;
1621
1621
  posixTimeZone: string;
1622
- maxYearSupported: number;
1623
1622
  timeZones: string[];
1624
1623
  timeZone?: string | undefined;
1624
+ maxYearSupported?: number | undefined;
1625
1625
  };
1626
1626
  }>;
1627
1627
  export declare const timeZoneSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{
@@ -135,7 +135,7 @@ exports.dateTimeinfoSchema = zod_1.z.object({
135
135
  });
136
136
  exports.allDateTimeInfoSchema = zod_1.z.object({
137
137
  data: timeInfoSchema.extend({
138
- maxYearSupported: zod_1.z.number(),
138
+ maxYearSupported: zod_1.z.number().optional(),
139
139
  timeZones: zod_1.z.array(zod_1.z.string()),
140
140
  }),
141
141
  });
package/esm/VapixAPI.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { arrayToUrl, isNullish, paramToUrl } from './internal/utils';
2
2
  import { sdCardWatchedStatuses, maxFpsResponseSchema, dateTimeinfoSchema, audioDeviceRequestSchema, audioSampleRatesResponseSchema, timeZoneSchema, getPortsResponseSchema, guardTourSchema, ptzOverviewSchema, cameraPTZItemDataSchema, applicationListSchema, sdCardInfoSchema, ALL_APP_IDS, allDateTimeInfoSchema, } from './types/VapixAPI';
3
- import { ApplicationAPIError, MaxFPSError, NoDeviceInfoError, PtzNotSupportedError, ErrorWithResponse, SDCardActionError, SDCardJobError, SettingParameterError, TimezoneFetchError, TimezoneNotSetupError, } from './errors/errors';
3
+ import { ApplicationAPIError, MaxFPSError, NoDeviceInfoError, PtzNotSupportedError, ErrorWithResponse, SDCardActionError, SDCardJobError, SettingParameterError, TimezoneFetchError, } from './errors/errors';
4
4
  import { z } from 'zod';
5
5
  import { XMLParser } from 'fast-xml-parser';
6
6
  import { BasicAPI } from './internal/BasicAPI';
@@ -151,7 +151,8 @@ export class VapixAPI extends BasicAPI {
151
151
  }
152
152
  const data = await this.getAllDateTimeInfo(options);
153
153
  if (data.data.timeZone === undefined) {
154
- throw new TimezoneNotSetupError();
154
+ console.warn('Timezone not set up on the camera, using POSIX time zone as fallback');
155
+ return z.string().parse(data.data.posixTimeZone);
155
156
  }
156
157
  return z.string().parse(data.data.timeZone);
157
158
  }
@@ -132,7 +132,7 @@ export const dateTimeinfoSchema = z.object({
132
132
  });
133
133
  export const allDateTimeInfoSchema = z.object({
134
134
  data: timeInfoSchema.extend({
135
- maxYearSupported: z.number(),
135
+ maxYearSupported: z.number().optional(),
136
136
  timeZones: z.array(z.string()),
137
137
  }),
138
138
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstreamerlib",
3
- "version": "4.0.9",
3
+ "version": "4.0.10",
4
4
  "description": "Helper library for CamStreamer ACAP applications.",
5
5
  "prettier": "@camstreamer/prettier-config",
6
6
  "engine": {
@@ -27,9 +27,9 @@ export declare class VapixAPI<Client extends IClient<TResponse, any>> extends Ba
27
27
  dstEnabled: boolean;
28
28
  localDateTime: string;
29
29
  posixTimeZone: string;
30
- maxYearSupported: number;
31
30
  timeZones: string[];
32
31
  timeZone?: string | undefined;
32
+ maxYearSupported?: number | undefined;
33
33
  };
34
34
  }>;
35
35
  getDateTimeInfo(options?: THttpRequestOptions): Promise<{
@@ -1584,24 +1584,24 @@ export declare const allDateTimeInfoSchema: z.ZodObject<{
1584
1584
  posixTimeZone: z.ZodString;
1585
1585
  timeZone: z.ZodOptional<z.ZodString>;
1586
1586
  } & {
1587
- maxYearSupported: z.ZodNumber;
1587
+ maxYearSupported: z.ZodOptional<z.ZodNumber>;
1588
1588
  timeZones: z.ZodArray<z.ZodString, "many">;
1589
1589
  }, "strip", z.ZodTypeAny, {
1590
1590
  dateTime: string;
1591
1591
  dstEnabled: boolean;
1592
1592
  localDateTime: string;
1593
1593
  posixTimeZone: string;
1594
- maxYearSupported: number;
1595
1594
  timeZones: string[];
1596
1595
  timeZone?: string | undefined;
1596
+ maxYearSupported?: number | undefined;
1597
1597
  }, {
1598
1598
  dateTime: string;
1599
1599
  dstEnabled: boolean;
1600
1600
  localDateTime: string;
1601
1601
  posixTimeZone: string;
1602
- maxYearSupported: number;
1603
1602
  timeZones: string[];
1604
1603
  timeZone?: string | undefined;
1604
+ maxYearSupported?: number | undefined;
1605
1605
  }>;
1606
1606
  }, "strip", z.ZodTypeAny, {
1607
1607
  data: {
@@ -1609,9 +1609,9 @@ export declare const allDateTimeInfoSchema: z.ZodObject<{
1609
1609
  dstEnabled: boolean;
1610
1610
  localDateTime: string;
1611
1611
  posixTimeZone: string;
1612
- maxYearSupported: number;
1613
1612
  timeZones: string[];
1614
1613
  timeZone?: string | undefined;
1614
+ maxYearSupported?: number | undefined;
1615
1615
  };
1616
1616
  }, {
1617
1617
  data: {
@@ -1619,9 +1619,9 @@ export declare const allDateTimeInfoSchema: z.ZodObject<{
1619
1619
  dstEnabled: boolean;
1620
1620
  localDateTime: string;
1621
1621
  posixTimeZone: string;
1622
- maxYearSupported: number;
1623
1622
  timeZones: string[];
1624
1623
  timeZone?: string | undefined;
1624
+ maxYearSupported?: number | undefined;
1625
1625
  };
1626
1626
  }>;
1627
1627
  export declare const timeZoneSchema: z.ZodDiscriminatedUnion<"status", [z.ZodObject<{