@camera.ui/browser 0.0.111 → 0.0.113

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.
Files changed (51) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +10 -1
  3. package/dist/index.d.ts +1269 -0
  4. package/dist/index.js +4179 -0
  5. package/package.json +55 -39
  6. package/CHANGELOG.md +0 -8
  7. package/dist/bundle.js +0 -2
  8. package/dist/bundle.js.LICENSE.txt +0 -14
  9. package/dist/types/packages/client/browser/src/api.d.ts +0 -8
  10. package/dist/types/packages/client/browser/src/client.d.ts +0 -21
  11. package/dist/types/packages/client/browser/src/index.d.ts +0 -2
  12. package/dist/types/packages/client/browser/src/proxy/cameraDevice.d.ts +0 -26
  13. package/dist/types/packages/client/browser/src/proxy/coreManager.d.ts +0 -14
  14. package/dist/types/packages/client/browser/src/proxy/deviceManager.d.ts +0 -16
  15. package/dist/types/packages/client/browser/src/proxy/index.d.ts +0 -3
  16. package/dist/types/packages/client/browser/src/proxy.d.ts +0 -7
  17. package/dist/types/packages/client/browser/src/streaming/config.d.ts +0 -21
  18. package/dist/types/packages/client/browser/src/streaming/go2rts-session.d.ts +0 -286
  19. package/dist/types/packages/client/browser/src/streaming/types.d.ts +0 -38
  20. package/dist/types/packages/client/browser/src/types.d.ts +0 -56
  21. package/dist/types/packages/client/browser/src/utils.d.ts +0 -12
  22. package/dist/types/packages/common/src/utils/subscribed.d.ts +0 -18
  23. package/dist/types/packages/types/src/index.d.ts +0 -812
  24. package/dist/types/server/src/api/database/types.d.ts +0 -80
  25. package/dist/types/server/src/api/go2rtc/types.d.ts +0 -147
  26. package/dist/types/server/src/api/schemas/backup.schema.d.ts +0 -211
  27. package/dist/types/server/src/api/schemas/cameras.schema.d.ts +0 -1864
  28. package/dist/types/server/src/api/schemas/config.schema.d.ts +0 -102
  29. package/dist/types/server/src/api/schemas/go2rtc.schema.d.ts +0 -735
  30. package/dist/types/server/src/api/schemas/plugins.schema.d.ts +0 -72
  31. package/dist/types/server/src/api/schemas/storage.schema.d.ts +0 -22
  32. package/dist/types/server/src/api/schemas/system.schema.d.ts +0 -185
  33. package/dist/types/server/src/api/schemas/users.schema.d.ts +0 -857
  34. package/dist/types/server/src/api/types/index.d.ts +0 -612
  35. package/dist/types/server/src/api/websocket/types.d.ts +0 -43
  36. package/dist/types/server/src/camera/classes.d.ts +0 -2
  37. package/dist/types/server/src/camera/index.d.ts +0 -92
  38. package/dist/types/server/src/camera/interfaces.d.ts +0 -17
  39. package/dist/types/server/src/camera/iou.d.ts +0 -2
  40. package/dist/types/server/src/camera/polygon.d.ts +0 -4
  41. package/dist/types/server/src/camera/types.d.ts +0 -17
  42. package/dist/types/server/src/go2rtc/types.d.ts +0 -15
  43. package/dist/types/server/src/manager/types.d.ts +0 -15
  44. package/dist/types/server/src/plugins/schema.d.ts +0 -27
  45. package/dist/types/server/src/plugins/types.d.ts +0 -49
  46. package/dist/types/server/src/rpc/namespaces.d.ts +0 -35
  47. package/dist/types/server/src/rpc/types.d.ts +0 -111
  48. package/dist/types/server/src/services/config/defaults.d.ts +0 -12
  49. package/dist/types/server/src/services/config/types.d.ts +0 -162
  50. package/dist/types/server/src/types.d.ts +0 -34
  51. package/dist/types/shared/types/index.d.ts +0 -22
