@formant/data-sdk 1.11.1 → 1.13.0

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.
@@ -6,10 +6,12 @@ export declare const AppRtcClientPools: {
6
6
  readonly teleop: RtcClientPool<RtcClient>;
7
7
  readonly portForward: RtcClientPool<RtcClient>;
8
8
  readonly observe: RtcClientPool<RtcClient>;
9
+ readonly headless: RtcClientPool<RtcClient>;
9
10
  readonly 0: RtcClientPool<RtcClient>;
10
11
  readonly 1: RtcClientPool<RtcClient>;
11
12
  readonly 2: RtcClientPool<RtcClient>;
12
13
  readonly 3: RtcClientPool<RtcClient>;
14
+ readonly 4: RtcClientPool<RtcClient>;
13
15
  };
14
16
  export declare const defaultRtcClientPool: RtcClientPool<RtcClient>;
15
17
  export declare const getRtcClientPool: (options: {
@@ -1,2 +1,2 @@
1
- import { IRtcPeer } from "@formant/realtime-sdk/dist/model/IRtcPeer";
1
+ import { IRtcPeer } from "@formant/realtime-sdk";
2
2
  export declare function getPeers(): Promise<IRtcPeer[]>;
@@ -1,9 +1,8 @@
1
- import { IRtcSendConfiguration, IRtcStreamMessage, RtcClient } from "@formant/realtime-sdk";
1
+ import { IRtcSendConfiguration, IRtcStreamMessage, RtcClient, IRtcPeer } from "@formant/realtime-sdk";
2
2
  import { DataChannel } from "../DataChannel";
3
3
  import { EventEmitter } from "eventemitter3";
4
4
  import { Manipulator } from "../Manipulator";
5
5
  import { BinaryRequestDataChannel, TextRequestDataChannel } from "../RequestDataChannel";
6
- import { IRtcPeer } from "@formant/realtime-sdk/dist/model/IRtcPeer";
7
6
  import { IRealtimeSubscriber } from "./IRealtimeSubscriber";
8
7
  import { ICustomDataChannelCreator } from "./ICustomDataChannelCreator";
9
8
  import { ConfigurationDocument, RealtimeListener, RealtimeAudioStream, RealtimeVideoStream, RealtimeDataStream } from "./device.types";
@@ -1,4 +1,4 @@
1
- import { IRtcPeer } from "@formant/realtime-sdk/dist/model/IRtcPeer";
1
+ import { IRtcPeer } from "@formant/realtime-sdk";
2
2
  import { CaptureStream } from "../CaptureStream";
3
3
  import { InterventionType } from "../model/InterventionType";
4
4
  import { IInterventionTypeMap } from "../model/IInterventionTypeMap";
@@ -1,5 +1,5 @@
1
+ import { IRtcPeer } from "@formant/realtime-sdk";
1
2
  import { IStreamCurrentValue } from "../model/IStreamCurrentValue";
2
- import { IRtcPeer } from "@formant/realtime-sdk/dist/model/IRtcPeer";
3
3
  import { ConfigurationDocument } from "./device.types";
4
4
  import { BaseDevice } from "./BaseDevice";
5
5
  export declare class PeerDevice extends BaseDevice {
@@ -1,8 +1,7 @@
1
- import { IRtcStreamPayload } from "@formant/realtime-sdk";
1
+ import { IRtcStreamPayload, RtcStreamType } from "@formant/realtime-sdk";
2
2
  import { ITags } from "../model/ITags";
3
3
  import { Uuid } from "../model/Uuid";
4
4
  import { SessionType } from "../model/SessionType";
5
- import { RtcStreamType } from "@formant/realtime-sdk/dist/model/RtcStreamType";
6
5
  export interface ConfigurationDocument {
7
6
  tags: ITags;
8
7
  urdfFiles: string[];
@@ -0,0 +1,6 @@
1
+ export interface IChallenge {
2
+ type: "new-password-required";
3
+ userId: string;
4
+ email: string;
5
+ session: string;
6
+ }
@@ -5,18 +5,22 @@ export declare const SessionTypes: {
5
5
  readonly TELEOP: 1;
6
6
  readonly PORT_FORWARD: 2;
7
7
  readonly OBSERVE: 3;
8
+ readonly HEADLESS: 4;
8
9
  };
9
10
  export declare const SessionTypeConstants: {
10
11
  readonly Unknown: 0;
11
12
  readonly Teleop: 1;
12
13
  readonly PortForward: 2;
13
14
  readonly Observe: 3;
15
+ readonly Headless: 4;
14
16
  readonly unknown: 0;
15
17
  readonly teleop: 1;
16
18
  readonly portForward: 2;
17
19
  readonly observe: 3;
20
+ readonly headless: 4;
18
21
  readonly UNKNOWN: 0;
19
22
  readonly TELEOP: 1;
20
23
  readonly PORT_FORWARD: 2;
21
24
  readonly OBSERVE: 3;
25
+ readonly HEADLESS: 4;
22
26
  };
@@ -0,0 +1,9 @@
1
+ import { IChallenge } from "../model/IChallenge";
2
+ export declare class LoginFailureError extends Error {
3
+ readonly reason: string;
4
+ constructor(reason: string);
5
+ }
6
+ export declare class LoginChallengedError extends Error {
7
+ readonly challenge: IChallenge;
8
+ constructor(challenge: IChallenge);
9
+ }
@@ -0,0 +1,15 @@
1
+ import { IAuthentication } from "./IAuthenticationStore";
2
+ import { IChallenge } from "../model/IChallenge";
3
+ export interface AuthSuccessResult {
4
+ result: "success";
5
+ authentication: IAuthentication;
6
+ }
7
+ export interface AuthFailedResult {
8
+ result: "failure";
9
+ reason: string;
10
+ }
11
+ export interface AuthChallengeResult {
12
+ result: "challenged";
13
+ challenge: IChallenge;
14
+ }
15
+ export type AuthenticationResult = AuthSuccessResult | AuthFailedResult | AuthChallengeResult;
@@ -1,4 +1,5 @@
1
1
  import { IAuthentication, IAuthenticationStore, IConfirmForgotPasswordRequest, IRespondToNewPasswordRequiredChallengeRequest } from "./IAuthenticationStore";
2
+ import { AuthenticationResult } from "./AuthenticationResult";
2
3
  import { IUser } from "../model/IUser";
3
4
  interface IAuthenticationStoreOptions {
4
5
  apiUrl: string;
@@ -30,7 +31,10 @@ export declare class AuthenticationStore implements IAuthenticationStore {
30
31
  * @deprecated Do not use directly. This will be removed in future versions of the API
31
32
  */
32
33
  get isShareToken(): boolean;
33
- login(email: string, password: string): Promise<IAuthentication | Error>;
34
+ login(email: string, password: string): Promise<IAuthentication>;
35
+ login(email: string, password: string, options: {
36
+ advanced: true;
37
+ }): Promise<AuthenticationResult>;
34
38
  loginWithToken(token: string, refreshToken?: string): Promise<void>;
35
39
  isAuthenticated(): boolean;
36
40
  /**
@@ -28,7 +28,7 @@ export interface IAuthenticationStore {
28
28
  * @deprecated Do not use directly. This will be removed in future versions of the API
29
29
  */
30
30
  readonly isShareToken: boolean;
31
- login(email: string, password: string): Promise<IAuthentication | Error>;
31
+ login(email: string, password: string): Promise<IAuthentication>;
32
32
  loginWithToken(token: string, refreshToken?: string): Promise<void>;
33
33
  isAuthenticated(): boolean;
34
34
  getCurrentUser(): IUser | undefined;
@@ -1,2 +1,2 @@
1
- import { IRtcPeer } from "@formant/realtime-sdk/dist/model/IRtcPeer";
1
+ import { IRtcPeer } from "@formant/realtime-sdk";
2
2
  export declare const isRtcPeer: (peer: IRtcPeer | undefined) => peer is IRtcPeer;
package/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  }
25
25
  }
26
26
  },
27
- "version": "1.11.1",
27
+ "version": "1.13.0",
28
28
  "scripts": {
29
29
  "preversion": "npm run verify",
30
30
  "postversion": "make",
@@ -46,7 +46,7 @@
46
46
  "docs": "typedoc src/main.ts --theme default --out ../../docs/data-sdk/"
47
47
  },
48
48
  "devDependencies": {
49
- "@formant/realtime-sdk": "1.0.0",
49
+ "@formant/realtime-sdk": "1.2.0",
50
50
  "@types/base-64": "^1.0.0",
51
51
  "@types/node": "^18.16.3",
52
52
  "@types/pako": "^2.0.0",
@@ -69,7 +69,7 @@
69
69
  "pako": "^2.1.0"
70
70
  },
71
71
  "peerDependencies": {
72
- "@formant/realtime-sdk": "^0.0.20 || ^1.0.0"
72
+ "@formant/realtime-sdk": "^1.2.0"
73
73
  },
74
74
  "engines": {
75
75
  "node": "^18.12.0 || ^16.13.0"