camstreamerlib 4.0.0-beta.19 → 4.0.0-beta.20

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.
@@ -2,7 +2,14 @@ import { HttpOptions } from '../internal/types';
2
2
  import { z } from 'zod';
3
3
  export type CamScripterOptions = HttpOptions;
4
4
  export type TStorageType = 'INTERNAL' | 'SD_CARD';
5
- export type TNodeState = 'OK' | 'NOT_INSTALLED' | 'NOT_FOUND';
5
+ export declare const nodeStateSchema: z.ZodObject<{
6
+ node_state: z.ZodUnion<[z.ZodLiteral<"OK">, z.ZodLiteral<"NOT_INSTALLED">, z.ZodLiteral<"NOT_FOUND">]>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ node_state: "OK" | "NOT_INSTALLED" | "NOT_FOUND";
9
+ }, {
10
+ node_state: "OK" | "NOT_INSTALLED" | "NOT_FOUND";
11
+ }>;
12
+ export type TNodeState = z.infer<typeof nodeStateSchema>;
6
13
  export declare const packageInfoListSchema: z.ZodArray<z.ZodObject<{
7
14
  storage: z.ZodUnion<[z.ZodLiteral<"SD_CARD">, z.ZodLiteral<"INTERNAL">]>;
8
15
  manifest: z.ZodObject<{
@@ -54,14 +61,55 @@ export declare const packageInfoListSchema: z.ZodArray<z.ZodObject<{
54
61
  };
55
62
  }>, "many">;
56
63
  export type TPackageInfoList = z.infer<typeof packageInfoListSchema>;
57
- export declare const storageSchema: z.ZodArray<z.ZodObject<{
58
- type: z.ZodUnion<[z.ZodLiteral<"INTERNAL">, z.ZodLiteral<"SD_CARD">]>;
64
+ export declare const packageConfigSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
65
+ enabled: z.ZodBoolean;
66
+ }, "strip", z.ZodTypeAny, {
67
+ enabled: boolean;
68
+ }, {
69
+ enabled: boolean;
70
+ }>>;
71
+ export type TPackageConfig = z.infer<typeof packageConfigSchema>;
72
+ export declare const storageSchema: z.ZodUnion<[z.ZodTuple<[z.ZodObject<{
73
+ type: z.ZodLiteral<"INTERNAL">;
59
74
  capacity_mb: z.ZodNumber;
60
75
  }, "strip", z.ZodTypeAny, {
61
- type: "INTERNAL" | "SD_CARD";
76
+ type: "INTERNAL";
62
77
  capacity_mb: number;
63
78
  }, {
64
- type: "INTERNAL" | "SD_CARD";
79
+ type: "INTERNAL";
65
80
  capacity_mb: number;
66
- }>, "many">;
81
+ }>, z.ZodObject<{
82
+ type: z.ZodLiteral<"SD_CARD">;
83
+ capacity_mb: z.ZodNumber;
84
+ }, "strip", z.ZodTypeAny, {
85
+ type: "SD_CARD";
86
+ capacity_mb: number;
87
+ }, {
88
+ type: "SD_CARD";
89
+ capacity_mb: number;
90
+ }>], null>, z.ZodTuple<[z.ZodObject<{
91
+ type: z.ZodLiteral<"INTERNAL">;
92
+ capacity_mb: z.ZodNumber;
93
+ }, "strip", z.ZodTypeAny, {
94
+ type: "INTERNAL";
95
+ capacity_mb: number;
96
+ }, {
97
+ type: "INTERNAL";
98
+ capacity_mb: number;
99
+ }>], null>]>;
67
100
  export type TStorage = z.infer<typeof storageSchema>;
101
+ export type TStorageParsedData = {
102
+ size: number;
103
+ storageType: TStorageType;
104
+ }[];
105
+ export declare const camscripterApiResponseSchema: z.ZodObject<{
106
+ status: z.ZodNumber;
107
+ message: z.ZodString;
108
+ }, "strip", z.ZodTypeAny, {
109
+ status: number;
110
+ message: string;
111
+ }, {
112
+ status: number;
113
+ message: string;
114
+ }>;
115
+ export type TCamscripterApiResponse = z.infer<typeof camscripterApiResponseSchema>;
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.storageSchema = exports.packageInfoListSchema = void 0;
3
+ exports.camscripterApiResponseSchema = exports.storageSchema = exports.packageConfigSchema = exports.packageInfoListSchema = exports.nodeStateSchema = void 0;
4
4
  const zod_1 = require("zod");
