camstreamerlib 4.0.0-beta.151 → 4.0.0-beta.152

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.js CHANGED
@@ -377,7 +377,7 @@ class VapixAPI extends BasicAPI_1.BasicAPI {
377
377
  method: 'getPorts',
378
378
  }, undefined, options);
379
379
  const portResponseParsed = VapixAPI_1.getPortsResponseSchema.parse(await res.json());
380
- return portResponseParsed.data.items;
380
+ return portResponseParsed.data.items ?? [];
381
381
  }
382
382
  async setPorts(ports, options) {
383
383
  await this._postJsonEncoded('/axis-cgi/io/portmanagement.cgi', {
@@ -1742,7 +1742,7 @@ export declare const getPortsResponseSchema: z.ZodObject<{
1742
1742
  method: z.ZodLiteral<"getPorts">;
1743
1743
  data: z.ZodObject<{
1744
1744
  numberOfPorts: z.ZodNumber;
1745
- items: z.ZodArray<z.ZodObject<{
1745
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
1746
1746
  port: z.ZodString;
1747
1747
  state: z.ZodEnum<["open", "closed"]>;
1748
1748
  configurable: z.ZodBoolean;
@@ -1769,10 +1769,10 @@ export declare const getPortsResponseSchema: z.ZodObject<{
1769
1769
  usage: string;
1770
1770
  normalState: "open" | "closed";
1771
1771
  readonly?: boolean | undefined;
1772
- }>, "many">;
1772
+ }>, "many">>;
1773
1773
  }, "strip", z.ZodTypeAny, {
1774
1774
  numberOfPorts: number;
1775
- items: {
1775
+ items?: {
1776
1776
  name: string;
1777
1777
  port: string;
1778
1778
  direction: "output" | "input";
@@ -1781,10 +1781,10 @@ export declare const getPortsResponseSchema: z.ZodObject<{
1781
1781
  usage: string;
1782
1782
  normalState: "open" | "closed";
1783
1783
  readonly?: boolean | undefined;
1784
- }[];
1784
+ }[] | undefined;
1785
1785
  }, {
1786
1786
  numberOfPorts: number;
1787
- items: {
1787
+ items?: {
1788
1788
  name: string;
1789
1789
  port: string;
1790
1790
  direction: "output" | "input";
@@ -1793,12 +1793,12 @@ export declare const getPortsResponseSchema: z.ZodObject<{
1793
1793
  usage: string;
1794
1794
  normalState: "open" | "closed";
1795
1795
  readonly?: boolean | undefined;
1796
- }[];
1796
+ }[] | undefined;
1797
1797
  }>;
1798
1798
  }, "strip", z.ZodTypeAny, {
1799
1799
  data: {
1800
1800
  numberOfPorts: number;
1801
- items: {
1801
+ items?: {
1802
1802
  name: string;
1803
1803
  port: string;
1804
1804
  direction: "output" | "input";
@@ -1807,7 +1807,7 @@ export declare const getPortsResponseSchema: z.ZodObject<{
1807
1807
  usage: string;
1808
1808
  normalState: "open" | "closed";
1809
1809
  readonly?: boolean | undefined;
1810
- }[];
1810
+ }[] | undefined;
1811
1811
  };
1812
1812
  apiVersion: string;
1813
1813
  context: string;
@@ -1815,7 +1815,7 @@ export declare const getPortsResponseSchema: z.ZodObject<{
1815
1815
  }, {
1816
1816
  data: {
1817
1817
  numberOfPorts: number;
1818
- items: {
1818
+ items?: {
1819
1819
  name: string;
1820
1820
  port: string;
1821
1821
  direction: "output" | "input";
@@ -1824,7 +1824,7 @@ export declare const getPortsResponseSchema: z.ZodObject<{
1824
1824
  usage: string;
1825
1825
  normalState: "open" | "closed";
1826
1826
  readonly?: boolean | undefined;
1827
- }[];
1827
+ }[] | undefined;
1828
1828
  };
1829
1829
  apiVersion: string;
1830
1830
  context: string;
@@ -172,7 +172,7 @@ exports.getPortsResponseSchema = zod_1.z.object({
172
172
  method: zod_1.z.literal('getPorts'),
173
173
  data: zod_1.z.object({
174
174
  numberOfPorts: zod_1.z.number(),
175
- items: zod_1.z.array(exports.portStatusSchema),
175
+ items: zod_1.z.array(exports.portStatusSchema).optional(),
176
176
  }),
177
177
  });
178
178
  exports.portSetSchema = zod_1.z.object({
package/esm/VapixAPI.js CHANGED
@@ -374,7 +374,7 @@ export class VapixAPI extends BasicAPI {
374
374
  method: 'getPorts',
375
375
  }, undefined, options);
376
376
  const portResponseParsed = getPortsResponseSchema.parse(await res.json());
377
- return portResponseParsed.data.items;
377
+ return portResponseParsed.data.items ?? [];
378
378
  }
379
379
  async setPorts(ports, options) {
380
380
  await this._postJsonEncoded('/axis-cgi/io/portmanagement.cgi', {
@@ -169,7 +169,7 @@ export const getPortsResponseSchema = z.object({
169
169
  method: z.literal('getPorts'),
170
170
  data: z.object({
171
171
  numberOfPorts: z.number(),
172
- items: z.array(portStatusSchema),
172
+ items: z.array(portStatusSchema).optional(),
173
173
  }),
174
174
  });
175
175
  export const portSetSchema = z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstreamerlib",
3
- "version": "4.0.0-beta.151",
3
+ "version": "4.0.0-beta.152",
4
4
  "description": "Helper library for CamStreamer ACAP applications.",
5
5
  "prettier": "@camstreamer/prettier-config",
6
6
  "engine": {
@@ -1742,7 +1742,7 @@ export declare const getPortsResponseSchema: z.ZodObject<{
1742
1742
  method: z.ZodLiteral<"getPorts">;
1743
1743
  data: z.ZodObject<{
1744
1744
  numberOfPorts: z.ZodNumber;
1745
- items: z.ZodArray<z.ZodObject<{
1745
+ items: z.ZodOptional<z.ZodArray<z.ZodObject<{
1746
1746
  port: z.ZodString;
1747
1747
  state: z.ZodEnum<["open", "closed"]>;
1748
1748
  configurable: z.ZodBoolean;
@@ -1769,10 +1769,10 @@ export declare const getPortsResponseSchema: z.ZodObject<{
1769
1769
  usage: string;
1770
1770
  normalState: "open" | "closed";
1771
1771
  readonly?: boolean | undefined;
1772
- }>, "many">;
1772
+ }>, "many">>;
1773
1773
  }, "strip", z.ZodTypeAny, {
1774
1774
  numberOfPorts: number;
1775
- items: {
1775
+ items?: {
1776
1776
  name: string;
1777
1777
  port: string;
1778
1778
  direction: "output" | "input";
@@ -1781,10 +1781,10 @@ export declare const getPortsResponseSchema: z.ZodObject<{
1781
1781
  usage: string;
1782
1782
  normalState: "open" | "closed";
1783
1783
  readonly?: boolean | undefined;
1784
- }[];
1784
+ }[] | undefined;
1785
1785
  }, {
1786
1786
  numberOfPorts: number;
1787
- items: {
1787
+ items?: {
1788
1788
  name: string;
1789
1789
  port: string;
1790
1790
  direction: "output" | "input";
@@ -1793,12 +1793,12 @@ export declare const getPortsResponseSchema: z.ZodObject<{
1793
1793
  usage: string;
1794
1794
  normalState: "open" | "closed";
1795
1795
  readonly?: boolean | undefined;
1796
- }[];
1796
+ }[] | undefined;
1797
1797
  }>;
1798
1798
  }, "strip", z.ZodTypeAny, {
1799
1799
  data: {
1800
1800
  numberOfPorts: number;
1801
- items: {
1801
+ items?: {
1802
1802
  name: string;
1803
1803
  port: string;
1804
1804
  direction: "output" | "input";
@@ -1807,7 +1807,7 @@ export declare const getPortsResponseSchema: z.ZodObject<{
1807
1807
  usage: string;
1808
1808
  normalState: "open" | "closed";
1809
1809
  readonly?: boolean | undefined;
1810
- }[];
1810
+ }[] | undefined;
1811
1811
  };
1812
1812
  apiVersion: string;
1813
1813
  context: string;
@@ -1815,7 +1815,7 @@ export declare const getPortsResponseSchema: z.ZodObject<{
1815
1815
  }, {
1816
1816
  data: {
1817
1817
  numberOfPorts: number;
1818
- items: {
1818
+ items?: {
1819
1819
  name: string;
1820
1820
  port: string;
1821
1821
  direction: "output" | "input";
@@ -1824,7 +1824,7 @@ export declare const getPortsResponseSchema: z.ZodObject<{
1824
1824
  usage: string;
1825
1825
  normalState: "open" | "closed";
1826
1826
  readonly?: boolean | undefined;
1827
- }[];
1827
+ }[] | undefined;
1828
1828
  };
1829
1829
  apiVersion: string;
1830
1830
  context: string;