@formant/realtime-sdk 1.4.9 → 1.4.11
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/dist/index.js +1 -2
- package/dist/protos/api/signaling/v1/signaling_grpc_web_pb.d.ts +45 -45
- package/dist/protos/api/signaling/v1/signaling_grpc_web_pb.js +1 -626
- package/dist/protos/api/signaling/v1/signaling_pb.d.ts +4 -0
- package/dist/protos/api/signaling/v1/signaling_pb.js +1 -3854
- package/dist/realtime-sdk/src/index.d.ts +6 -6
- package/dist/rtc-client/IHasRemoteDeviceId.d.ts +1 -1
- package/dist/rtc-client/RtcClient.d.ts +8 -6
- package/dist/rtc-client/RtcClientV1.d.ts +4 -4
- package/dist/rtc-client/RtcConnection.d.ts +2 -2
- package/dist/rtc-client/RtcConnectionV1.d.ts +1 -1
- package/dist/rtc-client/RtcSessionMetrics.d.ts +1 -1
- package/dist/rtc-client/gatherPingMetrics.d.ts +2 -2
- package/dist/rtc-client/models/IBinaryH264Message.d.ts +1 -1
- package/dist/rtc-client/models/IPingPayload.d.ts +2 -2
- package/dist/rtc-client/models/IRtcClientConfiguration.d.ts +6 -2
- package/dist/rtc-client/models/IRtcConnectionBaseConfiguration.d.ts +4 -2
- package/dist/rtc-client/models/IRtcConnectionRemoteConfiguration.d.ts +2 -2
- package/dist/rtc-client/models/IRtcPointCloud.d.ts +1 -1
- package/dist/rtc-client/models/IRtcStreamMessageHeader.d.ts +2 -2
- package/dist/rtc-client/models/IRtcStreamPayload.d.ts +16 -16
- package/dist/rtc-client/models/IRtcStreamsInfo.d.ts +1 -1
- package/dist/rtc-client/models-v1/IRtcClientConfigurationV1.d.ts +3 -3
- package/dist/rtc-client/models-v1/IRtcConnectionConfigurationV1.d.ts +3 -3
- package/dist/rtc-client/utils/createRtcStreamMessage.d.ts +1 -1
- package/dist/rtc-client/utils/encodeStreamId.d.ts +1 -1
- package/dist/rtc-client/utils/peerToRtcPeer.d.ts +1 -1
- package/dist/rtc-client/utils/streamIsEqual.d.ts +1 -1
- package/package.json +6 -8
- package/dist/client/AuthClient.d.ts +0 -42
- package/dist/client/Credentials.d.ts +0 -10
- package/dist/client/LanAgentClient.d.ts +0 -7
- package/dist/client/RtcSignalingClient.d.ts +0 -20
- package/dist/common/BaseClient.d.ts +0 -45
- package/dist/common/ConnectionError.d.ts +0 -6
- package/dist/common/FormantBaseClient.d.ts +0 -13
- package/dist/common/LogApiTransport.d.ts +0 -11
- package/dist/common/LogClient.d.ts +0 -6
- package/dist/common/LogReporter.d.ts +0 -6
- package/dist/common/LruCache.d.ts +0 -20
- package/dist/common/PromiseLruCache.d.ts +0 -11
- package/dist/common/ResponseError.d.ts +0 -11
- package/dist/common/ResponseHeadersError.d.ts +0 -7
- package/dist/common/StatsManager.d.ts +0 -39
- package/dist/common/StatsReporter.d.ts +0 -17
- package/dist/common/assertUnreachable.d.ts +0 -1
- package/dist/common/browser.d.ts +0 -2
- package/dist/common/collectErrors.d.ts +0 -1
- package/dist/common/config/index.d.ts +0 -24
- package/dist/common/defined.d.ts +0 -6
- package/dist/common/delay.d.ts +0 -1
- package/dist/common/errorConstants.d.ts +0 -7
- package/dist/common/errorToObject.d.ts +0 -16
- package/dist/common/errorToString.d.ts +0 -6
- package/dist/common/filterIceServers.d.ts +0 -8
- package/dist/common/instanceId.d.ts +0 -1
- package/dist/common/isErrorType.d.ts +0 -1
- package/dist/common/isObject.d.ts +0 -1
- package/dist/common/isValidTagString.d.ts +0 -3
- package/dist/common/logger.d.ts +0 -4
- package/dist/common/narrowError.d.ts +0 -1
- package/dist/common/objectMapValues.d.ts +0 -9
- package/dist/common/redact.d.ts +0 -6
- package/dist/common/setPromiseInterval.d.ts +0 -17
- package/dist/common/stats.d.ts +0 -2
- package/dist/common/toStringSafe.d.ts +0 -8
- package/dist/common/truncate.d.ts +0 -4
- package/dist/date-fns/parseIsoDate.d.ts +0 -1
- package/dist/index.js.LICENSE.txt +0 -19
- package/dist/model/AnnotationAreaType.d.ts +0 -2
- package/dist/model/AuditLogActionType.d.ts +0 -5
- package/dist/model/CognitoRegion.d.ts +0 -2
- package/dist/model/Feature.d.ts +0 -3
- package/dist/model/HealthStatus.d.ts +0 -2
- package/dist/model/HexRgbColor.d.ts +0 -1
- package/dist/model/IAdminSignupRequest.d.ts +0 -14
- package/dist/model/IAnnotationAreaTypeMap.d.ts +0 -4
- package/dist/model/IAudioChunk.d.ts +0 -5
- package/dist/model/IAuditLog.d.ts +0 -15
- package/dist/model/IAuthentication.d.ts +0 -8
- package/dist/model/IBaseEntity.d.ts +0 -7
- package/dist/model/IBattery.d.ts +0 -6
- package/dist/model/IBitset.d.ts +0 -9
- package/dist/model/IBoundingBox.d.ts +0 -6
- package/dist/model/IChallenge.d.ts +0 -7
- package/dist/model/ICheckSsoResult.d.ts +0 -5
- package/dist/model/IColorRGBA.d.ts +0 -6
- package/dist/model/ICompressedImage.d.ts +0 -3
- package/dist/model/ICreateServiceAccountResponse.d.ts +0 -5
- package/dist/model/IDeviceCredentials.d.ts +0 -9
- package/dist/model/IDictionary.d.ts +0 -3
- package/dist/model/IFile.d.ts +0 -6
- package/dist/model/IFilter.d.ts +0 -11
- package/dist/model/IGetFeaturesResponse.d.ts +0 -4
- package/dist/model/IGoal.d.ts +0 -5
- package/dist/model/IGoalID.d.ts +0 -3
- package/dist/model/IGoogleLoginRequest.d.ts +0 -4
- package/dist/model/IH264VideoFrame.d.ts +0 -5
- package/dist/model/IHealth.d.ts +0 -5
- package/dist/model/IImage.d.ts +0 -6
- package/dist/model/IImageAnnotation.d.ts +0 -9
- package/dist/model/IJointState.d.ts +0 -8
- package/dist/model/IJoy.d.ts +0 -4
- package/dist/model/IJsonString.d.ts +0 -3
- package/dist/model/IListResponse.d.ts +0 -9
- package/dist/model/ILocalization.d.ts +0 -14
- package/dist/model/ILocation.d.ts +0 -6
- package/dist/model/ILogLine.d.ts +0 -9
- package/dist/model/ILoginRequest.d.ts +0 -5
- package/dist/model/ILoginResult.d.ts +0 -7
- package/dist/model/IMap.d.ts +0 -10
- package/dist/model/IMarker3D.d.ts +0 -23
- package/dist/model/IMarker3DArray.d.ts +0 -4
- package/dist/model/IMetric.d.ts +0 -7
- package/dist/model/INumericSetEntry.d.ts +0 -5
- package/dist/model/IOdometry.d.ts +0 -7
- package/dist/model/IPath.d.ts +0 -7
- package/dist/model/IPoint.d.ts +0 -2
- package/dist/model/IPointCloud.d.ts +0 -6
- package/dist/model/IPoseWithCovariance.d.ts +0 -5
- package/dist/model/IPostLanRtcOfferRequest.d.ts +0 -3
- package/dist/model/IPostLanRtcOfferResponse.d.ts +0 -3
- package/dist/model/IQuaternion.d.ts +0 -6
- package/dist/model/IRequestToken.d.ts +0 -4
- package/dist/model/IRtcAddSignalsRequest.d.ts +0 -4
- package/dist/model/IRtcCapabilitySet.d.ts +0 -6
- package/dist/model/IRtcCreatePeerRequest.d.ts +0 -6
- package/dist/model/IRtcCreateSessionRequest.d.ts +0 -5
- package/dist/model/IRtcIceServer.d.ts +0 -5
- package/dist/model/IRtcInfo.d.ts +0 -7
- package/dist/model/IRtcPeer.d.ts +0 -11
- package/dist/model/IRtcPeerDescription.d.ts +0 -6
- package/dist/model/IRtcPortForwardingConfiguration.d.ts +0 -3
- package/dist/model/IRtcSession.d.ts +0 -12
- package/dist/model/IRtcSignal.d.ts +0 -3
- package/dist/model/IRtcStream.d.ts +0 -9
- package/dist/model/IRtcStreamCapability.d.ts +0 -6
- package/dist/model/IRtcStreamingConfiguration.d.ts +0 -4
- package/dist/model/IScopeFilter.d.ts +0 -6
- package/dist/model/IStat.d.ts +0 -21
- package/dist/model/IStreamTypeMap.d.ts +0 -27
- package/dist/model/ITagFilter.d.ts +0 -4
- package/dist/model/ITagSets.d.ts +0 -3
- package/dist/model/ITaggedEntity.d.ts +0 -5
- package/dist/model/ITags.d.ts +0 -2
- package/dist/model/ITransform.d.ts +0 -6
- package/dist/model/ITransformNode.d.ts +0 -8
- package/dist/model/ITwist.d.ts +0 -5
- package/dist/model/IUser.d.ts +0 -40
- package/dist/model/IUserScope.d.ts +0 -16
- package/dist/model/IValidation.d.ts +0 -3
- package/dist/model/IVector3.d.ts +0 -5
- package/dist/model/IVideo.d.ts +0 -7
- package/dist/model/IsoDate.d.ts +0 -1
- package/dist/model/LanguageType.d.ts +0 -2
- package/dist/model/LogLevel.d.ts +0 -2
- package/dist/model/Marker3DAction.d.ts +0 -2
- package/dist/model/Marker3DType.d.ts +0 -2
- package/dist/model/OrganizationPlan.d.ts +0 -2
- package/dist/model/RequireKeys.d.ts +0 -3
- package/dist/model/RtcConnectionStatus.d.ts +0 -2
- package/dist/model/RtcIceServerProtocol.d.ts +0 -2
- package/dist/model/RtcIceTransportPolicy.d.ts +0 -2
- package/dist/model/RtcSessionType.d.ts +0 -2
- package/dist/model/RtcStreamType.d.ts +0 -3
- package/dist/model/SmsOptInStatus.d.ts +0 -2
- package/dist/model/StreamType.d.ts +0 -2
- package/dist/model/Timeout.d.ts +0 -1
- package/dist/model/Timestamp.d.ts +0 -1
- package/dist/model/Uuid.d.ts +0 -1
- package/dist/model/VideoMimeType.d.ts +0 -2
- package/dist/model/auditLogActionTypes.d.ts +0 -1
- package/dist/model/bytes.d.ts +0 -9
- package/dist/model/cognitoRegions.d.ts +0 -1
- package/dist/model/duration.d.ts +0 -10
- package/dist/model/features.d.ts +0 -2
- package/dist/model/healthStatuses.d.ts +0 -5
- package/dist/model/languageTypes.d.ts +0 -1
- package/dist/model/logLevels.d.ts +0 -1
- package/dist/model/marker3DActions.d.ts +0 -1
- package/dist/model/marker3DTypes.d.ts +0 -1
- package/dist/model/organizationPlans.d.ts +0 -1
- package/dist/model/reservedTagValues.d.ts +0 -3
- package/dist/model/rtcConnectionStatuses.d.ts +0 -1
- package/dist/model/rtcIceServerProtocols.d.ts +0 -1
- package/dist/model/rtcIceTransportPolicies.d.ts +0 -1
- package/dist/model/rtcSessionTypes.d.ts +0 -1
- package/dist/model/rtcStreamTypes.d.ts +0 -32
- package/dist/model/smsOptInStatuses.d.ts +0 -1
- package/dist/model/userResources.d.ts +0 -1
- package/dist/model/videoMimeTypes.d.ts +0 -1
- package/dist/protos/api/signaling/v1/signaling.proto +0 -114
- package/dist/protos/index.d.ts +0 -3
- package/dist/protos/index.js +0 -14
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { AuthClient } from "
|
|
2
|
-
export { Credentials } from "
|
|
3
|
-
export { RtcSignalingClient } from "
|
|
1
|
+
export { AuthClient } from "@formant/core/client/AuthClient";
|
|
2
|
+
export { Credentials } from "@formant/core/client/Credentials";
|
|
3
|
+
export { RtcSignalingClient } from "@formant/core/client/RtcSignalingClient";
|
|
4
4
|
export { SignalingPromiseClient } from "../../protos";
|
|
5
5
|
export { RtcClient } from "../../rtc-client/RtcClient";
|
|
6
6
|
export { RtcClientV1 } from "../../rtc-client/RtcClientV1";
|
|
7
7
|
export { createRtcStreamMessage } from "../../rtc-client/utils/createRtcStreamMessage";
|
|
8
|
-
export type { IRtcPeer } from "
|
|
9
|
-
export type { IRtcStream } from "
|
|
10
|
-
export type { RtcStreamType } from "
|
|
8
|
+
export type { IRtcPeer } from "@formant/core/model/IRtcPeer";
|
|
9
|
+
export type { IRtcStream } from "@formant/core/model/IRtcStream";
|
|
10
|
+
export type { RtcStreamType } from "@formant/core/model/RtcStreamType";
|
|
11
11
|
export type { IRtcClientConfigurationV1 } from "../../rtc-client/models-v1/IRtcClientConfigurationV1";
|
|
12
12
|
export type { IRtcClientConfiguration } from "../../rtc-client/models/IRtcClientConfiguration";
|
|
13
13
|
export type { IRtcConnectionStatsInfo } from "../../rtc-client/models/IRtcConnectionStatsInfo";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { IRtcInfo } from "
|
|
2
|
-
import { IRtcPeer } from "
|
|
3
|
-
import { RtcConnectionStatus } from "
|
|
4
|
-
import { Timestamp } from "
|
|
5
|
-
import { Uuid } from "
|
|
1
|
+
import { IRtcInfo } from "@formant/core/model/IRtcInfo";
|
|
2
|
+
import { IRtcPeer } from "@formant/core/model/IRtcPeer";
|
|
3
|
+
import { RtcConnectionStatus } from "@formant/core/model/RtcConnectionStatus";
|
|
4
|
+
import { Timestamp } from "@formant/core/model/Timestamp";
|
|
5
|
+
import { Uuid } from "@formant/core/model/Uuid";
|
|
6
6
|
import { IPingInfo } from "./models/IPingInfo";
|
|
7
7
|
import { IRtcClientConfiguration } from "./models/IRtcClientConfiguration";
|
|
8
8
|
import { IRtcConnectionStatsInfo } from "./models/IRtcConnectionStatsInfo";
|
|
@@ -39,7 +39,9 @@ export declare class RtcClient {
|
|
|
39
39
|
* Connects to a peer given its id.
|
|
40
40
|
* Returns the id of the session, if one is created.
|
|
41
41
|
*/
|
|
42
|
-
connect(remotePeerId: Uuid, rtcInfo?: IRtcInfo
|
|
42
|
+
connect(remotePeerId: Uuid, rtcInfo?: IRtcInfo, options?: {
|
|
43
|
+
lockDevice?: boolean;
|
|
44
|
+
}): Promise<Uuid | undefined>;
|
|
43
45
|
connectLan(agentEndpoint: string): Promise<Uuid | false>;
|
|
44
46
|
getConnections(): RtcConnection[];
|
|
45
47
|
createCustomDataChannel(remotePeerId: Uuid, channelName: string, init: RTCDataChannelInit, isBinary: boolean, listener: (peerId: Uuid, channel: RTCDataChannel) => void): () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IRtcPeer } from "
|
|
2
|
-
import { RtcConnectionStatus } from "
|
|
3
|
-
import { Timestamp } from "
|
|
4
|
-
import { Uuid } from "
|
|
1
|
+
import { IRtcPeer } from "@formant/core/model/IRtcPeer";
|
|
2
|
+
import { RtcConnectionStatus } from "@formant/core/model/RtcConnectionStatus";
|
|
3
|
+
import { Timestamp } from "@formant/core/model/Timestamp";
|
|
4
|
+
import { Uuid } from "@formant/core/model/Uuid";
|
|
5
5
|
import { IRtcClientConfigurationV1 } from "./models-v1/IRtcClientConfigurationV1";
|
|
6
6
|
import { IIceMode } from "./models/IIceMode";
|
|
7
7
|
import { IRtcSendConfiguration } from "./models/IRtcSendConfiguration";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Timestamp } from "
|
|
2
|
-
import { Uuid } from "
|
|
1
|
+
import { Timestamp } from "@formant/core/model/Timestamp";
|
|
2
|
+
import { Uuid } from "@formant/core/model/Uuid";
|
|
3
3
|
import { Signal } from "../protos";
|
|
4
4
|
import { IHasPeerConnection } from "./IHasPeerConnection";
|
|
5
5
|
import { IHasRemoteDeviceId } from "./IHasRemoteDeviceId";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRtcSignal } from "
|
|
1
|
+
import { IRtcSignal } from "@formant/core/model/IRtcSignal";
|
|
2
2
|
import { IHasPeerConnection } from "./IHasPeerConnection";
|
|
3
3
|
import { IRtcConnectionConfigurationV1 } from "./models-v1/IRtcConnectionConfigurationV1";
|
|
4
4
|
import { IIceMode } from "./models/IIceMode";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Timestamp } from "
|
|
1
|
+
import { Timestamp } from "@formant/core/model/Timestamp";
|
|
2
2
|
import { IHasPeerConnection } from "./IHasPeerConnection";
|
|
3
3
|
import { IHasRemoteDeviceId } from "./IHasRemoteDeviceId";
|
|
4
4
|
import { IRtcSessionMetricsMessageCounts } from "./models/IRtcSessionMetricsMessageCounts";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Timestamp } from "
|
|
2
|
-
import { Uuid } from "
|
|
1
|
+
import { Timestamp } from "@formant/core/model/Timestamp";
|
|
2
|
+
import { Uuid } from "@formant/core/model/Uuid";
|
|
3
3
|
import { IPingInfo } from "./models/IPingInfo";
|
|
4
4
|
export interface IPing {
|
|
5
5
|
sent: Timestamp;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IH264VideoFrame } from "
|
|
1
|
+
import { IH264VideoFrame } from "@formant/core/model/IH264VideoFrame";
|
|
2
2
|
import { IRtcStreamCommunication } from "./IRtcStreamCommunication";
|
|
3
3
|
export interface IBinaryH264Message extends IRtcStreamCommunication<"binary-h264"> {
|
|
4
4
|
timestamp: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Timestamp } from "
|
|
2
|
-
import { Uuid } from "
|
|
1
|
+
import { Timestamp } from "@formant/core/model/Timestamp";
|
|
2
|
+
import { Uuid } from "@formant/core/model/Uuid";
|
|
3
3
|
export interface IPingPayload {
|
|
4
4
|
timestamp: Timestamp;
|
|
5
5
|
id: Uuid;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { Timestamp } from "
|
|
2
|
-
import { Uuid } from "
|
|
1
|
+
import { Timestamp } from "@formant/core/model/Timestamp";
|
|
2
|
+
import { Uuid } from "@formant/core/model/Uuid";
|
|
3
3
|
import { SessionType, SignalingPromiseClient } from "../../protos";
|
|
4
4
|
import { IRtcStreamMessage } from "./IRtcStreamMessage";
|
|
5
5
|
export type IRtcClientConfiguration = {
|
|
6
6
|
receive: (peerId: Uuid, message: IRtcStreamMessage) => void;
|
|
7
7
|
onStreamsInfoUpdate?: (peerId: Uuid, timestamp: Timestamp) => void;
|
|
8
|
+
/** Called when sending the connection signal fails (e.g. device locked). */
|
|
9
|
+
onConnectionError?: (error: unknown) => void;
|
|
8
10
|
alternateRTCPeerConnection?: typeof RTCPeerConnection;
|
|
9
11
|
sessionType?: SessionType;
|
|
12
|
+
/** When true, offer requests a device lock (all session types). Default false. */
|
|
13
|
+
lockDevice?: boolean;
|
|
10
14
|
} & ({
|
|
11
15
|
lanOnlyMode: true;
|
|
12
16
|
} | {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Timestamp } from "
|
|
2
|
-
import { Uuid } from "
|
|
1
|
+
import { Timestamp } from "@formant/core/model/Timestamp";
|
|
2
|
+
import { Uuid } from "@formant/core/model/Uuid";
|
|
3
3
|
import { SessionType } from "../../protos";
|
|
4
4
|
import { IRtcStreamMessage } from "./IRtcStreamMessage";
|
|
5
5
|
export interface IRtcConnectionBaseConfiguration {
|
|
@@ -10,6 +10,8 @@ export interface IRtcConnectionBaseConfiguration {
|
|
|
10
10
|
localUserId?: Uuid;
|
|
11
11
|
remoteDeviceId?: Uuid;
|
|
12
12
|
sessionType?: SessionType;
|
|
13
|
+
/** When true, offer requests a device lock (all session types). Default false. */
|
|
14
|
+
lockDevice?: boolean;
|
|
13
15
|
receive: (peerId: Uuid, message: IRtcStreamMessage) => void;
|
|
14
16
|
onStreamsInfoUpdate?: (peerId: Uuid, timestamp: Timestamp) => void;
|
|
15
17
|
track?: (event: string, properties?: object) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Timestamp } from "
|
|
2
|
-
import { Uuid } from "
|
|
1
|
+
import { Timestamp } from "@formant/core/model/Timestamp";
|
|
2
|
+
import { Uuid } from "@formant/core/model/Uuid";
|
|
3
3
|
export interface IRtcConnectionRemoteConfiguration {
|
|
4
4
|
sessionId?: Uuid;
|
|
5
5
|
sessionCreatedTimestamp?: Timestamp;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IRtcStream } from "
|
|
2
|
-
import { Timestamp } from "
|
|
1
|
+
import { IRtcStream } from "@formant/core/model/IRtcStream";
|
|
2
|
+
import { Timestamp } from "@formant/core/model/Timestamp";
|
|
3
3
|
export interface IRtcStreamMessageHeader {
|
|
4
4
|
stream: IRtcStream;
|
|
5
5
|
created: Timestamp;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { IAudioChunk } from "
|
|
2
|
-
import { ICompressedImage } from "
|
|
3
|
-
import { IGoalID } from "
|
|
4
|
-
import { IH264VideoFrame } from "
|
|
5
|
-
import { IJointState } from "
|
|
6
|
-
import { IJoy } from "
|
|
7
|
-
import { IJsonString } from "
|
|
8
|
-
import { ILocation } from "
|
|
9
|
-
import { IMap } from "
|
|
10
|
-
import { IMarker3DArray } from "
|
|
11
|
-
import { IOdometry } from "
|
|
12
|
-
import { IPoint } from "
|
|
13
|
-
import { IPoseWithCovariance } from "
|
|
14
|
-
import { ITransform } from "
|
|
15
|
-
import { ITwist } from "
|
|
16
|
-
import { Timestamp } from "
|
|
1
|
+
import { IAudioChunk } from "@formant/core/model/IAudioChunk";
|
|
2
|
+
import { ICompressedImage } from "@formant/core/model/ICompressedImage";
|
|
3
|
+
import { IGoalID } from "@formant/core/model/IGoalID";
|
|
4
|
+
import { IH264VideoFrame } from "@formant/core/model/IH264VideoFrame";
|
|
5
|
+
import { IJointState } from "@formant/core/model/IJointState";
|
|
6
|
+
import { IJoy } from "@formant/core/model/IJoy";
|
|
7
|
+
import { IJsonString } from "@formant/core/model/IJsonString";
|
|
8
|
+
import { ILocation } from "@formant/core/model/ILocation";
|
|
9
|
+
import { IMap } from "@formant/core/model/IMap";
|
|
10
|
+
import { IMarker3DArray } from "@formant/core/model/IMarker3DArray";
|
|
11
|
+
import { IOdometry } from "@formant/core/model/IOdometry";
|
|
12
|
+
import { IPoint } from "@formant/core/model/IPoint";
|
|
13
|
+
import { IPoseWithCovariance } from "@formant/core/model/IPoseWithCovariance";
|
|
14
|
+
import { ITransform } from "@formant/core/model/ITransform";
|
|
15
|
+
import { ITwist } from "@formant/core/model/ITwist";
|
|
16
|
+
import { Timestamp } from "@formant/core/model/Timestamp";
|
|
17
17
|
import { IPingPayload } from "./IPingPayload";
|
|
18
18
|
import { IRtcAgentInfo } from "./IRtcAgentInfo";
|
|
19
19
|
import { IRtcPointCloud } from "./IRtcPointCloud";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { RtcSignalingClient } from "
|
|
2
|
-
import { IRtcCapabilitySet } from "
|
|
3
|
-
import { Uuid } from "
|
|
1
|
+
import { RtcSignalingClient } from "@formant/core/client/RtcSignalingClient";
|
|
2
|
+
import { IRtcCapabilitySet } from "@formant/core/model/IRtcCapabilitySet";
|
|
3
|
+
import { Uuid } from "@formant/core/model/Uuid";
|
|
4
4
|
import { IRtcStreamMessage } from "../models/IRtcStreamMessage";
|
|
5
5
|
export interface IRtcClientConfigurationV1 {
|
|
6
6
|
signalingClient: RtcSignalingClient;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IRtcPeer } from "
|
|
2
|
-
import { IRtcSignal } from "
|
|
3
|
-
import { Uuid } from "
|
|
1
|
+
import { IRtcPeer } from "@formant/core/model/IRtcPeer";
|
|
2
|
+
import { IRtcSignal } from "@formant/core/model/IRtcSignal";
|
|
3
|
+
import { Uuid } from "@formant/core/model/Uuid";
|
|
4
4
|
import { IRtcStreamMessage } from "../models/IRtcStreamMessage";
|
|
5
5
|
export interface IRtcConnectionConfigurationV1 {
|
|
6
6
|
sessionId: Uuid;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRtcStream } from "
|
|
1
|
+
import { IRtcStream } from "@formant/core/model/IRtcStream";
|
|
2
2
|
import { IRtcStreamMessage } from "../models/IRtcStreamMessage";
|
|
3
3
|
import { IRtcStreamPayload } from "../models/IRtcStreamPayload";
|
|
4
4
|
export declare function createRtcStreamMessage(stream: IRtcStream, payload: IRtcStreamPayload, frameId?: string): IRtcStreamMessage;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IRtcStream } from "
|
|
1
|
+
import { IRtcStream } from "@formant/core/model/IRtcStream";
|
|
2
2
|
export declare function encodeStreamId({ entityId, streamName, streamType, }: IRtcStream): string;
|
|
3
3
|
export declare function decodeStreamId(streamId: string): IRtcStream;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IRtcStream } from "
|
|
1
|
+
import { IRtcStream } from "@formant/core/model/IRtcStream";
|
|
2
2
|
export declare function streamIsEqual(stream1: IRtcStream, stream2: IRtcStream): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formant/realtime-sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/realtime-sdk/src/index.d.ts",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"clean": "rimraf dist",
|
|
12
12
|
"compile": "tsc",
|
|
13
13
|
"build": "yarn maybe-make-protos && env $(node ../../scripts/webpack4-node-18-support.js && grep -v '^#' src/config/production.env) webpack",
|
|
14
|
-
"postbuild": "tsc --emitDeclarationOnly --declaration --declarationDir ./dist --skipLibCheck && tsc-alias
|
|
14
|
+
"postbuild": "tsc --emitDeclarationOnly --declaration --declarationDir ./dist --skipLibCheck && tsc-alias",
|
|
15
15
|
"maybe-make-protos": "if [ -z ${LERNA_PACKAGE_NAME} ]; then cd ../../../ && make protos_ts && cd -; fi"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
@@ -21,9 +21,7 @@
|
|
|
21
21
|
"generic-pool": "^3.9.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@formant/
|
|
25
|
-
"@formant/common": "*",
|
|
26
|
-
"@formant/model": "*",
|
|
24
|
+
"@formant/core": "*",
|
|
27
25
|
"@formant/protos": "*",
|
|
28
26
|
"@formant/rtc-client": "*",
|
|
29
27
|
"assert": "^2.1.0",
|
|
@@ -41,7 +39,7 @@
|
|
|
41
39
|
"rimraf": "^5.0.1",
|
|
42
40
|
"stream-browserify": "^3.0.0",
|
|
43
41
|
"stream-http": "^3.2.0",
|
|
44
|
-
"terser-webpack-plugin": "^
|
|
42
|
+
"terser-webpack-plugin": "^5.3.10",
|
|
45
43
|
"ts-loader": "^9.5.0",
|
|
46
44
|
"tsc-alias": "^1.4.1",
|
|
47
45
|
"url": "^0.11.3",
|
|
@@ -52,6 +50,6 @@
|
|
|
52
50
|
"author": "",
|
|
53
51
|
"description": "",
|
|
54
52
|
"engines": {
|
|
55
|
-
"node": "^
|
|
53
|
+
"node": "^24.0.0"
|
|
56
54
|
}
|
|
57
|
-
}
|
|
55
|
+
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { FormantBaseClient } from "../common/FormantBaseClient";
|
|
2
|
-
import { Feature } from "../model/Feature";
|
|
3
|
-
import { IAdminSignupRequest } from "../model/IAdminSignupRequest";
|
|
4
|
-
import { ICheckSsoResult } from "../model/ICheckSsoResult";
|
|
5
|
-
import { ICreateServiceAccountResponse } from "../model/ICreateServiceAccountResponse";
|
|
6
|
-
import { IDeviceCredentials } from "../model/IDeviceCredentials";
|
|
7
|
-
import { IGoogleLoginRequest } from "../model/IGoogleLoginRequest";
|
|
8
|
-
import { ILoginRequest } from "../model/ILoginRequest";
|
|
9
|
-
import { ILoginResult } from "../model/ILoginResult";
|
|
10
|
-
import { ITags } from "../model/ITags";
|
|
11
|
-
import { IUser } from "../model/IUser";
|
|
12
|
-
import { Uuid } from "../model/Uuid";
|
|
13
|
-
export declare class AuthClient extends FormantBaseClient {
|
|
14
|
-
adminSignup(props: IAdminSignupRequest, token?: string): Promise<IUser>;
|
|
15
|
-
login(credentials: ILoginRequest): Promise<ILoginResult>;
|
|
16
|
-
loginWithGoogleToken(credentials: IGoogleLoginRequest): Promise<ILoginResult>;
|
|
17
|
-
refresh(refreshToken: string, tokenExpirationSeconds?: number): Promise<ILoginResult>;
|
|
18
|
-
respondToNewPasswordRequiredChallenge(props: {
|
|
19
|
-
userId: Uuid;
|
|
20
|
-
session: string;
|
|
21
|
-
newPassword: string;
|
|
22
|
-
}): Promise<ILoginResult>;
|
|
23
|
-
forgotPassword(email: string): Promise<void>;
|
|
24
|
-
confirmForgotPassword(props: {
|
|
25
|
-
email: string;
|
|
26
|
-
confirmationCode: string;
|
|
27
|
-
newPassword: string;
|
|
28
|
-
}): Promise<void>;
|
|
29
|
-
resendInvitation(email: string): Promise<void>;
|
|
30
|
-
changePassword({ token, refreshToken, currentPassword, newPassword, }: {
|
|
31
|
-
token: string;
|
|
32
|
-
refreshToken: string;
|
|
33
|
-
currentPassword: string;
|
|
34
|
-
newPassword: string;
|
|
35
|
-
}): Promise<void>;
|
|
36
|
-
getDeviceCredentials(token: string): Promise<IDeviceCredentials>;
|
|
37
|
-
impersonate(token: string, userId: Uuid): Promise<ILoginResult>;
|
|
38
|
-
createServiceAccount(token: string, name: string, roleId: Uuid, tags: ITags, description?: string): Promise<ICreateServiceAccountResponse>;
|
|
39
|
-
getFeatures(token: string): Promise<Feature[]>;
|
|
40
|
-
checkSso(email: string, allowUserAutoCreation?: boolean): Promise<ICheckSsoResult>;
|
|
41
|
-
loginWithSso(token: string, refreshToken?: string): Promise<ILoginResult>;
|
|
42
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from "./AuthClient";
|
|
2
|
-
export declare class Credentials {
|
|
3
|
-
private authClient;
|
|
4
|
-
private email;
|
|
5
|
-
private password;
|
|
6
|
-
private tokenTtlMs;
|
|
7
|
-
private tokenCache;
|
|
8
|
-
constructor(authClient: AuthClient, email: string, password: string);
|
|
9
|
-
getToken(): Promise<string>;
|
|
10
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BaseClient } from "../common/BaseClient";
|
|
2
|
-
import { IPostLanRtcOfferRequest } from "../model/IPostLanRtcOfferRequest";
|
|
3
|
-
import { IPostLanRtcOfferResponse } from "../model/IPostLanRtcOfferResponse";
|
|
4
|
-
export declare class LanAgentClient extends BaseClient {
|
|
5
|
-
constructor(endpoint: string);
|
|
6
|
-
postLanRtcOffer(request: IPostLanRtcOfferRequest): Promise<IPostLanRtcOfferResponse>;
|
|
7
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FormantBaseClient } from "../common/FormantBaseClient";
|
|
2
|
-
import { IRtcAddSignalsRequest } from "../model/IRtcAddSignalsRequest";
|
|
3
|
-
import { IRtcCreatePeerRequest } from "../model/IRtcCreatePeerRequest";
|
|
4
|
-
import { IRtcCreateSessionRequest } from "../model/IRtcCreateSessionRequest";
|
|
5
|
-
import { IRtcPeer } from "../model/IRtcPeer";
|
|
6
|
-
import { IRtcSession } from "../model/IRtcSession";
|
|
7
|
-
import { IRtcSignal } from "../model/IRtcSignal";
|
|
8
|
-
import { Uuid } from "../model/Uuid";
|
|
9
|
-
export declare class RtcSignalingClient extends FormantBaseClient {
|
|
10
|
-
createPeer(token: string, request: IRtcCreatePeerRequest): Promise<IRtcPeer>;
|
|
11
|
-
getPeers(token: string): Promise<IRtcPeer[]>;
|
|
12
|
-
refreshPeer(token: string, id: Uuid): Promise<void>;
|
|
13
|
-
createSession(token: string, request: IRtcCreateSessionRequest): Promise<IRtcSession>;
|
|
14
|
-
refreshSession(token: string, id: Uuid): Promise<void>;
|
|
15
|
-
deleteSession(token: string, id: Uuid): Promise<void>;
|
|
16
|
-
getSessions(token: string): Promise<IRtcSession[]>;
|
|
17
|
-
getIceServers(token: string): Promise<RTCIceServer[]>;
|
|
18
|
-
addSignals(token: string, sessionId: Uuid, request: IRtcAddSignalsRequest): Promise<void>;
|
|
19
|
-
takeSignals(token: string, sessionId: Uuid): Promise<IRtcSignal[]>;
|
|
20
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { IDictionary } from "../model/IDictionary";
|
|
2
|
-
import { IRequestToken } from "../model/IRequestToken";
|
|
3
|
-
import { IValidation } from "../model/IValidation";
|
|
4
|
-
import { ResponseError } from "./ResponseError";
|
|
5
|
-
export interface IRequestInit {
|
|
6
|
-
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
7
|
-
headers?: IDictionary;
|
|
8
|
-
body?: any;
|
|
9
|
-
token?: string | IRequestToken;
|
|
10
|
-
allowUnsafeRetries?: boolean;
|
|
11
|
-
json?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export interface IResponse<T> {
|
|
14
|
-
body: T;
|
|
15
|
-
headers: Headers;
|
|
16
|
-
}
|
|
17
|
-
export declare abstract class BaseClient {
|
|
18
|
-
protected endpoint: string | undefined;
|
|
19
|
-
static retries: number;
|
|
20
|
-
static waitForConnectivity: () => Promise<void>;
|
|
21
|
-
static onResponseError: (error: ResponseError) => Promise<void>;
|
|
22
|
-
private validateHeaders;
|
|
23
|
-
private verbose;
|
|
24
|
-
private configuredRetries;
|
|
25
|
-
private timeoutMs?;
|
|
26
|
-
private maxBackoffDelayMs;
|
|
27
|
-
private json;
|
|
28
|
-
constructor(endpoint: string | undefined, options?: {
|
|
29
|
-
validateHeaders?: (headers: Headers) => IValidation;
|
|
30
|
-
verbose?: boolean;
|
|
31
|
-
retries?: number;
|
|
32
|
-
timeoutMs?: number;
|
|
33
|
-
maxBackoffDelayMs?: number;
|
|
34
|
-
json?: boolean;
|
|
35
|
-
});
|
|
36
|
-
protected getRetries(): number;
|
|
37
|
-
protected getHeaders(): {
|
|
38
|
-
[_: string]: string;
|
|
39
|
-
};
|
|
40
|
-
protected fetch<T>(path: string, extendedInit?: IRequestInit): Promise<T>;
|
|
41
|
-
protected fetchVerbose<T>(path: string, extendedInit?: IRequestInit): Promise<IResponse<T>>;
|
|
42
|
-
private doFetch;
|
|
43
|
-
private getConstructor;
|
|
44
|
-
static isNetworkError(error: any): boolean;
|
|
45
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BaseClient } from "./BaseClient";
|
|
2
|
-
export declare abstract class FormantBaseClient extends BaseClient {
|
|
3
|
-
protected endpoint: string;
|
|
4
|
-
static headers: {
|
|
5
|
-
[_: string]: string;
|
|
6
|
-
};
|
|
7
|
-
constructor(endpoint: string, options?: {
|
|
8
|
-
timeoutMs?: number;
|
|
9
|
-
});
|
|
10
|
-
protected getHeaders(): {
|
|
11
|
-
[_: string]: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import Transport from "winston-transport";
|
|
2
|
-
export declare class LogApiTransport extends Transport {
|
|
3
|
-
private endpoint;
|
|
4
|
-
private metadata;
|
|
5
|
-
private logClient;
|
|
6
|
-
constructor(endpoint: string, metadata: {
|
|
7
|
-
[_: string]: string;
|
|
8
|
-
});
|
|
9
|
-
private getLogClient;
|
|
10
|
-
log(info: any, callback: () => void): Promise<void>;
|
|
11
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import BaseLruCache from "lru-cache";
|
|
2
|
-
export type CacheOptions<V> = BaseLruCache.Options<string, V> & {
|
|
3
|
-
name: string;
|
|
4
|
-
fastStringify?: boolean;
|
|
5
|
-
};
|
|
6
|
-
export declare class LruCache<K, V> {
|
|
7
|
-
private options;
|
|
8
|
-
private cache;
|
|
9
|
-
private stringify;
|
|
10
|
-
constructor(options: CacheOptions<V>);
|
|
11
|
-
set(key: K, value: V, ttl?: number): void;
|
|
12
|
-
get(key: K): V | undefined;
|
|
13
|
-
delete(key: K): void;
|
|
14
|
-
peek(key: K): V | undefined;
|
|
15
|
-
size(): number;
|
|
16
|
-
clear(): void;
|
|
17
|
-
forEach(callback: (value: V) => void): void;
|
|
18
|
-
purgeStale(): boolean;
|
|
19
|
-
private updateStats;
|
|
20
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CacheOptions, LruCache } from "./LruCache";
|
|
2
|
-
export type PromiseCacheOptions<V> = CacheOptions<Promise<V>> & {
|
|
3
|
-
expireRejectedPromiseValues?: boolean;
|
|
4
|
-
rejectedPromiseValueTtl?: number;
|
|
5
|
-
};
|
|
6
|
-
export declare class PromiseLruCache<K, V> extends LruCache<K, Promise<V>> {
|
|
7
|
-
protected expireRejectedPromiseValues: boolean;
|
|
8
|
-
protected rejectedPromiseValueTtl: number;
|
|
9
|
-
constructor(options: PromiseCacheOptions<V>);
|
|
10
|
-
set(key: K, value: Promise<V>, ttl?: number): void;
|
|
11
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IValidation } from "../model/IValidation";
|
|
2
|
-
export declare class ResponseError extends Error {
|
|
3
|
-
method: string;
|
|
4
|
-
url: string;
|
|
5
|
-
requestBody: any;
|
|
6
|
-
statusCode: number;
|
|
7
|
-
headers: any;
|
|
8
|
-
body: any;
|
|
9
|
-
validationErrors: IValidation;
|
|
10
|
-
constructor(method: string, url: string, requestBody: any, statusCode: number, headers: any, body: any, validationErrors?: IValidation);
|
|
11
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { IValidation } from "../model/IValidation";
|
|
2
|
-
import { ResponseError } from "./ResponseError";
|
|
3
|
-
export declare class ResponseHeadersError extends Error {
|
|
4
|
-
validationErrors: IValidation;
|
|
5
|
-
responseError: ResponseError;
|
|
6
|
-
constructor(validationErrors: IValidation, responseError: ResponseError);
|
|
7
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { IStat } from "../model/IStat";
|
|
2
|
-
import { ITags } from "../model/ITags";
|
|
3
|
-
import { StatsReporter } from "./StatsReporter";
|
|
4
|
-
export declare class StatsManager {
|
|
5
|
-
static readonly samplePeriodMs: number;
|
|
6
|
-
private buffer;
|
|
7
|
-
private reporters;
|
|
8
|
-
private flushInterval;
|
|
9
|
-
private tags;
|
|
10
|
-
constructor(config?: {
|
|
11
|
-
tags?: ITags;
|
|
12
|
-
});
|
|
13
|
-
shutdown(): Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* Aggregates a value into the IStat record at key.
|
|
16
|
-
*/
|
|
17
|
-
aggregate(metric: string, value: number | IStat, tags?: ITags): void;
|
|
18
|
-
/**
|
|
19
|
-
* Aggregates 1 into the IStat record at key.
|
|
20
|
-
*/
|
|
21
|
-
increment(metric: string, tags?: ITags): void;
|
|
22
|
-
/**
|
|
23
|
-
* Times a function call and the promise it produces.
|
|
24
|
-
* The timing statistic is only recorded if the function
|
|
25
|
-
* returns without an exception.
|
|
26
|
-
*/
|
|
27
|
-
timer<T>(metric: string, f: () => Promise<T>, tags?: ITags): Promise<T>;
|
|
28
|
-
/**
|
|
29
|
-
* Register a reporter.
|
|
30
|
-
*/
|
|
31
|
-
registerStatsReporter(statsReporter: StatsReporter): void;
|
|
32
|
-
setTag(key: string, value: string): void;
|
|
33
|
-
private addToBuffer;
|
|
34
|
-
private write;
|
|
35
|
-
private flushStats;
|
|
36
|
-
private encodeKey;
|
|
37
|
-
private decodeKey;
|
|
38
|
-
private filterTags;
|
|
39
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IMetric } from "../model/IMetric";
|
|
2
|
-
import { ITags } from "../model/ITags";
|
|
3
|
-
export interface IEntryTypeMap {
|
|
4
|
-
simple: IStatEntry;
|
|
5
|
-
tagged: ITaggedStatEntry;
|
|
6
|
-
}
|
|
7
|
-
export type StatsReporterType = keyof IEntryTypeMap;
|
|
8
|
-
export type IStatEntry = Omit<IMetric, "tags">;
|
|
9
|
-
export type ITaggedStatEntry = IStatEntry & {
|
|
10
|
-
tags: ITags;
|
|
11
|
-
};
|
|
12
|
-
export declare abstract class StatsReporter<T extends StatsReporterType = StatsReporterType> {
|
|
13
|
-
readonly type: T;
|
|
14
|
-
readonly name: string;
|
|
15
|
-
constructor(type: T, name: string);
|
|
16
|
-
abstract send(values: IEntryTypeMap[T][], intervalMs: number): Promise<void>;
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function assertUnreachable(_: never): never;
|
package/dist/common/browser.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function collectErrors<T>(promises: Promise<T>[]): Promise<Error[]>;
|