camstreamerlib 4.0.26-7647bae → 4.0.26-b58d309

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.
@@ -270,20 +270,23 @@ class CamSwitcherAPI extends BasicAPI_1.BasicAPI {
270
270
  }
271
271
  async getParamFromCameraAndJSONParse(paramName, options) {
272
272
  const data = await this.vapixAgent.getParameter([paramName], options);
273
- if (data[paramName] !== undefined) {
273
+ if (data[paramName] === undefined) {
274
+ throw new errors_1.ParameterNotFoundError(paramName);
275
+ }
276
+ if (data[paramName] === '') {
277
+ return {};
278
+ }
279
+ try {
280
+ return JSON.parse(data[paramName] + '');
281
+ }
282
+ catch {
274
283
  try {
275
- if (data[paramName] === '') {
276
- return {};
277
- }
278
- else {
279
- return JSON.parse(data[paramName] + '');
280
- }
284
+ return JSON.parse(decodeURIComponent(data[paramName] + ''));
281
285
  }
282
- catch {
286
+ catch (e) {
283
287
  throw new errors_1.JsonParseError(paramName, data[paramName]);
284
288
  }
285
289
  }
286
- throw new errors_1.ParameterNotFoundError(paramName);
287
290
  }
288
291
  async getUploadedFileList(clipName, storage, options) {
289
292
  const res = await this._getJson(`${BASE_PATH}/clip_files.cgi`, { clip_name: clipName, storage }, options);
@@ -10,7 +10,7 @@ export declare const oldStringStreamSchema: z.ZodObject<{
10
10
  outputType: z.ZodString;
11
11
  mediaServerUrl: z.ZodString;
12
12
  inputType: z.ZodString;
13
- inputUrl: z.ZodString;
13
+ inputUrl: z.ZodDefault<z.ZodString>;
14
14
  forceStereo: z.ZodString;
15
15
  streamDelay: z.ZodString;
16
16
  statusLed: z.ZodString;
@@ -60,11 +60,11 @@ export declare const oldStringStreamSchema: z.ZodObject<{
60
60
  outputType: string;
61
61
  mediaServerUrl: string;
62
62
  inputType: string;
63
- inputUrl: string;
64
63
  streamDelay: string;
65
64
  statusLed: string;
66
65
  statusPort: string;
67
66
  prepareAhead: string;
67
+ inputUrl?: string | undefined;
68
68
  }>;
69
69
  export declare const oldStringStreamSchemaWithId: z.ZodObject<{
70
70
  enabled: z.ZodString;
@@ -77,7 +77,7 @@ export declare const oldStringStreamSchemaWithId: z.ZodObject<{
77
77
  outputType: z.ZodString;
78
78
  mediaServerUrl: z.ZodString;
79
79
  inputType: z.ZodString;
80
- inputUrl: z.ZodString;
80
+ inputUrl: z.ZodDefault<z.ZodString>;
81
81
  forceStereo: z.ZodString;
82
82
  streamDelay: z.ZodString;
83
83
  statusLed: z.ZodString;
@@ -131,11 +131,11 @@ export declare const oldStringStreamSchemaWithId: z.ZodObject<{
131
131
  outputType: string;
132
132
  mediaServerUrl: string;
133
133
  inputType: string;
134
- inputUrl: string;
135
134
  streamDelay: string;
136
135
  statusLed: string;
137
136
  statusPort: string;
138
137
  prepareAhead: string;
138
+ inputUrl?: string | undefined;
139
139
  }>;
140
140
  export type TOldStringStream = z.infer<typeof oldStringStreamSchema>;
141
141
  export declare const oldStreamSchema: z.ZodObject<{
@@ -13,7 +13,7 @@ exports.oldStringStreamSchema = zod_1.z.object({
13
13
  outputType: zod_1.z.string(),
14
14
  mediaServerUrl: zod_1.z.string(),
15
15
  inputType: zod_1.z.string(),
16
- inputUrl: zod_1.z.string(),
16
+ inputUrl: zod_1.z.string().default(''),
17
17
  forceStereo: zod_1.z.string(),
18
18
  streamDelay: zod_1.z.string(),
19
19
  statusLed: zod_1.z.string(),
@@ -267,20 +267,23 @@ export class CamSwitcherAPI extends BasicAPI {
267
267
  }
268
268
  async getParamFromCameraAndJSONParse(paramName, options) {
269
269
  const data = await this.vapixAgent.getParameter([paramName], options);
270
- if (data[paramName] !== undefined) {
270
+ if (data[paramName] === undefined) {
271
+ throw new ParameterNotFoundError(paramName);
272
+ }
273
+ if (data[paramName] === '') {
274
+ return {};
275
+ }
276
+ try {
277
+ return JSON.parse(data[paramName] + '');
278
+ }
279
+ catch {
271
280
  try {
272
- if (data[paramName] === '') {
273
- return {};
274
- }
275
- else {
276
- return JSON.parse(data[paramName] + '');
277
- }
281
+ return JSON.parse(decodeURIComponent(data[paramName] + ''));
278
282
  }
279
- catch {
283
+ catch (e) {
280
284
  throw new JsonParseError(paramName, data[paramName]);
281
285
  }
282
286
  }
283
- throw new ParameterNotFoundError(paramName);
284
287
  }
285
288
  async getUploadedFileList(clipName, storage, options) {
286
289
  const res = await this._getJson(`${BASE_PATH}/clip_files.cgi`, { clip_name: clipName, storage }, options);
@@ -10,7 +10,7 @@ export const oldStringStreamSchema = z.object({
10
10
  outputType: z.string(),
11
11
  mediaServerUrl: z.string(),
12
12
  inputType: z.string(),
13
- inputUrl: z.string(),
13
+ inputUrl: z.string().default(''),
14
14
  forceStereo: z.string(),
15
15
  streamDelay: z.string(),
16
16
  statusLed: z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstreamerlib",
3
- "version": "4.0.26-7647bae",
3
+ "version": "4.0.26-b58d309",
4
4
  "description": "Helper library for CamStreamer ACAP applications.",
5
5
  "prettier": "@camstreamer/prettier-config",
6
6
  "engine": {
@@ -10,7 +10,7 @@ export declare const oldStringStreamSchema: z.ZodObject<{
10
10
  outputType: z.ZodString;
11
11
  mediaServerUrl: z.ZodString;
12
12
  inputType: z.ZodString;
13
- inputUrl: z.ZodString;
13
+ inputUrl: z.ZodDefault<z.ZodString>;
14
14
  forceStereo: z.ZodString;
15
15
  streamDelay: z.ZodString;
16
16
  statusLed: z.ZodString;
@@ -60,11 +60,11 @@ export declare const oldStringStreamSchema: z.ZodObject<{
60
60
  outputType: string;
61
61
  mediaServerUrl: string;
62
62
  inputType: string;
63
- inputUrl: string;
64
63
  streamDelay: string;
65
64
  statusLed: string;
66
65
  statusPort: string;
67
66
  prepareAhead: string;
67
+ inputUrl?: string | undefined;
68
68
  }>;
69
69
  export declare const oldStringStreamSchemaWithId: z.ZodObject<{
70
70
  enabled: z.ZodString;
@@ -77,7 +77,7 @@ export declare const oldStringStreamSchemaWithId: z.ZodObject<{
77
77
  outputType: z.ZodString;
78
78
  mediaServerUrl: z.ZodString;
79
79
  inputType: z.ZodString;
80
- inputUrl: z.ZodString;
80
+ inputUrl: z.ZodDefault<z.ZodString>;
81
81
  forceStereo: z.ZodString;
82
82
  streamDelay: z.ZodString;
83
83
  statusLed: z.ZodString;
@@ -131,11 +131,11 @@ export declare const oldStringStreamSchemaWithId: z.ZodObject<{
131
131
  outputType: string;
132
132
  mediaServerUrl: string;
133
133
  inputType: string;
134
- inputUrl: string;
135
134
  streamDelay: string;
136
135
  statusLed: string;
137
136
  statusPort: string;
138
137
  prepareAhead: string;
138
+ inputUrl?: string | undefined;
139
139
  }>;
140
140
  export type TOldStringStream = z.infer<typeof oldStringStreamSchema>;
141
141
  export declare const oldStreamSchema: z.ZodObject<{