@formant/data-sdk 0.0.147 → 1.0.0-rc.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/LICENSE.txt +21 -0
- package/README.md +20 -2
- package/dist/data-sdk.es.js +1252 -1181
- package/dist/data-sdk.umd.js +23 -23
- package/dist/types/data-sdk/src/App.d.ts +11 -0
- package/dist/types/data-sdk/src/Device.d.ts +32 -10
- package/dist/types/data-sdk/src/Fleet.d.ts +4 -4
- package/dist/types/data-sdk/src/utils/index.d.ts +1 -0
- package/dist/types/data-sdk/src/utils/isRtcPeer.d.ts +2 -0
- package/package.json +3 -2
|
@@ -48,6 +48,8 @@ export type AppMessage = {
|
|
|
48
48
|
data: any;
|
|
49
49
|
} | {
|
|
50
50
|
type: "request_devices";
|
|
51
|
+
} | {
|
|
52
|
+
type: "formant_online";
|
|
51
53
|
};
|
|
52
54
|
export type ModuleConfigurationMessage = {
|
|
53
55
|
type: "module_configuration";
|
|
@@ -85,6 +87,9 @@ export type EmbeddedAppMessage = {
|
|
|
85
87
|
type: "prompt_response";
|
|
86
88
|
promptId: string;
|
|
87
89
|
data: any;
|
|
90
|
+
} | {
|
|
91
|
+
type: "formant_online";
|
|
92
|
+
online: boolean;
|
|
88
93
|
} | ModuleConfigurationMessage;
|
|
89
94
|
export interface ModuleData {
|
|
90
95
|
queryRange: QueryRange;
|
|
@@ -144,4 +149,10 @@ export declare class App {
|
|
|
144
149
|
cancelText?: string;
|
|
145
150
|
}): Promise<any>;
|
|
146
151
|
static getDate(minTime?: Date, maxTime?: Date): Promise<unknown>;
|
|
152
|
+
private static _isOnline;
|
|
153
|
+
private static _handleOnlineEvent;
|
|
154
|
+
static get isOnline(): boolean | null;
|
|
155
|
+
static listenForConnectionEvents(): void;
|
|
156
|
+
static checkConnection(deadlineMs?: number): Promise<boolean>;
|
|
157
|
+
static waitForConnection(deadlineMs?: number): Promise<void>;
|
|
147
158
|
}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from "events";
|
|
2
3
|
import { IRtcSendConfiguration, IRtcStreamMessage, IRtcStreamPayload, RtcClient, RtcClientV1 } from "@formant/realtime-sdk";
|
|
4
|
+
import { RtcStreamType } from "@formant/realtime-sdk/dist/model/RtcStreamType";
|
|
5
|
+
import { IRtcPeer } from "@formant/realtime-sdk/dist/model/IRtcPeer";
|
|
3
6
|
import { DataChannel } from "./DataChannel";
|
|
4
7
|
import { CaptureStream } from "./CaptureStream";
|
|
5
8
|
import { Manipulator } from "./Manipulator";
|
|
6
9
|
import { TextRequestDataChannel, BinaryRequestDataChannel } from "./RequestDataChannel";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { IEventQuery } from "./
|
|
12
|
-
import { AggregateLevel } from "./
|
|
13
|
-
import { EventType } from "./
|
|
10
|
+
import { Uuid } from "./model/Uuid";
|
|
11
|
+
import { InterventionType } from "./model/InterventionType";
|
|
12
|
+
import { IInterventionTypeMap } from "./model/IInterventionTypeMap";
|
|
13
|
+
import { IInterventionResponse } from "./model/IInterventionResponse";
|
|
14
|
+
import { IEventQuery } from "./model/IEventQuery";
|
|
15
|
+
import { AggregateLevel } from "./model/AggregateLevel";
|
|
16
|
+
import { EventType } from "./model/EventType";
|
|
14
17
|
import { IShare } from "./model/IShare";
|
|
15
|
-
import { EventEmitter } from "events";
|
|
16
18
|
export interface ConfigurationDocument {
|
|
19
|
+
tags: {
|
|
20
|
+
[key: string]: string;
|
|
21
|
+
};
|
|
17
22
|
urdfFiles: string[];
|
|
18
23
|
telemetry?: {
|
|
19
24
|
streams?: {
|
|
@@ -37,6 +42,7 @@ export interface ConfigurationDocument {
|
|
|
37
42
|
topicType: string;
|
|
38
43
|
}[];
|
|
39
44
|
};
|
|
45
|
+
adapters?: IAdapterConfiguration[];
|
|
40
46
|
}
|
|
41
47
|
export interface Command {
|
|
42
48
|
id: string;
|
|
@@ -59,6 +65,13 @@ export interface TelemetryStream {
|
|
|
59
65
|
name: string;
|
|
60
66
|
onDemand: boolean;
|
|
61
67
|
}
|
|
68
|
+
export interface IAdapterConfiguration {
|
|
69
|
+
id: Uuid;
|
|
70
|
+
name: string;
|
|
71
|
+
fileId: Uuid;
|
|
72
|
+
execCommand: string;
|
|
73
|
+
configuration?: string;
|
|
74
|
+
}
|
|
62
75
|
export type RealtimeMessage = {
|
|
63
76
|
header: {
|
|
64
77
|
created: number;
|
|
@@ -97,7 +110,7 @@ export declare class Device extends EventEmitter implements IRealtimeDevice {
|
|
|
97
110
|
name: string;
|
|
98
111
|
private organizationId;
|
|
99
112
|
rtcClient: RtcClient | RtcClientV1 | undefined;
|
|
100
|
-
remoteDevicePeerId: string |
|
|
113
|
+
remoteDevicePeerId: string | null;
|
|
101
114
|
realtimeListeners: RealtimeListener[];
|
|
102
115
|
private connectionMonitorInterval;
|
|
103
116
|
constructor(id: string, name: string, organizationId: string);
|
|
@@ -107,7 +120,15 @@ export declare class Device extends EventEmitter implements IRealtimeDevice {
|
|
|
107
120
|
private handleMessage;
|
|
108
121
|
getRealtimeStatus(): "disconnected" | "connecting" | "connected";
|
|
109
122
|
getRealtimePing(): number | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Starts a real-time connection with the remote device using WebRTC.
|
|
125
|
+
* @param {number} [sessionType] - Optional session type to be used for the connection.
|
|
126
|
+
* @throws `Error` If the connection could not be established or if a connection already exists.
|
|
127
|
+
* @returns {void}
|
|
128
|
+
*/
|
|
110
129
|
startRealtimeConnection(sessionType?: number): Promise<void>;
|
|
130
|
+
private getRemoteDevicePeerId;
|
|
131
|
+
private createSession;
|
|
111
132
|
private initConnectionMonitoring;
|
|
112
133
|
private isV2Signaling;
|
|
113
134
|
private stopConnectionMonitoring;
|
|
@@ -124,7 +145,7 @@ export declare class Device extends EventEmitter implements IRealtimeDevice {
|
|
|
124
145
|
enableRealtimeTelemetryPriorityIngestion(streamName: string): Promise<void>;
|
|
125
146
|
changeStreamAudioType(streamName: string, newFormat: "wav" | "opus"): Promise<void>;
|
|
126
147
|
disableRealtimeTelemetryPriorityIngestion(streamName: string): Promise<void>;
|
|
127
|
-
getRemotePeer(): Promise<
|
|
148
|
+
getRemotePeer(): Promise<IRtcPeer>;
|
|
128
149
|
stopRealtimeConnection(): Promise<void>;
|
|
129
150
|
isInRealtimeSession(): Promise<boolean>;
|
|
130
151
|
getAvailableCommands(): Promise<Command[]>;
|
|
@@ -156,4 +177,5 @@ export declare class Device extends EventEmitter implements IRealtimeDevice {
|
|
|
156
177
|
events: import("./main").IEvent[];
|
|
157
178
|
}[]>;
|
|
158
179
|
createShareLink(share: IShare, view: string): Promise<string | null>;
|
|
180
|
+
private getRemotePeerId;
|
|
159
181
|
}
|
|
@@ -9,7 +9,7 @@ import { PeerDevice } from "./PeerDevice";
|
|
|
9
9
|
import { IDeviceQuery } from "./model/IDeviceQuery";
|
|
10
10
|
import { IStream } from "./model/IStream";
|
|
11
11
|
import { IView } from "./model/IView";
|
|
12
|
-
import { EventType, AggregateLevel, IShare } from "./main";
|
|
12
|
+
import { EventType, AggregateLevel, IShare, IStreamTypeMap, IStreamCurrentValue } from "./main";
|
|
13
13
|
import { IAnalyticsModule } from "./model/IAnalyticsModule";
|
|
14
14
|
import { IStreamColumn } from "./model/IStreamColumn";
|
|
15
15
|
import { ITaskReportColumn } from "./model/ITaskReportColumn";
|
|
@@ -39,13 +39,13 @@ export declare class Fleet {
|
|
|
39
39
|
[key in string]: string[];
|
|
40
40
|
}>;
|
|
41
41
|
static getRealtimeDevices(): Promise<Device[]>;
|
|
42
|
-
static getLatestTelemetry(
|
|
42
|
+
static getLatestTelemetry(...ids: (string | string[])[]): Promise<IStreamCurrentValue<keyof IStreamTypeMap>[]>;
|
|
43
43
|
static getTelemetry(deviceIdOrDeviceIds: string | string[], streamNameOrStreamNames: string | string[], start: Date, end: Date, tags?: {
|
|
44
44
|
[key in string]: string[];
|
|
45
45
|
}): Promise<TelemetryResult[]>;
|
|
46
46
|
static getFileUrl(uuid: string): Promise<string>;
|
|
47
|
-
static queryTelemetry(query: IQuery): Promise<IStreamData<keyof
|
|
48
|
-
static aggregateTelemetry(query: IQuery): Promise<IStreamAggregateData<keyof
|
|
47
|
+
static queryTelemetry(query: IQuery): Promise<IStreamData<keyof IStreamTypeMap>[]>;
|
|
48
|
+
static aggregateTelemetry(query: IQuery): Promise<IStreamAggregateData<keyof IStreamTypeMap>[]>;
|
|
49
49
|
static queryEvents(query: IEventQuery): Promise<IEvent[]>;
|
|
50
50
|
static getEvent(uuid: string): Promise<IEvent>;
|
|
51
51
|
static getInterventions(): Promise<IEvent[]>;
|
package/package.json
CHANGED
|
@@ -24,9 +24,10 @@
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
|
-
"version": "0.0.
|
|
27
|
+
"version": "1.0.0-rc.1",
|
|
28
28
|
"scripts": {
|
|
29
|
-
"
|
|
29
|
+
"preversion": "make",
|
|
30
|
+
"dev": "vite --port 5173",
|
|
30
31
|
"build": "tsc && vite build",
|
|
31
32
|
"serve": "vite preview",
|
|
32
33
|
"test": "concurrently --kill-others-on-fail npm:test:*",
|