@formant/data-sdk 1.2.0 → 1.3.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.
Files changed (59) hide show
  1. package/README.md +3 -0
  2. package/dist/data-sdk.es.js +5620 -5489
  3. package/dist/data-sdk.umd.js +30 -29
  4. package/dist/types/data-sdk/src/Account.d.ts +10 -0
  5. package/dist/types/data-sdk/src/AppRtcClientPools.d.ts +2 -4
  6. package/dist/types/data-sdk/src/AudioPlayer.d.ts +2 -1
  7. package/dist/types/data-sdk/src/BaseDevice.d.ts +129 -0
  8. package/dist/types/data-sdk/src/Device.d.ts +6 -132
  9. package/dist/types/data-sdk/src/Fleet.d.ts +8 -0
  10. package/dist/types/data-sdk/src/KeyValue.d.ts +2 -1
  11. package/dist/types/data-sdk/src/Manipulator.d.ts +2 -2
  12. package/dist/types/data-sdk/src/PeerDevice.d.ts +7 -25
  13. package/dist/types/data-sdk/src/RequestDataChannel.d.ts +3 -3
  14. package/dist/types/data-sdk/src/Role.d.ts +8 -0
  15. package/dist/types/data-sdk/src/User.d.ts +8 -0
  16. package/dist/types/data-sdk/src/main.d.ts +20 -12
  17. package/dist/types/data-sdk/src/model/CognitoRegion.d.ts +2 -0
  18. package/dist/types/data-sdk/src/model/IAccount.d.ts +7 -0
  19. package/dist/types/data-sdk/src/model/IAccountTree.d.ts +4 -0
  20. package/dist/types/data-sdk/src/model/IAudioInfo.d.ts +4 -0
  21. package/dist/types/data-sdk/src/model/ICommandPropgress.d.ts +5 -0
  22. package/dist/types/data-sdk/src/model/IDevice.d.ts +31 -0
  23. package/dist/types/data-sdk/src/model/IDeviceReportedConfigurationState.d.ts +3 -0
  24. package/dist/types/data-sdk/src/model/IDeviceRosState.d.ts +4 -0
  25. package/dist/types/data-sdk/src/model/IDeviceScope.d.ts +5 -0
  26. package/dist/types/data-sdk/src/model/IDeviceState.d.ts +16 -0
  27. package/dist/types/data-sdk/src/model/IDictionary.d.ts +3 -0
  28. package/dist/types/data-sdk/src/model/IFleet.d.ts +8 -0
  29. package/dist/types/data-sdk/src/model/IHwInfo.d.ts +17 -0
  30. package/dist/types/data-sdk/src/model/IKernelInfo.d.ts +5 -0
  31. package/dist/types/data-sdk/src/model/INetwork.d.ts +4 -0
  32. package/dist/types/data-sdk/src/model/INodeInfo.d.ts +5 -0
  33. package/dist/types/data-sdk/src/model/IOnDemandPresenceStreamItemGroup.d.ts +6 -0
  34. package/dist/types/data-sdk/src/model/IOnDemandPresenceTimeRange.d.ts +7 -0
  35. package/dist/types/data-sdk/src/model/IOnDemandState.d.ts +4 -0
  36. package/dist/types/data-sdk/src/model/IOnDemandStreamPresence.d.ts +5 -0
  37. package/dist/types/data-sdk/src/model/IOnDemmandBuffer.d.ts +6 -0
  38. package/dist/types/data-sdk/src/model/IOnvifDevice.d.ts +5 -0
  39. package/dist/types/data-sdk/src/model/IOsInfo.d.ts +6 -0
  40. package/dist/types/data-sdk/src/model/IRole.d.ts +9 -0
  41. package/dist/types/data-sdk/src/model/IRosTopic.d.ts +4 -0
  42. package/dist/types/data-sdk/src/model/ITaggedEntity.d.ts +5 -0
  43. package/dist/types/data-sdk/src/model/IUser.d.ts +29 -0
  44. package/dist/types/data-sdk/src/model/IUserScope.d.ts +15 -0
  45. package/dist/types/data-sdk/src/model/IVideoDevice.d.ts +4 -0
  46. package/dist/types/data-sdk/src/model/IdeviceFollower.d.ts +4 -0
  47. package/dist/types/data-sdk/src/model/InetworkInfo.d.ts +4 -0
  48. package/dist/types/data-sdk/src/model/OnDemandBufferType.d.ts +2 -0
  49. package/dist/types/data-sdk/src/model/Policies.d.ts +35 -0
  50. package/dist/types/data-sdk/src/model/RequiredKeys.d.ts +3 -0
  51. package/dist/types/data-sdk/src/model/Resource.d.ts +2 -0
  52. package/dist/types/data-sdk/src/model/cognitoRegions.d.ts +1 -0
  53. package/dist/types/data-sdk/src/model/onDemandBufferTypes.d.ts +1 -0
  54. package/dist/types/data-sdk/src/model/resources.d.ts +1 -0
  55. package/dist/types/data-sdk/src/stores/AuthenticationStore.d.ts +4 -3
  56. package/dist/types/data-sdk/src/stores/IAuthenticationStore.d.ts +3 -10
  57. package/dist/types/data-sdk/src/utils/index.d.ts +0 -1
  58. package/package.json +4 -2
  59. package/dist/types/data-sdk/src/utils/rtcClientVersion.d.ts +0 -2