@@ -1,612 +0,0 @@
1
- import type { AuthConfig } from '@camera.ui/rpc-common';
2
- import type { CameraExtension, CameraExtensions, DetectionZone, ProbeConfig, SchemaConfig } from '@camera.ui/types';
3
- import type { Readable } from 'node:stream';
4
- import type { PLUGIN_STATUS, PluginContract } from '../../plugins/types.js';
5
- import type { LoggingLevel } from '../../services/config/types.js';
6
- import type { DBCamera, DBCamviewLayout, DBRoles, DBUser } from '../database/types.js';
7
- import type { ApplicationResponse, DeviceSourceType } from '../go2rtc/types.js';
8
- import type { RestoreBackupInput } from '../schemas/backup.schema.js';
9
- import type { CreateCameraInput, PairCameraInput, PatchCameraInput, PreviewCameraInput } from '../schemas/cameras.schema.js';
10
- import type { PatchConfigInput } from '../schemas/config.schema.js';
11
- import type { PatchGo2RtcConfigInput } from '../schemas/go2rtc.schema.js';
12
- import type { DetectAudioInput, DetectMotionInput, DetectObjectInput } from '../schemas/plugins.schema.js';
13
- import type { PatchStorateInput, SetStorageInput, SubmitStorageInput } from '../schemas/storage.schema.js';
14
- import type { PatchSystemInput } from '../schemas/system.schema.js';
15
- import type { CreateShortcutInput, CreateUserInput, CreateViewInput, LoginUserInput, PatchShortcutInput, PatchUserInput, PatchViewInput } from '../schemas/users.schema.js';
16
- export interface BusboyFileStream extends Readable {
17
- truncated: boolean;
18
- bytesRead: number;
19
- }
20
- export interface UiNotification {
21
- _id: string;
22
- title: string;
23
- text: string;
24
- timestamp: number;
25
- type: LoggingLevel;
26
- link?: string;
27
- }
28
- export interface JwtTokenEncoded {
29
- readonly _id: string;
30
- access_token: string;
31
- refresh_token: string;
32
- token_type: string;
33
- expires_in: number;
34
- expires_at: Date;
35
- }
36
- export interface UserData extends JwtTokenEncoded {
37
- username: string;
38
- avatar: string;
39
- role: DBRoles;
40
- rememberMe: boolean;
41
- singleSession: boolean;
42
- firstLogin: boolean;
43
- sessionTimer: number;
44
- }
45
- export interface JwtPayload {
46
- _id: string;
47
- username: string;
48
- rememberMe: boolean;
49
- sessionTimer: number;
50
- }
51
- export interface JwtRefreshPayload {
52
- _id: string;
53
- }
54
- export interface ClientData {
55
- _id: string;
56
- access_token: string;
57
- address?: string;
58
- device?: string;
59
- }
60
- export declare const enum REFRESH_TOKEN {
61
- EXPIRES_IN = "7d"
62
- }
63
- export interface CameraCamviewSettings {
64
- enabled: boolean;
65
- mode: InterfaceStreamMode;
66
- imageRefreshTimer: number;
67
- }
68
- export type InterfaceStreamMode = 'live' | 'snapshot';
69
- export interface JwtTokenDecoded {
70
- _id: string;
71
- username: string;
72
- rememberMe: boolean;
73
- sessionTimer: number;
74
- exp: Readonly<number>;
75
- iat: Readonly<number>;
76
- }
77
- export interface JwtRefreshTokenDecoded {
78
- _id: string;
79
- expires_in: number;
80
- expires_at: Date;
81
- exp: Readonly<number>;
82
- iat: Readonly<number>;
83
- }
84
- export interface JwtTokenResponse {
85
- access_token: string;
86
- refresh_token: string;
87
- }
88
- export interface JwtTokenClientData {
89
- token: JwtTokenEncoded;
90
- clientData?: ClientData;
91
- }
92
- export type LogoutResponse = 'OK';
93
- export interface SessionResponse {
94
- status: 'OK';
95
- statusCode: undefined;
96
- message: undefined;
97
- }
98
- export interface SessionExpiredResponse {
99
- status: undefined;
100
- statusCode: number;
101
- message: string;
102
- }
103
- export type SessionStatus = SessionResponse | SessionExpiredResponse;
104
- export interface Pagination {
105
- pageSize: number;
106
- startIndex: number;
107
- endIndex: number;
108
- totalItems: number;
109
- currentPage: number;
110
- totalPages: number;
111
- nextPageQuery?: string | null;
112
- prevPageQuery?: string | null;
113
- }
114
- export interface PaginationResponse {
115
- pagination: Pagination;
116
- result: any[];
117
- }
118
- export interface UsersResponse {
119
- pagination: Pagination;
120
- result: DBUser[];
121
- }
122
- export interface ViewsResponse {
123
- pagination: Pagination;
124
- result: DBCamviewLayout[];
125
- }
126
- export interface CamerasResponse {
127
- pagination: Pagination;
128
- result: DBCamera[];
129
- }
130
- export interface PluginExtension {
131
- pluginName: string;
132
- displayName: string;
133
- type: CameraExtension[];
134
- }
135
- export interface PluginExtensionConfig extends PluginExtension, SchemaConfig {
136
- }
137
- export interface ExtensionsResponse {
138
- pagination: Pagination;
139
- result: PluginExtension[];
140
- }
141
- export interface PluginsResponse {
142
- pagination: Pagination;
143
- result: CameraUiPlugin[];
144
- }
145
- export interface FrameWorkerResponse {
146
- pagination: Pagination;
147
- result: FrameWorker[];
148
- }
149
- export interface PluginContractCamera {
150
- name: string;
151
- extensions: CameraExtensions;
152
- }
153
- export interface PluginContractResponse {
154
- contract: PluginContract;
155
- cameras: PluginContractCamera[];
156
- }
157
- export interface Go2RtcInfoAuth {
158
- username: string;
159
- password: string;
160
- }
161
- export interface Go2RtcInfo {
162
- url: string;
163
- wsURL: string;
164
- port: number;
165
- info: ApplicationResponse;
166
- auth: Partial<Go2RtcInfoAuth>;
167
- }
168
- export interface NatsInfo {
169
- auth: AuthConfig;
170
- }
171
- export interface TokenClientDataResponse {
172
- pagination: Pagination;
173
- result: JwtTokenClientData[];
174
- }
175
- export interface PaginationQuery {
176
- start?: number;
177
- page?: number;
178
- pageSize?: number;
179
- }
180
- export interface PaginationRequest {
181
- Querystring: PaginationQuery;
182
- }
183
- export interface AuthParamsRequest {
184
- Params: {
185
- id: string;
186
- username?: string;
187
- };
188
- }
189
- export interface AuthLoginRequest {
190
- Querystring: {
191
- username?: string;
192
- password?: string;
193
- token?: string;
194
- };
195
- }
196
- export interface AuthNewLoginRequest {
197
- Body: LoginUserInput;
198
- }
199
- export interface AuthRefreshRequest {
200
- Body: {
201
- refresh_token: string;
202
- };
203
- }
204
- export interface CamerasParamsRequest {
205
- Params: {
206
- cameraname: string;
207
- };
208
- }
209
- export interface CamerasStreamRequest {
210
- Params: {
211
- cameraid: string;
212
- sourcename: string;
213
- };
214
- }
215
- export interface CameraSnapshotQueryRequest {
216
- Querystring: {
217
- forceNew?: boolean;
218
- };
219
- }
220
- export interface CameraDiscoverQueryRequest {
221
- Querystring: {
222
- type?: DeviceSourceType;
223
- src?: string;
224
- };
225
- }
226
- export interface CameraProbeSourceQueryRequest {
227
- Querystring: ProbeConfig;
228
- }
229
- export interface CameraSourceParamsRequest {
230
- Params: {
231
- sourcename: string;
232
- };
233
- }
234
- export interface CamerasParamsIdRequest {
235
- Params: {
236
- cameraid: string;
237
- };
238
- }
239
- export interface CamerasExtensionsParamsRequest {
240
- Params: {
241
- cameraname: string;
242
- pluginname: string;
243
- scope?: string;
244
- };
245
- }
246
- export interface CamerasExtensionsRequest {
247
- Querystring: {
248
- type: CameraExtension;
249
- };
250
- }
251
- export interface CameraZoneInsertPatchRequest {
252
- Body: DetectionZone[];
253
- }
254
- export interface CamerasInsertRequest {
255
- Body: CreateCameraInput;
256
- }
257
- export interface CameraPairRequest {
258
- Body: PairCameraInput;
259
- }
260
- export interface CamerasPreviewRequest {
261
- Body: PreviewCameraInput;
262
- }
263
- export interface CamerasPatchRequest {
264
- Body: PatchCameraInput;
265
- }
266
- export interface StoragePatchRequest {
267
- Body: PatchStorateInput;
268
- }
269
- export interface StorageSetRequest {
270
- Body: SetStorageInput;
271
- }
272
- export interface StorageSubmitRequest {
273
- Body: SubmitStorageInput;
274
- }
275
- export interface ConfigRequest {
276
- Querystring: {
277
- json?: boolean;
278
- };
279
- }
280
- export interface ConfigPatchRequest {
281
- Body: PatchConfigInput;
282
- }
283
- export interface Go2RtcConfigPatchRequest {
284
- Body: PatchGo2RtcConfigInput;
285
- }
286
- export interface FilesParamsRequest {
287
- Params: {
288
- file: string;
289
- };
290
- }
291
- export interface PluginsParamsIdRequest {
292
- Params: {
293
- pluginid: string;
294
- };
295
- }
296
- export interface PluginsParamsNameRequest {
297
- Params: {
298
- scope?: string;
299
- pluginname: string;
300
- };
301
- }
302
- export interface FrameWorkerParamsNameRequest {
303
- Params: {
304
- frameworkername: string;
305
- };
306
- }
307
- export interface PluginsParamsRemoveRequest {
308
- Querystring: {
309
- removeStorage?: boolean;
310
- };
311
- }
312
- export interface PluginsQuery {
313
- pluginname?: string;
314
- pluginversion?: string;
315
- }
316
- export interface PluginsQueryRequest {
317
- Querystring: PluginsQuery;
318
- }
319
- export interface PluginsInsertRequest {
320
- Body: {
321
- pluginname: string;
322
- pluginversion?: string;
323
- };
324
- }
325
- export interface PluginsConfigPatchRequest {
326
- Body: Record<string, any>;
327
- }
328
- export interface PluginsActionRequest {
329
- Body: {
330
- actionId: string;
331
- payload: any;
332
- };
333
- }
334
- export interface PluginsDetectMotionRequest {
335
- Body: DetectMotionInput;
336
- }
337
- export interface PluginsDetectObjectRequest {
338
- Body: DetectObjectInput;
339
- }
340
- export interface PluginsDetectAudioRequest {
341
- Body: DetectAudioInput;
342
- }
343
- export interface PluginsInterfaceQueryType {
344
- type: 'objectDetection' | 'motionDetection' | 'audioDetection';
345
- }
346
- export interface UsersParamsRequest {
347
- Params: {
348
- username: string;
349
- };
350
- }
351
- export interface UsersInsertRequest {
352
- Body: CreateUserInput & {
353
- avatar: string;
354
- };
355
- }
356
- export interface UsersPatchRequest {
357
- Body: PatchUserInput & {
358
- avatar: string;
359
- };
360
- }
361
- export interface SystemPatchRequest {
362
- Body: PatchSystemInput;
363
- }
364
- export interface ServerUpdateRequest {
365
- Body: {
366
- version: string;
367
- };
368
- }
369
- export interface ViewsParamsRequest {
370
- Params: {
371
- viewid: string;
372
- };
373
- }
374
- export interface ViewsInsertRequest {
375
- Body: CreateViewInput;
376
- }
377
- export interface ViewsPatchRequest {
378
- Body: PatchViewInput;
379
- }
380
- export interface ShortcutParamsRequest {
381
- Params: {
382
- shortcutid: string;
383
- };
384
- }
385
- export interface ShortcutInsertRequest {
386
- Body: CreateShortcutInput;
387
- }
388
- export interface ShortcutPatchRequest {
389
- Body: PatchShortcutInput;
390
- }
391
- export interface BackupCreateRequest {
392
- Body: {
393
- localStorage: Partial<UiLocalStorage>;
394
- };
395
- }
396
- export interface PluginBackupInfo {
397
- id: string;
398
- name: string;
399
- version: string;
400
- }
401
- export interface BackupInfo {
402
- timestamp: number;
403
- platform: string;
404
- node: string;
405
- version: string;
406
- plugins: PluginBackupInfo[];
407
- localStorage: Partial<UiLocalStorage>;
408
- }
409
- export interface BackupStorage {
410
- backupDirectory: string;
411
- backupFile: string;
412
- backupFileName: string;
413
- }
414
- export type SupportedLanguageAbbreviatons = 'de' | 'en';
415
- export type SupportedThemes = 'light' | 'dark';
416
- export interface ConfigSettings {
417
- zoom: number;
418
- }
419
- export interface ConsoleSettings {
420
- zoom: number;
421
- }
422
- export type CamviewSettingsLayoutMode = 'dnd' | 'view';
423
- export type SettingsViews = 'account' | 'appearance' | 'user' | 'recordings' | 'backup' | 'system';
424
- export interface CamviewSettings {
425
- dragDisabled?: boolean;
426
- viewid?: string;
427
- }
428
- export interface CamerasSettings {
429
- showEvents: boolean;
430
- }
431
- export interface InterfaceSettinges {
432
- showBottomBarOnMobile: boolean;
433
- selectedSettingsView: SettingsViews;
434
- navbarStayCollapsed: boolean;
435
- }
436
- export interface UiSettingsLocalStorage {
437
- cameras: CamerasSettings;
438
- camview: CamviewSettings;
439
- config: ConfigSettings;
440
- console: ConsoleSettings;
441
- interface: InterfaceSettinges;
442
- }
443
- export interface ThemeLocalStorage {
444
- theme: SupportedThemes;
445
- autoMode: boolean;
446
- }
447
- export interface UiLocalStorage {
448
- ui: UiSettingsLocalStorage;
449
- theme: ThemeLocalStorage;
450
- locale: SupportedLanguageAbbreviatons;
451
- }
452
- export interface BackupRestoreRequest {
453
- Body: RestoreBackupInput;
454
- }
455
- export interface INpmPluginState {
456
- updateAvailable: boolean;
457
- betaUpdateAvailable: boolean;
458
- lastUpdated?: string;
459
- latestVersion?: string;
460
- }
461
- export interface INpmPerson {
462
- name?: string;
463
- email?: string;
464
- homepage?: string;
465
- username?: string;
466
- url?: string;
467
- }
468
- export interface IPackageJson {
469
- name: string;
470
- displayName?: string;
471
- version: string;
472
- description?: string;
473
- keywords?: string[];
474
- homepage?: string;
475
- bugs?: string | {
476
- email?: string;
477
- url?: string;
478
- };
479
- license?: string;
480
- author?: string | INpmPerson;
481
- maintainers?: INpmPerson[];
482
- contributors?: string[] | INpmPerson[];
483
- files?: string[];
484
- main?: string;
485
- bin?: string | Record<string, string>;
486
- repository?: string | {
487
- type: string;
488
- url: string;
489
- };
490
- scripts?: Record<string, string>;
491
- dependencies?: Record<string, string>;
492
- devDependencies?: Record<string, string>;
493
- peerDependencies?: Record<string, string>;
494
- optionalDependencies?: Record<string, string>;
495
- bundledDependencies?: string[];
496
- engines?: Record<string, string>;
497
- os?: string[];
498
- cpu?: string[];
499
- preferGlobal?: boolean;
500
- private?: boolean;
501
- publishConfig?: {
502
- registry?: string;
503
- };
504
- exports?: Record<string, any>;
505
- type?: 'module';
506
- 'camera.ui'?: PluginContract;
507
- }
508
- export interface INpmRegistryModule {
509
- _id: string;
510
- _rev: string;
511
- name: string;
512
- 'dist-tags': {
513
- latest: string;
514
- [key: string]: string;
515
- };
516
- versions: Record<string, IPackageJson>;
517
- time: {
518
- created: string;
519
- modified: string;
520
- [key: string]: string;
521
- };
522
- maintainers: INpmPerson[];
523
- description: string;
524
- homepage: string;
525
- keywords: string[];
526
- repository: {
527
- type: string;
528
- url: string;
529
- };
530
- author: INpmPerson;
531
- bugs: {
532
- email?: string;
533
- url?: string;
534
- };
535
- license: string;
536
- readme: string;
537
- readmeFilename: string;
538
- }
539
- export interface INpmSearchResults {
540
- objects: INpmSearchResultItem[];
541
- }
542
- export interface INpmSearchResultItem {
543
- package: {
544
- name: string;
545
- scoped: string;
546
- version: string;
547
- description: string;
548
- keywords: string[];
549
- date: string;
550
- links: {
551
- npm: string;
552
- homebridge?: string;
553
- repository?: string;
554
- bugs?: string;
555
- };
556
- author: INpmPerson;
557
- publisher: INpmPerson;
558
- maintainers: INpmPerson[];
559
- };
560
- flags: {
561
- unstable: boolean;
562
- };
563
- score: {
564
- final: number;
565
- detail: {
566
- quality: number;
567
- popularity: number;
568
- maintenance: number;
569
- };
570
- };
571
- searchScore: number;
572
- }
573
- export interface PluginLinks {
574
- npm: string;
575
- homepage: string;
576
- }
577
- export interface PluginEngines {
578
- node: string;
579
- 'camera.ui': string;
580
- }
581
- export interface CameraUiPlugin {
582
- id: string;
583
- pluginName: string;
584
- private: boolean;
585
- displayName: string;
586
- description?: string;
587
- publicPackage?: boolean;
588
- installedVersion?: string;
589
- latestVersion?: string;
590
- lastUpdated?: string;
591
- availableVersions?: string[];
592
- installPath?: string;
593
- globalInstall?: boolean;
594
- disabled?: boolean;
595
- links?: {
596
- npm?: string;
597
- homepage?: string;
598
- bugs?: string;
599
- };
600
- author?: string;
601
- engines?: {
602
- 'camera.ui'?: string;
603
- node?: string;
604
- };
605
- 'camera.ui': PluginContract;
606
- isPython: boolean;
607
- isNode: boolean;
608
- }
609
- export interface FrameWorker {
610
- name: string;
611
- status: PLUGIN_STATUS;
612
- }
@@ -1,43 +0,0 @@
1
- import type { Namespace } from 'socket.io';
2
- import type { PLUGIN_STATUS } from '../../plugins/types.js';
3
- import type { RuntimeInfo } from '../../services/config/types.js';
4
- export type SocketNsp = '/camera.ui' | '/metrics' | '/logs' | '/status' | '/notifications' | '/plugins' | '/server';
5
- export interface SocketNspMap {
6
- nsp: Namespace;
7
- [key: string]: any;
8
- }
9
- export type ProcessType = 'system' | 'core' | 'frameworker' | 'plugin';
10
- export interface ProcessInfo {
11
- name: string;
12
- pid?: number;
13
- cpuLoad: string;
14
- memLoad: string;
15
- type: ProcessType;
16
- timestamp: number;
17
- }
18
- export interface ServerProcessInfo {
19
- 'camera.ui': ProcessInfo;
20
- go2rtc: ProcessInfo;
21
- nats: ProcessInfo;
22
- }
23
- export interface ServerProcesses {
24
- 'camera.ui': ProcessInfo[];
25
- go2rtc: ProcessInfo[];
26
- nats: ProcessInfo[];
27
- }
28
- export type WorkerProcessInfo = Record<string, ProcessInfo>;
29
- export type WorkerProcesses = Record<string, ProcessInfo[]>;
30
- export interface AllProcesses extends ServerProcessInfo {
31
- plugins: WorkerProcessInfo;
32
- workers: WorkerProcessInfo;
33
- }
34
- export interface PluginRuntimeInfo {
35
- name: string;
36
- status: PLUGIN_STATUS;
37
- }
38
- export interface ServerRuntime {
39
- 'camera.ui'?: RuntimeInfo;
40
- go2rtc?: RuntimeInfo;
41
- nats?: RuntimeInfo;
42
- }
43
- export type WorkerRuntime = Record<string, PluginRuntimeInfo>;
@@ -1,2 +0,0 @@
1
- import type { Detection } from '@camera.ui/types';
2
- export declare function transformLabels(detections: Detection[]): Detection[];