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