@formant/data-sdk 0.0.2 → 0.0.6

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.
@@ -0,0 +1,3 @@
1
+ export declare function defined<T>(value: T | undefined): T;
2
+ export declare function notNull<T>(value: T | null): T;
3
+ export declare function definedAndNotNull<T>(value: T | undefined | null): T;
@@ -0,0 +1,18 @@
1
+ export interface User {
2
+ firstName: string;
3
+ lastName: string;
4
+ email: string;
5
+ organizationId: string;
6
+ id: string;
7
+ }
8
+ export declare class Authentication {
9
+ static token: string | undefined;
10
+ static currentUser: User | undefined;
11
+ static defaultDeviceId: string | undefined;
12
+ static waitingForAuth: ((result: boolean) => void)[];
13
+ static login(email: string, password: string): Promise<void>;
14
+ static loginWithToken(token: string): Promise<void>;
15
+ static isAuthenticated(): boolean;
16
+ static getCurrentUser(): User | undefined;
17
+ static waitTilAuthenticated(): Promise<boolean>;
18
+ }
@@ -0,0 +1,28 @@
1
+ import { RtcClient } from "@formant/realtime-sdk";
2
+ export interface ConfigurationDocument {
3
+ urdfFiles: string[];
4
+ }
5
+ export declare type RealtimeListener = (peerId: string, message: any) => void;
6
+ export declare type RealtimeVideoStream = {
7
+ name: string;
8
+ };
9
+ export declare class Device {
10
+ private token;
11
+ id: string;
12
+ name: string;
13
+ rtcClient: RtcClient | undefined;
14
+ realtimeListeners: RealtimeListener[];
15
+ constructor(token: string, id: string, name: string);
16
+ getLatestTelemetry(): Promise<any>;
17
+ getCurrentConfiguration(): Promise<ConfigurationDocument>;
18
+ getFileUrl(fileId: string): Promise<string[]>;
19
+ private handleMessage;
20
+ private getAuthToken;
21
+ startRealtimeConnection(): Promise<void>;
22
+ addRealtimeListener(listener: RealtimeListener): void;
23
+ removeRealtimeListener(listener: RealtimeListener): void;
24
+ getRealtimeVideoStreams(): Promise<RealtimeVideoStream[]>;
25
+ startListeningToRealtimeVideo(stream: RealtimeVideoStream): void;
26
+ stopListeningToRealtimeVideo(stream: RealtimeVideoStream): void;
27
+ stopRealtimeConnection(): Promise<void>;
28
+ }
@@ -0,0 +1,16 @@
1
+ import { Device } from "./Device";
2
+ export interface User {
3
+ firstName: string;
4
+ lastName: string;
5
+ email: string;
6
+ organizationId: string;
7
+ id: string;
8
+ }
9
+ export declare class Fleet {
10
+ static defaultDeviceId: string | undefined;
11
+ static knownContext: WeakRef<Device>[];
12
+ static setDefaultDevice(deviceId: string): Promise<void>;
13
+ static getCurrentDevice(): Promise<Device>;
14
+ static getDevice(deviceId: string): Promise<Device>;
15
+ static getDevices(): Promise<Device[]>;
16
+ }
@@ -0,0 +1 @@
1
+ export declare const FORMANT_API_URL: any;
@@ -0,0 +1,3 @@
1
+ export { Fleet } from "./Fleet";
2
+ export { Authentication } from "./Authentication";
3
+ export { Device } from "./Device";
@@ -0,0 +1 @@
1
+ export declare function delay(ms: number): Promise<unknown>;
package/package.json CHANGED
@@ -3,13 +3,13 @@
3
3
  "description": "A library for getting data from Formant",
4
4
  "repository": {
5
5
  "type": "git",
6
- "url": "https://github.com/formantio/web-sdk.git"
6
+ "url": "https://github.com/formantio/toolkit.git"
7
7
  },
8
8
  "files": [
9
9
  "dist"
10
10
  ],
11
11
  "license": "MIT",
12
- "homepage": "https://github.com/formantio/web-sdk",
12
+ "homepage": "https://github.com/formantio/toolkit",
13
13
  "main": "./dist/data-sdk.umd.js",
14
14
  "module": "./dist/data-sdk.es.js",
15
15
  "exports": {
@@ -18,7 +18,7 @@
18
18
  "require": "./dist/data-sdk.umd.js"
19
19
  }
20
20
  },
21
- "version": "0.0.2",
21
+ "version": "0.0.6",
22
22
  "scripts": {
23
23
  "dev": "vite --port 4000",
24
24
  "build": "tsc && vite build",
@@ -31,7 +31,7 @@
31
31
  "typescript": "^4.3.2",
32
32
  "vite": "^2.5.4"
33
33
  },
34
- "types": "./dist/types/main.d.ts",
34
+ "types": "./dist/types/data-sdk/src/main.d.ts",
35
35
  "dependencies": {
36
36
  "@types/google-protobuf": "^3.15.5",
37
37
  "@formant/realtime-sdk": "0.0.3"