@camera.ui/browser 0.0.100 → 0.0.102

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 (33) hide show
  1. package/dist/bundle.js +2 -1
  2. package/dist/bundle.js.LICENSE.txt +23 -0
  3. package/dist/types/packages/client/browser/src/types.d.ts +1 -0
  4. package/dist/types/packages/plugineer/src/polyglot/node/camera/index.d.ts +2 -1
  5. package/dist/types/packages/plugineer/src/polyglot/node/camera/iou.d.ts +1 -1
  6. package/dist/types/packages/plugineer/src/polyglot/node/camera/polygon.d.ts +1 -2
  7. package/dist/types/packages/plugineer/src/polyglot/node/plugins/types.d.ts +4 -0
  8. package/dist/types/packages/types/src/index.d.ts +8 -4
  9. package/dist/types/server/src/api/database/checks.d.ts +55 -0
  10. package/dist/types/server/src/api/database/index.d.ts +2 -1
  11. package/dist/types/server/src/api/database/migration.d.ts +1 -0
  12. package/dist/types/server/src/api/database/selfcheck.d.ts +48 -0
  13. package/dist/types/server/src/api/schemas/cameras.schema.d.ts +26 -26
  14. package/dist/types/server/src/api/schemas/users.schema.d.ts +34 -34
  15. package/dist/types/server/src/api/services/cameras.service.d.ts +1 -0
  16. package/dist/types/server/src/api/services/plugins.service.d.ts +1 -0
  17. package/dist/types/server/src/api/types/index.d.ts +0 -5
  18. package/dist/types/server/src/api/websocket/nsp/logs.d.ts +7 -1
  19. package/dist/types/server/src/api/websocket/nsp/metrics.d.ts +1 -1
  20. package/dist/types/server/src/api/websocket/nsp/status.d.ts +1 -1
  21. package/dist/types/server/src/api.d.ts +5 -14
  22. package/dist/types/server/src/camera/controller.d.ts +16 -3
  23. package/dist/types/server/src/{decoder/worker.d.ts → camera/frameWorker.d.ts} +8 -5
  24. package/dist/types/server/src/plugins/index.d.ts +2 -4
  25. package/dist/types/server/src/plugins/plugin.d.ts +5 -0
  26. package/dist/types/server/src/plugins/worker.d.ts +16 -2
  27. package/dist/types/server/src/services/config/constants.d.ts +1 -0
  28. package/dist/types/server/src/services/config/index.d.ts +11 -2
  29. package/dist/types/server/src/services/config/types.d.ts +7 -0
  30. package/dist/types/shared/types/index.d.ts +0 -1
  31. package/package.json +4 -4
  32. package/dist/types/server/src/decoder/index.d.ts +0 -11
  33. package/dist/types/server/src/decoder/types.d.ts +0 -7
