@3deye-toolkit/react-event-list 0.0.3 → 0.0.5

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.
@@ -2,7 +2,6 @@ import { BehaviorSubject } from 'rxjs';
2
2
  import crossfilter from 'crossfilter2';
3
3
  import type { IReactionDisposer } from 'mobx';
4
4
  import { Observable } from 'rxjs';
5
- import { default as React_2 } from 'react';
6
5
  import { Subject } from 'rxjs';
7
6
  import { Subscription } from 'rxjs';
8
7
 
@@ -33,13 +32,13 @@ declare class AllEventsLoaderFilters implements EventsLoaderFilters {
33
32
  }
34
33
 
35
34
  export declare class AllEventsStore extends ApiStore {
36
- api: ExtendedApi;
37
- cameraFilters: Camera[];
35
+ cameraFilters: CameraOption[];
38
36
  objectFilters: DetectedObjectOption[];
39
37
  eventTypeFilters: EventTypeOption[];
40
38
  date: Date | null;
41
- setDate: (date: Date) => Date;
39
+ setDate: (date: Date | null) => void;
42
40
  clearDate: () => void;
41
+ resetDate: () => void;
43
42
  sortDirection: 'ASC' | 'DESC';
44
43
  probabilityThreshold: number;
45
44
  colors: Set<string>;
@@ -71,11 +70,12 @@ declare class Api<T extends DeepPartial<IApi>> {
71
70
  event: string;
72
71
  data: any;
73
72
  }>;
74
- logging: boolean;
73
+ logLevel: LOG_LEVEL;
75
74
  authStore: Auth;
76
75
  createConnection: (accessToken: string) => Connection;
77
76
  apiConfig: PartialApi;
78
77
  constructor(apiConfig: T, authStore: Auth, createConnection: (accessToken: string) => Connection);
78
+ log: (level: LOG_LEVEL, ...args: unknown[]) => void;
79
79
  connect(token: Token): void;
80
80
  shutdownConnection(): void;
81
81
  private init;
@@ -187,7 +187,7 @@ declare class Camera {
187
187
  get supportsWebRTC(): boolean;
188
188
  constructor(raw: RawCamera);
189
189
  update: (raw: RawCamera) => void;
190
- can: (permission: CameraPermissions) => number;
190
+ can: (permission: CameraPermissions) => boolean;
191
191
  }
192
192
 
193
193
  declare interface CameraAddress {
@@ -218,6 +218,12 @@ declare class CameraEvent {
218
218
  constructor(raw: RawSensorEvent);
219
219
  }
220
220
 
221
+ declare interface CameraOption {
222
+ type: 'camera';
223
+ value: number;
224
+ label: string;
225
+ }
226
+
221
227
  declare const enum CameraPermissions {
222
228
  View = 1,
223
229
  SaveClip = 2,
@@ -279,7 +285,7 @@ declare interface Connection {
279
285
  proxies: {
280
286
  [P in keyof typeof FULL_API_CONFIG]: {
281
287
  on: (eventName: string, callback: (data: any) => void) => void;
282
- invoke: any;
288
+ invoke: (...params: unknown[]) => any;
283
289
  };
284
290
  };
285
291
  createHubProxy: (hubName: string) => void;
@@ -310,14 +316,14 @@ declare type DetectedObject = Car | LicensePlate | {
310
316
  };
311
317
 
312
318
  declare interface DetectedObjectOption {
313
- id: string;
314
- name: string;
319
+ value: string;
320
+ label: string;
315
321
  color: string;
316
322
  highlightColor: string;
317
323
  type: 'detectedObject';
318
324
  }
319
325
 
320
- declare const EventList: React_2.FC<Props>;
326
+ declare const EventList: React.FC<Props>;
321
327
  export default EventList;
322
328
 
323
329
  declare const events: {
@@ -345,7 +351,7 @@ declare class EventsLoader extends ApiStore {
345
351
  }[];
346
352
  liveUpdateMode: 'manual' | 'auto' | 'disabled';
347
353
  disposables: (IReactionDisposer | Subscription)[];
348
- pageInfo: PageInfo_2 | null;
354
+ pageInfo: PageInfo | null;
349
355
  loading: boolean;
350
356
  loadMoreTrigger: number;
351
357
  retryTrigger: number;
@@ -357,7 +363,7 @@ declare class EventsLoader extends ApiStore {
357
363
  objectIdx: number;
358
364
  }[]);
359
365
  flushUpdates: () => void;
360
- setLiveUpdateMode: (mode: 'manual' | 'auto' | 'disabled') => void;
366
+ setLiveUpdateMode: (mode: "manual" | "auto" | "disabled") => void;
361
367
  load: () => void;
362
368
  reload: () => void;
363
369
  loadMore: () => void;
@@ -407,7 +413,6 @@ declare class EventsStore extends ApiStore {
407
413
  eventsByType: crossfilter.Dimension<CameraEvent, EventType>;
408
414
  eventsByFoundObjects: crossfilter.Dimension<CameraEvent, string>;
409
415
  eventsByColor: crossfilter.Dimension<CameraEvent, string>;
410
- eventsByLiveliness: crossfilter.Dimension<CameraEvent, boolean>;
411
416
  pendingRequests: crossfilter.Crossfilter<PendingRequest>;
412
417
  pendingRequestsByEnd: crossfilter.Dimension<PendingRequest, number>;
413
418
  pendingRequestsByStart: crossfilter.Dimension<PendingRequest, number>;
@@ -418,6 +423,7 @@ declare class EventsStore extends ApiStore {
418
423
  knownIntervalsByEnd: crossfilter.Dimension<Interval, number>;
419
424
  eventsById: Map<number, CameraEvent>;
420
425
  updates: number;
426
+ updatesByCameraId: Map<number, number>;
421
427
  /**
422
428
  * Contains recent additions to the store as list of event ids
423
429
  * NOTE: do not update several times in single action as we lose info about intermediate additions that way
@@ -452,6 +458,7 @@ declare class EventsStore extends ApiStore {
452
458
  misc: boolean;
453
459
  };
454
460
  }): CameraEvent;
461
+ getRunningEvent(cameraId: number): CameraEvent | undefined;
455
462
  getFirstNonAnalyticEventAfter({ cameraId, date }: {
456
463
  cameraId: number;
457
464
  date: Date;
@@ -475,17 +482,11 @@ declare class EventsStore extends ApiStore {
475
482
  declare type EventType = 'Motion' | 'Tampering' | 'PanTiltZoom' | 'CrossLine' | 'Intrusion' | 'LicensePlate' | 'FaceDetection' | 'Audio' | 'Analytic' | 'SpeedDetection' | 'PeopleCounter' | 'Temperature' | 'PoS' | 'GPS' | 'DigitalInput' | 'Normal' | 'Suspicious' | 'Loitering' | 'Vandalism' | 'Trespass' | 'Emergency' | 'LifeInDanger' | 'ErroneousAlert' | 'Misidentification' | 'Fire' | 'MedicalDuress' | 'HoldUp' | 'CheckIn' | 'CheckOut' | 'ClockIn' | 'ClockOut' | 'ParkingStart' | 'ParkingEnd' | 'ParkingViolation' | 'GateAccess' | 'DoorAccess' | 'TemperatureCheck' | 'IDCheck' | 'PPECheck' | 'WelfareCheck' | 'VehicleBreakIn' | 'DrugTrafficking' | 'Assault' | 'PackageDelivery' | 'Uncategorized';
476
483
 
477
484
  declare interface EventTypeOption {
478
- id: SensorEventType;
479
- name: string;
485
+ value: SensorEventType;
486
+ label: string;
480
487
  type: 'eventType';
481
488
  }
482
489
 
483
- declare type ExtendedApi = Api<IApi> & IApi & {
484
- archives: {
485
- GetLongLastingTimeLaps: (cameraId: number) => Observable<any>;
486
- };
487
- };
488
-
489
490
  declare type ExtractHubs<T, K> = {
490
491
  [P in keyof ExtractMethods<T, K>]: ExtractMethods<T[P], K[P]>;
491
492
  };
@@ -566,7 +567,7 @@ declare interface IApi {
566
567
  UpdateCamgroup: (params: any) => Observable<ApiResult<RawCamgroup>>;
567
568
  };
568
569
  sound: {
569
- GetPushSoundServiceUrl: (id: number) => Observable<any>;
570
+ GetPushSoundServiceUrl: (id: number) => Observable<ApiResult<string>>;
570
571
  };
571
572
  thumbnails: {
572
573
  GetThumbnailsInfo: (params: {
@@ -602,21 +603,20 @@ declare interface Interval {
602
603
  declare interface LicensePlate {
603
604
  Type: 'LicensePlate';
604
605
  Value: string;
605
- Number: string;
606
606
  ParentIndex: number;
607
607
  Box: BoundingBox;
608
608
  Probability: number;
609
609
  }
610
610
 
611
- declare type OptionType = Camera | EventTypeOption | DetectedObjectOption;
612
-
613
- declare interface PageInfo {
614
- isDescending: boolean;
615
- nextPageToken: number;
616
- haveMore: boolean;
611
+ declare enum LOG_LEVEL {
612
+ INFO = 0,
613
+ WARN = 1,
614
+ ERROR = 2
617
615
  }
618
616
 
619
- declare interface PageInfo_2 {
617
+ declare type OptionType = CameraOption | EventTypeOption | DetectedObjectOption;
618
+
619
+ declare interface PageInfo {
620
620
  isDescending: boolean;
621
621
  nextPageToken: number;
622
622
  haveMore: boolean;
@@ -633,7 +633,7 @@ declare interface PendingRequest {
633
633
  request: Observable<any>;
634
634
  }
635
635
 
636
- declare interface Props extends React_2.HTMLAttributes<HTMLDivElement> {
636
+ declare interface Props extends React.HTMLAttributes<HTMLDivElement> {
637
637
  onEventClick: (event: CameraEvent) => void;
638
638
  }
639
639
 
@@ -851,21 +851,21 @@ declare interface SensorEventsRequest {
851
851
  }
852
852
 
853
853
  declare enum SensorEventType {
854
- Motion = 0,
855
- Tampering = 1,
856
- PanTiltZoom = 2,
857
- CrossLine = 3,
858
- Intrusion = 4,
859
- LicensePlate = 5,
860
- FaceDetection = 6,
861
- Audio = 7,
862
- Analytic = 8,
863
- SpeedDetection = 9,
864
- PeopleCounter = 10,
865
- Temperature = 11,
866
- PoS = 12,
867
- GPS = 13,
868
- DigitalInput = 14,
854
+ Motion = 0,// Has duration
855
+ Tampering = 1,// Has duration
856
+ PanTiltZoom = 2,// Has duration
857
+ CrossLine = 3,// Has duration
858
+ Intrusion = 4,// Has duration
859
+ LicensePlate = 5,// Instant
860
+ FaceDetection = 6,// Instant
861
+ Audio = 7,// Has duration
862
+ Analytic = 8,// Instant, has data
863
+ SpeedDetection = 9,// Instant, has data
864
+ PeopleCounter = 10,// Instant, has data
865
+ Temperature = 11,// Instant, has data
866
+ PoS = 12,// Instant, ? has data. Point of Sale transaction event
867
+ GPS = 13,// Instant, has data. GPS coordinates event
868
+ DigitalInput = 14,// Instant
869
869
  Normal = 15,
870
870
  Suspicious = 16,
871
871
  Loitering = 17,