@formant/realtime-sdk 1.4.2 → 1.4.4

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.
Files changed (33) hide show
  1. package/dist/common/BaseClient.d.ts +3 -1
  2. package/dist/common/config/index.d.ts +1 -0
  3. package/dist/common/errorConstants.d.ts +7 -0
  4. package/dist/common/isValidTagString.d.ts +3 -1
  5. package/dist/common/redact.d.ts +1 -0
  6. package/dist/common/setPromiseInterval.d.ts +3 -2
  7. package/dist/common/truncate.d.ts +4 -0
  8. package/dist/index.js +1 -1
  9. package/dist/model/IAuditLog.d.ts +1 -0
  10. package/dist/model/IBitset.d.ts +5 -0
  11. package/dist/model/IListResponse.d.ts +6 -0
  12. package/dist/model/ILoginRequest.d.ts +0 -2
  13. package/dist/model/IPath.d.ts +3 -1
  14. package/dist/model/IRequestToken.d.ts +4 -0
  15. package/dist/model/IUser.d.ts +5 -1
  16. package/dist/model/auditLogActionTypes.d.ts +1 -1
  17. package/dist/model/features.d.ts +1 -1
  18. package/dist/model/healthStatuses.d.ts +3 -3
  19. package/dist/model/reservedTagValues.d.ts +3 -0
  20. package/dist/model/rtcConnectionStatuses.d.ts +1 -1
  21. package/dist/model/rtcStreamTypes.d.ts +5 -1
  22. package/dist/model/userResources.d.ts +1 -0
  23. package/dist/protos/api/signaling/v1/BUILD.bazel +25 -0
  24. package/dist/realtime-sdk/src/index.d.ts +3 -3
  25. package/dist/rtc-client/RtcConnection.d.ts +5 -1
  26. package/dist/rtc-client/models/IBinaryH264Message.d.ts +13 -0
  27. package/dist/rtc-client/models/IRtcClientConfiguration.d.ts +1 -2
  28. package/dist/rtc-client/models/IRtcConnectionBaseConfiguration.d.ts +1 -1
  29. package/dist/rtc-client/models/IRtcStreamPayload.d.ts +12 -0
  30. package/dist/rtc-client/models/RtcCommunicationType.d.ts +1 -1
  31. package/dist/rtc-client/utils/binaryMessageParser.d.ts +19 -0
  32. package/dist/rtc-client/utils/peerToRtcPeer.d.ts +1 -1
  33. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import { AuditLogActionType } from "./AuditLogActionType";
2
2
  import { Uuid } from "./Uuid";
3
3
  export interface IAuditLog {
4
+ traceId?: Uuid;
4
5
  organizationId: Uuid;
5
6
  userId?: Uuid;
6
7
  deviceId?: Uuid;
@@ -1,4 +1,9 @@
1
1
  export interface IBitset {
2
2
  keys: string[];
3
3
  values: boolean[];
4
+ aggregateData?: {
5
+ key: string;
6
+ trueCount: number;
7
+ falseCount: number;
8
+ }[];
4
9
  }
@@ -1,3 +1,9 @@
1
1
  export interface IListResponse<T> {
2
2
  items: T[];
3
+ paging?: {
4
+ page: number;
5
+ pageSize: number;
6
+ totalCount: number;
7
+ totalPages: number;
8
+ };
3
9
  }
@@ -1,7 +1,5 @@
1
- import { ITagFilter } from "./ITagFilter";
2
1
  export interface ILoginRequest {
3
2
  email: string;
4
3
  password: string;
5
4
  tokenExpirationSeconds?: number;
6
- filter?: ITagFilter;
7
5
  }
@@ -1,5 +1,7 @@
1
1
  import { ITransform } from "./ITransform";
2
2
  export interface IPath {
3
3
  worldToLocal: ITransform;
4
- poses: ITransform[];
4
+ poses?: ITransform[];
5
+ url?: string;
6
+ size?: number;
5
7
  }
@@ -0,0 +1,4 @@
1
+ export interface IRequestToken {
2
+ token: string;
3
+ traceId?: string;
4
+ }
@@ -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;
@@ -33,4 +35,6 @@ export interface IUser extends ITaggedEntity {
33
35
  allowCustomEmailConfiguration?: boolean;
34
36
  title?: string | null;
35
37
  description?: string | null;
38
+ metadata?: IDictionary | null;
39
+ grants?: ITagSets;
36
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"];
@@ -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", "analytics", "annotations", "observability", "diagnostics", "advancedConfiguration", "dataExport", "share", "adapters", "s3Export", "fileStorage", "roleViewer", "teams", "schedules", "teleop2.0", "billing", "taskSummaries"];
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 HealthStatus = (typeof healthStatuses)[number];
3
- export declare function healthStatusToOrdinal(a: HealthStatus): number;
4
- export declare function ordinalToHealthStatus(a: number): HealthStatus;
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 {};
@@ -0,0 +1,3 @@
1
+ export declare const anyTagValue = "*";
2
+ export declare const notTagKey = "";
3
+ export declare const reservedTagValues: readonly ["*", ""];
@@ -1 +1 @@
1
- export declare const rtcConnectionStatuses: readonly ["disconnected", "connected", "connecting"];
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 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"];
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
+ )
@@ -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 { SignalingPromiseClient } from "../../protos/api/signaling/v1/signaling_grpc_web_pb";
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/api/signaling/v1/signaling_pb";
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/api/signaling/v1/signaling_grpc_web_pb";
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/api/signaling/v1/signaling_pb";
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;
@@ -1,3 +1,3 @@
1
1
  import { IRtcPeer } from "../../model/IRtcPeer";
2
- import { Peer } from "../../protos/api/signaling/v1/signaling_pb";
2
+ import { Peer } from "../../protos";
3
3
  export declare function peerToRtcPeer(peer: Peer): IRtcPeer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formant/realtime-sdk",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/realtime-sdk/src/index.d.ts",