@@ -33,7 +33,7 @@ export declare const userPreferencesCamviewViewsLayout: zod.ZodObject<{
33
33
  type: "dnd" | "view";
34
34
  _id: string;
35
35
  name: string;
36
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
36
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
37
37
  cameras: {
38
38
  cameraId: string;
39
39
  index: number;
@@ -41,7 +41,7 @@ export declare const userPreferencesCamviewViewsLayout: zod.ZodObject<{
41
41
  }, {
42
42
  type: "dnd" | "view";
43
43
  name: string;
44
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
44
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
45
45
  cameras: {
46
46
  cameraId: string;
47
47
  index: number;
@@ -63,14 +63,14 @@ export declare const patchPreferencesCamviewViewsLayout: zod.ZodOptional<zod.Zod
63
63
  }>, "many">>;
64
64
  }, "strip", zod.ZodTypeAny, {
65
65
  name?: string | undefined;
66
- viewSize?: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26 | undefined;
66
+ viewSize?: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26 | undefined;
67
67
  cameras?: {
68
68
  cameraId: string;
69
69
  index: number;
70
70
  }[] | undefined;
71
71
  }, {
72
72
  name?: string | undefined;
73
- viewSize?: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26 | undefined;
73
+ viewSize?: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26 | undefined;
74
74
  cameras?: {
75
75
  cameraId: string;
76
76
  index: number;
@@ -96,7 +96,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
96
96
  type: "dnd" | "view";
97
97
  _id: string;
98
98
  name: string;
99
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
99
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
100
100
  cameras: {
101
101
  cameraId: string;
102
102
  index: number;
@@ -104,7 +104,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
104
104
  }, {
105
105
  type: "dnd" | "view";
106
106
  name: string;
107
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
107
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
108
108
  cameras: {
109
109
  cameraId: string;
110
110
  index: number;
@@ -116,7 +116,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
116
116
  type: "dnd" | "view";
117
117
  _id: string;
118
118
  name: string;
119
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
119
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
120
120
  cameras: {
121
121
  cameraId: string;
122
122
  index: number;
@@ -126,7 +126,7 @@ export declare const userPreferencesCamview: zod.ZodObject<{
126
126
  views: {
127
127
  type: "dnd" | "view";
128
128
  name: string;
129
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
129
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
130
130
  cameras: {
131
131
  cameraId: string;
132
132
  index: number;
@@ -256,7 +256,7 @@ export declare const userPreferences: zod.ZodObject<{
256
256
  type: "dnd" | "view";
257
257
  _id: string;
258
258
  name: string;
259
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
259
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
260
260
  cameras: {
261
261
  cameraId: string;
262
262
  index: number;
@@ -264,7 +264,7 @@ export declare const userPreferences: zod.ZodObject<{
264
264
  }, {
265
265
  type: "dnd" | "view";
266
266
  name: string;
267
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
267
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
268
268
  cameras: {
269
269
  cameraId: string;
270
270
  index: number;
@@ -276,7 +276,7 @@ export declare const userPreferences: zod.ZodObject<{
276
276
  type: "dnd" | "view";
277
277
  _id: string;
278
278
  name: string;
279
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
279
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
280
280
  cameras: {
281
281
  cameraId: string;
282
282
  index: number;
@@ -286,7 +286,7 @@ export declare const userPreferences: zod.ZodObject<{
286
286
  views: {
287
287
  type: "dnd" | "view";
288
288
  name: string;
289
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
289
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
290
290
  cameras: {
291
291
  cameraId: string;
292
292
  index: number;
@@ -358,7 +358,7 @@ export declare const userPreferences: zod.ZodObject<{
358
358
  type: "dnd" | "view";
359
359
  _id: string;
360
360
  name: string;
361
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
361
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
362
362
  cameras: {
363
363
  cameraId: string;
364
364
  index: number;
@@ -380,7 +380,7 @@ export declare const userPreferences: zod.ZodObject<{
380
380
  views: {
381
381
  type: "dnd" | "view";
382
382
  name: string;
383
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
383
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
384
384
  cameras: {
385
385
  cameraId: string;
386
386
  index: number;
@@ -420,7 +420,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
420
420
  type: "dnd" | "view";
421
421
  _id: string;
422
422
  name: string;
423
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
423
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
424
424
  cameras: {
425
425
  cameraId: string;
426
426
  index: number;
@@ -428,7 +428,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
428
428
  }, {
429
429
  type: "dnd" | "view";
430
430
  name: string;
431
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
431
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
432
432
  cameras: {
433
433
  cameraId: string;
434
434
  index: number;
@@ -440,7 +440,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
440
440
  type: "dnd" | "view";
441
441
  _id: string;
442
442
  name: string;
443
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
443
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
444
444
  cameras: {
445
445
  cameraId: string;
446
446
  index: number;
@@ -450,7 +450,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
450
450
  views: {
451
451
  type: "dnd" | "view";
452
452
  name: string;
453
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
453
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
454
454
  cameras: {
455
455
  cameraId: string;
456
456
  index: number;
@@ -522,7 +522,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
522
522
  type: "dnd" | "view";
523
523
  _id: string;
524
524
  name: string;
525
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
525
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
526
526
  cameras: {
527
527
  cameraId: string;
528
528
  index: number;
@@ -544,7 +544,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
544
544
  views: {
545
545
  type: "dnd" | "view";
546
546
  name: string;
547
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
547
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
548
548
  cameras: {
549
549
  cameraId: string;
550
550
  index: number;
@@ -579,7 +579,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
579
579
  type: "dnd" | "view";
580
580
  _id: string;
581
581
  name: string;
582
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
582
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
583
583
  cameras: {
584
584
  cameraId: string;
585
585
  index: number;
@@ -612,7 +612,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
612
612
  views: {
613
613
  type: "dnd" | "view";
614
614
  name: string;
615
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
615
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
616
616
  cameras: {
617
617
  cameraId: string;
618
618
  index: number;
@@ -647,7 +647,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
647
647
  type: "dnd" | "view";
648
648
  _id: string;
649
649
  name: string;
650
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
650
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
651
651
  cameras: {
652
652
  cameraId: string;
653
653
  index: number;
@@ -680,7 +680,7 @@ export declare const createUserSchema: zod.ZodEffects<zod.ZodObject<{
680
680
  views: {
681
681
  type: "dnd" | "view";
682
682
  name: string;
683
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
683
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
684
684
  cameras: {
685
685
  cameraId: string;
686
686
  index: number;
@@ -734,7 +734,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
734
734
  type: "dnd" | "view";
735
735
  _id: string;
736
736
  name: string;
737
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
737
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
738
738
  cameras: {
739
739
  cameraId: string;
740
740
  index: number;
@@ -742,7 +742,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
742
742
  }, {
743
743
  type: "dnd" | "view";
744
744
  name: string;
745
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
745
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
746
746
  cameras: {
747
747
  cameraId: string;
748
748
  index: number;
@@ -754,7 +754,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
754
754
  type: "dnd" | "view";
755
755
  _id: string;
756
756
  name: string;
757
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
757
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
758
758
  cameras: {
759
759
  cameraId: string;
760
760
  index: number;
@@ -764,7 +764,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
764
764
  views: {
765
765
  type: "dnd" | "view";
766
766
  name: string;
767
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
767
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
768
768
  cameras: {
769
769
  cameraId: string;
770
770
  index: number;
@@ -836,7 +836,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
836
836
  type: "dnd" | "view";
837
837
  _id: string;
838
838
  name: string;
839
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
839
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
840
840
  cameras: {
841
841
  cameraId: string;
842
842
  index: number;
@@ -858,7 +858,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
858
858
  views: {
859
859
  type: "dnd" | "view";
860
860
  name: string;
861
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
861
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
862
862
  cameras: {
863
863
  cameraId: string;
864
864
  index: number;
@@ -893,7 +893,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
893
893
  type: "dnd" | "view";
894
894
  _id: string;
895
895
  name: string;
896
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
896
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
897
897
  cameras: {
898
898
  cameraId: string;
899
899
  index: number;
@@ -926,7 +926,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
926
926
  views: {
927
927
  type: "dnd" | "view";
928
928
  name: string;
929
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
929
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
930
930
  cameras: {
931
931
  cameraId: string;
932
932
  index: number;
@@ -961,7 +961,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
961
961
  type: "dnd" | "view";
962
962
  _id: string;
963
963
  name: string;
964
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
964
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
965
965
  cameras: {
966
966
  cameraId: string;
967
967
  index: number;
@@ -994,7 +994,7 @@ export declare const patchUserSchema: zod.ZodEffects<zod.ZodObject<{
994
994
  views: {
995
995
  type: "dnd" | "view";
996
996
  name: string;
997
- viewSize: 1 | 4 | 6 | 16 | 20 | 12 | 10 | 7 | 9 | 13 | 15 | 26;
997
+ viewSize: 1 | 4 | 6 | 9 | 10 | 16 | 20 | 12 | 7 | 13 | 15 | 26;
998
998
  cameras: {
999
999
  cameraId: string;
1000
1000
  index: number;
@@ -49,6 +49,7 @@ export declare class CamerasService {
49
49
  private generateRTSPUrls;
50
50
  private generateWWWUrls;
51
51
  private extensionIsEnabled;
52
+ private isExtendedMotionDetector;
52
53
  private defaultZone;
53
54
  private convertToDetectionZones;
54
55
  private isInternalSource;
@@ -12,6 +12,7 @@ export declare class PluginsService {
12
12
  getPluginProcessByName(pluginName: string): PluginWorker | undefined;
13
13
  getPluginProcessById(id: string): PluginWorker | undefined;
14
14
  installedPlugins(): Plugin[];
15
+ installedPluginsByIdentifier(): string[];
15
16
  installedPluginProcesses(): PluginWorker[];
16
17
  listPluginDb(): DBPlugin[];
17
18
  getPluginDbByName(pluginName: string): DBPlugin | undefined;
@@ -183,11 +183,6 @@ export interface PaginationQuery {
183
183
  export type PaginationRequest = {
184
184
  Querystring: PaginationQuery;
185
185
  };
186
- export type DownloadLogRequest = {
187
- Querystring: {
188
- filter?: string;
189
- };
190
- };
191
186
  export type AuthParamsRequest = {
192
187
  Params: {
193
188
  id: string;
@@ -4,8 +4,14 @@ export declare class LogsNamespace {
4
4
  nsp: Namespace;
5
5
  nspName: SocketNsp;
6
6
  private nativeTail?;
7
+ private api;
7
8
  private configService;
9
+ private pluginManager;
8
10
  constructor(io: Server);
9
- connect(socket: Socket, filter?: string[]): void;
11
+ getAllLogs(socket: Socket): void;
12
+ getCameraLog(socket: Socket, cameraName: string): void;
13
+ getPluginLog(socket: Socket, pluginName: string): void;
10
14
  private tailLogFromFileNative;
15
+ private removeName;
16
+ private removeBracketedContent;
11
17
  }
@@ -3,8 +3,8 @@ import type { ProcessInfo, ServerProcesses, SocketNsp, WorkerProcesses } from '.
3
3
  export declare class MetricsNamespace {
4
4
  nsp: Namespace;
5
5
  nspName: SocketNsp;
6
+ private api;
6
7
  private pluginManager;
7
- private frameManager;
8
8
  private go2rtc;
9
9
  private natsServer;
10
10
  private processServerHistory;
@@ -3,9 +3,9 @@ import type { ServerRuntime, SocketNsp, WorkerRuntime } from '../types.js';
3
3
  export declare class StatusNamespace {
4
4
  nsp: Namespace;
5
5
  nspName: SocketNsp;
6
+ private api;
6
7
  private configService;
7
8
  private pluginManager;
8
- private frameManager;
9
9
  private go2rtc;
10
10
  private natsServer;
11
11
  constructor(io: Server);
@@ -3,7 +3,6 @@ import { EventEmitter } from 'node:events';
3
3
  import { CameraController } from './camera/controller.js';
4
4
  import type { Camera, CameraExtension } from '@camera.ui/types';
5
5
  import type { CameraExtensions } from './api/database/types.js';
6
- import type { FrameWorker } from './decoder/worker.js';
7
6
  export declare enum API_EVENT {
8
7
  FINISH_LAUNCHING = "finishLaunching",
9
8
  SHUTDOWN = "shutdown"
@@ -15,23 +14,15 @@ export declare interface CameraUiAPI {
15
14
  emit(event: 'shutdown'): boolean;
16
15
  }
17
16
  export declare class CameraUiAPI extends EventEmitter {
18
- private camerasMap;
17
+ private cameraControllers;
19
18
  constructor();
20
19
  configureCameras(): Promise<void>;
21
- addCamera(camera: Camera): Promise<{
22
- controller: CameraController;
23
- worker: FrameWorker;
24
- }>;
25
- getCamera(cameraId: string): {
26
- controller: CameraController;
27
- worker: FrameWorker;
28
- } | undefined;
29
- getCameras(pluginId?: string): {
30
- controller: CameraController;
31
- worker: FrameWorker;
32
- }[];
20
+ addCamera(camera: Camera): Promise<CameraController>;
21
+ getCamera(cameraIdOrName: string): CameraController | undefined;
22
+ getCameras(pluginId?: string): CameraController[];
33
23
  updateCamera(camera: Camera): void;
34
24
  removeCamera(camera: Camera, extensions: CameraExtensions): Promise<void>;
35
25
  selectCamera(pluginId: string, camera: Camera, extension: CameraExtension): void;
36
26
  deselectCamera(pluginId: string, camera: Camera, extension: CameraExtension): void;
27
+ writeCameraLog(cameraId: string, msg: string): void;
37
28
  }
@@ -1,25 +1,32 @@
1
1
  import { CameraDevice, CameraPrebufferInterface, CameraPTZInterface } from '@camera.ui/plugineer';
2
2
  import type { Logger } from '@camera.ui/common/logger';
3
3
  import type { Camera, CameraConfigInputSettings, CameraDelegate, CameraDeviceInternalSource, CameraDeviceSource, MotionFrame, ProbeStream, SetValues, VideoFrame } from '@camera.ui/types';
4
- import type { ProxyServer } from '../nats/index.js';
4
+ import { FrameWorker } from './frameWorker.js';
5
5
  export declare class CameraController extends CameraDevice {
6
- readonly proxy: ProxyServer;
6
+ readonly frameWorker: FrameWorker;
7
7
  readonly streamInfos: Map<string, ProbeStream>;
8
+ private logStream?;
8
9
  private motionTimeout?;
9
10
  private objectTimeout?;
10
11
  private objectTimeoutDuration;
11
12
  private doorbellTimeout?;
12
13
  private doorbellTimeoutDuration;
14
+ private proxyServer;
13
15
  private go2rtcApi;
16
+ private configService;
17
+ private api;
18
+ private truncateInterval?;
19
+ private truncateIntervalMs;
14
20
  protected cameraDelegate: CameraDelegate;
15
21
  protected ptzDelegate: CameraPTZInterface;
16
22
  protected prebufferDelegate: CameraPrebufferInterface;
23
+ get logPath(): string;
17
24
  get streamSource(): CameraDeviceSource;
18
25
  get camera(): Camera;
19
26
  get sources(): CameraDeviceSource[];
20
27
  get internalSources(): CameraDeviceInternalSource[];
21
28
  private get _sources();
22
- constructor(camera: Camera, logger: Logger, proxy: ProxyServer);
29
+ constructor(camera: Camera, logger: Logger);
23
30
  setDelegate(): void;
24
31
  getFrames(): AsyncIterableIterator<VideoFrame>;
25
32
  getMotionFrames(): AsyncIterableIterator<MotionFrame>;
@@ -32,6 +39,8 @@ export declare class CameraController extends CameraDevice {
32
39
  removeCameraSource(sourceId: string): Promise<void>;
33
40
  updateCamera(updatedCamera: Camera): void;
34
41
  cleanup(): void;
42
+ writeLog(...args: any[]): void;
43
+ private internalLog;
35
44
  private subscribeToCameraState;
36
45
  private subscribeToCameraChanges;
37
46
  private subscribeToStateChanges;
@@ -46,4 +55,8 @@ export declare class CameraController extends CameraDevice {
46
55
  private getAudioCodecProperties;
47
56
  private getVideoCodecProperties;
48
57
  private generateSdp;
58
+ private createLogStream;
59
+ private closeLogStream;
60
+ private removeLogStream;
61
+ private truncateLog;
49
62
  }
@@ -1,7 +1,7 @@
1
1
  import { Subscribed } from '@camera.ui/common';
2
2
  import { PLUGIN_STATUS } from '@camera.ui/plugineer';
3
3
  import type { AuthConfig } from '@camera.ui/plugineer';
4
- import type { CameraController } from '../camera/controller.js';
4
+ import type { CameraController } from './controller.js';
5
5
  export declare class FrameWorker extends Subscribed {
6
6
  readonly frameWorkerId: string;
7
7
  name: string;
@@ -11,10 +11,11 @@ export declare class FrameWorker extends Subscribed {
11
11
  private publisher?;
12
12
  private subscriber?;
13
13
  private coreManager;
14
- private logger;
14
+ private frameWorkerLogger;
15
+ private processLogger;
15
16
  private configService;
16
17
  private socketService;
17
- private cameraDevice;
18
+ private cameraController;
18
19
  private frameWorker?;
19
20
  private initialized;
20
21
  private stopped;
@@ -25,16 +26,18 @@ export declare class FrameWorker extends Subscribed {
25
26
  private py;
26
27
  private _status;
27
28
  get status(): PLUGIN_STATUS;
28
- constructor(cameraDevice: CameraController, proxyEndpoints: string[], auth: AuthConfig);
29
+ constructor(cameraController: CameraController, proxyEndpoints: string[], auth: AuthConfig);
29
30
  start(): Promise<void>;
30
31
  close(): Promise<void>;
31
32
  restart(): Promise<void>;
32
33
  getPID(): number;
33
34
  private startWorker;
34
35
  private restartWorker;
36
+ private reset;
35
37
  private killWorker;
36
38
  private sendMessage;
37
39
  private onChildMessage;
38
40
  private setStatus;
39
- private getLogPrefix;
41
+ private internalLog;
42
+ private createPythonPath;
40
43
  }
@@ -1,16 +1,14 @@
1
1
  import 'reflect-metadata';
2
2
  import { Plugin } from './plugin.js';
3
- import { PluginWorker } from './worker.js';
4
3
  import type { IPackageJson } from '../api/types/index.js';
5
4
  export declare class PluginManager {
6
5
  private logger;
7
6
  private api;
8
7
  private configService;
9
- private pythonVersionsToInstall;
10
8
  installedPythonVersions: Set<string>;
11
- plugins: Map<string, Plugin>;
12
- pluginWorkers: Map<string, PluginWorker>;
13
9
  searchPaths: Set<string>;
10
+ plugins: Map<string, Plugin>;
11
+ pluginIdentifiers: Set<string>;
14
12
  constructor();
15
13
  static isQualifiedPluginIdentifier(pluginName: string): boolean;
16
14
  static extractPluginScope(pluginName: string): string | undefined;
@@ -1,5 +1,7 @@
1
1
  import { PythonInstaller } from '@camera.ui/plugineer';
2
+ import { PluginWorker } from './worker.js';
2
3
  import type { PluginContract } from '@camera.ui/plugineer';
4
+ import type { CameraExtension } from '@camera.ui/types';
3
5
  import type { CameraUiPlugin, IPackageJson } from '../api/types/index.js';
4
6
  export declare class Plugin {
5
7
  private logger;
@@ -19,11 +21,14 @@ export declare class Plugin {
19
21
  readonly configFile: string;
20
22
  readonly storagePath: string;
21
23
  readonly py: PythonInstaller;
24
+ readonly logPath: string;
25
+ readonly worker: PluginWorker;
22
26
  get contract(): PluginContract;
23
27
  get info(): CameraUiPlugin;
24
28
  set info(value: CameraUiPlugin);
25
29
  get disabled(): boolean;
26
30
  set disabled(value: boolean);
31
+ get type(): CameraExtension[];
27
32
  constructor(pluginName: string, installPath: string, packageJSON: IPackageJson, pluginId: string, scope?: string);
28
33
  load(): Promise<void>;
29
34
  reparsePackageJson(): void;
@@ -4,8 +4,11 @@ export declare class PluginWorker {
4
4
  plugin: Plugin;
5
5
  private pluginWorker?;
6
6
  private proxyServer;
7
+ private logStream?;
7
8
  private api;
8
- private logger;
9
+ private mainLogger;
10
+ private pluginLogger;
11
+ private processLogger;
9
12
  private configService;
10
13
  private socketService;
11
14
  private pluginManager;
@@ -15,16 +18,20 @@ export declare class PluginWorker {
15
18
  private targetSubject;
16
19
  private started;
17
20
  private shuttingDown;
21
+ private truncateInterval?;
22
+ private truncateIntervalMs;
18
23
  private _status;
19
24
  get status(): PLUGIN_STATUS;
20
25
  constructor(plugin: Plugin);
21
26
  start(): Promise<void>;
22
27
  teardown(): Promise<void>;
23
- destroy(): void;
28
+ destroy(): Promise<void>;
24
29
  restart(): Promise<void>;
30
+ disable(): void;
25
31
  getPID(): number;
26
32
  isRunning(): boolean;
27
33
  isReady(): boolean;
34
+ cleanup(): Promise<void>;
28
35
  private gatherDevices;
29
36
  private kill;
30
37
  private setStatus;
@@ -33,5 +40,12 @@ export declare class PluginWorker {
33
40
  private reset;
34
41
  private updatePython;
35
42
  private onChildMessage;
43
+ private createPythonPath;
44
+ writeLog(...args: any[]): void;
45
+ private internalLog;
46
+ private createLogStream;
47
+ private closeLogStream;
48
+ private removeLogStream;
49
+ private truncateLog;
36
50
  private cleanedProcessEnv;
37
51
  }
@@ -1,5 +1,6 @@
1
1
  import type { IceServer } from '@camera.ui/types';
2
2
  import type { Go2RtcConfig, IConfig } from './types.js';
3
+ export declare const PROCESS_IDENTIFIER = "--id=camera.ui";
3
4
  export declare const APP_NAME: any;
4
5
  export declare const DEFAULT_ICE_SERVERS: IceServer[];
5
6
  export declare const DEFAULT_CONFIG: IConfig;
@@ -1,9 +1,11 @@
1
1
  import 'reflect-metadata';
2
2
  import type { LoggerOptions } from '@camera.ui/common/logger';
3
+ import type { ProcInfo } from '../../api/database/checks.js';
3
4
  import type { DeepPartial } from '../../types.js';
4
- import type { Go2RtcConfig, IConfig, Secrets } from './types.js';
5
+ import type { EnvironmentInfo, Go2RtcConfig, IConfig, Secrets } from './types.js';
5
6
  export declare class ConfigService {
6
7
  static get VERSION(): string;
8
+ static get ENVIRONMENT(): EnvironmentInfo;
7
9
  static readonly NODE_VERSION: string;
8
10
  static readonly MIN_NODE_VERSION: string;
9
11
  static readonly INSTALL_PATH: string | null;
@@ -15,12 +17,15 @@ export declare class ConfigService {
15
17
  readonly SECRETS: Secrets;
16
18
  readonly HOME_PATH: string;
17
19
  readonly STORAGE_PATH: string;
20
+ readonly LOGS_PATH: string;
21
+ readonly PIDS_FILE: string;
18
22
  readonly DATABASE_PATH: string;
19
23
  readonly TOKENS_PATH: string;
20
24
  readonly USERS_STORAGE_PATH: string;
21
- readonly TMP_DIR: string;
25
+ readonly TMP_PATH: string;
22
26
  readonly PLUGINS_STORAGE_PATH: string;
23
27
  readonly PLUGINS_INSTALL_PATH: string;
28
+ readonly REPORTS_FILE: string;
24
29
  readonly LOG_FILE: string;
25
30
  readonly CONFIG_FILE: string;
26
31
  readonly SECRETS_FILE: string;
@@ -42,6 +47,10 @@ export declare class ConfigService {
42
47
  writeGo2RtcConfigApi(newConfig?: DeepPartial<Go2RtcConfig>): Promise<void>;
43
48
  mergeGo2RtcConfig(): Promise<void>;
44
49
  updateGo2RtcWebRtcFilter(serverAddresses: string[], oldAddresses?: string[], api?: boolean): Promise<void>;
50
+ addProc(proc: ProcInfo): void;
51
+ removeProcByPID(pid?: number): void;
52
+ getProcs(): ProcInfo[];
53
+ setProcs(pids: ProcInfo[]): void;
45
54
  private defaultConfig;
46
55
  private defaultGo2RtcConfig;
47
56
  private readConfig;
@@ -1,4 +1,11 @@
1
1
  import type { IceServer } from '@camera.ui/types';
2
+ export interface EnvironmentInfo {
3
+ development: boolean;
4
+ docker: boolean;
5
+ electron: boolean;
6
+ homeassistant: boolean;
7
+ serviceMode: boolean;
8
+ }
2
9
  export interface Secrets {
3
10
  jwtAccessKey: string;
4
11
  jwtRefreshKey: string;