@formant/data-sdk 0.0.50 → 0.0.54
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/data-sdk.es.js +94 -17
- package/dist/data-sdk.umd.js +6 -6
- package/dist/types/data-sdk/src/App.d.ts +26 -7
- package/dist/types/data-sdk/src/Authentication.d.ts +9 -2
- package/dist/types/data-sdk/src/KeyValue.d.ts +4 -0
- package/dist/types/data-sdk/src/main.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,13 +1,31 @@
|
|
|
1
|
-
export
|
|
1
|
+
export interface ModuleData {
|
|
2
|
+
queryRange: QueryRange;
|
|
3
|
+
time: number;
|
|
2
4
|
streams: {
|
|
3
|
-
[
|
|
5
|
+
[stream_name: string]: Stream;
|
|
4
6
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
}
|
|
8
|
+
export interface QueryRange {
|
|
9
|
+
start: number;
|
|
10
|
+
end: number;
|
|
11
|
+
}
|
|
12
|
+
export interface Stream {
|
|
13
|
+
data: StreamData[];
|
|
14
|
+
loading: boolean;
|
|
15
|
+
tooMuchData: boolean;
|
|
16
|
+
type: string;
|
|
17
|
+
}
|
|
18
|
+
export interface StreamData {
|
|
19
|
+
points: DataPoint[];
|
|
20
|
+
deviceId: string;
|
|
21
|
+
agentId: string;
|
|
22
|
+
name: string;
|
|
23
|
+
tags: {
|
|
24
|
+
[key: string]: string;
|
|
9
25
|
};
|
|
10
|
-
|
|
26
|
+
type: string;
|
|
27
|
+
}
|
|
28
|
+
export declare type DataPoint = [number, any];
|
|
11
29
|
export declare class App {
|
|
12
30
|
private static sendAppMessage;
|
|
13
31
|
private static getCurrentModuleContext;
|
|
@@ -15,6 +33,7 @@ export declare class App {
|
|
|
15
33
|
static goToTime(date: Date): void;
|
|
16
34
|
static showMessage(message: string): void;
|
|
17
35
|
static requestModuleData(): void;
|
|
36
|
+
static setModuleDateTimeRange(beforeInMilliseconds: number, afterInMilliseconds?: number): void;
|
|
18
37
|
static refreshAuthToken(): void;
|
|
19
38
|
static setupModuleMenus(menus: {
|
|
20
39
|
label: string;
|
|
@@ -5,13 +5,20 @@ export interface User {
|
|
|
5
5
|
organizationId: string;
|
|
6
6
|
id: string;
|
|
7
7
|
}
|
|
8
|
+
export interface IAuthentication {
|
|
9
|
+
accessToken: string;
|
|
10
|
+
organizationId: string;
|
|
11
|
+
refreshToken: string;
|
|
12
|
+
userId: string;
|
|
13
|
+
}
|
|
8
14
|
export declare class Authentication {
|
|
9
15
|
static token: string | undefined;
|
|
16
|
+
static refreshToken: string | undefined;
|
|
10
17
|
static currentUser: User | undefined;
|
|
11
18
|
static defaultDeviceId: string | undefined;
|
|
12
19
|
static waitingForAuth: ((result: boolean) => void)[];
|
|
13
|
-
static login(email: string, password: string): Promise<
|
|
14
|
-
static loginWithToken(token: string): Promise<void>;
|
|
20
|
+
static login(email: string, password: string): Promise<IAuthentication | Error>;
|
|
21
|
+
static loginWithToken(token: string, refreshToken?: string): Promise<void>;
|
|
15
22
|
static isAuthenticated(): boolean;
|
|
16
23
|
static getCurrentUser(): User | undefined;
|
|
17
24
|
static waitTilAuthenticated(): Promise<boolean>;
|