camstreamerlib 4.0.0-beta.106 → 4.0.0-beta.107
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/CamOverlayAPI.d.ts +5 -12
- package/cjs/CamOverlayAPI.js +2 -2
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.d.ts +293 -12
- package/cjs/types/CamOverlayAPI/CamOverlayAPI.js +50 -11
- package/esm/CamOverlayAPI.js +3 -3
- package/esm/types/CamOverlayAPI/CamOverlayAPI.js +44 -10
- package/package.json +1 -1
- package/types/CamOverlayAPI.d.ts +5 -12
- package/types/types/CamOverlayAPI/CamOverlayAPI.d.ts +293 -12
package/cjs/CamOverlayAPI.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IClient, TBlobResponse, TResponse } from './internal/types';
|
|
2
2
|
import { THttpRequestOptions, TProxyParams } from './types/common';
|
|
3
3
|
import { ProxyClient } from './internal/ProxyClient';
|
|
4
|
-
import { ImageType, TCoordinates, TField, TFile, TFileType, TFileStorageType, TService } from './types/CamOverlayAPI';
|
|
4
|
+
import { ImageType, TCoordinates, TField, TFile, TFileType, TFileStorageType, TService, TFileList, TStorageDataList } from './types/CamOverlayAPI';
|
|
5
5
|
export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
6
6
|
private client;
|
|
7
7
|
constructor(client: Client);
|
|
@@ -16,17 +16,10 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
16
16
|
}[]>;
|
|
17
17
|
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
18
18
|
getMjpegStreamImage(mjpegUrl: string, options?: THttpRequestOptions): Promise<TBlobResponse<Client>>;
|
|
19
|
-
listFiles(fileType:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}[]>;
|
|
24
|
-
uploadFile(fileType: TFileType, formData: Parameters<Client['post']>[0]['data'], storage: TFileStorageType, options?: THttpRequestOptions): Promise<void>;
|
|
25
|
-
removeFile(fileType: TFileType, fileParams: TFile, options?: THttpRequestOptions): Promise<void>;
|
|
26
|
-
getFileStorage(fileType: TFileType, options?: THttpRequestOptions): Promise<{
|
|
27
|
-
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
28
|
-
state: string;
|
|
29
|
-
}[]>;
|
|
19
|
+
listFiles<T extends TFileType>(fileType: T, options?: THttpRequestOptions): Promise<TFileList<T>>;
|
|
20
|
+
uploadFile<T extends TFileType>(fileType: T, formData: Parameters<Client['post']>[0]['data'], storage: TFileStorageType<T>, options?: THttpRequestOptions): Promise<void>;
|
|
21
|
+
removeFile<T extends TFileType>(fileType: T, fileParams: TFile<T>, options?: THttpRequestOptions): Promise<void>;
|
|
22
|
+
getFileStorage<T extends TFileType>(fileType: T, options?: THttpRequestOptions): Promise<TStorageDataList<T>>;
|
|
30
23
|
getFilePreviewFromCamera(path: string, options?: THttpRequestOptions): Promise<TBlobResponse<Client>>;
|
|
31
24
|
updateInfoticker(serviceId: number, text: string, options?: THttpRequestOptions): Promise<void>;
|
|
32
25
|
setEnabled(serviceId: number, enabled: boolean, options?: THttpRequestOptions): Promise<void>;
|
package/cjs/CamOverlayAPI.js
CHANGED
|
@@ -36,7 +36,7 @@ class CamOverlayAPI {
|
|
|
36
36
|
}
|
|
37
37
|
async listFiles(fileType, options) {
|
|
38
38
|
const res = await this._getJson(`${BASE_PATH}/upload_${fileType}.cgi`, { action: 'list' }, options);
|
|
39
|
-
return CamOverlayAPI_1.
|
|
39
|
+
return (0, CamOverlayAPI_1.getFileListSchema)(fileType).parse(res.list);
|
|
40
40
|
}
|
|
41
41
|
async uploadFile(fileType, formData, storage, options) {
|
|
42
42
|
await this._post(`${BASE_PATH}/upload_${fileType}.cgi`, formData, {
|
|
@@ -55,7 +55,7 @@ class CamOverlayAPI {
|
|
|
55
55
|
if (res.code !== 200) {
|
|
56
56
|
throw new errors_1.StorageDataFetchError(res);
|
|
57
57
|
}
|
|
58
|
-
return CamOverlayAPI_1.
|
|
58
|
+
return (0, CamOverlayAPI_1.getStorageDataListSchema)(fileType).parse(res.list);
|
|
59
59
|
}
|
|
60
60
|
async getFilePreviewFromCamera(path, options) {
|
|
61
61
|
return await this._getBlob(CamOverlayAPI.getFilePreviewPath(path), undefined, options);
|
|
@@ -4229,9 +4229,12 @@ export declare enum ImageType {
|
|
|
4229
4229
|
PNG = 0,
|
|
4230
4230
|
JPEG = 1
|
|
4231
4231
|
}
|
|
4232
|
-
export declare const
|
|
4233
|
-
export
|
|
4234
|
-
export
|
|
4232
|
+
export declare const imageFileStorageTypeSchema: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
4233
|
+
export declare const fontFileStorageTypeSchema: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4234
|
+
export type TImageFileStorageType = z.infer<typeof imageFileStorageTypeSchema>;
|
|
4235
|
+
export type TFontFileStorageType = z.infer<typeof fontFileStorageTypeSchema>;
|
|
4236
|
+
export type TFileStorageType<T extends TFileType> = T extends 'image' ? TImageFileStorageType : TFontFileStorageType;
|
|
4237
|
+
export declare const imageFilestorageDataListSchema: z.ZodArray<z.ZodObject<{
|
|
4235
4238
|
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
4236
4239
|
state: z.ZodString;
|
|
4237
4240
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -4241,8 +4244,89 @@ export declare const storageDataListSchema: z.ZodArray<z.ZodObject<{
|
|
|
4241
4244
|
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4242
4245
|
state: string;
|
|
4243
4246
|
}>, "many">;
|
|
4244
|
-
export
|
|
4245
|
-
|
|
4247
|
+
export declare const fontStorageDataListSchema: z.ZodArray<z.ZodObject<{
|
|
4248
|
+
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4249
|
+
state: z.ZodString;
|
|
4250
|
+
}, "strip", z.ZodTypeAny, {
|
|
4251
|
+
type: "flash" | "SD0";
|
|
4252
|
+
state: string;
|
|
4253
|
+
}, {
|
|
4254
|
+
type: "flash" | "SD0";
|
|
4255
|
+
state: string;
|
|
4256
|
+
}>, "many">;
|
|
4257
|
+
export declare const getStorageDataListSchema: (fileType: TFileType) => z.ZodArray<z.ZodObject<{
|
|
4258
|
+
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
4259
|
+
state: z.ZodString;
|
|
4260
|
+
}, "strip", z.ZodTypeAny, {
|
|
4261
|
+
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4262
|
+
state: string;
|
|
4263
|
+
}, {
|
|
4264
|
+
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4265
|
+
state: string;
|
|
4266
|
+
}>, "many"> | z.ZodArray<z.ZodObject<{
|
|
4267
|
+
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4268
|
+
state: z.ZodString;
|
|
4269
|
+
}, "strip", z.ZodTypeAny, {
|
|
4270
|
+
type: "flash" | "SD0";
|
|
4271
|
+
state: string;
|
|
4272
|
+
}, {
|
|
4273
|
+
type: "flash" | "SD0";
|
|
4274
|
+
state: string;
|
|
4275
|
+
}>, "many">;
|
|
4276
|
+
export type TImageStorageDataList = z.infer<typeof imageFilestorageDataListSchema>;
|
|
4277
|
+
export type TFontStorageDataList = z.infer<typeof fontStorageDataListSchema>;
|
|
4278
|
+
export type TStorageDataList<T extends TFileType> = T extends 'image' ? TImageStorageDataList : TFontStorageDataList;
|
|
4279
|
+
export declare const imageStorageResponseSchema: z.ZodObject<{
|
|
4280
|
+
code: z.ZodNumber;
|
|
4281
|
+
list: z.ZodArray<z.ZodObject<{
|
|
4282
|
+
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
4283
|
+
state: z.ZodString;
|
|
4284
|
+
}, "strip", z.ZodTypeAny, {
|
|
4285
|
+
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4286
|
+
state: string;
|
|
4287
|
+
}, {
|
|
4288
|
+
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4289
|
+
state: string;
|
|
4290
|
+
}>, "many">;
|
|
4291
|
+
}, "strip", z.ZodTypeAny, {
|
|
4292
|
+
code: number;
|
|
4293
|
+
list: {
|
|
4294
|
+
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4295
|
+
state: string;
|
|
4296
|
+
}[];
|
|
4297
|
+
}, {
|
|
4298
|
+
code: number;
|
|
4299
|
+
list: {
|
|
4300
|
+
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4301
|
+
state: string;
|
|
4302
|
+
}[];
|
|
4303
|
+
}>;
|
|
4304
|
+
export declare const fontStorageResponseSchema: z.ZodObject<{
|
|
4305
|
+
code: z.ZodNumber;
|
|
4306
|
+
list: z.ZodArray<z.ZodObject<{
|
|
4307
|
+
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4308
|
+
state: z.ZodString;
|
|
4309
|
+
}, "strip", z.ZodTypeAny, {
|
|
4310
|
+
type: "flash" | "SD0";
|
|
4311
|
+
state: string;
|
|
4312
|
+
}, {
|
|
4313
|
+
type: "flash" | "SD0";
|
|
4314
|
+
state: string;
|
|
4315
|
+
}>, "many">;
|
|
4316
|
+
}, "strip", z.ZodTypeAny, {
|
|
4317
|
+
code: number;
|
|
4318
|
+
list: {
|
|
4319
|
+
type: "flash" | "SD0";
|
|
4320
|
+
state: string;
|
|
4321
|
+
}[];
|
|
4322
|
+
}, {
|
|
4323
|
+
code: number;
|
|
4324
|
+
list: {
|
|
4325
|
+
type: "flash" | "SD0";
|
|
4326
|
+
state: string;
|
|
4327
|
+
}[];
|
|
4328
|
+
}>;
|
|
4329
|
+
export declare const getStorageResponseSchema: (fileType: TFileType) => z.ZodObject<{
|
|
4246
4330
|
code: z.ZodNumber;
|
|
4247
4331
|
list: z.ZodArray<z.ZodObject<{
|
|
4248
4332
|
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
@@ -4266,9 +4350,35 @@ export declare const storageResponseSchema: z.ZodObject<{
|
|
|
4266
4350
|
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4267
4351
|
state: string;
|
|
4268
4352
|
}[];
|
|
4353
|
+
}> | z.ZodObject<{
|
|
4354
|
+
code: z.ZodNumber;
|
|
4355
|
+
list: z.ZodArray<z.ZodObject<{
|
|
4356
|
+
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4357
|
+
state: z.ZodString;
|
|
4358
|
+
}, "strip", z.ZodTypeAny, {
|
|
4359
|
+
type: "flash" | "SD0";
|
|
4360
|
+
state: string;
|
|
4361
|
+
}, {
|
|
4362
|
+
type: "flash" | "SD0";
|
|
4363
|
+
state: string;
|
|
4364
|
+
}>, "many">;
|
|
4365
|
+
}, "strip", z.ZodTypeAny, {
|
|
4366
|
+
code: number;
|
|
4367
|
+
list: {
|
|
4368
|
+
type: "flash" | "SD0";
|
|
4369
|
+
state: string;
|
|
4370
|
+
}[];
|
|
4371
|
+
}, {
|
|
4372
|
+
code: number;
|
|
4373
|
+
list: {
|
|
4374
|
+
type: "flash" | "SD0";
|
|
4375
|
+
state: string;
|
|
4376
|
+
}[];
|
|
4269
4377
|
}>;
|
|
4270
|
-
export type
|
|
4271
|
-
export
|
|
4378
|
+
export type TImageStorageResponse = z.infer<typeof imageStorageResponseSchema>;
|
|
4379
|
+
export type TFontStorageResponse = z.infer<typeof fontStorageResponseSchema>;
|
|
4380
|
+
export type TStorageResponse<T extends TFileType> = T extends 'image' ? TImageStorageResponse : TFontStorageResponse;
|
|
4381
|
+
export declare const imageFileSchema: z.ZodObject<{
|
|
4272
4382
|
name: z.ZodString;
|
|
4273
4383
|
path: z.ZodString;
|
|
4274
4384
|
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
@@ -4281,8 +4391,20 @@ export declare const fileSchema: z.ZodObject<{
|
|
|
4281
4391
|
name: string;
|
|
4282
4392
|
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4283
4393
|
}>;
|
|
4284
|
-
export
|
|
4285
|
-
|
|
4394
|
+
export declare const fontFileSchema: z.ZodObject<{
|
|
4395
|
+
name: z.ZodString;
|
|
4396
|
+
path: z.ZodString;
|
|
4397
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4398
|
+
}, "strip", z.ZodTypeAny, {
|
|
4399
|
+
path: string;
|
|
4400
|
+
name: string;
|
|
4401
|
+
storage: "flash" | "SD0";
|
|
4402
|
+
}, {
|
|
4403
|
+
path: string;
|
|
4404
|
+
name: string;
|
|
4405
|
+
storage: "flash" | "SD0";
|
|
4406
|
+
}>;
|
|
4407
|
+
export declare const getFileSchema: (fileType: TFileType) => z.ZodObject<{
|
|
4286
4408
|
name: z.ZodString;
|
|
4287
4409
|
path: z.ZodString;
|
|
4288
4410
|
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
@@ -4294,9 +4416,77 @@ export declare const fileListSchema: z.ZodArray<z.ZodObject<{
|
|
|
4294
4416
|
path: string;
|
|
4295
4417
|
name: string;
|
|
4296
4418
|
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4419
|
+
}> | z.ZodObject<{
|
|
4420
|
+
name: z.ZodString;
|
|
4421
|
+
path: z.ZodString;
|
|
4422
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4423
|
+
}, "strip", z.ZodTypeAny, {
|
|
4424
|
+
path: string;
|
|
4425
|
+
name: string;
|
|
4426
|
+
storage: "flash" | "SD0";
|
|
4427
|
+
}, {
|
|
4428
|
+
path: string;
|
|
4429
|
+
name: string;
|
|
4430
|
+
storage: "flash" | "SD0";
|
|
4431
|
+
}>;
|
|
4432
|
+
export type TImageFile = z.infer<typeof imageFileSchema>;
|
|
4433
|
+
export type TFontFile = z.infer<typeof fontFileSchema>;
|
|
4434
|
+
export type TFile<T extends TFileType> = T extends 'image' ? TImageFile : TFontFile;
|
|
4435
|
+
export declare const imageFileListSchema: z.ZodArray<z.ZodObject<{
|
|
4436
|
+
name: z.ZodString;
|
|
4437
|
+
path: z.ZodString;
|
|
4438
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
4439
|
+
}, "strip", z.ZodTypeAny, {
|
|
4440
|
+
path: string;
|
|
4441
|
+
name: string;
|
|
4442
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4443
|
+
}, {
|
|
4444
|
+
path: string;
|
|
4445
|
+
name: string;
|
|
4446
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4447
|
+
}>, "many">;
|
|
4448
|
+
export declare const fontFileListSchema: z.ZodArray<z.ZodObject<{
|
|
4449
|
+
name: z.ZodString;
|
|
4450
|
+
path: z.ZodString;
|
|
4451
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4452
|
+
}, "strip", z.ZodTypeAny, {
|
|
4453
|
+
path: string;
|
|
4454
|
+
name: string;
|
|
4455
|
+
storage: "flash" | "SD0";
|
|
4456
|
+
}, {
|
|
4457
|
+
path: string;
|
|
4458
|
+
name: string;
|
|
4459
|
+
storage: "flash" | "SD0";
|
|
4460
|
+
}>, "many">;
|
|
4461
|
+
export declare const getFileListSchema: (fileType: TFileType) => z.ZodArray<z.ZodObject<{
|
|
4462
|
+
name: z.ZodString;
|
|
4463
|
+
path: z.ZodString;
|
|
4464
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
4465
|
+
}, "strip", z.ZodTypeAny, {
|
|
4466
|
+
path: string;
|
|
4467
|
+
name: string;
|
|
4468
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4469
|
+
}, {
|
|
4470
|
+
path: string;
|
|
4471
|
+
name: string;
|
|
4472
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4473
|
+
}>, "many"> | z.ZodArray<z.ZodObject<{
|
|
4474
|
+
name: z.ZodString;
|
|
4475
|
+
path: z.ZodString;
|
|
4476
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4477
|
+
}, "strip", z.ZodTypeAny, {
|
|
4478
|
+
path: string;
|
|
4479
|
+
name: string;
|
|
4480
|
+
storage: "flash" | "SD0";
|
|
4481
|
+
}, {
|
|
4482
|
+
path: string;
|
|
4483
|
+
name: string;
|
|
4484
|
+
storage: "flash" | "SD0";
|
|
4297
4485
|
}>, "many">;
|
|
4298
|
-
export type
|
|
4299
|
-
export
|
|
4486
|
+
export type TImageFileList = z.infer<typeof imageFileListSchema>;
|
|
4487
|
+
export type TFontFileList = z.infer<typeof fontFileListSchema>;
|
|
4488
|
+
export type TFileList<T extends TFileType> = T extends 'image' ? TImageFileList : TFontFileList;
|
|
4489
|
+
export declare const imageFileDataSchema: z.ZodObject<{
|
|
4300
4490
|
code: z.ZodNumber;
|
|
4301
4491
|
list: z.ZodArray<z.ZodObject<{
|
|
4302
4492
|
name: z.ZodString;
|
|
@@ -4326,5 +4516,96 @@ export declare const fileDataSchema: z.ZodObject<{
|
|
|
4326
4516
|
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4327
4517
|
}[];
|
|
4328
4518
|
}>;
|
|
4329
|
-
export
|
|
4519
|
+
export declare const fontFileDataSchema: z.ZodObject<{
|
|
4520
|
+
code: z.ZodNumber;
|
|
4521
|
+
list: z.ZodArray<z.ZodObject<{
|
|
4522
|
+
name: z.ZodString;
|
|
4523
|
+
path: z.ZodString;
|
|
4524
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4525
|
+
}, "strip", z.ZodTypeAny, {
|
|
4526
|
+
path: string;
|
|
4527
|
+
name: string;
|
|
4528
|
+
storage: "flash" | "SD0";
|
|
4529
|
+
}, {
|
|
4530
|
+
path: string;
|
|
4531
|
+
name: string;
|
|
4532
|
+
storage: "flash" | "SD0";
|
|
4533
|
+
}>, "many">;
|
|
4534
|
+
}, "strip", z.ZodTypeAny, {
|
|
4535
|
+
code: number;
|
|
4536
|
+
list: {
|
|
4537
|
+
path: string;
|
|
4538
|
+
name: string;
|
|
4539
|
+
storage: "flash" | "SD0";
|
|
4540
|
+
}[];
|
|
4541
|
+
}, {
|
|
4542
|
+
code: number;
|
|
4543
|
+
list: {
|
|
4544
|
+
path: string;
|
|
4545
|
+
name: string;
|
|
4546
|
+
storage: "flash" | "SD0";
|
|
4547
|
+
}[];
|
|
4548
|
+
}>;
|
|
4549
|
+
export declare const getFileDataSchema: (fileType: TFileType) => z.ZodObject<{
|
|
4550
|
+
code: z.ZodNumber;
|
|
4551
|
+
list: z.ZodArray<z.ZodObject<{
|
|
4552
|
+
name: z.ZodString;
|
|
4553
|
+
path: z.ZodString;
|
|
4554
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
4555
|
+
}, "strip", z.ZodTypeAny, {
|
|
4556
|
+
path: string;
|
|
4557
|
+
name: string;
|
|
4558
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4559
|
+
}, {
|
|
4560
|
+
path: string;
|
|
4561
|
+
name: string;
|
|
4562
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4563
|
+
}>, "many">;
|
|
4564
|
+
}, "strip", z.ZodTypeAny, {
|
|
4565
|
+
code: number;
|
|
4566
|
+
list: {
|
|
4567
|
+
path: string;
|
|
4568
|
+
name: string;
|
|
4569
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4570
|
+
}[];
|
|
4571
|
+
}, {
|
|
4572
|
+
code: number;
|
|
4573
|
+
list: {
|
|
4574
|
+
path: string;
|
|
4575
|
+
name: string;
|
|
4576
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4577
|
+
}[];
|
|
4578
|
+
}> | z.ZodObject<{
|
|
4579
|
+
code: z.ZodNumber;
|
|
4580
|
+
list: z.ZodArray<z.ZodObject<{
|
|
4581
|
+
name: z.ZodString;
|
|
4582
|
+
path: z.ZodString;
|
|
4583
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4584
|
+
}, "strip", z.ZodTypeAny, {
|
|
4585
|
+
path: string;
|
|
4586
|
+
name: string;
|
|
4587
|
+
storage: "flash" | "SD0";
|
|
4588
|
+
}, {
|
|
4589
|
+
path: string;
|
|
4590
|
+
name: string;
|
|
4591
|
+
storage: "flash" | "SD0";
|
|
4592
|
+
}>, "many">;
|
|
4593
|
+
}, "strip", z.ZodTypeAny, {
|
|
4594
|
+
code: number;
|
|
4595
|
+
list: {
|
|
4596
|
+
path: string;
|
|
4597
|
+
name: string;
|
|
4598
|
+
storage: "flash" | "SD0";
|
|
4599
|
+
}[];
|
|
4600
|
+
}, {
|
|
4601
|
+
code: number;
|
|
4602
|
+
list: {
|
|
4603
|
+
path: string;
|
|
4604
|
+
name: string;
|
|
4605
|
+
storage: "flash" | "SD0";
|
|
4606
|
+
}[];
|
|
4607
|
+
}>;
|
|
4608
|
+
export type TImageFileData = z.infer<typeof imageFileDataSchema>;
|
|
4609
|
+
export type TFontFileData = z.infer<typeof fontFileDataSchema>;
|
|
4610
|
+
export type TFileData<T extends TFileType> = T extends 'image' ? TImageFileData : TFontFileData;
|
|
4330
4611
|
export type TOverlayListItem = z.infer<typeof overlaySchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getFileDataSchema = exports.fontFileDataSchema = exports.imageFileDataSchema = exports.getFileListSchema = exports.fontFileListSchema = exports.imageFileListSchema = exports.getFileSchema = exports.fontFileSchema = exports.imageFileSchema = exports.getStorageResponseSchema = exports.fontStorageResponseSchema = exports.imageStorageResponseSchema = exports.getStorageDataListSchema = exports.fontStorageDataListSchema = exports.imageFilestorageDataListSchema = exports.fontFileStorageTypeSchema = exports.imageFileStorageTypeSchema = exports.ImageType = exports.isScoreOverview = exports.isBaseballScoreBoardAutomatic = exports.isBaseballScoreBoard = exports.isScoreBoard = exports.isWebCameraSharing = exports.isScreenSharing = exports.isPtz = exports.isPtzCompass = exports.isPip = exports.isInfoticker = exports.isImages = exports.isCustomGraphics = exports.isAccuweather = exports.serviceListSchema = exports.servicesSchema = exports.wsResponseSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const infotickerSchema_1 = require("./infotickerSchema");
|
|
6
6
|
const accuweatherSchema_1 = require("./accuweatherSchema");
|
|
@@ -65,28 +65,67 @@ var ImageType;
|
|
|
65
65
|
ImageType[ImageType["PNG"] = 0] = "PNG";
|
|
66
66
|
ImageType[ImageType["JPEG"] = 1] = "JPEG";
|
|
67
67
|
})(ImageType || (exports.ImageType = ImageType = {}));
|
|
68
|
-
exports.
|
|
68
|
+
exports.imageFileStorageTypeSchema = zod_1.z.union([
|
|
69
69
|
zod_1.z.literal('flash'),
|
|
70
70
|
zod_1.z.literal('SD0'),
|
|
71
71
|
zod_1.z.literal('ftp'),
|
|
72
72
|
zod_1.z.literal('samba'),
|
|
73
73
|
zod_1.z.literal('url'),
|
|
74
74
|
]);
|
|
75
|
-
exports.
|
|
76
|
-
|
|
75
|
+
exports.fontFileStorageTypeSchema = zod_1.z.union([zod_1.z.literal('flash'), zod_1.z.literal('SD0')]);
|
|
76
|
+
exports.imageFilestorageDataListSchema = zod_1.z.array(zod_1.z.object({
|
|
77
|
+
type: exports.imageFileStorageTypeSchema,
|
|
77
78
|
state: zod_1.z.string(),
|
|
78
79
|
}));
|
|
79
|
-
exports.
|
|
80
|
+
exports.fontStorageDataListSchema = zod_1.z.array(zod_1.z.object({
|
|
81
|
+
type: exports.fontFileStorageTypeSchema,
|
|
82
|
+
state: zod_1.z.string(),
|
|
83
|
+
}));
|
|
84
|
+
const getStorageDataListSchema = (fileType) => {
|
|
85
|
+
return fileType === 'image' ? exports.imageFilestorageDataListSchema : exports.fontStorageDataListSchema;
|
|
86
|
+
};
|
|
87
|
+
exports.getStorageDataListSchema = getStorageDataListSchema;
|
|
88
|
+
exports.imageStorageResponseSchema = zod_1.z.object({
|
|
80
89
|
code: zod_1.z.number(),
|
|
81
|
-
list: exports.
|
|
90
|
+
list: exports.imageFilestorageDataListSchema,
|
|
82
91
|
});
|
|
83
|
-
exports.
|
|
92
|
+
exports.fontStorageResponseSchema = zod_1.z.object({
|
|
93
|
+
code: zod_1.z.number(),
|
|
94
|
+
list: exports.fontStorageDataListSchema,
|
|
95
|
+
});
|
|
96
|
+
const getStorageResponseSchema = (fileType) => {
|
|
97
|
+
return fileType === 'image' ? exports.imageStorageResponseSchema : exports.fontStorageResponseSchema;
|
|
98
|
+
};
|
|
99
|
+
exports.getStorageResponseSchema = getStorageResponseSchema;
|
|
100
|
+
exports.imageFileSchema = zod_1.z.object({
|
|
84
101
|
name: zod_1.z.string(),
|
|
85
102
|
path: zod_1.z.string().url(),
|
|
86
|
-
storage: exports.
|
|
103
|
+
storage: exports.imageFileStorageTypeSchema,
|
|
104
|
+
});
|
|
105
|
+
exports.fontFileSchema = zod_1.z.object({
|
|
106
|
+
name: zod_1.z.string(),
|
|
107
|
+
path: zod_1.z.string().url(),
|
|
108
|
+
storage: exports.fontFileStorageTypeSchema,
|
|
109
|
+
});
|
|
110
|
+
const getFileSchema = (fileType) => {
|
|
111
|
+
return fileType === 'image' ? exports.imageFileSchema : exports.fontFileSchema;
|
|
112
|
+
};
|
|
113
|
+
exports.getFileSchema = getFileSchema;
|
|
114
|
+
exports.imageFileListSchema = zod_1.z.array(exports.imageFileSchema);
|
|
115
|
+
exports.fontFileListSchema = zod_1.z.array(exports.fontFileSchema);
|
|
116
|
+
const getFileListSchema = (fileType) => {
|
|
117
|
+
return fileType === 'image' ? exports.imageFileListSchema : exports.fontFileListSchema;
|
|
118
|
+
};
|
|
119
|
+
exports.getFileListSchema = getFileListSchema;
|
|
120
|
+
exports.imageFileDataSchema = zod_1.z.object({
|
|
121
|
+
code: zod_1.z.number(),
|
|
122
|
+
list: exports.imageFileListSchema,
|
|
87
123
|
});
|
|
88
|
-
exports.
|
|
89
|
-
exports.fileDataSchema = zod_1.z.object({
|
|
124
|
+
exports.fontFileDataSchema = zod_1.z.object({
|
|
90
125
|
code: zod_1.z.number(),
|
|
91
|
-
list: exports.
|
|
126
|
+
list: exports.fontFileListSchema,
|
|
92
127
|
});
|
|
128
|
+
const getFileDataSchema = (fileType) => {
|
|
129
|
+
return fileType === 'image' ? exports.imageFileDataSchema : exports.fontFileDataSchema;
|
|
130
|
+
};
|
|
131
|
+
exports.getFileDataSchema = getFileDataSchema;
|
package/esm/CamOverlayAPI.js
CHANGED
|
@@ -3,7 +3,7 @@ import { ParsingBlobError, ErrorWithResponse, ServiceNotFoundError, StorageDataF
|
|
|
3
3
|
import { networkCameraListSchema } from './types/common';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { ProxyClient } from './internal/ProxyClient';
|
|
6
|
-
import {
|
|
6
|
+
import { ImageType, serviceListSchema, servicesSchema, wsResponseSchema, getStorageDataListSchema, getFileListSchema, } from './types/CamOverlayAPI';
|
|
7
7
|
const BASE_PATH = '/local/camoverlay/api';
|
|
8
8
|
export class CamOverlayAPI {
|
|
9
9
|
client;
|
|
@@ -33,7 +33,7 @@ export class CamOverlayAPI {
|
|
|
33
33
|
}
|
|
34
34
|
async listFiles(fileType, options) {
|
|
35
35
|
const res = await this._getJson(`${BASE_PATH}/upload_${fileType}.cgi`, { action: 'list' }, options);
|
|
36
|
-
return
|
|
36
|
+
return getFileListSchema(fileType).parse(res.list);
|
|
37
37
|
}
|
|
38
38
|
async uploadFile(fileType, formData, storage, options) {
|
|
39
39
|
await this._post(`${BASE_PATH}/upload_${fileType}.cgi`, formData, {
|
|
@@ -52,7 +52,7 @@ export class CamOverlayAPI {
|
|
|
52
52
|
if (res.code !== 200) {
|
|
53
53
|
throw new StorageDataFetchError(res);
|
|
54
54
|
}
|
|
55
|
-
return
|
|
55
|
+
return getStorageDataListSchema(fileType).parse(res.list);
|
|
56
56
|
}
|
|
57
57
|
async getFilePreviewFromCamera(path, options) {
|
|
58
58
|
return await this._getBlob(CamOverlayAPI.getFilePreviewPath(path), undefined, options);
|
|
@@ -49,28 +49,62 @@ export var ImageType;
|
|
|
49
49
|
ImageType[ImageType["PNG"] = 0] = "PNG";
|
|
50
50
|
ImageType[ImageType["JPEG"] = 1] = "JPEG";
|
|
51
51
|
})(ImageType || (ImageType = {}));
|
|
52
|
-
export const
|
|
52
|
+
export const imageFileStorageTypeSchema = z.union([
|
|
53
53
|
z.literal('flash'),
|
|
54
54
|
z.literal('SD0'),
|
|
55
55
|
z.literal('ftp'),
|
|
56
56
|
z.literal('samba'),
|
|
57
57
|
z.literal('url'),
|
|
58
58
|
]);
|
|
59
|
-
export const
|
|
60
|
-
|
|
59
|
+
export const fontFileStorageTypeSchema = z.union([z.literal('flash'), z.literal('SD0')]);
|
|
60
|
+
export const imageFilestorageDataListSchema = z.array(z.object({
|
|
61
|
+
type: imageFileStorageTypeSchema,
|
|
61
62
|
state: z.string(),
|
|
62
63
|
}));
|
|
63
|
-
export const
|
|
64
|
+
export const fontStorageDataListSchema = z.array(z.object({
|
|
65
|
+
type: fontFileStorageTypeSchema,
|
|
66
|
+
state: z.string(),
|
|
67
|
+
}));
|
|
68
|
+
export const getStorageDataListSchema = (fileType) => {
|
|
69
|
+
return fileType === 'image' ? imageFilestorageDataListSchema : fontStorageDataListSchema;
|
|
70
|
+
};
|
|
71
|
+
export const imageStorageResponseSchema = z.object({
|
|
64
72
|
code: z.number(),
|
|
65
|
-
list:
|
|
73
|
+
list: imageFilestorageDataListSchema,
|
|
66
74
|
});
|
|
67
|
-
export const
|
|
75
|
+
export const fontStorageResponseSchema = z.object({
|
|
76
|
+
code: z.number(),
|
|
77
|
+
list: fontStorageDataListSchema,
|
|
78
|
+
});
|
|
79
|
+
export const getStorageResponseSchema = (fileType) => {
|
|
80
|
+
return fileType === 'image' ? imageStorageResponseSchema : fontStorageResponseSchema;
|
|
81
|
+
};
|
|
82
|
+
export const imageFileSchema = z.object({
|
|
68
83
|
name: z.string(),
|
|
69
84
|
path: z.string().url(),
|
|
70
|
-
storage:
|
|
85
|
+
storage: imageFileStorageTypeSchema,
|
|
86
|
+
});
|
|
87
|
+
export const fontFileSchema = z.object({
|
|
88
|
+
name: z.string(),
|
|
89
|
+
path: z.string().url(),
|
|
90
|
+
storage: fontFileStorageTypeSchema,
|
|
91
|
+
});
|
|
92
|
+
export const getFileSchema = (fileType) => {
|
|
93
|
+
return fileType === 'image' ? imageFileSchema : fontFileSchema;
|
|
94
|
+
};
|
|
95
|
+
export const imageFileListSchema = z.array(imageFileSchema);
|
|
96
|
+
export const fontFileListSchema = z.array(fontFileSchema);
|
|
97
|
+
export const getFileListSchema = (fileType) => {
|
|
98
|
+
return fileType === 'image' ? imageFileListSchema : fontFileListSchema;
|
|
99
|
+
};
|
|
100
|
+
export const imageFileDataSchema = z.object({
|
|
101
|
+
code: z.number(),
|
|
102
|
+
list: imageFileListSchema,
|
|
71
103
|
});
|
|
72
|
-
export const
|
|
73
|
-
export const fileDataSchema = z.object({
|
|
104
|
+
export const fontFileDataSchema = z.object({
|
|
74
105
|
code: z.number(),
|
|
75
|
-
list:
|
|
106
|
+
list: fontFileListSchema,
|
|
76
107
|
});
|
|
108
|
+
export const getFileDataSchema = (fileType) => {
|
|
109
|
+
return fileType === 'image' ? imageFileDataSchema : fontFileDataSchema;
|
|
110
|
+
};
|
package/package.json
CHANGED
package/types/CamOverlayAPI.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IClient, TBlobResponse, TResponse } from './internal/types';
|
|
2
2
|
import { THttpRequestOptions, TProxyParams } from './types/common';
|
|
3
3
|
import { ProxyClient } from './internal/ProxyClient';
|
|
4
|
-
import { ImageType, TCoordinates, TField, TFile, TFileType, TFileStorageType, TService } from './types/CamOverlayAPI';
|
|
4
|
+
import { ImageType, TCoordinates, TField, TFile, TFileType, TFileStorageType, TService, TFileList, TStorageDataList } from './types/CamOverlayAPI';
|
|
5
5
|
export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
6
6
|
private client;
|
|
7
7
|
constructor(client: Client);
|
|
@@ -16,17 +16,10 @@ export declare class CamOverlayAPI<Client extends IClient<TResponse, any>> {
|
|
|
16
16
|
}[]>;
|
|
17
17
|
wsAuthorization(options?: THttpRequestOptions): Promise<string>;
|
|
18
18
|
getMjpegStreamImage(mjpegUrl: string, options?: THttpRequestOptions): Promise<TBlobResponse<Client>>;
|
|
19
|
-
listFiles(fileType:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}[]>;
|
|
24
|
-
uploadFile(fileType: TFileType, formData: Parameters<Client['post']>[0]['data'], storage: TFileStorageType, options?: THttpRequestOptions): Promise<void>;
|
|
25
|
-
removeFile(fileType: TFileType, fileParams: TFile, options?: THttpRequestOptions): Promise<void>;
|
|
26
|
-
getFileStorage(fileType: TFileType, options?: THttpRequestOptions): Promise<{
|
|
27
|
-
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
28
|
-
state: string;
|
|
29
|
-
}[]>;
|
|
19
|
+
listFiles<T extends TFileType>(fileType: T, options?: THttpRequestOptions): Promise<TFileList<T>>;
|
|
20
|
+
uploadFile<T extends TFileType>(fileType: T, formData: Parameters<Client['post']>[0]['data'], storage: TFileStorageType<T>, options?: THttpRequestOptions): Promise<void>;
|
|
21
|
+
removeFile<T extends TFileType>(fileType: T, fileParams: TFile<T>, options?: THttpRequestOptions): Promise<void>;
|
|
22
|
+
getFileStorage<T extends TFileType>(fileType: T, options?: THttpRequestOptions): Promise<TStorageDataList<T>>;
|
|
30
23
|
getFilePreviewFromCamera(path: string, options?: THttpRequestOptions): Promise<TBlobResponse<Client>>;
|
|
31
24
|
updateInfoticker(serviceId: number, text: string, options?: THttpRequestOptions): Promise<void>;
|
|
32
25
|
setEnabled(serviceId: number, enabled: boolean, options?: THttpRequestOptions): Promise<void>;
|
|
@@ -4229,9 +4229,12 @@ export declare enum ImageType {
|
|
|
4229
4229
|
PNG = 0,
|
|
4230
4230
|
JPEG = 1
|
|
4231
4231
|
}
|
|
4232
|
-
export declare const
|
|
4233
|
-
export
|
|
4234
|
-
export
|
|
4232
|
+
export declare const imageFileStorageTypeSchema: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
4233
|
+
export declare const fontFileStorageTypeSchema: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4234
|
+
export type TImageFileStorageType = z.infer<typeof imageFileStorageTypeSchema>;
|
|
4235
|
+
export type TFontFileStorageType = z.infer<typeof fontFileStorageTypeSchema>;
|
|
4236
|
+
export type TFileStorageType<T extends TFileType> = T extends 'image' ? TImageFileStorageType : TFontFileStorageType;
|
|
4237
|
+
export declare const imageFilestorageDataListSchema: z.ZodArray<z.ZodObject<{
|
|
4235
4238
|
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
4236
4239
|
state: z.ZodString;
|
|
4237
4240
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -4241,8 +4244,89 @@ export declare const storageDataListSchema: z.ZodArray<z.ZodObject<{
|
|
|
4241
4244
|
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4242
4245
|
state: string;
|
|
4243
4246
|
}>, "many">;
|
|
4244
|
-
export
|
|
4245
|
-
|
|
4247
|
+
export declare const fontStorageDataListSchema: z.ZodArray<z.ZodObject<{
|
|
4248
|
+
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4249
|
+
state: z.ZodString;
|
|
4250
|
+
}, "strip", z.ZodTypeAny, {
|
|
4251
|
+
type: "flash" | "SD0";
|
|
4252
|
+
state: string;
|
|
4253
|
+
}, {
|
|
4254
|
+
type: "flash" | "SD0";
|
|
4255
|
+
state: string;
|
|
4256
|
+
}>, "many">;
|
|
4257
|
+
export declare const getStorageDataListSchema: (fileType: TFileType) => z.ZodArray<z.ZodObject<{
|
|
4258
|
+
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
4259
|
+
state: z.ZodString;
|
|
4260
|
+
}, "strip", z.ZodTypeAny, {
|
|
4261
|
+
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4262
|
+
state: string;
|
|
4263
|
+
}, {
|
|
4264
|
+
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4265
|
+
state: string;
|
|
4266
|
+
}>, "many"> | z.ZodArray<z.ZodObject<{
|
|
4267
|
+
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4268
|
+
state: z.ZodString;
|
|
4269
|
+
}, "strip", z.ZodTypeAny, {
|
|
4270
|
+
type: "flash" | "SD0";
|
|
4271
|
+
state: string;
|
|
4272
|
+
}, {
|
|
4273
|
+
type: "flash" | "SD0";
|
|
4274
|
+
state: string;
|
|
4275
|
+
}>, "many">;
|
|
4276
|
+
export type TImageStorageDataList = z.infer<typeof imageFilestorageDataListSchema>;
|
|
4277
|
+
export type TFontStorageDataList = z.infer<typeof fontStorageDataListSchema>;
|
|
4278
|
+
export type TStorageDataList<T extends TFileType> = T extends 'image' ? TImageStorageDataList : TFontStorageDataList;
|
|
4279
|
+
export declare const imageStorageResponseSchema: z.ZodObject<{
|
|
4280
|
+
code: z.ZodNumber;
|
|
4281
|
+
list: z.ZodArray<z.ZodObject<{
|
|
4282
|
+
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
4283
|
+
state: z.ZodString;
|
|
4284
|
+
}, "strip", z.ZodTypeAny, {
|
|
4285
|
+
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4286
|
+
state: string;
|
|
4287
|
+
}, {
|
|
4288
|
+
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4289
|
+
state: string;
|
|
4290
|
+
}>, "many">;
|
|
4291
|
+
}, "strip", z.ZodTypeAny, {
|
|
4292
|
+
code: number;
|
|
4293
|
+
list: {
|
|
4294
|
+
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4295
|
+
state: string;
|
|
4296
|
+
}[];
|
|
4297
|
+
}, {
|
|
4298
|
+
code: number;
|
|
4299
|
+
list: {
|
|
4300
|
+
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4301
|
+
state: string;
|
|
4302
|
+
}[];
|
|
4303
|
+
}>;
|
|
4304
|
+
export declare const fontStorageResponseSchema: z.ZodObject<{
|
|
4305
|
+
code: z.ZodNumber;
|
|
4306
|
+
list: z.ZodArray<z.ZodObject<{
|
|
4307
|
+
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4308
|
+
state: z.ZodString;
|
|
4309
|
+
}, "strip", z.ZodTypeAny, {
|
|
4310
|
+
type: "flash" | "SD0";
|
|
4311
|
+
state: string;
|
|
4312
|
+
}, {
|
|
4313
|
+
type: "flash" | "SD0";
|
|
4314
|
+
state: string;
|
|
4315
|
+
}>, "many">;
|
|
4316
|
+
}, "strip", z.ZodTypeAny, {
|
|
4317
|
+
code: number;
|
|
4318
|
+
list: {
|
|
4319
|
+
type: "flash" | "SD0";
|
|
4320
|
+
state: string;
|
|
4321
|
+
}[];
|
|
4322
|
+
}, {
|
|
4323
|
+
code: number;
|
|
4324
|
+
list: {
|
|
4325
|
+
type: "flash" | "SD0";
|
|
4326
|
+
state: string;
|
|
4327
|
+
}[];
|
|
4328
|
+
}>;
|
|
4329
|
+
export declare const getStorageResponseSchema: (fileType: TFileType) => z.ZodObject<{
|
|
4246
4330
|
code: z.ZodNumber;
|
|
4247
4331
|
list: z.ZodArray<z.ZodObject<{
|
|
4248
4332
|
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
@@ -4266,9 +4350,35 @@ export declare const storageResponseSchema: z.ZodObject<{
|
|
|
4266
4350
|
type: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4267
4351
|
state: string;
|
|
4268
4352
|
}[];
|
|
4353
|
+
}> | z.ZodObject<{
|
|
4354
|
+
code: z.ZodNumber;
|
|
4355
|
+
list: z.ZodArray<z.ZodObject<{
|
|
4356
|
+
type: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4357
|
+
state: z.ZodString;
|
|
4358
|
+
}, "strip", z.ZodTypeAny, {
|
|
4359
|
+
type: "flash" | "SD0";
|
|
4360
|
+
state: string;
|
|
4361
|
+
}, {
|
|
4362
|
+
type: "flash" | "SD0";
|
|
4363
|
+
state: string;
|
|
4364
|
+
}>, "many">;
|
|
4365
|
+
}, "strip", z.ZodTypeAny, {
|
|
4366
|
+
code: number;
|
|
4367
|
+
list: {
|
|
4368
|
+
type: "flash" | "SD0";
|
|
4369
|
+
state: string;
|
|
4370
|
+
}[];
|
|
4371
|
+
}, {
|
|
4372
|
+
code: number;
|
|
4373
|
+
list: {
|
|
4374
|
+
type: "flash" | "SD0";
|
|
4375
|
+
state: string;
|
|
4376
|
+
}[];
|
|
4269
4377
|
}>;
|
|
4270
|
-
export type
|
|
4271
|
-
export
|
|
4378
|
+
export type TImageStorageResponse = z.infer<typeof imageStorageResponseSchema>;
|
|
4379
|
+
export type TFontStorageResponse = z.infer<typeof fontStorageResponseSchema>;
|
|
4380
|
+
export type TStorageResponse<T extends TFileType> = T extends 'image' ? TImageStorageResponse : TFontStorageResponse;
|
|
4381
|
+
export declare const imageFileSchema: z.ZodObject<{
|
|
4272
4382
|
name: z.ZodString;
|
|
4273
4383
|
path: z.ZodString;
|
|
4274
4384
|
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
@@ -4281,8 +4391,20 @@ export declare const fileSchema: z.ZodObject<{
|
|
|
4281
4391
|
name: string;
|
|
4282
4392
|
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4283
4393
|
}>;
|
|
4284
|
-
export
|
|
4285
|
-
|
|
4394
|
+
export declare const fontFileSchema: z.ZodObject<{
|
|
4395
|
+
name: z.ZodString;
|
|
4396
|
+
path: z.ZodString;
|
|
4397
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4398
|
+
}, "strip", z.ZodTypeAny, {
|
|
4399
|
+
path: string;
|
|
4400
|
+
name: string;
|
|
4401
|
+
storage: "flash" | "SD0";
|
|
4402
|
+
}, {
|
|
4403
|
+
path: string;
|
|
4404
|
+
name: string;
|
|
4405
|
+
storage: "flash" | "SD0";
|
|
4406
|
+
}>;
|
|
4407
|
+
export declare const getFileSchema: (fileType: TFileType) => z.ZodObject<{
|
|
4286
4408
|
name: z.ZodString;
|
|
4287
4409
|
path: z.ZodString;
|
|
4288
4410
|
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
@@ -4294,9 +4416,77 @@ export declare const fileListSchema: z.ZodArray<z.ZodObject<{
|
|
|
4294
4416
|
path: string;
|
|
4295
4417
|
name: string;
|
|
4296
4418
|
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4419
|
+
}> | z.ZodObject<{
|
|
4420
|
+
name: z.ZodString;
|
|
4421
|
+
path: z.ZodString;
|
|
4422
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4423
|
+
}, "strip", z.ZodTypeAny, {
|
|
4424
|
+
path: string;
|
|
4425
|
+
name: string;
|
|
4426
|
+
storage: "flash" | "SD0";
|
|
4427
|
+
}, {
|
|
4428
|
+
path: string;
|
|
4429
|
+
name: string;
|
|
4430
|
+
storage: "flash" | "SD0";
|
|
4431
|
+
}>;
|
|
4432
|
+
export type TImageFile = z.infer<typeof imageFileSchema>;
|
|
4433
|
+
export type TFontFile = z.infer<typeof fontFileSchema>;
|
|
4434
|
+
export type TFile<T extends TFileType> = T extends 'image' ? TImageFile : TFontFile;
|
|
4435
|
+
export declare const imageFileListSchema: z.ZodArray<z.ZodObject<{
|
|
4436
|
+
name: z.ZodString;
|
|
4437
|
+
path: z.ZodString;
|
|
4438
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
4439
|
+
}, "strip", z.ZodTypeAny, {
|
|
4440
|
+
path: string;
|
|
4441
|
+
name: string;
|
|
4442
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4443
|
+
}, {
|
|
4444
|
+
path: string;
|
|
4445
|
+
name: string;
|
|
4446
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4447
|
+
}>, "many">;
|
|
4448
|
+
export declare const fontFileListSchema: z.ZodArray<z.ZodObject<{
|
|
4449
|
+
name: z.ZodString;
|
|
4450
|
+
path: z.ZodString;
|
|
4451
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4452
|
+
}, "strip", z.ZodTypeAny, {
|
|
4453
|
+
path: string;
|
|
4454
|
+
name: string;
|
|
4455
|
+
storage: "flash" | "SD0";
|
|
4456
|
+
}, {
|
|
4457
|
+
path: string;
|
|
4458
|
+
name: string;
|
|
4459
|
+
storage: "flash" | "SD0";
|
|
4460
|
+
}>, "many">;
|
|
4461
|
+
export declare const getFileListSchema: (fileType: TFileType) => z.ZodArray<z.ZodObject<{
|
|
4462
|
+
name: z.ZodString;
|
|
4463
|
+
path: z.ZodString;
|
|
4464
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
4465
|
+
}, "strip", z.ZodTypeAny, {
|
|
4466
|
+
path: string;
|
|
4467
|
+
name: string;
|
|
4468
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4469
|
+
}, {
|
|
4470
|
+
path: string;
|
|
4471
|
+
name: string;
|
|
4472
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4473
|
+
}>, "many"> | z.ZodArray<z.ZodObject<{
|
|
4474
|
+
name: z.ZodString;
|
|
4475
|
+
path: z.ZodString;
|
|
4476
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4477
|
+
}, "strip", z.ZodTypeAny, {
|
|
4478
|
+
path: string;
|
|
4479
|
+
name: string;
|
|
4480
|
+
storage: "flash" | "SD0";
|
|
4481
|
+
}, {
|
|
4482
|
+
path: string;
|
|
4483
|
+
name: string;
|
|
4484
|
+
storage: "flash" | "SD0";
|
|
4297
4485
|
}>, "many">;
|
|
4298
|
-
export type
|
|
4299
|
-
export
|
|
4486
|
+
export type TImageFileList = z.infer<typeof imageFileListSchema>;
|
|
4487
|
+
export type TFontFileList = z.infer<typeof fontFileListSchema>;
|
|
4488
|
+
export type TFileList<T extends TFileType> = T extends 'image' ? TImageFileList : TFontFileList;
|
|
4489
|
+
export declare const imageFileDataSchema: z.ZodObject<{
|
|
4300
4490
|
code: z.ZodNumber;
|
|
4301
4491
|
list: z.ZodArray<z.ZodObject<{
|
|
4302
4492
|
name: z.ZodString;
|
|
@@ -4326,5 +4516,96 @@ export declare const fileDataSchema: z.ZodObject<{
|
|
|
4326
4516
|
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4327
4517
|
}[];
|
|
4328
4518
|
}>;
|
|
4329
|
-
export
|
|
4519
|
+
export declare const fontFileDataSchema: z.ZodObject<{
|
|
4520
|
+
code: z.ZodNumber;
|
|
4521
|
+
list: z.ZodArray<z.ZodObject<{
|
|
4522
|
+
name: z.ZodString;
|
|
4523
|
+
path: z.ZodString;
|
|
4524
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4525
|
+
}, "strip", z.ZodTypeAny, {
|
|
4526
|
+
path: string;
|
|
4527
|
+
name: string;
|
|
4528
|
+
storage: "flash" | "SD0";
|
|
4529
|
+
}, {
|
|
4530
|
+
path: string;
|
|
4531
|
+
name: string;
|
|
4532
|
+
storage: "flash" | "SD0";
|
|
4533
|
+
}>, "many">;
|
|
4534
|
+
}, "strip", z.ZodTypeAny, {
|
|
4535
|
+
code: number;
|
|
4536
|
+
list: {
|
|
4537
|
+
path: string;
|
|
4538
|
+
name: string;
|
|
4539
|
+
storage: "flash" | "SD0";
|
|
4540
|
+
}[];
|
|
4541
|
+
}, {
|
|
4542
|
+
code: number;
|
|
4543
|
+
list: {
|
|
4544
|
+
path: string;
|
|
4545
|
+
name: string;
|
|
4546
|
+
storage: "flash" | "SD0";
|
|
4547
|
+
}[];
|
|
4548
|
+
}>;
|
|
4549
|
+
export declare const getFileDataSchema: (fileType: TFileType) => z.ZodObject<{
|
|
4550
|
+
code: z.ZodNumber;
|
|
4551
|
+
list: z.ZodArray<z.ZodObject<{
|
|
4552
|
+
name: z.ZodString;
|
|
4553
|
+
path: z.ZodString;
|
|
4554
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">, z.ZodLiteral<"ftp">, z.ZodLiteral<"samba">, z.ZodLiteral<"url">]>;
|
|
4555
|
+
}, "strip", z.ZodTypeAny, {
|
|
4556
|
+
path: string;
|
|
4557
|
+
name: string;
|
|
4558
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4559
|
+
}, {
|
|
4560
|
+
path: string;
|
|
4561
|
+
name: string;
|
|
4562
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4563
|
+
}>, "many">;
|
|
4564
|
+
}, "strip", z.ZodTypeAny, {
|
|
4565
|
+
code: number;
|
|
4566
|
+
list: {
|
|
4567
|
+
path: string;
|
|
4568
|
+
name: string;
|
|
4569
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4570
|
+
}[];
|
|
4571
|
+
}, {
|
|
4572
|
+
code: number;
|
|
4573
|
+
list: {
|
|
4574
|
+
path: string;
|
|
4575
|
+
name: string;
|
|
4576
|
+
storage: "url" | "flash" | "SD0" | "ftp" | "samba";
|
|
4577
|
+
}[];
|
|
4578
|
+
}> | z.ZodObject<{
|
|
4579
|
+
code: z.ZodNumber;
|
|
4580
|
+
list: z.ZodArray<z.ZodObject<{
|
|
4581
|
+
name: z.ZodString;
|
|
4582
|
+
path: z.ZodString;
|
|
4583
|
+
storage: z.ZodUnion<[z.ZodLiteral<"flash">, z.ZodLiteral<"SD0">]>;
|
|
4584
|
+
}, "strip", z.ZodTypeAny, {
|
|
4585
|
+
path: string;
|
|
4586
|
+
name: string;
|
|
4587
|
+
storage: "flash" | "SD0";
|
|
4588
|
+
}, {
|
|
4589
|
+
path: string;
|
|
4590
|
+
name: string;
|
|
4591
|
+
storage: "flash" | "SD0";
|
|
4592
|
+
}>, "many">;
|
|
4593
|
+
}, "strip", z.ZodTypeAny, {
|
|
4594
|
+
code: number;
|
|
4595
|
+
list: {
|
|
4596
|
+
path: string;
|
|
4597
|
+
name: string;
|
|
4598
|
+
storage: "flash" | "SD0";
|
|
4599
|
+
}[];
|
|
4600
|
+
}, {
|
|
4601
|
+
code: number;
|
|
4602
|
+
list: {
|
|
4603
|
+
path: string;
|
|
4604
|
+
name: string;
|
|
4605
|
+
storage: "flash" | "SD0";
|
|
4606
|
+
}[];
|
|
4607
|
+
}>;
|
|
4608
|
+
export type TImageFileData = z.infer<typeof imageFileDataSchema>;
|
|
4609
|
+
export type TFontFileData = z.infer<typeof fontFileDataSchema>;
|
|
4610
|
+
export type TFileData<T extends TFileType> = T extends 'image' ? TImageFileData : TFontFileData;
|
|
4330
4611
|
export type TOverlayListItem = z.infer<typeof overlaySchema>;
|