@formant/realtime-sdk 1.4.3 → 1.4.5
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/README.md +32 -21
- package/dist/client/AuthClient.d.ts +1 -1
- package/dist/common/BaseClient.d.ts +3 -1
- package/dist/common/config/index.d.ts +1 -0
- package/dist/common/errorConstants.d.ts +7 -0
- package/dist/common/isValidTagString.d.ts +3 -1
- package/dist/common/redact.d.ts +2 -0
- package/dist/common/setPromiseInterval.d.ts +3 -2
- package/dist/common/truncate.d.ts +4 -0
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +5 -7
- package/dist/model/IAuditLog.d.ts +1 -0
- package/dist/model/IBitset.d.ts +5 -0
- package/dist/model/IFilter.d.ts +2 -2
- package/dist/model/IListResponse.d.ts +6 -0
- package/dist/model/IPath.d.ts +3 -1
- package/dist/model/IRequestToken.d.ts +4 -0
- package/dist/model/IUser.d.ts +6 -1
- package/dist/model/auditLogActionTypes.d.ts +1 -1
- package/dist/model/features.d.ts +1 -1
- package/dist/model/healthStatuses.d.ts +3 -3
- package/dist/model/reservedTagValues.d.ts +3 -0
- package/dist/model/rtcConnectionStatuses.d.ts +1 -1
- package/dist/model/rtcStreamTypes.d.ts +5 -1
- package/dist/model/userResources.d.ts +1 -0
- package/dist/protos/api/signaling/v1/BUILD.bazel +25 -0
- package/dist/protos/index.d.ts +3 -0
- package/dist/protos/index.js +14 -0
- package/dist/realtime-sdk/src/index.d.ts +3 -3
- package/dist/rtc-client/RtcConnection.d.ts +5 -1
- package/dist/rtc-client/models/IBinaryH264Message.d.ts +13 -0
- package/dist/rtc-client/models/IRtcClientConfiguration.d.ts +1 -2
- package/dist/rtc-client/models/IRtcConnectionBaseConfiguration.d.ts +1 -1
- package/dist/rtc-client/models/IRtcStreamPayload.d.ts +12 -0
- package/dist/rtc-client/models/RtcCommunicationType.d.ts +1 -1
- package/dist/rtc-client/utils/binaryMessageParser.d.ts +19 -0
- package/dist/rtc-client/utils/peerToRtcPeer.d.ts +1 -1
- package/package.json +19 -5
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/*
|
|
2
|
-
object-assign
|
|
3
|
-
(c) Sindre Sorhus
|
|
4
|
-
@license MIT
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
1
|
/*!
|
|
8
2
|
* The buffer module from node.js, for the browser.
|
|
9
3
|
*
|
|
@@ -14,8 +8,12 @@ object-assign
|
|
|
14
8
|
/*!
|
|
15
9
|
* The buffer module from node.js, for the browser.
|
|
16
10
|
*
|
|
17
|
-
* @author Feross Aboukhadijeh <
|
|
11
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
18
12
|
* @license MIT
|
|
19
13
|
*/
|
|
20
14
|
|
|
21
15
|
/*! https://mths.be/punycode v1.4.1 by @mathias */
|
|
16
|
+
|
|
17
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
18
|
+
|
|
19
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
package/dist/model/IBitset.d.ts
CHANGED
package/dist/model/IFilter.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { ITagFilter } from "./ITagFilter";
|
|
1
2
|
import { ITagSets } from "./ITagSets";
|
|
2
3
|
import { StreamType } from "./StreamType";
|
|
3
4
|
import { Uuid } from "./Uuid";
|
|
4
|
-
export interface IFilter {
|
|
5
|
+
export interface IFilter extends ITagFilter {
|
|
5
6
|
deviceIds?: Uuid[];
|
|
6
7
|
names?: string[];
|
|
7
8
|
types?: StreamType[];
|
|
8
|
-
tags?: ITagSets | ITagSets[];
|
|
9
9
|
notTags?: ITagSets | ITagSets[];
|
|
10
10
|
notNames?: string[];
|
|
11
11
|
}
|
package/dist/model/IPath.d.ts
CHANGED
package/dist/model/IUser.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { CognitoRegion } from "./CognitoRegion";
|
|
2
|
+
import { IDictionary } from "./IDictionary";
|
|
2
3
|
import { IsoDate } from "./IsoDate";
|
|
3
4
|
import { ITaggedEntity } from "./ITaggedEntity";
|
|
5
|
+
import { ITagSets } from "./ITagSets";
|
|
4
6
|
import { IUserScope } from "./IUserScope";
|
|
5
7
|
import { LanguageType } from "./LanguageType";
|
|
6
8
|
import { SmsOptInStatus } from "./SmsOptInStatus";
|
|
@@ -20,7 +22,7 @@ export interface IUser extends ITaggedEntity {
|
|
|
20
22
|
enabled?: boolean;
|
|
21
23
|
isOrganizationOwner?: boolean;
|
|
22
24
|
termsAccepted?: string;
|
|
23
|
-
lastLoggedIn?: IsoDate;
|
|
25
|
+
lastLoggedIn?: IsoDate | null;
|
|
24
26
|
passwordHash?: string | null;
|
|
25
27
|
isSingleSignOn?: boolean;
|
|
26
28
|
isServiceAccount?: boolean;
|
|
@@ -32,4 +34,7 @@ export interface IUser extends ITaggedEntity {
|
|
|
32
34
|
timezone?: string;
|
|
33
35
|
allowCustomEmailConfiguration?: boolean;
|
|
34
36
|
title?: string | null;
|
|
37
|
+
description?: string | null;
|
|
38
|
+
metadata?: IDictionary | null;
|
|
39
|
+
grants?: ITagSets;
|
|
35
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const auditLogActionTypes: readonly ["create", "update", "delete", "provision", "unprovision", "sso-login", "forgot-password"];
|
|
1
|
+
export declare const auditLogActionTypes: readonly ["create", "update", "delete", "provision", "unprovision", "login", "sso-login", "forgot-password"];
|
package/dist/model/features.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const agentFeatures: readonly ["telemetry", "internalTelemetry", "teleop", "ssh", "customEvents", "triggeredEvents", "portForwarding", "commands", "interventions", "onDemand", "appConfig", "blobStorage"];
|
|
2
|
-
export declare const features: readonly ["telemetry", "internalTelemetry", "teleop", "ssh", "customEvents", "triggeredEvents", "portForwarding", "commands", "interventions", "onDemand", "appConfig", "blobStorage", "events", "
|
|
2
|
+
export declare const features: readonly ["telemetry", "internalTelemetry", "teleop", "ssh", "customEvents", "triggeredEvents", "portForwarding", "commands", "interventions", "onDemand", "appConfig", "blobStorage", "events", "annotations", "observability", "diagnostics", "advancedConfiguration", "dataExport", "share", "adapters", "s3Export", "fileStorage", "roleViewer", "teams", "schedules", "teleop2.0", "billing", "taskSummaries"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const healthStatuses: readonly ["unknown", "operational", "offline", "error"];
|
|
2
|
-
type
|
|
3
|
-
export declare function healthStatusToOrdinal(a:
|
|
4
|
-
export declare function ordinalToHealthStatus(a: number):
|
|
2
|
+
type HealthStatusValues = (typeof healthStatuses)[number];
|
|
3
|
+
export declare function healthStatusToOrdinal(a: HealthStatusValues): number;
|
|
4
|
+
export declare function ordinalToHealthStatus(a: number): HealthStatusValues;
|
|
5
5
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const rtcConnectionStatuses: readonly ["disconnected", "
|
|
1
|
+
export declare const rtcConnectionStatuses: readonly ["disconnected", "connecting", "connected"];
|
|
@@ -23,6 +23,10 @@ export declare const rtcPointStreamType: "point";
|
|
|
23
23
|
export declare const rtcJsonStringType: "json-string";
|
|
24
24
|
export declare const rtcOdometryStreamType: "odometry";
|
|
25
25
|
export declare const rtcJoyStreamType: "joy";
|
|
26
|
-
export declare const
|
|
26
|
+
export declare const rtcTextStreamType: "text";
|
|
27
|
+
export declare const rtcMapStreamType: "map";
|
|
28
|
+
export declare const rtcLocationStreamType: "location";
|
|
29
|
+
export declare const rtcNumericSetStreamType: "numeric-set";
|
|
30
|
+
export declare const rtcStreamTypes: readonly ["ping", "pong", "ping-v2", "pong-v2", "stream-control", "streams-info", "agent-info", "numeric", "boolean", "bitset", "twist", "compressed-image", "h264-video-frame", "audio-chunk", "pose", "goal-id", "joint-state", "pose-with-covariance", "point-cloud", "point", "marker-array", "json-string", "odometry", "joy", "text", "map", "location", "numeric-set"];
|
|
27
31
|
export declare const rtcImageStreamTypes: string[];
|
|
28
32
|
export declare const rtcSystemStreamTypes: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const userResources: readonly ["roles", "users", "teams", "devices", "fleets", "events", "views", "keyValue"];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
load("@rules_proto//proto:defs.bzl", "proto_library")
|
|
2
|
+
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
|
3
|
+
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
|
4
|
+
|
|
5
|
+
proto_library(
|
|
6
|
+
name = "signaling_proto",
|
|
7
|
+
srcs = ["signaling.proto"],
|
|
8
|
+
visibility = ["//visibility:public"],
|
|
9
|
+
deps = ["@com_google_protobuf//:wrappers_proto"],
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
go_proto_library(
|
|
13
|
+
name = "signaling_go_proto",
|
|
14
|
+
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
|
|
15
|
+
importpath = "github.com/FormantIO/genproto/go/v1/api/signaling",
|
|
16
|
+
proto = ":signaling_proto",
|
|
17
|
+
visibility = ["//visibility:public"],
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
go_library(
|
|
21
|
+
name = "signaling",
|
|
22
|
+
embed = [":signaling_go_proto"],
|
|
23
|
+
importpath = "github.com/FormantIO/genproto/go/v1/api/signaling",
|
|
24
|
+
visibility = ["//visibility:public"],
|
|
25
|
+
)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Import everything from signaling_pb.js
|
|
2
|
+
const signalingPb = require("./api/signaling/v1/signaling_pb.js");
|
|
3
|
+
|
|
4
|
+
// Import everything from signaling_grpc_web_pb.js
|
|
5
|
+
const signalingGrpcWebPb = require("./api/signaling/v1/signaling_grpc_web_pb.js");
|
|
6
|
+
|
|
7
|
+
// Combine all exports into a single object
|
|
8
|
+
const combinedExports = {
|
|
9
|
+
...signalingPb,
|
|
10
|
+
...signalingGrpcWebPb,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// Export the combined object as the default export
|
|
14
|
+
module.exports = combinedExports;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export { AuthClient } from "../../client/AuthClient";
|
|
2
|
-
export { RtcSignalingClient } from "../../client/RtcSignalingClient";
|
|
3
2
|
export { Credentials } from "../../client/Credentials";
|
|
4
|
-
export {
|
|
3
|
+
export { RtcSignalingClient } from "../../client/RtcSignalingClient";
|
|
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 { IRtcStream } from "../../model/IRtcStream";
|
|
9
8
|
export type { IRtcPeer } from "../../model/IRtcPeer";
|
|
9
|
+
export type { IRtcStream } from "../../model/IRtcStream";
|
|
10
10
|
export type { RtcStreamType } from "../../model/RtcStreamType";
|
|
11
11
|
export type { IRtcClientConfigurationV1 } from "../../rtc-client/models-v1/IRtcClientConfigurationV1";
|
|
12
12
|
export type { IRtcClientConfiguration } from "../../rtc-client/models/IRtcClientConfiguration";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Timestamp } from "../model/Timestamp";
|
|
2
2
|
import { Uuid } from "../model/Uuid";
|
|
3
|
-
import { Signal } from "../protos
|
|
3
|
+
import { Signal } from "../protos";
|
|
4
4
|
import { IHasPeerConnection } from "./IHasPeerConnection";
|
|
5
5
|
import { IHasRemoteDeviceId } from "./IHasRemoteDeviceId";
|
|
6
6
|
import { IPingInfo } from "./models/IPingInfo";
|
|
@@ -33,6 +33,8 @@ export declare class RtcConnection implements IHasPeerConnection, IHasRemoteDevi
|
|
|
33
33
|
private streamLatestTimestamp;
|
|
34
34
|
private reassemblyTable;
|
|
35
35
|
private reassemblyTableLastTimestamp;
|
|
36
|
+
private binaryReassemblyTable;
|
|
37
|
+
private binaryReassemblyTableLastTimestamp;
|
|
36
38
|
private pingTimeMs;
|
|
37
39
|
private lastMessageTimestamp;
|
|
38
40
|
private sessionMetrics;
|
|
@@ -83,6 +85,8 @@ export declare class RtcConnection implements IHasPeerConnection, IHasRemoteDevi
|
|
|
83
85
|
private setupChannel;
|
|
84
86
|
private receiveChannelMessage;
|
|
85
87
|
private receiveChannelMessageChunk;
|
|
88
|
+
private receiveBinaryH264Message;
|
|
89
|
+
private receiveBinaryChunkMessage;
|
|
86
90
|
/**
|
|
87
91
|
* Handles system messages (e.g., ping/pong).
|
|
88
92
|
* Returns true if the message is a system message.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IH264VideoFrame } from "../../model/IH264VideoFrame";
|
|
2
|
+
import { IRtcStreamCommunication } from "./IRtcStreamCommunication";
|
|
3
|
+
export interface IBinaryH264Message extends IRtcStreamCommunication<"binary-h264"> {
|
|
4
|
+
timestamp: number;
|
|
5
|
+
streamName: string;
|
|
6
|
+
frame: IH264VideoFrame;
|
|
7
|
+
}
|
|
8
|
+
export interface IBinaryChunkMessage extends IRtcStreamCommunication<"binary-chunk"> {
|
|
9
|
+
chunkId: number;
|
|
10
|
+
sequence: number;
|
|
11
|
+
total: number;
|
|
12
|
+
data: Uint8Array;
|
|
13
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Timestamp } from "../../model/Timestamp";
|
|
2
2
|
import { Uuid } from "../../model/Uuid";
|
|
3
|
-
import { SignalingPromiseClient } from "../../protos
|
|
4
|
-
import { SessionType } from "../../protos/api/signaling/v1/signaling_pb";
|
|
3
|
+
import { SessionType, SignalingPromiseClient } from "../../protos";
|
|
5
4
|
import { IRtcStreamMessage } from "./IRtcStreamMessage";
|
|
6
5
|
export type IRtcClientConfiguration = {
|
|
7
6
|
receive: (peerId: Uuid, message: IRtcStreamMessage) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Timestamp } from "../../model/Timestamp";
|
|
2
2
|
import { Uuid } from "../../model/Uuid";
|
|
3
|
-
import { SessionType } from "../../protos
|
|
3
|
+
import { SessionType } from "../../protos";
|
|
4
4
|
import { IRtcStreamMessage } from "./IRtcStreamMessage";
|
|
5
5
|
export interface IRtcConnectionBaseConfiguration {
|
|
6
6
|
isOffer: boolean;
|
|
@@ -5,6 +5,8 @@ import { IH264VideoFrame } from "../../model/IH264VideoFrame";
|
|
|
5
5
|
import { IJointState } from "../../model/IJointState";
|
|
6
6
|
import { IJoy } from "../../model/IJoy";
|
|
7
7
|
import { IJsonString } from "../../model/IJsonString";
|
|
8
|
+
import { ILocation } from "../../model/ILocation";
|
|
9
|
+
import { IMap } from "../../model/IMap";
|
|
8
10
|
import { IMarker3DArray } from "../../model/IMarker3DArray";
|
|
9
11
|
import { IOdometry } from "../../model/IOdometry";
|
|
10
12
|
import { IPoint } from "../../model/IPoint";
|
|
@@ -28,6 +30,13 @@ export interface IRtcStreamPayload {
|
|
|
28
30
|
numeric?: {
|
|
29
31
|
value: number;
|
|
30
32
|
};
|
|
33
|
+
numericSet?: {
|
|
34
|
+
numerics: {
|
|
35
|
+
value: number;
|
|
36
|
+
label: string;
|
|
37
|
+
unit: string;
|
|
38
|
+
}[];
|
|
39
|
+
};
|
|
31
40
|
boolean?: boolean;
|
|
32
41
|
bitset?: {
|
|
33
42
|
bits: {
|
|
@@ -51,5 +60,8 @@ export interface IRtcStreamPayload {
|
|
|
51
60
|
markerArray?: IMarker3DArray;
|
|
52
61
|
jsonString?: IJsonString;
|
|
53
62
|
odometry?: IOdometry;
|
|
63
|
+
location?: ILocation;
|
|
64
|
+
map?: IMap;
|
|
54
65
|
joy?: IJoy;
|
|
66
|
+
text?: string;
|
|
55
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type RtcCommunicationType = "message" | "message-chunk";
|
|
1
|
+
export type RtcCommunicationType = "message" | "message-chunk" | "binary-h264" | "binary-chunk";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IBinaryChunkMessage, IBinaryH264Message } from "../models/IBinaryH264Message";
|
|
2
|
+
/**
|
|
3
|
+
* Detects if a message is a binary H264 message by checking for the "H264" magic bytes
|
|
4
|
+
*/
|
|
5
|
+
export declare function isBinaryH264Message(data: ArrayBuffer): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Detects if a message is a binary chunk by checking for the "BCHK" magic bytes
|
|
8
|
+
*/
|
|
9
|
+
export declare function isBinaryChunkMessage(data: ArrayBuffer): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Parses a binary H264 message according to the Go agent's format:
|
|
12
|
+
* [4 bytes: "H264"] + [8 bytes: timestamp] + [2 bytes: stream name length] + [n bytes: stream name] + [m bytes: protobuf data]
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseBinaryH264Message(data: ArrayBuffer): IBinaryH264Message;
|
|
15
|
+
/**
|
|
16
|
+
* Parses a binary chunk message according to the Go agent's format:
|
|
17
|
+
* [4 bytes: "BCHK"] + [4 bytes: chunk_id] + [4 bytes: seq] + [4 bytes: total] + [n bytes: data]
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseBinaryChunkMessage(data: ArrayBuffer): IBinaryChunkMessage;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formant/realtime-sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/realtime-sdk/src/index.d.ts",
|
|
@@ -15,8 +15,10 @@
|
|
|
15
15
|
"maybe-make-protos": "if [ -z ${LERNA_PACKAGE_NAME} ]; then cd ../../../ && make protos_ts && cd -; fi"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
+
"@types/generic-pool": "^3.8.1",
|
|
19
|
+
"@types/google-protobuf": "~3.7.0",
|
|
18
20
|
"env-var": "^7.4.0",
|
|
19
|
-
"
|
|
21
|
+
"generic-pool": "^3.9.0"
|
|
20
22
|
},
|
|
21
23
|
"devDependencies": {
|
|
22
24
|
"@formant/client": "*",
|
|
@@ -24,16 +26,28 @@
|
|
|
24
26
|
"@formant/model": "*",
|
|
25
27
|
"@formant/protos": "*",
|
|
26
28
|
"@formant/rtc-client": "*",
|
|
29
|
+
"assert": "^2.1.0",
|
|
30
|
+
"browserify-zlib": "^0.2.0",
|
|
31
|
+
"buffer": "^6.0.3",
|
|
27
32
|
"circular-dependency-plugin": "^5.2.2",
|
|
28
33
|
"copy-webpack-plugin": "^6.4.1",
|
|
34
|
+
"crypto-browserify": "^3.12.0",
|
|
29
35
|
"file-loader": "^5.1.0",
|
|
30
36
|
"fork-ts-checker-webpack-plugin": "^6.5.3",
|
|
37
|
+
"https-browserify": "^1.0.0",
|
|
38
|
+
"os-browserify": "^0.3.0",
|
|
39
|
+
"path-browserify": "^1.0.1",
|
|
40
|
+
"process": "^0.11.10",
|
|
31
41
|
"rimraf": "^5.0.1",
|
|
42
|
+
"stream-browserify": "^3.0.0",
|
|
43
|
+
"stream-http": "^3.2.0",
|
|
32
44
|
"terser-webpack-plugin": "^2.3.5",
|
|
33
|
-
"ts-loader": "^
|
|
45
|
+
"ts-loader": "^9.5.0",
|
|
34
46
|
"tsc-alias": "^1.4.1",
|
|
35
|
-
"
|
|
36
|
-
"webpack
|
|
47
|
+
"url": "^0.11.3",
|
|
48
|
+
"webpack": "^5.88.2",
|
|
49
|
+
"webpack-bundle-analyzer": "^4.9.0",
|
|
50
|
+
"webpack-filter-warnings-plugin": "^1.2.1"
|
|
37
51
|
},
|
|
38
52
|
"author": "",
|
|
39
53
|
"description": "",
|