@formant/realtime-sdk 0.0.20 → 1.0.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.
- package/LICENSE.txt +19 -0
- package/README.md +43 -0
- package/dist/{common → client}/Credentials.d.ts +1 -1
- package/dist/common/BaseClient.d.ts +4 -3
- package/dist/common/LogReporter.d.ts +1 -3
- package/dist/common/LruCache.d.ts +1 -1
- package/dist/common/PromiseLruCache.d.ts +1 -1
- package/dist/common/ResponseError.d.ts +3 -2
- package/dist/common/StatsManager.d.ts +1 -1
- package/dist/common/StatsReporter.d.ts +7 -6
- package/dist/common/config/index.d.ts +1 -1
- package/dist/common/defined.d.ts +3 -0
- package/dist/common/delay.d.ts +1 -1
- package/dist/common/redact.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/model/AnnotationAreaType.d.ts +1 -1
- package/dist/model/CognitoRegion.d.ts +1 -1
- package/dist/model/Feature.d.ts +2 -2
- package/dist/model/HealthStatus.d.ts +1 -1
- package/dist/model/HexRgbColor.d.ts +1 -1
- package/dist/model/IDictionary.d.ts +3 -0
- package/dist/model/IFilter.d.ts +1 -1
- package/dist/model/IPoint.d.ts +1 -1
- package/dist/model/IRtcSession.d.ts +1 -1
- package/dist/model/ITags.d.ts +2 -3
- package/dist/model/IUser.d.ts +10 -4
- package/dist/model/IUserScope.d.ts +16 -0
- package/dist/model/IsoDate.d.ts +1 -1
- package/dist/model/LanguageType.d.ts +2 -0
- package/dist/model/LogLevel.d.ts +1 -1
- package/dist/model/Marker3DAction.d.ts +1 -1
- package/dist/model/Marker3DType.d.ts +1 -1
- package/dist/model/OrganizationPlan.d.ts +1 -1
- package/dist/model/RequireKeys.d.ts +3 -0
- package/dist/model/RtcConnectionStatus.d.ts +1 -1
- package/dist/model/RtcIceServerProtocol.d.ts +1 -1
- package/dist/model/RtcIceTransportPolicy.d.ts +1 -1
- package/dist/model/RtcStreamType.d.ts +2 -2
- package/dist/model/SmsOptInStatus.d.ts +2 -0
- package/dist/model/StreamType.d.ts +1 -1
- package/dist/model/Timeout.d.ts +1 -1
- package/dist/model/Timestamp.d.ts +1 -1
- package/dist/model/Uuid.d.ts +1 -1
- package/dist/model/VideoMimeType.d.ts +1 -1
- package/dist/model/cognitoRegions.d.ts +1 -1
- package/dist/model/healthStatuses.d.ts +1 -1
- package/dist/model/languageTypes.d.ts +1 -0
- package/dist/model/rtcStreamTypes.d.ts +2 -1
- package/dist/model/smsOptInStatuses.d.ts +1 -0
- package/dist/protos/api/signaling/v1/signaling_grpc_web_pb.d.ts +47 -47
- package/dist/protos/api/signaling/v1/signaling_grpc_web_pb.js +27 -175
- package/dist/protos/api/signaling/v1/signaling_pb.js +7 -1
- package/dist/realtime-sdk/src/index.d.ts +10 -10
- package/dist/rtc-client/IHasPeerConnection.d.ts +3 -0
- package/dist/rtc-client/IHasRemoteDeviceId.d.ts +4 -0
- package/dist/rtc-client/RtcClient.d.ts +3 -1
- package/dist/rtc-client/RtcConnection.d.ts +18 -14
- package/dist/rtc-client/RtcConnectionV1.d.ts +2 -1
- package/dist/rtc-client/RtcSessionMetrics.d.ts +5 -4
- package/dist/rtc-client/RtcSessionMetricsV1.d.ts +8 -6
- package/dist/rtc-client/gatherPingMetrics.d.ts +2 -2
- package/dist/rtc-client/models/IIceMode.d.ts +1 -1
- package/dist/rtc-client/models/IRtcClientConfiguration.d.ts +1 -1
- package/dist/rtc-client/models/IRtcConnectionConfiguration.d.ts +1 -1
- package/dist/rtc-client/models/IRtcStreamPayload.d.ts +2 -0
- package/dist/rtc-client/models/IStreamControl.d.ts +1 -1
- package/dist/rtc-client/models/RtcChannelLabel.d.ts +1 -1
- package/dist/rtc-client/models/RtcCommunicationType.d.ts +1 -1
- package/dist/rtc-client/utils/assertHasPeerConnection.d.ts +1 -0
- package/dist/rtc-client/utils/partition.d.ts +1 -0
- package/dist/ui/utils/browser.d.ts +1 -1
- package/package.json +3 -3
- package/dist/model/IAccessScope.d.ts +0 -5
- package/dist/protos/api/signaling/v1/signaling_grpc_pb.js +0 -276
- package/dist/version.txt +0 -1
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2023 Formant
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Formant Realtime SDK
|
|
2
|
+
|
|
3
|
+
A library for accessing realtime connections your Formant devices/fleet.
|
|
4
|
+
|
|
5
|
+
## Get Started
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
$ npm install --save @formant/realtime-sdk@latest
|
|
9
|
+
|
|
10
|
+
# or with
|
|
11
|
+
|
|
12
|
+
$ yarn add @formant/realtime-sdk@latest
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## License
|
|
16
|
+
|
|
17
|
+
Distributed under the MIT License. See LICENSE.txt for more information.
|
|
18
|
+
|
|
19
|
+
## Changelog
|
|
20
|
+
|
|
21
|
+
### **1.0.0** - 2023-07-19
|
|
22
|
+
|
|
23
|
+
#### Added
|
|
24
|
+
- Odometry over teleop
|
|
25
|
+
- Add support for eventing on all event trigger types
|
|
26
|
+
|
|
27
|
+
#### Changed
|
|
28
|
+
- Reduce ICE gathering timeout to 3s
|
|
29
|
+
|
|
30
|
+
#### Fixed
|
|
31
|
+
- Workaround for lack of getConfiguration method on RTCPeerConnection
|
|
32
|
+
- Project de-cycling
|
|
33
|
+
- Fix Odom
|
|
34
|
+
- Use previously implemented util for detecting STUN vs TURN
|
|
35
|
+
- Partition connections in a single step…
|
|
36
|
+
- Immediately eject a disconnected connection from the connection set
|
|
37
|
+
- More cleanup on rtcClient shutdown
|
|
38
|
+
- Record RTC connection type metric (host, relay, etc)
|
|
39
|
+
- Make best-effort to *release* the RtcPeerConnection on close
|
|
40
|
+
- `isConnectionInitiator` never gets cleared, keeping RtcConnections alive
|
|
41
|
+
- Add prettier plugin to deterministically sort import ordering
|
|
42
|
+
- Dependency updates
|
|
43
|
+
- Resolve realtime-sdk build warnings about re-exporting types
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
import { IDictionary } from "../model/IDictionary";
|
|
1
2
|
import { IValidation } from "../model/IValidation";
|
|
2
3
|
import { ResponseError } from "./ResponseError";
|
|
3
4
|
export interface IRequestInit {
|
|
4
5
|
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
5
|
-
headers?:
|
|
6
|
-
[key: string]: string;
|
|
7
|
-
};
|
|
6
|
+
headers?: IDictionary;
|
|
8
7
|
body?: any;
|
|
9
8
|
token?: string;
|
|
10
9
|
allowUnsafeRetries?: boolean;
|
|
@@ -24,12 +23,14 @@ export declare abstract class BaseClient {
|
|
|
24
23
|
private configuredRetries;
|
|
25
24
|
private timeoutMs?;
|
|
26
25
|
private maxBackoffDelayMs;
|
|
26
|
+
private json;
|
|
27
27
|
constructor(endpoint: string | undefined, options?: {
|
|
28
28
|
validateHeaders?: (headers: Headers) => IValidation;
|
|
29
29
|
verbose?: boolean;
|
|
30
30
|
retries?: number;
|
|
31
31
|
timeoutMs?: number;
|
|
32
32
|
maxBackoffDelayMs?: number;
|
|
33
|
+
json?: boolean;
|
|
33
34
|
});
|
|
34
35
|
protected getRetries(): number;
|
|
35
36
|
protected getHeaders(): {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { IStatEntry, StatsReporter } from "./StatsReporter";
|
|
2
|
-
export declare class LogReporter
|
|
3
|
-
name: string;
|
|
4
|
-
type: "simple";
|
|
2
|
+
export declare class LogReporter extends StatsReporter<"simple"> {
|
|
5
3
|
private message;
|
|
6
4
|
constructor(message: string);
|
|
7
5
|
send(values: IStatEntry[]): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CacheOptions, LruCache } from "./LruCache";
|
|
2
|
-
export
|
|
2
|
+
export type PromiseCacheOptions<V> = CacheOptions<Promise<V>> & {
|
|
3
3
|
expireRejectedPromiseValues?: boolean;
|
|
4
4
|
rejectedPromiseValueTtl?: number;
|
|
5
5
|
};
|
|
@@ -2,9 +2,10 @@ import { IValidation } from "../model/IValidation";
|
|
|
2
2
|
export declare class ResponseError extends Error {
|
|
3
3
|
method: string;
|
|
4
4
|
url: string;
|
|
5
|
+
requestBody: any;
|
|
5
6
|
statusCode: number;
|
|
7
|
+
headers: any;
|
|
6
8
|
body: any;
|
|
7
9
|
validationErrors: IValidation;
|
|
8
|
-
headers?:
|
|
9
|
-
constructor(method: string, url: string, statusCode: number, body: any, validationErrors?: IValidation, headers?: any);
|
|
10
|
+
constructor(method: string, url: string, requestBody: any, statusCode: number, headers: any, body: any, validationErrors?: IValidation);
|
|
10
11
|
}
|
|
@@ -2,7 +2,7 @@ import { IStat } from "../model/IStat";
|
|
|
2
2
|
import { ITags } from "../model/ITags";
|
|
3
3
|
import { StatsReporter } from "./StatsReporter";
|
|
4
4
|
export declare class StatsManager {
|
|
5
|
-
|
|
5
|
+
static readonly samplePeriodMs: number;
|
|
6
6
|
private buffer;
|
|
7
7
|
private reporters;
|
|
8
8
|
private flushInterval;
|
|
@@ -4,13 +4,14 @@ export interface IEntryTypeMap {
|
|
|
4
4
|
simple: IStatEntry;
|
|
5
5
|
tagged: ITaggedStatEntry;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
7
|
+
export type StatsReporterType = keyof IEntryTypeMap;
|
|
8
|
+
export type IStatEntry = Omit<IMetric, "tags">;
|
|
9
|
+
export type ITaggedStatEntry = IStatEntry & {
|
|
10
10
|
tags: ITags;
|
|
11
11
|
};
|
|
12
12
|
export declare abstract class StatsReporter<T extends StatsReporterType = StatsReporterType> {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
readonly type: T;
|
|
14
|
+
readonly name: string;
|
|
15
|
+
constructor(type: T, name: string);
|
|
16
|
+
abstract send(values: IEntryTypeMap[T][], intervalMs: number): Promise<void>;
|
|
16
17
|
}
|
|
@@ -18,5 +18,5 @@ export declare const jestWorkerId: string | undefined;
|
|
|
18
18
|
export declare const sheetExportMaxRowCount: number;
|
|
19
19
|
export declare const logToFile: boolean;
|
|
20
20
|
export declare const enableSelfServe: boolean;
|
|
21
|
-
export
|
|
21
|
+
export type UsageMetricsAggregateLevel = "day" | "hour" | "minute";
|
|
22
22
|
export declare const aggregateLevel: UsageMetricsAggregateLevel;
|
package/dist/common/defined.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export declare function assertsDefined<T>(value: T | undefined, message?: string): asserts value is T;
|
|
2
|
+
export declare function assertsNotNull<T>(value: T | null, message?: string): asserts value is T;
|
|
3
|
+
export declare function assertsDefinedAndNotNull<T>(value: T | undefined | null, message?: string): asserts value is T;
|
|
1
4
|
export declare function defined<T>(value: T | undefined): T;
|
|
2
5
|
export declare function notNull<T>(value: T | null): T;
|
|
3
6
|
export declare function definedAndNotNull<T>(value: T | undefined | null): T;
|
package/dist/common/delay.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const delay: (time?: number
|
|
1
|
+
export declare const delay: (time?: number) => Promise<unknown>;
|
package/dist/common/redact.d.ts
CHANGED