@3deye-toolkit/react-event-search 0.0.1-alpha.21

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.
@@ -0,0 +1,945 @@
1
+ import { app } from '@3deye-toolkit/core';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import crossfilter from 'crossfilter2';
4
+ import { IReactionDisposer } from 'mobx';
5
+ import { Observable } from 'rxjs';
6
+ import { default as React_2 } from 'react';
7
+ import { Subject } from 'rxjs';
8
+ import { Subscription } from 'rxjs';
9
+
10
+ declare class Api<T> {
11
+ [key: string]: any;
12
+ static create<T extends PartialApi>(apiConfig: T | null, authStore: Auth, createConnection: (accessToken: string) => Connection): Api<T> & ExtractHubs<IApi, T>;
13
+ connectionShutdown$: Subject<null>;
14
+ connection$: BehaviorSubject<Connection | null>;
15
+ events: Subject<{
16
+ hub: keyof typeof events;
17
+ event: string;
18
+ data: any;
19
+ }>;
20
+ logging: boolean;
21
+ authStore: Auth;
22
+ createConnection: (accessToken: string) => Connection;
23
+ apiConfig: PartialApi;
24
+ constructor(apiConfig: T, authStore: Auth, createConnection: (accessToken: string) => Connection);
25
+ connect(token: Token): void;
26
+ shutdownConnection(): void;
27
+ private init;
28
+ private createHubMethod;
29
+ private subscribeToEvents;
30
+ }
31
+
32
+ declare type ApiPageResult<T> = {
33
+ success: true;
34
+ resultItems: T[];
35
+ pageInfo: PageInfo;
36
+ } | {
37
+ success: false;
38
+ error: {
39
+ code: number;
40
+ message: string;
41
+ };
42
+ };
43
+
44
+ declare type ApiResult<T> = {
45
+ success: true;
46
+ resultItems: T[];
47
+ } | {
48
+ success: false;
49
+ error: {
50
+ code: number;
51
+ message: string;
52
+ };
53
+ };
54
+
55
+ declare abstract class ApiStore {
56
+ api: Api<IApi> & IApi;
57
+ disposables: (IReactionDisposer | Subscription)[];
58
+ protected afterInit?(): void;
59
+ initWith(api: Api<IApi> & IApi): void;
60
+ dispose(): void;
61
+ }
62
+
63
+ declare class Auth {
64
+ token: Token | null;
65
+ isAuthenticating: boolean;
66
+ storage: Storage_2;
67
+ tokenServiceUrl: string;
68
+ tokenStorageKey: string;
69
+ widgetTokenServiceUrl?: string;
70
+ deviceInfo: string | null;
71
+ clientId: string;
72
+ private pendingUpdateTokenRequest;
73
+ get isAuthenticated(): boolean;
74
+ constructor({ tokenServiceUrl, widgetTokenServiceUrl, storage, tokenStorageKey, deviceInfo, clientId }: AuthStoreOptions);
75
+ signOut: () => void;
76
+ signIn: ({ username, password, tokenToKick, agreedWithTerms }: {
77
+ username: string;
78
+ password: string;
79
+ tokenToKick?: string | undefined;
80
+ agreedWithTerms?: boolean | undefined;
81
+ }) => Promise<Token> | undefined;
82
+ invalidateToken: () => void;
83
+ getTokenFromStorage(): Promise<Token | null>;
84
+ private storeToken;
85
+ private getInitialToken;
86
+ private fetchTokenBy;
87
+ private updateToken;
88
+ private fetchWidgetToken;
89
+ }
90
+
91
+ declare interface AuthStoreOptions {
92
+ tokenServiceUrl: string;
93
+ widgetTokenServiceUrl?: string;
94
+ storage: Storage_2;
95
+ tokenStorageKey: string;
96
+ deviceInfo: any;
97
+ clientId: string;
98
+ }
99
+
100
+ declare interface Box {
101
+ Top: number;
102
+ Left: number;
103
+ Bottom: number;
104
+ Right: number;
105
+ }
106
+
107
+ declare class Camera {
108
+ id: number;
109
+ name: string;
110
+ imageUrl: string;
111
+ streamUrl: string;
112
+ dashStreamUrl: string;
113
+ address: {
114
+ Lat: number;
115
+ Lng: number;
116
+ } | null;
117
+ archiveDuration: number;
118
+ dvrWindowLength: number;
119
+ stateUpdatedAt: Date;
120
+ raw: RawCamera;
121
+ enabled: boolean;
122
+ isMicEnabled: boolean;
123
+ state: string;
124
+ pin: string;
125
+ webRtcUrl: string;
126
+ isPtz: boolean;
127
+ permissions: number;
128
+ get isOnline(): boolean;
129
+ get supportsWebRTC(): boolean;
130
+ constructor(raw: RawCamera);
131
+ update: (raw: RawCamera) => void;
132
+ }
133
+
134
+ declare class CameraEvent {
135
+ cameraId: number;
136
+ type: EventType;
137
+ raw: RawSensorEvent;
138
+ thumbnailUrl: string;
139
+ detectedObjects: DetectedObject[];
140
+ faces: Face[];
141
+ instant: boolean;
142
+ get id(): number;
143
+ get startTime(): Date;
144
+ get endTime(): Date;
145
+ get isLive(): boolean;
146
+ get acknowledged(): boolean;
147
+ constructor(raw: RawSensorEvent);
148
+ }
149
+
150
+ declare class CamerasStore extends ApiStore {
151
+ camerasById: Map<number, Camera>;
152
+ data: Camera[];
153
+ loading: boolean;
154
+ loaded: boolean;
155
+ constructor();
156
+ load: () => Observable<RawCamera[]> | undefined;
157
+ add: (cameras: RawCamera[]) => void;
158
+ sync: () => void;
159
+ fetchPermissions(): Promise<void>;
160
+ protected afterInit(): void;
161
+ dispose(): void;
162
+ }
163
+
164
+ declare interface CameraStatistics {
165
+ id: number;
166
+ month: number;
167
+ trafficOutMBytes: number;
168
+ archiveStorageMBytes: number;
169
+ clipStorageMBytes: number;
170
+ }
171
+
172
+ declare interface CamgroupItem {
173
+ id: number;
174
+ order: number;
175
+ }
176
+
177
+ declare interface Connection {
178
+ state: CONNECTION_STATE;
179
+ stop: () => void;
180
+ start: () => Connection;
181
+ done: (callback: () => void) => Connection;
182
+ fail: (callback: (err: any) => void) => Connection;
183
+ error: (callback: (err: any) => void) => Connection;
184
+ disconnected: (callback: () => void) => Connection;
185
+ reconnecting: (callback: () => void) => Connection;
186
+ reconnected: (callback: () => void) => Connection;
187
+ proxies: {
188
+ [P in keyof typeof FULL_API_CONFIG]: {
189
+ on: (eventName: string, callback: (data: any) => void) => void;
190
+ invoke: any;
191
+ };
192
+ };
193
+ createHubProxy: (hubName: string) => void;
194
+ lastError: any;
195
+ qs: {
196
+ access_token: string;
197
+ };
198
+ }
199
+
200
+ declare enum CONNECTION_STATE {
201
+ CONNECTING = 0,
202
+ CONNECTED = 1,
203
+ RECONNECTING = 2,
204
+ DISCONNECTED = 3
205
+ }
206
+
207
+ export declare const createEventSearchStore: (appInstance?: typeof app) => EventSearchStore;
208
+
209
+ declare type DeepPartial<T> = {
210
+ [K in keyof T]?: DeepPartial<T[K]>;
211
+ };
212
+
213
+ declare interface DetectedObject {
214
+ Type: string;
215
+ Box: {
216
+ Left: number;
217
+ Top: number;
218
+ Right: number;
219
+ Bottom: number;
220
+ };
221
+ Probability: number;
222
+ Colors: {
223
+ Color: string;
224
+ }[];
225
+ }
226
+
227
+ declare interface EventOption {
228
+ id: string;
229
+ name: string;
230
+ color: string;
231
+ highlightColor: string;
232
+ isEventType: boolean;
233
+ }
234
+
235
+ declare const events: {
236
+ [P in keyof PartialApi]: Array<{
237
+ name: string;
238
+ explicit?: boolean;
239
+ }>;
240
+ };
241
+
242
+ declare class EventSchemaStore extends ApiStore {
243
+ schemaDescription: SchemaDescriptionParameter[];
244
+ constructor();
245
+ get foundObjectTypes(): string[];
246
+ get foundObjectTypesForSelect(): {
247
+ id: EventType;
248
+ name: string;
249
+ color: string;
250
+ highlightColor: any;
251
+ isEventType: boolean;
252
+ }[];
253
+ get colorsByFoundObjectType(): Map<string, string>;
254
+ fetchAnalyticEventSchema: () => void;
255
+ protected afterInit(): void;
256
+ dispose(): void;
257
+ }
258
+
259
+ declare const EventSearch: React_2.FC<Props>;
260
+ export default EventSearch;
261
+
262
+ declare class EventSearchStore extends ApiStore {
263
+ eventSchema: EventSchemaStore;
264
+ events: EventsStore;
265
+ private notification;
266
+ private heatmaps?;
267
+ api: ExtendedApi;
268
+ disposables: (IReactionDisposer | Subscription)[];
269
+ readonly analyticsEnabled: boolean;
270
+ disposeReactionToCamera: any;
271
+ cameraId: number | null;
272
+ date: Date | null;
273
+ regions: {
274
+ x: number;
275
+ y: number;
276
+ }[][] | null;
277
+ filters: EventOption[];
278
+ colors: Set<string>;
279
+ peopleCountingDataLoading: boolean;
280
+ heatmapHidden: boolean;
281
+ heatmapLoading: boolean;
282
+ data: CameraEvent[];
283
+ heatmap: Heatmap | null;
284
+ peopleCountingData: RawPeopleContingData[];
285
+ probabilityThreshold: number;
286
+ brushFilter: null | [Date, Date];
287
+ eventsLoader: EventsLoader;
288
+ get params(): SchemaDescriptionParameter[];
289
+ get filteredData(): CameraEvent[];
290
+ get filteredPeopleCountingData(): RawPeopleContingData[];
291
+ constructor(eventSchema: EventSchemaStore, events: EventsStore, notification: NotificationService, heatmaps?: HeatmapsStore | undefined);
292
+ setDate: (value: Date) => void;
293
+ setFilters: (filters: EventOption[]) => void;
294
+ getProbabilityThreshold: () => number;
295
+ setProbabilityThreshold: (value: number) => void;
296
+ setBrushFilter: (value: [Date, Date] | null) => void;
297
+ setParams: ({ cameraId, box }: {
298
+ cameraId: number;
299
+ box: Box;
300
+ }) => void;
301
+ openForPlayer: (cameraId: number) => void;
302
+ searchFullFrame: (cameraId: number) => void;
303
+ setRegions: (polies: {
304
+ x: number;
305
+ y: number;
306
+ }[][]) => void;
307
+ toggleHeatmap: () => void;
308
+ toggleColor: (color: string) => void;
309
+ clearColors: () => void;
310
+ clear: () => void;
311
+ initDataFetching: () => void;
312
+ /**
313
+ * given region as array of vertices in normalized coordinates
314
+ * returns its representation in WKT: https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry
315
+ * @param region
316
+ */
317
+ regionToWktPolygon(region: {
318
+ x: number;
319
+ y: number;
320
+ }[]): string;
321
+ boxRegions(regions: {
322
+ x: number;
323
+ y: number;
324
+ }[][]): {
325
+ Left: number;
326
+ Right: number;
327
+ Top: number;
328
+ Bottom: number;
329
+ };
330
+ afterInit(): void;
331
+ dispose(): void;
332
+ }
333
+
334
+ declare class EventsLoader extends ApiStore {
335
+ private eventsStore;
336
+ api: ExtendedApi;
337
+ data: CameraEvent[];
338
+ pendingData: CameraEvent[];
339
+ liveUpdateMode: 'manual' | 'auto' | 'disabled';
340
+ updateTrigger: number;
341
+ colors: Set<string>;
342
+ disposables: (IReactionDisposer | Subscription)[];
343
+ pageInfo: PageInfo_2 | null;
344
+ loading: boolean;
345
+ loadMoreTrigger: number;
346
+ retryTrigger: number;
347
+ error: Error | null;
348
+ sortDirection: 'ASC' | 'DESC';
349
+ probabilityThreshold: null | number;
350
+ from?: Date;
351
+ to?: Date;
352
+ cameras: number[];
353
+ detectedObjects: string[];
354
+ polygons: string[];
355
+ eventTypes: SensorEventType[];
356
+ private loadingInited;
357
+ get isLive(): boolean;
358
+ get totalCount(): number;
359
+ get filterJson(): string | null;
360
+ constructor(eventsStore: EventsStore);
361
+ flushUpdates: () => void;
362
+ load: () => void;
363
+ reload: () => void;
364
+ loadMore: () => void;
365
+ private requestData;
366
+ private initDataLoading;
367
+ private initLiveUpdates;
368
+ private filter;
369
+ /**
370
+ * Joins to arrays leaving only unique events
371
+ * TODO: check if using map only on joint is more efficient
372
+ *
373
+ * requested events current data
374
+ * [ ] [ ]
375
+ * [common events]
376
+ * @param arr1
377
+ * @param arr2
378
+ */
379
+ uniquelyConcat(arr1: CameraEvent[], arr2: CameraEvent[]): CameraEvent[];
380
+ dispose(): void;
381
+ }
382
+
383
+ declare interface EventsQuery {
384
+ cameraIds?: number[];
385
+ eventTypes?: EventType[];
386
+ from: Date;
387
+ to: Date | null;
388
+ detectedObjectTypes?: string[];
389
+ colors?: Set<string>;
390
+ probability?: number;
391
+ }
392
+
393
+ declare class EventsStore extends ApiStore {
394
+ private camerasStore;
395
+ data: crossfilter.Crossfilter<CameraEvent>;
396
+ eventsByCameraId: crossfilter.Dimension<CameraEvent, number>;
397
+ eventsByStart: crossfilter.Dimension<CameraEvent, number>;
398
+ eventsByEnd: crossfilter.Dimension<CameraEvent, number>;
399
+ eventsByType: crossfilter.Dimension<CameraEvent, EventType>;
400
+ eventsByFoundObjects: crossfilter.Dimension<CameraEvent, string>;
401
+ eventsByColor: crossfilter.Dimension<CameraEvent, string>;
402
+ eventsByLiveliness: crossfilter.Dimension<CameraEvent, boolean>;
403
+ pendingRequests: crossfilter.Crossfilter<PendingRequest>;
404
+ pendingRequestsByEnd: crossfilter.Dimension<PendingRequest, number>;
405
+ pendingRequestsByStart: crossfilter.Dimension<PendingRequest, number>;
406
+ pendingRequestsByCameraId: crossfilter.Dimension<PendingRequest, number>;
407
+ knownIntervals: crossfilter.Crossfilter<Interval_2>;
408
+ knownIntervalsByCameraId: crossfilter.Dimension<Interval_2, number>;
409
+ knownIntervalsByStart: crossfilter.Dimension<Interval_2, number>;
410
+ knownIntervalsByEnd: crossfilter.Dimension<Interval_2, number>;
411
+ eventsById: Map<number, CameraEvent>;
412
+ updates: number;
413
+ /**
414
+ * Contains recent additions to the store as list of event ids
415
+ * NOTE: do not update several times in single action as we lose info about intermediate additions that way
416
+ */
417
+ recentAdditions: number[];
418
+ constructor(camerasStore: CamerasStore);
419
+ /**
420
+ * Populates store with the events for given camera and period
421
+ * @param cameraId - camera id or -1 to fetch all available events for given period
422
+ * @param startTime - start of the period
423
+ * @param endTime - end of the period
424
+ */
425
+ populateEvents(cameraId: number, startTime: Date, endTime: Date): void;
426
+ update: (data: CameraEvent[]) => void;
427
+ add: (data: CameraEvent[]) => void;
428
+ getEvents({ cameraIds, from, to, detectedObjectTypes, eventTypes, colors, probability }: EventsQuery): CameraEvent[];
429
+ getOverlappedEvents({ cameraId, from, to }: {
430
+ cameraId: number;
431
+ from: Date;
432
+ to: Date;
433
+ }): CameraEvent[];
434
+ getLastNonAnalyticEventBefore({ cameraId, date }: {
435
+ cameraId: number;
436
+ date: Date;
437
+ }): CameraEvent;
438
+ getLastObjectBefore({ cameraId, date, objectFilters }: {
439
+ cameraId: number;
440
+ date: Date;
441
+ objectFilters: {
442
+ people: boolean;
443
+ cars: boolean;
444
+ misc: boolean;
445
+ };
446
+ }): CameraEvent;
447
+ getFirstNonAnalyticEventAfter({ cameraId, date }: {
448
+ cameraId: number;
449
+ date: Date;
450
+ }): CameraEvent;
451
+ getFirstObjectAfter({ cameraId, date, objectFilters }: {
452
+ cameraId: number;
453
+ date: Date;
454
+ objectFilters: {
455
+ people: boolean;
456
+ cars: boolean;
457
+ misc: boolean;
458
+ };
459
+ }): CameraEvent;
460
+ protected afterInit(): void;
461
+ processNewEvents: ({ data }: {
462
+ data: RawSensorEvent[];
463
+ }) => void;
464
+ dispose(): void;
465
+ }
466
+
467
+ 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' | 'Uncategorized' | 'Unknown';
468
+
469
+ declare type ExtendedApi = Api<IApi> & IApi & {
470
+ cameras: {
471
+ GetPeopleCountingData: (cameraId: number, startTime: Date, endTime: Date, box: Box) => Observable<ApiResult<RawPeopleContingData>>;
472
+ };
473
+ archives: {
474
+ GetLongLastingTimeLaps: (cameraId: number) => Observable<any>;
475
+ };
476
+ };
477
+
478
+ declare type ExtractHubs<T, K> = {
479
+ [P in keyof ExtractMethods<T, K>]: ExtractMethods<T[P], K[P]>;
480
+ };
481
+
482
+ declare type ExtractMethods<T, K> = Pick<T, Extract<keyof T, keyof K>>;
483
+
484
+ declare interface Face {
485
+ PersonId: number;
486
+ Name: string;
487
+ Box: {
488
+ Left: number;
489
+ Top: number;
490
+ Right: number;
491
+ Bottom: number;
492
+ };
493
+ Probability: number;
494
+ }
495
+
496
+ declare const FULL_API_CONFIG: IApi;
497
+
498
+ declare class Heatmap {
499
+ url: string;
500
+ startTime: Date;
501
+ endTime: Date;
502
+ minMotion: number;
503
+ maxMotion: number;
504
+ cameraId: number;
505
+ constructor(raw: RawHeatmap, cameraId: number, duration: number);
506
+ }
507
+
508
+ declare class HeatmapsStore extends ApiStore {
509
+ api: ExtendedApi;
510
+ fetchHeatmaps(cameraId: number, from: Date, to: Date, count: number): Observable<Heatmap[]>;
511
+ }
512
+
513
+ declare interface IApi {
514
+ archives: {
515
+ PopulateArchive: (params: {
516
+ cameraId: number;
517
+ endTime: Date;
518
+ startTime: Date;
519
+ }) => Observable<any>;
520
+ GetArchives: (params: any) => Observable<any>;
521
+ GetClips: () => Observable<any>;
522
+ UpdateClip: (params: any) => Observable<any>;
523
+ DeleteClip: (params: any) => Observable<any>;
524
+ SaveClip: (params: any) => Observable<any>;
525
+ SaveTimelaps: (params: any) => Observable<any>;
526
+ SaveArchive: (params: any) => Observable<any>;
527
+ DeleteArchive: (params: any) => Observable<any>;
528
+ ShareClip: (sharedClip: RawSharedClip) => Observable<ApiResult<RawSharedClip>>;
529
+ GetSharedClips: (recordId: number | null) => Observable<ApiResult<RawSharedClip>>;
530
+ UpdateSharedClip: (sharedClip: RawSharedClip) => Observable<ApiResult<RawSharedClip>>;
531
+ DeleteSharedClip: (recordId: number) => Observable<ApiResult<RawSharedClip>>;
532
+ };
533
+ cameras: {
534
+ GetCameras: (camera: {
535
+ id?: number;
536
+ } | null, since: Date | null) => Observable<ApiResult<RawCamera>>;
537
+ /**
538
+ * @deprecated
539
+ */
540
+ GetMotionEvents: (params: {
541
+ cameraId: number;
542
+ endTime: Date | null;
543
+ startTime: Date;
544
+ }) => Observable<OBVIOUSLY_NEEDS_TO_BE_FIXED_EventsApiResult<RawEvent>>;
545
+ GetSensorDataSchema: (eventType: EventType) => Observable<any>;
546
+ GetSensorEvents: (params: SensorEventsParams, filter: string, box: Box) => Observable<ApiResult<RawSensorEvent>>;
547
+ GetSensorEventsPage: (request: SensorEventsRequest, filter: string | null, searchPolygons: string[]) => Observable<ApiPageResult<RawSensorEvent>>;
548
+ AddUserSensorEvent: (event: PartialExcept<RawSensorEvent, 'id' | 'eventType' | 'message'>) => Observable<ApiResult<RawSensorEvent>>;
549
+ AcknowledgeSensorEvent: (event: PartialExcept<RawSensorEvent, 'id' | 'ackEventType' | 'message'>) => Observable<ApiResult<RawSensorEvent>>;
550
+ MoveCamera: (camera: {
551
+ id: number;
552
+ }, x: number, y: number, zoom: number, moveSpeed: number, zoomSpeed: number) => Observable<any>;
553
+ MoveCameraContinuousStart: ({ id }: {
554
+ id: number;
555
+ }, x: number, y: number, zoom: number, timeout: number) => Observable<any>;
556
+ MoveCameraContinuousStop: ({ id }: {
557
+ id: number;
558
+ }) => Observable<any>;
559
+ GoHomePtzCamera: ({ id }: {
560
+ id: number;
561
+ }) => Observable<any>;
562
+ SetHomePtzCamera: ({ id }: {
563
+ id: number;
564
+ }) => Observable<any>;
565
+ };
566
+ camgroups: {
567
+ GetCamgroups: () => Observable<ApiResult<RawCamgroup>>;
568
+ DeleteCamgroup: (params: any) => Observable<ApiResult<RawCamgroup>>;
569
+ AddCamgroup: (params: any) => Observable<ApiResult<RawCamgroup>>;
570
+ UpdateCamgroup: (params: any) => Observable<ApiResult<RawCamgroup>>;
571
+ };
572
+ sound: {
573
+ GetPushSoundServiceUrl: (id: number) => Observable<any>;
574
+ };
575
+ thumbnails: {
576
+ GetThumbnailsInfo: (params: {
577
+ cameraId: number;
578
+ from: Date;
579
+ to: Date;
580
+ count: number;
581
+ }) => Observable<any>;
582
+ GetThumbnailInfo: (params: {
583
+ cameraId: number;
584
+ from: Date;
585
+ to: Date;
586
+ }) => Observable<any>;
587
+ GetHeatMapsInfo: (params: {
588
+ cameraId: number;
589
+ from: Date;
590
+ to: Date;
591
+ count: number;
592
+ }) => Observable<any>;
593
+ };
594
+ users: {
595
+ GetUser: () => Observable<ApiResult<RawUser>>;
596
+ UserUpdateProfile: (user: Partial<RawUser>) => Observable<ApiResult<RawUser>>;
597
+ };
598
+ }
599
+
600
+ declare interface Interval_2 {
601
+ cameraId: number;
602
+ from: Date;
603
+ to: Date;
604
+ }
605
+
606
+ declare interface NotificationOptions_2 {
607
+ autoClose: number | false | undefined;
608
+ }
609
+
610
+ declare class NotificationService implements Notifier {
611
+ private notifier;
612
+ constructor(notifier: Notifier);
613
+ error(message: string): void;
614
+ success(message: string, options?: NotificationOptions_2): void;
615
+ warn(message: string): void;
616
+ }
617
+
618
+ declare interface Notifier {
619
+ success: (message: string, options?: NotificationOptions_2) => void;
620
+ warn: (message: string) => void;
621
+ error: (message: string) => void;
622
+ }
623
+
624
+ declare type OBVIOUSLY_NEEDS_TO_BE_FIXED_EventsApiResult<T> = {
625
+ success: true;
626
+ motionEventItems: T[];
627
+ } | {
628
+ success: false;
629
+ error: {
630
+ code: number;
631
+ message: string;
632
+ };
633
+ };
634
+
635
+ declare interface PageInfo {
636
+ isDescending: boolean;
637
+ nextPageToken: number;
638
+ haveMore: boolean;
639
+ }
640
+
641
+ declare interface PageInfo_2 {
642
+ isDescending: boolean;
643
+ nextPageToken: number;
644
+ haveMore: boolean;
645
+ }
646
+
647
+ declare type PartialApi = DeepPartial<IApi>;
648
+
649
+ declare type PartialExcept<T, K extends keyof T> = Pick<T, K> & Partial<T>;
650
+
651
+ declare interface PendingRequest {
652
+ cameraId: number;
653
+ startTime: Date;
654
+ endTime: Date;
655
+ request: Observable<any>;
656
+ }
657
+
658
+ declare interface Props {
659
+ store: EventSearchStore;
660
+ onEventClick: (event: CameraEvent) => void;
661
+ }
662
+
663
+ declare interface RawCamera {
664
+ id: number;
665
+ customerId: number;
666
+ name: string;
667
+ description: string;
668
+ cameraBrand: string;
669
+ cameraModel: string;
670
+ enabled: boolean;
671
+ cameraUserName: string;
672
+ cameraPassword: null;
673
+ serialNum: string;
674
+ isOnvif: boolean;
675
+ isP2P: boolean;
676
+ p2pRegistrationCode: null;
677
+ planId: null;
678
+ p2pState: string;
679
+ cameraVideoFormat: string;
680
+ cameraState: string;
681
+ cameraStateChangedTime: Date;
682
+ cameraError: null;
683
+ cameraAddress: string;
684
+ isMicEnabled: boolean;
685
+ imageQuality: number;
686
+ cameraSourceChannel: string;
687
+ pin: string;
688
+ streamUrl: string;
689
+ dashStreamUrl: string;
690
+ rtmpUrl: string;
691
+ webRtcStreamHost: string;
692
+ webRtcUrl: string;
693
+ cameraHttpSourceUrl: string;
694
+ cameraRtspSourceUrl: string;
695
+ supportedResolutions: string;
696
+ cameraType: string;
697
+ isCloud: boolean;
698
+ generateImageUrl: null;
699
+ imageUrl: string;
700
+ qualityProfile: string;
701
+ encodingProfile: null;
702
+ width: number;
703
+ height: number;
704
+ bitRate: number;
705
+ frameRate: number;
706
+ archiveDuration: number;
707
+ isArchiveByMotionEvent: boolean;
708
+ isAnalyticsEnabled: boolean;
709
+ isTimelapseAvailable: boolean;
710
+ motionEnabled: boolean;
711
+ isPTZ: boolean;
712
+ motionDuration: number;
713
+ dvrWindowLength: number;
714
+ jsonField: string;
715
+ dtUpdUtc: Date;
716
+ version: string;
717
+ statistics: CameraStatistics;
718
+ }
719
+
720
+ declare interface RawCamgroup {
721
+ id: number;
722
+ name: string | null;
723
+ text: null;
724
+ description: null;
725
+ iconUrl: null;
726
+ iconCls: null;
727
+ dynamic: boolean;
728
+ allowDuplicates: boolean;
729
+ allowDrop: boolean;
730
+ allowNodeDropInView: boolean;
731
+ visible: boolean;
732
+ layout_id: string;
733
+ contentFilter: null;
734
+ customerWideGroup: boolean;
735
+ cameras: CamgroupItem[];
736
+ camgroups: CamgroupItem[];
737
+ version: string;
738
+ order: number;
739
+ }
740
+
741
+ declare interface RawEvent {
742
+ id: number;
743
+ startTime: string;
744
+ endTime?: string;
745
+ cameraId: number;
746
+ data: string | null;
747
+ }
748
+
749
+ declare interface RawHeatmap {
750
+ url: string;
751
+ timestamp: string;
752
+ minMotion: number;
753
+ maxMotion: number;
754
+ }
755
+
756
+ declare interface RawPeopleContingData {
757
+ EventId: number;
758
+ TimeStamp: Date;
759
+ Motions: number;
760
+ Left: number;
761
+ Top: number;
762
+ Right: number;
763
+ Bottom: number;
764
+ timestamp: Date;
765
+ }
766
+
767
+ declare interface RawSensorEvent {
768
+ message: string;
769
+ data: string | null;
770
+ id: number;
771
+ customerId: number;
772
+ sensorId: number;
773
+ sensorType: 'CameraSensor' | 'MotionSensor' | 'IntrusionSensor' | 'AudioSensor' | 'TemperatureSensor' | 'SpeedSensor' | 'Unknown';
774
+ eventType: EventType;
775
+ ackEventType: string;
776
+ description?: any;
777
+ tags?: any;
778
+ customerData?: any;
779
+ startTime: string;
780
+ endTime: string;
781
+ userId: string;
782
+ }
783
+
784
+ declare interface RawSharedClip {
785
+ id: number;
786
+ recordId: number;
787
+ creatorUserId: number;
788
+ cameraId: number;
789
+ startTime: string | Date;
790
+ endTime: string | Date;
791
+ duration: number;
792
+ fileSize: number;
793
+ password: string;
794
+ name: string;
795
+ description: string;
796
+ url: string;
797
+ validTo: string | Date;
798
+ }
799
+
800
+ declare interface RawToken {
801
+ access_token: string;
802
+ accessToken: string;
803
+ access_token_expires: string;
804
+ accessTokenExpires: string;
805
+ access_token_issued: string;
806
+ accessTokenIssued: string;
807
+ client_id: string;
808
+ clientId: string;
809
+ expires_in: number;
810
+ expiresIn: number;
811
+ refresh_token: string;
812
+ refreshToken: string;
813
+ refresh_token_expires: string;
814
+ refreshTokenExpires: string;
815
+ refresh_token_issued: string;
816
+ refreshTokenIssued: string;
817
+ token_type: string;
818
+ tokenType: string;
819
+ userName: string;
820
+ widgetId?: string;
821
+ widgetToken?: string;
822
+ }
823
+
824
+ declare interface RawUser {
825
+ id: number;
826
+ customerId: number;
827
+ userName: string;
828
+ firstName?: string;
829
+ lastName?: string;
830
+ email: string;
831
+ languageCode: string;
832
+ layoutStartId: number | null;
833
+ layoutStartType: 'camera' | 'camgroup' | '';
834
+ timeZoneOffset: string;
835
+ connectionId: string;
836
+ ipAddress: string;
837
+ userRoles: string[];
838
+ lastLoginAt: Date;
839
+ createdAt: Date;
840
+ jsonField: string;
841
+ imageUrl: null;
842
+ permissions: number;
843
+ version: string;
844
+ }
845
+
846
+ declare interface SchemaDescriptionParameter {
847
+ schemaId: number;
848
+ eventType: string;
849
+ description: string;
850
+ fieldName: string;
851
+ parameterType: string;
852
+ possibleValues: string;
853
+ valueSet: string;
854
+ values?: string[];
855
+ }
856
+
857
+ declare interface SensorEventsParams {
858
+ sensorId: number;
859
+ sensorType: 'CameraSensor' | 'MotionSensor' | 'IntrusionSensor' | 'AudioSensor' | 'TemperatureSensor' | 'SpeedSensor' | 'Unknown';
860
+ startTime: Date;
861
+ endTime: Date;
862
+ eventType: EventType;
863
+ }
864
+
865
+ declare interface SensorEventsRequest {
866
+ sensorIds: number[];
867
+ sensorType: string;
868
+ sensorEventTypes: SensorEventType[];
869
+ startTime?: Date;
870
+ endTime?: Date;
871
+ isDescending: boolean;
872
+ rowsLimit: number;
873
+ pageToken?: number;
874
+ }
875
+
876
+ declare enum SensorEventType {
877
+ Motion = 0,
878
+ Tampering = 1,
879
+ PanTiltZoom = 2,
880
+ CrossLine = 3,
881
+ Intrusion = 4,
882
+ LicensePlate = 5,
883
+ FaceDetection = 6,
884
+ Audio = 7,
885
+ Analytic = 8,
886
+ SpeedDetection = 9,
887
+ PeopleCounter = 10,
888
+ Temperature = 11,
889
+ PoS = 12,
890
+ GPS = 13,
891
+ DigitalInput = 14,
892
+ Normal = 15,
893
+ Suspicious = 16,
894
+ Loitering = 17,
895
+ Vandalism = 18,
896
+ Trespass = 19,
897
+ Emergency = 20,
898
+ LifeInDanger = 21,
899
+ ErroneousAlert = 22,
900
+ Misidentification = 23,
901
+ Fire = 24,
902
+ MedicalDuress = 25,
903
+ HoldUp = 26,
904
+ CheckIn = 27,
905
+ CheckOut = 28,
906
+ ClockIn = 29,
907
+ ClockOut = 30,
908
+ ParkingStart = 31,
909
+ ParkingEnd = 32,
910
+ ParkingViolation = 33,
911
+ GateAccess = 34,
912
+ DoorAccess = 35,
913
+ TemperatureCheck = 36,
914
+ IDCheck = 37,
915
+ PPECheck = 38,
916
+ WelfareCheck = 39,
917
+ Uncategorized = 40,
918
+ Unknown = 999
919
+ }
920
+
921
+ declare interface Storage_2 {
922
+ setItem: (key: string, value: string) => void | Promise<undefined>;
923
+ getItem: (key: string) => (string | null) | Promise<string | null>;
924
+ removeItem: (key: string) => void | Promise<undefined>;
925
+ }
926
+
927
+ declare class Token {
928
+ accessToken: string;
929
+ accessTokenExpires: Date;
930
+ accessTokenIssued: Date;
931
+ clientId: string;
932
+ expiresIn: number;
933
+ refreshToken: string;
934
+ refreshTokenExpires: Date;
935
+ refreshTokenIssued: Date;
936
+ tokenType: string;
937
+ userName: string;
938
+ invalid: boolean;
939
+ widgetId?: string;
940
+ widgetToken?: string;
941
+ json: RawToken;
942
+ constructor(raw: RawToken);
943
+ }
944
+
945
+ export { }