camstreamerlib 4.0.0-beta.57 → 4.0.0-beta.59

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.
@@ -158,14 +158,13 @@ class PlaneTrackerAPI {
158
158
  timeout: options?.timeout,
159
159
  });
160
160
  if (!res.ok) {
161
- const statusText = (await res.json()).statusText;
162
- if (res.status === 400 && statusText === 'Cannot set coordinates in automatic mode') {
161
+ if (res.status === 400 && res.statusText === 'Cannot set coordinates in automatic mode') {
163
162
  throw new errors_1.CannotSetCoordsInAutoModeError();
164
163
  }
165
- if (res.status === 400 && statusText === 'Invalid lat/lon parameters') {
164
+ if (res.status === 400 && res.statusText === 'Invalid lat/lon parameters') {
166
165
  throw new errors_1.InvalidLatLngError();
167
166
  }
168
- if (res.status === 400 && statusText === 'Invalid alt parameter') {
167
+ if (res.status === 400 && res.statusText === 'Invalid alt parameter') {
169
168
  throw new errors_1.InvalidAltitudeError();
170
169
  }
171
170
  if (res.status === 400) {
@@ -175,7 +174,6 @@ class PlaneTrackerAPI {
175
174
  throw new errors_1.ServerError();
176
175
  }
177
176
  }
178
- return res;
179
177
  }
180
178
  async checkGenetecConnection(params, options) {
181
179
  return await this._postUrlEncoded(`${BASE_PATH}/package/checkGenetecConnection.cgi`, params, options);
@@ -7,7 +7,7 @@ exports.nodeStateSchema = zod_1.z.object({
7
7
  node_state: zod_1.z.union([zod_1.z.literal('OK'), zod_1.z.literal('NOT_INSTALLED'), zod_1.z.literal('NOT_FOUND')]),
8
8
  });
9
9
  exports.packageInfoListSchema = zod_1.z.array(zod_1.z.object({
10
- storage: zod_1.z.union([zod_1.z.literal('SD_CARD'), zod_1.z.literal('INTERNAL')]),
10
+ storage: common_1.storageTypeSchema,
11
11
  manifest: zod_1.z.object({
12
12
  package_name: zod_1.z.string(),
13
13
  package_menu_name: zod_1.z.string(),
@@ -155,14 +155,13 @@ export class PlaneTrackerAPI {
155
155
  timeout: options?.timeout,
156
156
  });
157
157
  if (!res.ok) {
158
- const statusText = (await res.json()).statusText;
159
- if (res.status === 400 && statusText === 'Cannot set coordinates in automatic mode') {
158
+ if (res.status === 400 && res.statusText === 'Cannot set coordinates in automatic mode') {
160
159
  throw new CannotSetCoordsInAutoModeError();
161
160
  }
162
- if (res.status === 400 && statusText === 'Invalid lat/lon parameters') {
161
+ if (res.status === 400 && res.statusText === 'Invalid lat/lon parameters') {
163
162
  throw new InvalidLatLngError();
164
163
  }
165
- if (res.status === 400 && statusText === 'Invalid alt parameter') {
164
+ if (res.status === 400 && res.statusText === 'Invalid alt parameter') {
166
165
  throw new InvalidAltitudeError();
167
166
  }
168
167
  if (res.status === 400) {
@@ -172,7 +171,6 @@ export class PlaneTrackerAPI {
172
171
  throw new ServerError();
173
172
  }
174
173
  }
175
- return res;
176
174
  }
177
175
  async checkGenetecConnection(params, options) {
178
176
  return await this._postUrlEncoded(`${BASE_PATH}/package/checkGenetecConnection.cgi`, params, options);
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
- import { flashStorageTypeSchema, sdCardStorageTypeSchema } from './common';
2
+ import { flashStorageTypeSchema, sdCardStorageTypeSchema, storageTypeSchema } from './common';
3
3
  export const nodeStateSchema = z.object({
4
4
  node_state: z.union([z.literal('OK'), z.literal('NOT_INSTALLED'), z.literal('NOT_FOUND')]),
5
5
  });
6
6
  export const packageInfoListSchema = z.array(z.object({
7
- storage: z.union([z.literal('SD_CARD'), z.literal('INTERNAL')]),
7
+ storage: storageTypeSchema,
8
8
  manifest: z.object({
9
9
  package_name: z.string(),
10
10
  package_menu_name: z.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camstreamerlib",
3
- "version": "4.0.0-beta.57",
3
+ "version": "4.0.0-beta.59",
4
4
  "description": "Helper library for CamStreamer ACAP applications.",
5
5
  "prettier": "@camstreamer/prettier-config",
6
6
  "engine": {
@@ -22,7 +22,7 @@ export declare class CamScripterAPI<Client extends IClient<TResponse, any>> {
22
22
  capacity_mb: number;
23
23
  }]>;
24
24
  getPackageList(options?: THttpRequestOptions): Promise<{
25
- storage: "SD_CARD" | "INTERNAL";
25
+ storage: "FLASH" | "SD_DISK";
26
26
  manifest: {
27
27
  package_name: string;
28
28
  package_menu_name: string;
@@ -214,7 +214,7 @@ export declare class PlaneTrackerAPI<Client extends IClient<TResponse, any>> {
214
214
  }[];
215
215
  }>;
216
216
  setZones(zones: TZones, options?: THttpRequestOptions): Promise<void>;
217
- goToCoordinates(lat: number, lon: number, alt?: number, options?: THttpRequestOptions): Promise<ReturnType<Client["get"]>>;
217
+ goToCoordinates(lat: number, lon: number, alt?: number, options?: THttpRequestOptions): Promise<void>;
218
218
  checkGenetecConnection(params: TParameters, options?: THttpRequestOptions): Promise<TResponse>;
219
219
  getGenetecCameraList(params: TParameters, options?: THttpRequestOptions): Promise<{
220
220
  value: string;
@@ -16,6 +16,7 @@ export type TResponse = {
16
16
  blob: () => Promise<unknown>;
17
17
  status: number;
18
18
  ok: boolean;
19
+ statusText: string;
19
20
  };
20
21
  export type TGetParams = {
21
22
  path: string;
@@ -9,7 +9,7 @@ export declare const nodeStateSchema: z.ZodObject<{
9
9
  }>;
10
10
  export type TNodeState = z.infer<typeof nodeStateSchema>;
11
11
  export declare const packageInfoListSchema: z.ZodArray<z.ZodObject<{
12
- storage: z.ZodUnion<[z.ZodLiteral<"SD_CARD">, z.ZodLiteral<"INTERNAL">]>;
12
+ storage: z.ZodUnion<[z.ZodLiteral<"SD_DISK">, z.ZodLiteral<"FLASH">]>;
13
13
  manifest: z.ZodObject<{
14
14
  package_name: z.ZodString;
15
15
  package_menu_name: z.ZodString;
@@ -36,7 +36,7 @@ export declare const packageInfoListSchema: z.ZodArray<z.ZodObject<{
36
36
  required_camscripter_rbi_version?: string | undefined;
37
37
  }>;
38
38
  }, "strip", z.ZodTypeAny, {
39
- storage: "SD_CARD" | "INTERNAL";
39
+ storage: "FLASH" | "SD_DISK";
40
40
  manifest: {
41
41
  package_name: string;
42
42
  package_menu_name: string;
@@ -47,7 +47,7 @@ export declare const packageInfoListSchema: z.ZodArray<z.ZodObject<{
47
47
  required_camscripter_rbi_version?: string | undefined;
48
48
  };
49
49
  }, {
50
- storage: "SD_CARD" | "INTERNAL";
50
+ storage: "FLASH" | "SD_DISK";
51
51
  manifest: {
52
52
  package_name: string;
53
53
  package_menu_name: string;