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