@@ -0,0 +1,10 @@
1
+ import { IAccount } from "./model/IAccount";
2
+ import { IAccountTree } from "./model/IAccountTree";
3
+ export declare class Account {
4
+ static listAccounts(): Promise<IAccount[]>;
5
+ static createAccounts(account: IAccount): Promise<IAccount>;
6
+ static getAccount(id: string): Promise<IAccount>;
7
+ static patchAccount(id: string, account: Partial<Account>): Promise<IAccount>;
8
+ static deleteAccount(id: string): Promise<void>;
9
+ static getAccountTree(id: string): Promise<IAccountTree>;
10
+ }
@@ -1,4 +1,4 @@
1
- import { RtcClient, RtcClientV1 } from "@formant/realtime-sdk";
1
+ import { RtcClient } from "@formant/realtime-sdk";
2
2
  import { SessionType } from "./model/SessionType";
3
3
  import { RtcClientPool } from "./utils/RtcClientPool";
4
4
  export declare const AppRtcClientPools: {
@@ -12,9 +12,7 @@ export declare const AppRtcClientPools: {
12
12
  readonly 3: RtcClientPool<RtcClient>;
13
13
  };
14
14
  export declare const defaultRtcClientPool: RtcClientPool<RtcClient>;
15
- export declare const v1RtcClientPool: RtcClientPool<RtcClientV1>;
16
15
  export declare const getRtcClientPool: (options: {
17
- version: string;
18
16
  sessionType?: SessionType;
19
- }) => RtcClientPool<RtcClient> | RtcClientPool<RtcClientV1>;
17
+ }) => RtcClientPool<RtcClient>;
20
18
  export declare function debug(): void;
@@ -1,5 +1,6 @@
1
1
  import { IRtcStreamMessage } from "@formant/realtime-sdk";
