@formant/data-sdk 0.0.48 → 0.0.52
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 +19178 -2
- package/dist/data-sdk.umd.js +44 -2
- package/dist/types/data-sdk/src/App.d.ts +25 -0
- package/dist/types/data-sdk/src/Authentication.d.ts +3 -1
- package/dist/types/data-sdk/src/Device.d.ts +3 -3
- package/dist/types/data-sdk/src/KeyValue.d.ts +4 -0
- package/dist/types/data-sdk/src/RequestDataChannel.d.ts +20 -10
- package/dist/types/data-sdk/src/main.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare type ModuleData = {
|
|
2
|
+
streams: {
|
|
3
|
+
[x: string]: any;
|
|
4
|
+
};
|
|
5
|
+
time: number;
|
|
6
|
+
queryRange: {
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare class App {
|
|
12
|
+
private static sendAppMessage;
|
|
13
|
+
private static getCurrentModuleContext;
|
|
14
|
+
static isModule(): boolean;
|
|
15
|
+
static goToTime(date: Date): void;
|
|
16
|
+
static showMessage(message: string): void;
|
|
17
|
+
static requestModuleData(): void;
|
|
18
|
+
static refreshAuthToken(): void;
|
|
19
|
+
static setupModuleMenus(menus: {
|
|
20
|
+
label: string;
|
|
21
|
+
}[]): void;
|
|
22
|
+
static addMenuListener(handler: (label: string) => void): void;
|
|
23
|
+
static addAccessTokenRefreshListener(handler: (token: string) => void): void;
|
|
24
|
+
static addModuleDataListener(handler: (data: ModuleData) => void): void;
|
|
25
|
+
}
|
|
@@ -7,12 +7,14 @@ export interface User {
|
|
|
7
7
|
}
|
|
8
8
|
export declare class Authentication {
|
|
9
9
|
static token: string | undefined;
|
|
10
|
+
static refreshToken: string | undefined;
|
|
10
11
|
static currentUser: User | undefined;
|
|
11
12
|
static defaultDeviceId: string | undefined;
|
|
12
13
|
static waitingForAuth: ((result: boolean) => void)[];
|
|
13
14
|
static login(email: string, password: string): Promise<void>;
|
|
14
|
-
static loginWithToken(token: string): Promise<void>;
|
|
15
|
+
static loginWithToken(token: string, refreshToken?: string): Promise<void>;
|
|
15
16
|
static isAuthenticated(): boolean;
|
|
16
17
|
static getCurrentUser(): User | undefined;
|
|
17
18
|
static waitTilAuthenticated(): Promise<boolean>;
|
|
19
|
+
static listenForRefresh(): Promise<void>;
|
|
18
20
|
}
|
|
@@ -2,7 +2,7 @@ import { RtcClient } from "@formant/realtime-sdk";
|
|
|
2
2
|
import { DataChannel } from "./DataChannel";
|
|
3
3
|
import { CaptureStream } from "./CaptureStream";
|
|
4
4
|
import { Manipulator } from "./Manipulator";
|
|
5
|
-
import {
|
|
5
|
+
import { TextRequestDataChannel, BinaryRequestDataChannel } from "./RequestDataChannel";
|
|
6
6
|
export interface ConfigurationDocument {
|
|
7
7
|
urdfFiles: string[];
|
|
8
8
|
telemetry?: {
|
|
@@ -72,8 +72,8 @@ export declare class Device {
|
|
|
72
72
|
getAvailableCommands(): Promise<Command[]>;
|
|
73
73
|
sendCommand(name: string, data?: string, time?: Date, metadata?: {}): Promise<any>;
|
|
74
74
|
createCustomDataChannel(channelName: string, rtcConfig?: RTCDataChannelInit): Promise<DataChannel>;
|
|
75
|
-
createCustomRequestDataChannel(channelName: string, timeout?: number
|
|
76
|
-
|
|
75
|
+
createCustomRequestDataChannel(channelName: string, timeout?: number): TextRequestDataChannel;
|
|
76
|
+
createCustomBinaryRequestDataChannel(channelName: string, timeout?: number): BinaryRequestDataChannel;
|
|
77
77
|
createCaptureStream(streamName: string): Promise<CaptureStream>;
|
|
78
78
|
getTelemetry(streamNameOrStreamNames: string | string[], start: Date, end: Date, tags?: {
|
|
79
79
|
[key in string]: string[];
|
|
@@ -1,12 +1,22 @@
|
|
|
1
|
-
import { Device } from "./main";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Device, DataChannel } from "./main";
|
|
2
|
+
declare abstract class RequestDataChannel {
|
|
3
|
+
protected device: Device;
|
|
4
|
+
protected channel_name: string;
|
|
5
|
+
protected timeout: number;
|
|
6
|
+
protected channel: undefined | DataChannel;
|
|
7
|
+
protected requestIdToResponseMap: Map<string, any>;
|
|
8
|
+
constructor(device: Device, channel_name: string, timeout: number);
|
|
9
|
+
}
|
|
10
|
+
export declare class BinaryRequestDataChannel extends RequestDataChannel {
|
|
11
|
+
private RESPONSE_SUCCESS_BYTE;
|
|
12
|
+
private decoder;
|
|
13
|
+
generateBinaryId(): Uint8Array;
|
|
14
|
+
initialize(): Promise<void>;
|
|
15
|
+
request(data: Uint8Array): Promise<any>;
|
|
16
|
+
}
|
|
17
|
+
export declare class TextRequestDataChannel extends RequestDataChannel {
|
|
18
|
+
generateTextId(): string;
|
|
10
19
|
initialize(): Promise<void>;
|
|
11
|
-
request(data:
|
|
20
|
+
request(data: string): Promise<any>;
|
|
12
21
|
}
|
|
22
|
+
export {};
|
package/package.json
CHANGED
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
"require": "./dist/data-sdk.umd.js"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
|
-
"version": "0.0.
|
|
21
|
+
"version": "0.0.52",
|
|
22
22
|
"scripts": {
|
|
23
23
|
"dev": "vite --port 9146",
|
|
24
24
|
"build": "tsc && vite build",
|
|
25
25
|
"serve": "vite preview",
|
|
26
|
-
"types": "tsc src/*.ts --lib ESNext,DOM --declaration --emitDeclarationOnly --outDir dist/types",
|
|
26
|
+
"types": "tsc src/*.ts --lib ESNext,DOM --declaration --emitDeclarationOnly --downlevelIteration --outDir dist/types",
|
|
27
27
|
"docs": "typedoc src/main.ts --theme minimal --out ../../docs/data-sdk/"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|