5
+ exports.nodeStateSchema = zod_1.z.object({
6
+ node_state: zod_1.z.union([zod_1.z.literal('OK'), zod_1.z.literal('NOT_INSTALLED'), zod_1.z.literal('NOT_FOUND')]),
7
+ });
5
8
  exports.packageInfoListSchema = zod_1.z.array(zod_1.z.object({
6
9
  storage: zod_1.z.union([zod_1.z.literal('SD_CARD'), zod_1.z.literal('INTERNAL')]),
7
10
  manifest: zod_1.z.object({
@@ -14,7 +17,15 @@ exports.packageInfoListSchema = zod_1.z.array(zod_1.z.object({
14
17
  ui_link: zod_1.z.string(),
15
18
  }),
16
19
  }));
17
- exports.storageSchema = zod_1.z.array(zod_1.z.object({
18
- type: zod_1.z.union([zod_1.z.literal('INTERNAL'), zod_1.z.literal('SD_CARD')]),
19
- capacity_mb: zod_1.z.number(),
20
- }));
20
+ exports.packageConfigSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.object({ enabled: zod_1.z.boolean() }));
21
+ exports.storageSchema = zod_1.z.union([
22
+ zod_1.z.tuple([
23
+ zod_1.z.object({ type: zod_1.z.literal('INTERNAL'), capacity_mb: zod_1.z.number() }),
24
+ zod_1.z.object({ type: zod_1.z.literal('SD_CARD'), capacity_mb: zod_1.z.number() }),
25
+ ]),
26
+ zod_1.z.tuple([zod_1.z.object({ type: zod_1.z.literal('INTERNAL'), capacity_mb: zod_1.z.number() })]),
27
+ ]);
28
+ exports.camscripterApiResponseSchema = zod_1.z.object({
29
+ status: zod_1.z.number(),
30
+ message: zod_1.z.string(),
31
+ });
@@ -137,3 +137,14 @@ export declare const streamListSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
137
137
  stopTime: string;
138
138
  }>>;
139
139
  export type TStreamList = z.infer<typeof streamListSchema>;
140
+ export declare const camstreamerServerResponseSchema: z.ZodObject<{
141
+ code: z.ZodNumber;
142
+ message: z.ZodString;
143
+ }, "strip", z.ZodTypeAny, {
144
+ code: number;
145
+ message: string;
146
+ }, {
147
+ code: number;
148
+ message: string;
149
+ }>;
150
+ export type TCamstreamerServerResponse = z.infer<typeof camstreamerServerResponseSchema>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.streamListSchema = exports.streamAttributesSchema = void 0;
3
+ exports.camstreamerServerResponseSchema = exports.streamListSchema = exports.streamAttributesSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.streamAttributesSchema = zod_1.z.object({
6
6
  enabled: zod_1.z.string(),
@@ -26,3 +26,7 @@ exports.streamAttributesSchema = zod_1.z.object({
26
26
  stopTime: zod_1.z.string(),
27
27
  });
28
28
  exports.streamListSchema = zod_1.z.record(zod_1.z.string(), exports.streamAttributesSchema);
29
+ exports.camstreamerServerResponseSchema = zod_1.z.object({
30
+ code: zod_1.z.number(),
31
+ message: zod_1.z.string(),
32
+ });
@@ -2,7 +2,14 @@ import { HttpOptions } from '../internal/types';
2
2
  import { z } from 'zod';
3
3
  export type CamScripterOptions = HttpOptions;
4
4
  export type TStorageType = 'INTERNAL' | 'SD_CARD';
5
- export type TNodeState = 'OK' | 'NOT_INSTALLED' | 'NOT_FOUND';
5
+ export declare const nodeStateSchema: z.ZodObject<{
6
+ node_state: z.ZodUnion<[z.ZodLiteral<"OK">, z.ZodLiteral<"NOT_INSTALLED">, z.ZodLiteral<"NOT_FOUND">]>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ node_state: "OK" | "NOT_INSTALLED" | "NOT_FOUND";
9
+ }, {
10
+ node_state: "OK" | "NOT_INSTALLED" | "NOT_FOUND";
11
+ }>;
12
+ export type TNodeState = z.infer<typeof nodeStateSchema>;
6
13
  export declare const packageInfoListSchema: z.ZodArray<z.ZodObject<{
7
14
  storage: z.ZodUnion<[z.ZodLiteral<"SD_CARD">, z.ZodLiteral<"INTERNAL">]>;
8
15
  manifest: z.ZodObject<{
@@ -54,14 +61,55 @@ export declare const packageInfoListSchema: z.ZodArray<z.ZodObject<{
54
61
  };
55
62
  }>, "many">;
56
63
  export type TPackageInfoList = z.infer<typeof packageInfoListSchema>;
57
- export declare const storageSchema: z.ZodArray<z.ZodObject<{
58
- type: z.ZodUnion<[z.ZodLiteral<"INTERNAL">, z.ZodLiteral<"SD_CARD">]>;
64
+ export declare const packageConfigSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
65
+ enabled: z.ZodBoolean;
66
+ }, "strip", z.ZodTypeAny, {
67
+ enabled: boolean;
68
+ }, {
69
+ enabled: boolean;
70
+ }>>;
71
+ export type TPackageConfig = z.infer<typeof packageConfigSchema>;
72
+ export declare const storageSchema: z.ZodUnion<[z.ZodTuple<[z.ZodObject<{
73
+ type: z.ZodLiteral<"INTERNAL">;
59
74
  capacity_mb: z.ZodNumber;
60
75
  }, "strip", z.ZodTypeAny, {
61
- type: "INTERNAL" | "SD_CARD";
76
+ type: "INTERNAL";
62
77
  capacity_mb: number;
63
78
  }, {
64
- type: "INTERNAL" | "SD_CARD";
79
+ type: "INTERNAL";
65
80
  capacity_mb: number;
66
- }>, "many">;
81
+ }>, z.ZodObject<{
82
+ type: z.ZodLiteral<"SD_CARD">;
83
+ capacity_mb: z.ZodNumber;
84
+ }, "strip", z.ZodTypeAny, {
85
+ type: "SD_CARD";
86
+ capacity_mb: number;
87
+ }, {
88
+ type: "SD_CARD";
89
+ capacity_mb: number;
90
+ }>], null>, z.ZodTuple<[z.ZodObject<{
91
+ type: z.ZodLiteral<"INTERNAL">;
92
+ capacity_mb: z.ZodNumber;
93
+ }, "strip", z.ZodTypeAny, {
94
+ type: "INTERNAL";
95
+ capacity_mb: number;
96
+ }, {
97
+ type: "INTERNAL";
98
+ capacity_mb: number;
99
+ }>], null>]>;
67
100
  export type TStorage = z.infer<typeof storageSchema>;
101
+ export type TStorageParsedData = {
102
+ size: number;
103
+ storageType: TStorageType;
104
+ }[];
105
+ export declare const camscripterApiResponseSchema: z.ZodObject<{
106
+ status: z.ZodNumber;
107
+ message: z.ZodString;
108
+ }, "strip", z.ZodTypeAny, {
109
+ status: number;
110
+ message: string;
111
+ }, {
112
+ status: number;
113
+ message: string;
114
+ }>;
115
+ export type TCamscripterApiResponse = z.infer<typeof camscripterApiResponseSchema>;
@@ -1,4 +1,7 @@
1
1
  import { z } from 'zod';
2
+ export const nodeStateSchema = z.object({
3
+ node_state: z.union([z.literal('OK'), z.literal('NOT_INSTALLED'), z.literal('NOT_FOUND')]),
4
+ });
2
5
  export const packageInfoListSchema = z.array(z.object({
3
6
  storage: z.union([z.literal('SD_CARD'), z.literal('INTERNAL')]),
4
7
  manifest: z.object({
@@ -11,7 +14,15 @@ export const packageInfoListSchema = z.array(z.object({
11
14
  ui_link: z.string(),
12
15
  }),
13
16
  }));
14
- export const storageSchema = z.array(z.object({
15
- type: z.union([z.literal('INTERNAL'), z.literal('SD_CARD')]),
16
- capacity_mb: z.number(),
17
- }));
17
+ export const packageConfigSchema = z.record(z.string(), z.object({ enabled: z.boolean() }));
18
+ export const storageSchema = z.union([
19
+ z.tuple([
20
+ z.object({ type: z.literal('INTERNAL'), capacity_mb: z.number() }),
21
+ z.object({ type: z.literal('SD_CARD'), capacity_mb: z.number() }),
22
+ ]),
23
+ z.tuple([z.object({ type: z.literal('INTERNAL'), capacity_mb: z.number() })]),
24
+ ]);
25
+ export const camscripterApiResponseSchema = z.object({
26
+ status: z.number(),
27
+ message: z.string(),
28
+ });
@@ -137,3 +137,14 @@ export declare const streamListSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
137
137
  stopTime: string;
138
138
  }>>;
139
139
  export type TStreamList = z.infer<typeof streamListSchema>;
140
+ export declare const camstreamerServerResponseSchema: z.ZodObject<{
141
+ code: z.ZodNumber;
142
+ message: z.ZodString;
143
+ }, "strip", z.ZodTypeAny, {
144
+ code: number;
145
+ message: string;
146
+ }, {
147
+ code: number;
148
+ message: string;
149
+ }>;
150
+ export type TCamstreamerServerResponse = z.infer<typeof camstreamerServerResponseSchema>;
@@ -23,3 +23,7 @@ export const streamAttributesSchema = z.object({
23
23
  stopTime: z.string(),
24
24
  });
25
25
  export const streamListSchema = z.record(z.string(), streamAttributesSchema);
26
+ export const camstreamerServerResponseSchema = z.object({
27
+ code: z.number(),
28
+ message: z.string(),
29
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstreamerlib",
3
- "version": "4.0.0-beta.19",
3
+ "version": "4.0.0-beta.20",
4
4
  "description": "Helper library for CamStreamer ACAP applications.",
5
5
  "prettier": "@camstreamer/prettier-config",
6
6
  "dependencies": {