2
- import { Device, RealtimeDataStream } from "./Device";
2
+ import { Device } from "./Device";
3
+ import { RealtimeDataStream } from "./BaseDevice";
3
4
  export declare class AudioPlayer {
4
5
  private device;
5
6
  private stream;
@@ -0,0 +1,129 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { IRtcSendConfiguration, IRtcStreamMessage, IRtcStreamPayload, RtcClient } from "@formant/realtime-sdk";
4
+ import { ITags } from "./model/ITags";
5
+ import { Uuid } from "./model/Uuid";
6
+ import { SessionType } from "./model/SessionType";
7
+ import { DataChannel } from "./DataChannel";
8
+ import { RtcStreamType } from "@formant/realtime-sdk/dist/model/RtcStreamType";
9
+ import { EventEmitter } from "events";
10
+ import { Manipulator } from "./Manipulator";
11
+ import { BinaryRequestDataChannel, TextRequestDataChannel } from "./main";
12
+ import { IRtcPeer } from "@formant/realtime-sdk/dist/model/IRtcPeer";
13
+ export interface ConfigurationDocument {
14
+ tags: ITags;
15
+ urdfFiles: string[];
16
+ telemetry?: {
17
+ streams?: {
18
+ name: string;
19
+ disabled?: boolean;
20
+ onDemand?: boolean;
21
+ }[];
22
+ };
23
+ teleop?: {
24
+ customStreams?: {
25
+ name: string;
26
+ rtcStreamType: RtcStreamType;
27
+ }[];
28
+ hardwareStreams?: {
29
+ name: string;
30
+ rtcStreamType: RtcStreamType;
31
+ }[];
32
+ rosStreams?: {
33
+ rtcStreamType: RtcStreamType;
34
+ topicName: string;
35
+ topicType: string;
36
+ }[];
37
+ };
38
+ adapters?: IAdapterConfiguration[];
39
+ application?: {
40
+ configurationMap: {
41
+ [key: string]: string;
42
+ };
43
+ };
44
+ }
45
+ export interface Command {
46
+ id: string;
47
+ name: string;
48
+ command: string;
49
+ description: string;
50
+ parameterEnabled: true;
51
+ parameterValue: string | null;
52
+ tags: ITags;
53
+ parameterMeta?: {
54
+ topic?: string;
55
+ };
56
+ }
57
+ export interface IJointState {
58
+ name: string[];
59
+ position: number[];
60
+ velocity?: number[];
61
+ effort?: number[];
62
+ }
63
+ export interface TelemetryStream {
64
+ name: string;
65
+ onDemand: boolean;
66
+ }
67
+ export interface IAdapterConfiguration {
68
+ id: Uuid;
69
+ name: string;
70
+ fileId: Uuid;
71
+ execCommand: string;
72
+ configuration?: string;
73
+ }
74
+ export type RealtimeMessage = {
75
+ header: {
76
+ created: number;
77
+ stream: {
78
+ entityId: string;
79
+ streamName: string;
80
+ streamType: RtcStreamType;
81
+ };
82
+ };
83
+ payload: IRtcStreamPayload;
84
+ };
85
+ export type RealtimeListener = (peerId: string, message: RealtimeMessage) => void;
86
+ export type RealtimeAudioStream = {
87
+ name: string;
88
+ };
89
+ export type RealtimeVideoStream = {
90
+ name: string;
91
+ };
92
+ export type RealtimeDataStream = {
93
+ name: string;
94
+ };
95
+ export interface IStartRealtimeConnectionOptions {
96
+ sessionType?: SessionType;
97
+ deadlineMs?: number;
98
+ maxConnectRetries?: number;
99
+ }
100
+ export declare abstract class BaseDevice extends EventEmitter {
101
+ rtcClient: RtcClient | undefined;
102
+ remoteDevicePeerId: string | null;
103
+ protected realtimeListeners: RealtimeListener[];
104
+ protected connectionMonitorInterval: NodeJS.Timeout | undefined;
105
+ abstract getConfiguration(): Promise<ConfigurationDocument>;
106
+ abstract startRealtimeConnection(sessionType?: number): Promise<void>;
107
+ abstract getRemotePeer(): Promise<IRtcPeer>;
108
+ protected handleMessage: (peerId: string, message: any) => void;
109
+ protected stopConnectionMonitoring(): void;
110
+ protected assertNotCancelled(cancelled: boolean): void;
111
+ getRealtimeStatus(): "disconnected" | "connecting" | "connected";
112
+ getRealtimePing(): number | undefined;
113
+ addRealtimeListener(listener: RealtimeListener): void;
114
+ removeRealtimeListener(listener: RealtimeListener): void;
115
+ getRealtimeManipulators(): Promise<Manipulator[]>;
116
+ getRealtimeVideoStreams(): Promise<RealtimeVideoStream[]>;
117
+ createCustomRequestDataChannel(channelName: string, timeout?: number): TextRequestDataChannel;
118
+ createCustomBinaryRequestDataChannel(channelName: string, timeout?: number): BinaryRequestDataChannel;
119
+ startListeningToRealtimeVideo(stream: RealtimeVideoStream): Promise<void>;
120
+ stopListeningToRealtimeVideo(stream: RealtimeVideoStream): Promise<void>;
121
+ startListeningToRealtimeDataStream(stream: RealtimeDataStream): Promise<void>;
122
+ stopListeningToRealtimeDataStream(stream: RealtimeDataStream): Promise<void>;
123
+ enableRealtimeTelemetryPriorityIngestion(streamName: string): Promise<void>;
124
+ disableRealtimeTelemetryPriorityIngestion(streamName: string): Promise<void>;
125
+ changeStreamAudioType(streamName: string, newFormat: "wav" | "opus"): Promise<void>;
126
+ createCustomDataChannel(channelName: string, rtcConfig?: RTCDataChannelInit): Promise<DataChannel>;
127
+ sendRealtimeMessage(message: IRtcStreamMessage, config?: IRtcSendConfiguration): Promise<void>;
128
+ getRealtimeAudioStreams(): Promise<RealtimeAudioStream[]>;
129
+ }
@@ -1,13 +1,5 @@
1
- /// <reference types="node" />
2
- import { EventEmitter } from "events";
3
- import { IRtcSendConfiguration, IRtcStreamMessage, IRtcStreamPayload, RtcClient, RtcClientV1 } from "@formant/realtime-sdk";
4
- import { RtcStreamType } from "@formant/realtime-sdk/dist/model/RtcStreamType";
5
1
  import { IRtcPeer } from "@formant/realtime-sdk/dist/model/IRtcPeer";
6
- import { DataChannel } from "./DataChannel";
7
2
  import { CaptureStream } from "./CaptureStream";
8
- import { Manipulator } from "./Manipulator";
9
- import { TextRequestDataChannel, BinaryRequestDataChannel } from "./RequestDataChannel";
10
- import { Uuid } from "./model/Uuid";
11
3
  import { InterventionType } from "./model/InterventionType";
12
4
  import { IInterventionTypeMap } from "./model/IInterventionTypeMap";
13
5
  import { IInterventionResponse } from "./model/IInterventionResponse";
@@ -15,119 +7,19 @@ import { IEventQuery } from "./model/IEventQuery";
15
7
  import { AggregateLevel } from "./model/AggregateLevel";
16
8
  import { EventType } from "./model/EventType";
17
9
  import { IShare } from "./model/IShare";
18
- import { ITags } from "./model/ITags";
19
10
  import { SessionType } from "./model/SessionType";
20
- export interface ConfigurationDocument {
21
- tags: ITags;
22
- urdfFiles: string[];
23
- telemetry?: {
24
- streams?: {
25
- name: string;
26
- disabled?: boolean;
27
- onDemand?: boolean;
28
- }[];
29
- };
30
- teleop?: {
31
- customStreams?: {
32
- name: string;
33
- rtcStreamType: RtcStreamType;
34
- }[];
35
- hardwareStreams?: {
36
- name: string;
37
- rtcStreamType: RtcStreamType;
38
- }[];
39
- rosStreams?: {
40
- rtcStreamType: RtcStreamType;
41
- topicName: string;
42
- topicType: string;
43
- }[];
44
- };
45
- adapters?: IAdapterConfiguration[];
46
- application?: {
47
- configurationMap: {
48
- [key: string]: string;
49
- };
50
- };
51
- }
52
- export interface Command {
53
- id: string;
54
- name: string;
55
- command: string;
56
- description: string;
57
- parameterEnabled: true;
58
- parameterValue: string | null;
59
- tags: ITags;
60
- parameterMeta?: {
61
- topic?: string;
62
- };
63
- }
64
- export interface IJointState {
65
- name: string[];
66
- position: number[];
67
- velocity?: number[];
68
- effort?: number[];
69
- }
70
- export interface TelemetryStream {
71
- name: string;
72
- onDemand: boolean;
73
- }
74
- export interface IAdapterConfiguration {
75
- id: Uuid;
76
- name: string;
77
- fileId: Uuid;
78
- execCommand: string;
79
- configuration?: string;
80
- }
81
- export type RealtimeMessage = {
82
- header: {
83
- created: number;
84
- stream: {
85
- entityId: string;
86
- streamName: string;
87
- streamType: RtcStreamType;
88
- };
89
- };
90
- payload: IRtcStreamPayload;
91
- };
92
- export type RealtimeListener = (peerId: string, message: RealtimeMessage) => void;
93
- export type RealtimeAudioStream = {
94
- name: string;
95
- };
96
- export type RealtimeVideoStream = {
97
- name: string;
98
- };
99
- export type RealtimeDataStream = {
100
- name: string;
101
- };
102
- interface IStartRealtimeConnectionOptions {
103
- sessionType?: SessionType;
104
- deadlineMs?: number;
105
- maxConnectRetries?: number;
106
- }
107
- export interface IRealtimeDevice {
108
- startRealtimeConnection(sessionType?: number): Promise<void>;
109
- startListeningToRealtimeDataStream(stream: RealtimeDataStream): Promise<void>;
110
- stopListeningToRealtimeDataStream(stream: RealtimeDataStream): Promise<void>;
111
- addRealtimeListener(listener: RealtimeListener): void;
112
- removeRealtimeListener(listener: RealtimeListener): void;
113
- createCustomDataChannel(channelName: string, rtcConfig?: RTCDataChannelInit): Promise<DataChannel>;
114
- }
115
- export declare class Device extends EventEmitter implements IRealtimeDevice {
11
+ import { BaseDevice, Command, ConfigurationDocument, IStartRealtimeConnectionOptions, TelemetryStream } from "./BaseDevice";
12
+ import { ITags } from "./model/ITags";
13
+ import { IDevice } from "./model/IDevice";
14
+ export declare class Device extends BaseDevice {
116
15
  id: string;
117
16
  name: string;
118
17
  private organizationId;
119
18
  tags?: ITags | undefined;
120
- rtcClient: RtcClient | RtcClientV1 | undefined;
121
- remoteDevicePeerId: string | null;
122
- realtimeListeners: RealtimeListener[];
123
- private connectionMonitorInterval;
124
19
  constructor(id: string, name: string, organizationId: string, tags?: ITags | undefined);
125
20
  getLatestTelemetry(): Promise<any>;
126
21
  getConfiguration(): Promise<ConfigurationDocument>;
127
22
  getFileUrl(fileId: string): Promise<string[]>;
128
- private handleMessage;
129
- getRealtimeStatus(): "disconnected" | "connecting" | "connected";
130
- getRealtimePing(): number | undefined;
131
23
  /**
132
24
  * Starts a real-time connection with the remote device using WebRTC.
133
25
  * @param {number} [options] - Optional session type to be used for the connection.
@@ -137,30 +29,12 @@ export declare class Device extends EventEmitter implements IRealtimeDevice {
137
29
  startRealtimeConnection(options?: SessionType | IStartRealtimeConnectionOptions): Promise<void>;
138
30
  private getRemoteDevicePeerId;
139
31
  private initConnectionMonitoring;
140
- private isV2Signaling;
141
- private stopConnectionMonitoring;
142
- sendRealtimeMessage(message: IRtcStreamMessage, config?: IRtcSendConfiguration): Promise<void>;
143
- addRealtimeListener(listener: RealtimeListener): void;
144
- removeRealtimeListener(listener: RealtimeListener): void;
145
- getRealtimeAudioStreams(): Promise<RealtimeAudioStream[]>;
146
- getRealtimeVideoStreams(): Promise<RealtimeVideoStream[]>;
147
- getRealtimeManipulators(): Promise<Manipulator[]>;
148
- startListeningToRealtimeVideo(stream: RealtimeVideoStream): Promise<void>;
149
- stopListeningToRealtimeVideo(stream: RealtimeVideoStream): Promise<void>;
150
- startListeningToRealtimeDataStream(stream: RealtimeDataStream): Promise<void>;
151
- stopListeningToRealtimeDataStream(stream: RealtimeDataStream): Promise<void>;
152
- enableRealtimeTelemetryPriorityIngestion(streamName: string): Promise<void>;
153
- changeStreamAudioType(streamName: string, newFormat: "wav" | "opus"): Promise<void>;
154
- disableRealtimeTelemetryPriorityIngestion(streamName: string): Promise<void>;
155
32
  getRemotePeer(): Promise<IRtcPeer>;
156
33
  stopRealtimeConnection(): Promise<void>;
157
34
  isInRealtimeSession(): Promise<boolean>;
158
35
  getAvailableCommands(): Promise<Command[]>;
159
36
  sendCommand(name: string, data?: string, time?: Date, metadata?: {}): Promise<Response>;
160
37
  getCommand(id: string): Promise<Response>;
161
- createCustomDataChannel(channelName: string, rtcConfig?: RTCDataChannelInit): Promise<DataChannel>;
162
- createCustomRequestDataChannel(channelName: string, timeout?: number): TextRequestDataChannel;
163
- createCustomBinaryRequestDataChannel(channelName: string, timeout?: number): BinaryRequestDataChannel;
164
38
  createCaptureStream(streamName: string): Promise<CaptureStream>;
165
39
  getTelemetry(streamNameOrStreamNames: string | string[], start: Date, end: Date, tags?: {
166
40
  [key in string]: string[];
@@ -184,6 +58,6 @@ export declare class Device extends EventEmitter implements IRealtimeDevice {
184
58
  events: import("./main").IEvent[];
185
59
  }[]>;
186
60
  createShareLink(share: IShare, view: string): Promise<string | null>;
187
- private getRemotePeerId;
61
+ createDevice(device: IDevice): Promise<IDevice>;
62
+ patchDevice(id: string, device: Partial<IDevice>): Promise<IDevice>;
188
63
  }
189
- export {};
@@ -19,6 +19,7 @@ import { IStreamTypeMap } from "./model/IStreamTypeMap";
19
19
  import { ITaskReportColumn } from "./model/ITaskReportColumn";
20
20
  import { IView } from "./model/IView";
21
21
  import { PeerDevice } from "./PeerDevice";
22
+ import { IFleet } from "./model/IFleet";
22
23
  export interface TelemetryResult {
23
24
  deviceId: string;
24
25
  name: string;
@@ -205,4 +206,11 @@ export declare class Fleet {
205
206
  * });
206
207
  */
207
208
  static createShareLink(share: IShare, view: string): Promise<string | null>;
209
+ static listFleets(): Promise<IFleet[]>;
210
+ static createFleet(fleet: IFleet): Promise<IFleet>;
211
+ static getFleet(id: string): Promise<IFleet>;
212
+ static patchFleet(id: string, role: Partial<IFleet>): Promise<IFleet>;
213
+ static deleteFleet(id: string): Promise<void>;
214
+ static addDeviceToFleet(deviceId: string, fleetId: string): Promise<any>;
215
+ static getFleetDevices(id: string): Promise<void>;
208
216
  }
@@ -1,5 +1,6 @@
1
+ import { ITagSets } from "./main";
1
2
  export declare class KeyValue {
2
- static set(key: string, value: string): Promise<void>;
3
+ static set(key: string, value: string, tags?: ITagSets): Promise<void>;
3
4
  static get(key: string): Promise<string>;
4
5
  static list(): Promise<string[]>;
5
6
  static delete(key: string): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { RealtimeDataStream, IJointState, RealtimeMessage, IRealtimeDevice } from "./Device";
1
+ import { RealtimeDataStream, IJointState, RealtimeMessage, BaseDevice } from "./BaseDevice";
2
2
  export type RealtimeManipulatorConfig = {
3
3
  currentJointStateStream: RealtimeDataStream;
4
4
  plannedJointStateStream?: RealtimeDataStream;
@@ -12,7 +12,7 @@ export declare class Manipulator {
12
12
  private device;
13
13
  private config;
14
14
  currentListeners: ((js: IJointState) => void)[];
15
- constructor(device: IRealtimeDevice, config: RealtimeManipulatorConfig);
15
+ constructor(device: BaseDevice, config: RealtimeManipulatorConfig);
16
16
  synchronize(): Promise<void>;
17
17
  desynchronize(): Promise<void>;
18
18
  onRealtimeMessage: (_peerId: string, message: RealtimeMessage) => void;
@@ -1,37 +1,19 @@
1
- import { RtcClient } from "@formant/realtime-sdk";
2
- import { DataChannel } from "./DataChannel";
3
- import { Manipulator } from "./Manipulator";
4
- import { TextRequestDataChannel, BinaryRequestDataChannel } from "./RequestDataChannel";
5
- import { ConfigurationDocument, IRealtimeDevice, RealtimeDataStream, RealtimeListener, RealtimeVideoStream } from "./Device";
6
1
  import { IStreamCurrentValue } from "./model/IStreamCurrentValue";
7
2
  import { IRtcPeer } from "@formant/realtime-sdk/dist/model/IRtcPeer";
8
- export declare class PeerDevice implements IRealtimeDevice {
3
+ import { BaseDevice, ConfigurationDocument } from "./BaseDevice";
4
+ export declare class PeerDevice extends BaseDevice {
9
5
  peerUrl: string;
10
- rtcClient: RtcClient | undefined;
11
- remoteDevicePeerId: string | undefined;
12
- realtimeListeners: RealtimeListener[];
13
6
  id: string;
7
+ private telemetryStreamActive;
8
+ private streamTelemetry;
14
9
  constructor(peerUrl: string);
15
10
  getLatestTelemetry(): Promise<IStreamCurrentValue[]>;
11
+ private subscribeToTelemetry;
12
+ private readNextTelemetryRecord;
16
13
  getDeviceId(): Promise<string>;
17
14
  getConfiguration(): Promise<ConfigurationDocument>;
18
- private handleMessage;
19
- getRealtimeStatus(): "disconnected" | "connecting" | "connected";
20
- getRealtimePing(): number | undefined;
21
15
  startRealtimeConnection(sessionType?: number): Promise<void>;
22
- addRealtimeListener(listener: RealtimeListener): void;
23
- removeRealtimeListener(listener: RealtimeListener): void;
24
- getRealtimeVideoStreams(): Promise<RealtimeVideoStream[]>;
25
- getRealtimeManipulators(): Promise<Manipulator[]>;
26
- startListeningToRealtimeVideo(stream: RealtimeVideoStream): Promise<void>;
27
- stopListeningToRealtimeVideo(stream: RealtimeVideoStream): Promise<void>;
28
- startListeningToRealtimeDataStream(stream: RealtimeDataStream): Promise<void>;
29
- stopListeningToRealtimeDataStream(stream: RealtimeDataStream): Promise<void>;
30
- enableRealtimeTelemetryPriorityIngestion(streamName: string): Promise<void>;
31
- disableRealtimeTelemetryPriorityIngestion(streamName: string): Promise<void>;
16
+ private initConnectionMonitoring;
32
17
  getRemotePeer(): Promise<IRtcPeer>;
33
18
  stopRealtimeConnection(): Promise<void>;
34
- createCustomDataChannel(channelName: string, rtcConfig?: RTCDataChannelInit): Promise<DataChannel>;
35
- createCustomRequestDataChannel(channelName: string, timeout?: number): TextRequestDataChannel;
36
- createCustomBinaryRequestDataChannel(channelName: string, timeout?: number): BinaryRequestDataChannel;
37
19
  }
@@ -1,12 +1,12 @@
1
1
  import { DataChannel, DataChannelErrorListener, DataChannelListener } from "./main";
2
- import { IRealtimeDevice } from "./Device";
2
+ import { BaseDevice } from "./BaseDevice";
3
3
  declare abstract class RequestDataChannel {
4
- protected device: IRealtimeDevice;
4
+ protected device: BaseDevice;
5
5
  protected channel_name: string;
6
6
  protected timeout: number;
7
7
  protected channel: undefined | DataChannel;
8
8
  protected requestIdToResponseMap: Map<string, any>;
9
- constructor(device: IRealtimeDevice, channel_name: string, timeout: number);
9
+ constructor(device: BaseDevice, channel_name: string, timeout: number);
10
10
  addOpenListener(listener: DataChannelListener): void;
11
11
  removeOpenListener(listener: DataChannelListener): void;
12
12
  addCloseListener(listener: DataChannelListener): void;
@@ -0,0 +1,8 @@
1
+ import { IRole } from "./model/IRole";
2
+ export declare class Role {
3
+ static listRoles(): Promise<IRole[]>;
4
+ static createRole(role: IRole): Promise<IRole>;
5
+ static getRole(id: string): Promise<IRole>;
6
+ static patchRole(id: string, role: Partial<IRole>): Promise<IRole>;
7
+ static deleteRole(id: string): Promise<void>;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { IUser } from "./model/IUser";
2
+ export declare class User {
3
+ static listUsers(): Promise<IUser[]>;
4
+ static createUser(user: IUser): Promise<IUser>;
5
+ static getUser(id: string): Promise<IUser>;
6
+ static patchUser(id: string, user: Partial<IUser>): Promise<IUser>;
7
+ static deleteUser(id: string): Promise<void>;
8
+ }
@@ -1,15 +1,23 @@
1
- export * from "./Fleet";
2
- export * from "./Authentication";
3
- export * from "./Device";
4
- export * from "./PeerDevice";
5
- export * from "./DataChannel";
6
- export * from "./CaptureStream";
7
- export * from "./Manipulator";
8
- export * from "./RequestDataChannel";
9
- export * from "./App";
10
- export * from "./KeyValue";
11
- export * from "./utils";
12
- export * from "./AudioPlayer";
1
+ export { App } from "./App";
2
+ export { Fleet } from "./Fleet";
3
+ export { Authentication } from "./Authentication";
4
+ export { Device } from "./Device";
5
+ export { PeerDevice } from "./PeerDevice";
6
+ export { DataChannel } from "./DataChannel";
7
+ export { CaptureStream } from "./CaptureStream";
8
+ export { Manipulator } from "./Manipulator";
9
+ export { BinaryRequestDataChannel, TextRequestDataChannel, } from "./RequestDataChannel";
10
+ export { KeyValue } from "./KeyValue";
11
+ export { AudioPlayer } from "./AudioPlayer";
12
+ export { Account } from "./Account";
13
+ export { Role } from "./Role";
14
+ export { User } from "./User";
15
+ export type { AppMessage, DataPoint, EmbeddedAppMessage, IDevice, ModuleConfigurationMessage, ModuleData, QueryRange, Stream, StreamData, } from "./App";
16
+ export type { TelemetryResult } from "./Fleet";
17
+ export type { Command, ConfigurationDocument, IAdapterConfiguration, IJointState, IStartRealtimeConnectionOptions, RealtimeAudioStream, RealtimeDataStream, RealtimeListener, RealtimeMessage, RealtimeVideoStream, TelemetryStream, } from "./BaseDevice";
18
+ export type { DataChannelBinaryListener, DataChannelErrorListener, DataChannelListener, DataChannelStringListener, } from "./DataChannel";
19
+ export type { CaptureSession } from "./CaptureStream";
20
+ export type { RealtimeManipulatorConfig } from "./Manipulator";
13
21
  export * from "./model/accessLevels";
14
22
  export * from "./model/AccessLevel";
15
23
  export * from "./model/aggregateLevels";
@@ -0,0 +1,2 @@
1
+ import { cognitoRegions } from "./cognitoRegions";
2
+ export type CognitoRegion = (typeof cognitoRegions)[number];
@@ -0,0 +1,7 @@
1
+ import { IBaseEntity } from "./IBaseEntity";
2
+ import { Uuid } from "./Uuid";
3
+ export interface IAccount extends IBaseEntity {
4
+ organizationId?: Uuid;
5
+ name: string;
6
+ parentId: Uuid | null;
7
+ }
@@ -0,0 +1,4 @@
1
+ import { IAccount } from "./IAccount";
2
+ export interface IAccountTree extends IAccount {
3
+ children?: IAccountTree[];
4
+ }
@@ -0,0 +1,4 @@
1
+ export interface IAudioDevice {
2
+ id: string;
3
+ name: string;
4
+ }
@@ -0,0 +1,5 @@
1
+ export interface ICommandProgress {
2
+ commandId: string;
3
+ progress: number;
4
+ pending: boolean;
5
+ }
@@ -0,0 +1,31 @@
1
+ import { ITaggedEntity } from "./ITaggedEntity";
2
+ import { Uuid } from "./Uuid";
3
+ import { IScopeFilter } from "./IScopeFilter";
4
+ import { IsoDate } from "./IsoDate";
5
+ import { DeviceType } from "./DeviceType";
6
+ import { IDeviceScope } from "./IDeviceScope";
7
+ import { IDeviceState } from "./IDeviceState";
8
+ import { IDeviceFollower } from "./IdeviceFollower";
9
+ export interface IDevice extends ITaggedEntity {
10
+ organizationId?: Uuid;
11
+ name: string;
12
+ type?: DeviceType;
13
+ userId?: Uuid | null;
14
+ fleetId?: Uuid | null;
15
+ eventTriggerGroupId?: Uuid | null;
16
+ scope?: IScopeFilter | null;
17
+ deviceScope?: IDeviceScope;
18
+ publicKey: string;
19
+ desiredAgentVersion?: string | null;
20
+ desiredConfigurationVersion?: number | null;
21
+ temporaryConfigurationVersion?: number | null;
22
+ temporaryConfigurationExpiration?: IsoDate | null;
23
+ temporaryConfigurationTemplateId?: Uuid | null;
24
+ followers?: IDeviceFollower[];
25
+ slackChannels?: string[];
26
+ phoneNumber?: string;
27
+ state?: IDeviceState;
28
+ enabled?: boolean;
29
+ fullyConfigured?: boolean;
30
+ disabledAt?: IsoDate | null;
31
+ }
@@ -0,0 +1,3 @@
1
+ export interface IDeviceReportedConfigurationState {
2
+ version: number | null;
3
+ }
@@ -0,0 +1,4 @@
1
+ import { IRosTopic } from "./IRosTopic";
2
+ export interface IDeviceRosState {
3
+ topics: IRosTopic[];
4
+ }
@@ -0,0 +1,5 @@
1
+ import { IScopeFilter } from "./IScopeFilter";
2
+ export interface IDeviceScope extends IScopeFilter {
3
+ views?: IScopeFilter;
4
+ commands?: IScopeFilter;
5
+ }
@@ -0,0 +1,16 @@
1
+ import { IDeviceReportedConfigurationState } from "./IDeviceReportedConfigurationState";
2
+ import { IHwInfo } from "./IHwInfo";
3
+ import { IDeviceRosState } from "./IDeviceRosState";
4
+ import { IDictionary } from "./IDictionary";
5
+ import { IOnDemandState } from "./IOnDemandState";
6
+ import { ICommandProgress } from "./ICommandPropgress";
7
+ export interface IDeviceState {
8
+ agentVersion?: string | null;
9
+ reportedConfiguration?: IDeviceReportedConfigurationState | null;
10
+ hwInfo?: IHwInfo | null;
11
+ ros?: IDeviceRosState | null;
12
+ env?: IDictionary | null;
13
+ otaEnabled?: boolean | null;
14
+ onDemand?: IOnDemandState | null;
15
+ commandProgress?: ICommandProgress[] | null;
16
+ }
@@ -0,0 +1,3 @@
1
+ export interface IDictionary<T = string> {
2
+ [key: string]: T;
3
+ }
@@ -0,0 +1,8 @@
1
+ import { IDeviceScope } from "./IDeviceScope";
2
+ import { ITaggedEntity } from "./ITaggedEntity";
3
+ import { Uuid } from "./Uuid";
4
+ export interface IFleet extends ITaggedEntity {
5
+ organizationId?: Uuid;
6
+ name: string;
7
+ scope?: IDeviceScope;
8
+ }
@@ -0,0 +1,17 @@
1
+ import { IAudioDevice } from "./IAudioInfo";
2
+ import { IKernelInfo } from "./IKernelInfo";
3
+ import { INetworkInfo } from "./InetworkInfo";
4
+ import { INodeInfo } from "./INodeInfo";
5
+ import { IOnvifDevice } from "./IOnvifDevice";
6
+ import { IOsInfo } from "./IOsInfo";
7
+ import { IVideoDevice } from "./IVideoDevice";
8
+ export interface IHwInfo {
9
+ hwEncodingAvailable?: boolean;
10
+ nodeInfo?: INodeInfo;
11
+ kernelInfo?: IKernelInfo;
12
+ osInfo?: IOsInfo;
13
+ networkInfo?: INetworkInfo;
14
+ videoDevices?: IVideoDevice[];
15
+ audioCaptureDevices?: IAudioDevice[];
16
+ onvifDevices?: IOnvifDevice[];
17
+ }
@@ -0,0 +1,5 @@
1
+ export interface IKernelInfo {
2
+ release?: string;
3
+ version?: string;
4
+ architecture?: string;
5
+ }
@@ -0,0 +1,4 @@
1
+ export interface INetwork {
2
+ name?: string;
3
+ ip4?: string;
4
+ }