@formant/realtime-sdk 0.0.2 → 0.0.6

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.
@@ -0,0 +1,3 @@
1
+ import { agentFeatures, features } from "./features";
2
+ export declare type Feature = typeof features[number];
3
+ export declare type AgentFeature = typeof agentFeatures[number];
@@ -0,0 +1,6 @@
1
+ export interface IColorRGBA {
2
+ r: number;
3
+ g: number;
4
+ b: number;
5
+ a: number;
6
+ }
@@ -0,0 +1,4 @@
1
+ import { Feature } from "./Feature";
2
+ export interface IGetFeaturesResponse {
3
+ features: Feature[];
4
+ }
@@ -1,6 +1,8 @@
1
+ import { ITransform } from "./ITransform";
1
2
  export interface IJointState {
3
+ world_to_local?: ITransform;
2
4
  name: string[];
3
5
  position: number[];
4
- velocity: number[];
5
- effort: number[];
6
+ velocity?: number[];
7
+ effort?: number[];
6
8
  }
@@ -0,0 +1,23 @@
1
+ import { IColorRGBA } from "./IColorRGBA";
2
+ import { ITransform } from "./ITransform";
3
+ import { IVector3 } from "./IVector3";
4
+ import { Marker3DAction } from "./Marker3DAction";
5
+ import { Marker3DType } from "./Marker3DType";
6
+ export interface IMarker3D {
7
+ world_to_local?: ITransform;
8
+ ns: string;
9
+ id: number;
10
+ type: Marker3DType;
11
+ action: Marker3DAction;
12
+ pose: ITransform;
13
+ scale: IVector3;
14
+ color: IColorRGBA;
15
+ lifetime: number;
16
+ frame_id: string;
17
+ frame_locked: boolean;
18
+ points: IVector3[];
19
+ colors: IColorRGBA[];
20
+ text: string;
21
+ mesh_resource: string;
22
+ mesh_use_embedded_materials: boolean;
23
+ }
@@ -0,0 +1,4 @@
1
+ import { IMarker3D } from "./IMarker3D";
2
+ export interface IMarker3DArray {
3
+ markers: IMarker3D[];
4
+ }
@@ -0,0 +1,2 @@
1
+ import { IVector3 } from "./IVector3";
2
+ export declare type IPoint = IVector3;
@@ -0,0 +1,5 @@
1
+ import { ITransform } from "./ITransform";
2
+ export interface IPoseWithCovariance {
3
+ pose: ITransform;
4
+ covariance: Array<number>;
5
+ }
@@ -1,16 +1,16 @@
1
1
  import { IBaseEntity } from "./IBaseEntity";
2
2
  import { IsoDate } from "./IsoDate";
3
3
  import { ITags } from "./ITags";
4
- import { Role } from "./Role";
5
4
  import { Uuid } from "./Uuid";
6
5
  export interface IUser extends IBaseEntity {
7
6
  organizationId?: Uuid;
8
7
  email: string;
9
8
  firstName: string;
10
9
  lastName: string;
11
- role: Role;
10
+ roleId: Uuid;
11
+ teamId?: Uuid | null;
12
12
  tags: ITags;
13
- phoneNumber?: string | null;
13
+ phoneNumber?: string;
14
14
  enabled?: boolean;
15
15
  isOrganizationOwner?: boolean;
16
16
  termsAccepted?: string;
@@ -0,0 +1,2 @@
1
+ import { marker3DActions } from "./marker3DActions";
2
+ export declare type Marker3DAction = typeof marker3DActions[number];
@@ -0,0 +1,2 @@
1
+ import { marker3DTypes } from "./marker3DTypes";
2
+ export declare type Marker3DType = typeof marker3DTypes[number];
@@ -0,0 +1,9 @@
1
+ export declare const bytes: {
2
+ readonly byte: number;
3
+ readonly kilobyte: number;
4
+ readonly kibibyte: number;
5
+ readonly megabyte: number;
6
+ readonly mebibyte: number;
7
+ readonly gigabyte: number;
8
+ readonly gibibyte: number;
9
+ };
@@ -0,0 +1,2 @@
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", "onDemand", "share", "adapters", "s3Export", "fileStorage", "roleViewer", "teams"];
@@ -0,0 +1 @@
1
+ export declare const marker3DActions: readonly ["add", "modify", "delete", "delete_all"];
@@ -0,0 +1 @@
1
+ export declare const marker3DTypes: readonly ["arrow", "cube", "sphere", "cylinder", "line_strip", "line_list", "cube_list", "sphere_list", "points", "text_view_facing", "mesh_resource", "triangle_list"];
@@ -2,6 +2,7 @@ export declare const rtcPingStreamType: "ping";
2
2
  export declare const rtcPongStreamType: "pong";
3
3
  export declare const rtcStreamControlStreamType: "stream-control";
4
4
  export declare const rtcStreamsInfoStreamType: "streams-info";
5
+ export declare const rtcAgentInfoStreamType: "agent-info";
5
6
  export declare const rtcNumericStreamType: "numeric";
6
7
  export declare const rtcBooleanStreamType: "boolean";
7
8
  export declare const rtcBitsetStreamType: "bitset";
@@ -12,6 +13,10 @@ export declare const rtcAudioChunkStreamType: "audio-chunk";
12
13
  export declare const rtcPoseStreamType: "pose";
13
14
  export declare const rtcGoalIDStreamType: "goal-id";
14
15
  export declare const rtcJointStateStreamType: "joint-state";
15
- export declare const rtcStreamTypes: readonly ["ping", "pong", "stream-control", "streams-info", "numeric", "boolean", "bitset", "twist", "compressed-image", "h264-video-frame", "audio-chunk", "pose", "goal-id", "joint-state"];
16
+ export declare const rtcPoseWithCovarianceStreamType: "pose-with-covariance";
17
+ export declare const rtcPointCloudStreamType: "point-cloud";
18
+ export declare const rtcMarkerArrayStreamType: "marker-array";
19
+ export declare const rtcPointStreamType: "point";
20
+ export declare const rtcStreamTypes: readonly ["ping", "pong", "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"];
16
21
  export declare const rtcImageStreamTypes: string[];
17
22
  export declare const rtcSystemStreamTypes: string[];
@@ -31,6 +31,12 @@ message Peer {
31
31
  google.protobuf.Int64Value peer_created_timestamp = 6; // No value means it's for a new peer
32
32
  }
33
33
 
34
+ enum SessionType {
35
+ UNKNOWN = 0;
36
+ TELEOP = 1;
37
+ PORT_FORWARD = 2;
38
+ }
39
+
34
40
  message Signal {
35
41
  google.protobuf.StringValue session_id = 1; // No value means it's for a new session
36
42
  google.protobuf.Int64Value session_created_timestamp = 2; // No value means it's for a new session
@@ -39,6 +45,7 @@ message Signal {
39
45
  string payload = 5;
40
46
  string ice_servers = 6; // JSON-encoded RTCIceServer list
41
47
  string ice_transport_policy = 7;
48
+ SessionType session_type = 8;
42
49
  }
43
50
 
44
51
  message CreatePeerRequest {}
@@ -75,6 +75,9 @@ export class Signal extends jspb.Message {
75
75
  getIceTransportPolicy(): string;
76
76
  setIceTransportPolicy(value: string): Signal;
77
77
 
78
+ getSessionType(): SessionType;
79
+ setSessionType(value: SessionType): Signal;
80
+
78
81
  serializeBinary(): Uint8Array;
79
82
  toObject(includeInstance?: boolean): Signal.AsObject;
80
83
  static toObject(includeInstance: boolean, msg: Signal): Signal.AsObject;
@@ -92,6 +95,7 @@ export namespace Signal {
92
95
  payload: string,
93
96
  iceServers: string,
94
97
  iceTransportPolicy: string,
98
+ sessionType: SessionType,
95
99
  }
96
100
  }
97
101
 
@@ -345,3 +349,8 @@ export namespace ReceiveSignalStreamResponse {
345
349
  }
346
350
  }
347
351
 
352
+ export enum SessionType {
353
+ UNKNOWN = 0,
354
+ TELEOP = 1,
355
+ PORT_FORWARD = 2,
356
+ }
@@ -32,6 +32,7 @@ goog.exportSymbol('proto.v1.signaling.api.RefreshPeerRequest', null, global);
32
32
  goog.exportSymbol('proto.v1.signaling.api.RefreshPeerResponse', null, global);
33
33
  goog.exportSymbol('proto.v1.signaling.api.SendSignalRequest', null, global);
34
34
  goog.exportSymbol('proto.v1.signaling.api.SendSignalResponse', null, global);
35
+ goog.exportSymbol('proto.v1.signaling.api.SessionType', null, global);
35
36
  goog.exportSymbol('proto.v1.signaling.api.Signal', null, global);
36
37
  /**
37
38
  * Generated by JsPbCodeGenerator.
@@ -776,7 +777,8 @@ proto.v1.signaling.api.Signal.toObject = function(includeInstance, msg) {
776
777
  receiverId: jspb.Message.getFieldWithDefault(msg, 4, ""),
777
778
  payload: jspb.Message.getFieldWithDefault(msg, 5, ""),
778
779
  iceServers: jspb.Message.getFieldWithDefault(msg, 6, ""),
779
- iceTransportPolicy: jspb.Message.getFieldWithDefault(msg, 7, "")
780
+ iceTransportPolicy: jspb.Message.getFieldWithDefault(msg, 7, ""),
781
+ sessionType: jspb.Message.getFieldWithDefault(msg, 8, 0)
780
782
  };
781
783
 
782
784
  if (includeInstance) {
@@ -843,6 +845,10 @@ proto.v1.signaling.api.Signal.deserializeBinaryFromReader = function(msg, reader
843
845
  var value = /** @type {string} */ (reader.readString());
844
846
  msg.setIceTransportPolicy(value);
845
847
  break;
848
+ case 8:
849
+ var value = /** @type {!proto.v1.signaling.api.SessionType} */ (reader.readEnum());
850
+ msg.setSessionType(value);
851
+ break;
846
852
  default:
847
853
  reader.skipField();
848
854
  break;
@@ -923,6 +929,13 @@ proto.v1.signaling.api.Signal.serializeBinaryToWriter = function(message, writer
923
929
  f
924
930
  );
925
931
  }
932
+ f = message.getSessionType();
933
+ if (f !== 0.0) {
934
+ writer.writeEnum(
935
+ 8,
936
+ f
937
+ );
938
+ }
926
939
  };
927
940
 
928
941
 
@@ -1090,6 +1103,24 @@ proto.v1.signaling.api.Signal.prototype.setIceTransportPolicy = function(value)
1090
1103
  };
1091
1104
 
1092
1105
 
1106
+ /**
1107
+ * optional SessionType session_type = 8;
1108
+ * @return {!proto.v1.signaling.api.SessionType}
1109
+ */
1110
+ proto.v1.signaling.api.Signal.prototype.getSessionType = function() {
1111
+ return /** @type {!proto.v1.signaling.api.SessionType} */ (jspb.Message.getFieldWithDefault(this, 8, 0));
1112
+ };
1113
+
1114
+
1115
+ /**
1116
+ * @param {!proto.v1.signaling.api.SessionType} value
1117
+ * @return {!proto.v1.signaling.api.Signal} returns this
1118
+ */
1119
+ proto.v1.signaling.api.Signal.prototype.setSessionType = function(value) {
1120
+ return jspb.Message.setProto3EnumField(this, 8, value);
1121
+ };
1122
+
1123
+
1093
1124
 
1094
1125
 
1095
1126
 
@@ -2951,4 +2982,13 @@ proto.v1.signaling.api.ReceiveSignalStreamResponse.prototype.hasSignal = functio
2951
2982
  };
2952
2983
 
2953
2984
 
2985
+ /**
2986
+ * @enum {number}
2987
+ */
2988
+ proto.v1.signaling.api.SessionType = {
2989
+ UNKNOWN: 0,
2990
+ TELEOP: 1,
2991
+ PORT_FORWARD: 2
2992
+ };
2993
+
2954
2994
  goog.object.extend(exports, proto.v1.signaling.api);
@@ -45,6 +45,9 @@ export declare class RtcClient {
45
45
  getConnectionStatsInfo(remotePeerId: Uuid): Promise<IRtcConnectionStatsInfo | undefined>;
46
46
  disconnect(remotePeerId: Uuid): Promise<void>;
47
47
  getPeers(): Promise<IRtcPeer[]>;
48
+ getSessions(): Promise<{
49
+ [key in string]: string[];
50
+ }>;
48
51
  getPing(remotePeerId: Uuid): number | undefined;
49
52
  getLastMessageTimestamp(remotePeerId: Uuid): Timestamp | undefined;
50
53
  getSessionMetricsMessageCounts(remotePeerId: Uuid): IRtcSessionMetricsMessageCounts | undefined;
@@ -0,0 +1,3 @@
1
+ export interface IRtcAgentInfo {
2
+ isLowBandwidthMode?: boolean;
3
+ }
@@ -0,0 +1,5 @@
1
+ import { ITransform } from "../../model/ITransform";
2
+ export interface IRtcPointCloud {
3
+ world_to_local?: ITransform;
4
+ data: string;
5
+ }
@@ -3,9 +3,14 @@ import { ICompressedImage } from "../../model/ICompressedImage";
3
3
  import { IGoalID } from "../../model/IGoalID";
4
4
  import { IH264VideoFrame } from "../../model/IH264VideoFrame";
5
5
  import { IJointState } from "../../model/IJointState";
6
+ import { IMarker3DArray } from "../../model/IMarker3DArray";
7
+ import { IPoint } from "../../model/IPoint";
8
+ import { IPoseWithCovariance } from "../../model/IPoseWithCovariance";
6
9
  import { ITransform } from "../../model/ITransform";
7
10
  import { ITwist } from "../../model/ITwist";
8
11
  import { Timestamp } from "../../model/Timestamp";
12
+ import { IRtcAgentInfo } from "./IRtcAgentInfo";
13
+ import { IRtcPointCloud } from "./IRtcPointCloud";
9
14
  import { IRtcStreamsInfo } from "./IRtcStreamsInfo";
10
15
  import { IStreamControl } from "./IStreamControl";
11
16
  export interface IRtcStreamPayload {
@@ -13,6 +18,7 @@ export interface IRtcStreamPayload {
13
18
  pong?: Timestamp;
14
19
  streamControl?: IStreamControl;
15
20
  streamsInfo?: IRtcStreamsInfo;
21
+ agentInfo?: IRtcAgentInfo;
16
22
  numeric?: {
17
23
  value: number;
18
24
  };
@@ -30,4 +36,8 @@ export interface IRtcStreamPayload {
30
36
  h264VideoFrame?: IH264VideoFrame;
31
37
  audioChunk?: IAudioChunk;
32
38
  jointState?: IJointState;
39
+ poseWithCovariance?: IPoseWithCovariance;
40
+ pointCloud?: IRtcPointCloud;
41
+ point?: IPoint;
42
+ markerArray?: IMarker3DArray;
33
43
  }
@@ -1,6 +1,6 @@
1
1
  export declare const rtcPipelineType = "rtc";
2
2
  export declare const telemetryPipelineType = "telemetry";
3
- export declare type IStreamControl = IRtcStreamControl | ITelemetryStreamControl | IDegradeVideoStreamControl | IAudioStreamControl;
3
+ export declare type IStreamControl = IRtcStreamControl | ITelemetryStreamControl | IDegradeVideoStreamControl | IAudioStreamControl | ISetLowBandwidthMode;
4
4
  export interface IStreamControlBase {
5
5
  streamName: string;
6
6
  }
@@ -18,3 +18,6 @@ export interface IDegradeVideoStreamControl extends IStreamControlBase {
18
18
  export interface IAudioStreamControl extends IStreamControlBase {
19
19
  setAudioFormat: string;
20
20
  }
21
+ export interface ISetLowBandwidthMode extends IStreamControlBase {
22
+ setLowBandwidthMode: boolean;
23
+ }
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
1
  {
2
- "name": "@formant/realtime-sdk",
3
- "version": "0.0.2",
4
- "license": "MIT",
5
- "main": "./dist/index.js",
6
- "types": "./dist/realtime-sdk/src/index.d.ts",
7
- "files": [
8
- "dist"
9
- ],
10
- "scripts": {
11
- "clean": "rm -rf dist",
12
- "compile": "tsc",
13
- "build": "yarn make-protos && env $(cat src/config/production.env) webpack",
14
- "postbuild": "tsc --emitDeclarationOnly --declaration --declarationDir ./dist --skipLibCheck && tsc-alias",
15
- "prepublishOnly": "yarn clean && yarn build",
16
- "make-protos": "cd ../../../ && make protos && cd -"
17
- },
18
- "dependencies": {
19
- "google-protobuf": "^3.17.3",
20
- "grpc-web": "^1.2.1"
21
- },
22
- "devDependencies": {
23
- "circular-dependency-plugin": "^5.2.2",
24
- "copy-webpack-plugin": "^6.4.1",
25
- "file-loader": "^5.1.0",
26
- "fork-ts-checker-webpack-plugin": "^4.1.0",
27
- "terser-webpack-plugin": "^2.3.5",
28
- "ts-loader": "^6.2.1",
29
- "tsc-alias": "^1.3.7",
30
- "webpack": "^4.42.0",
31
- "webpack-bundle-analyzer": "^3.6.1"
32
- },
33
- "author": "",
34
- "description": ""
2
+ "name": "@formant/realtime-sdk",
3
+ "version": "0.0.6",
4
+ "license": "MIT",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/realtime-sdk/src/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "scripts": {
11
+ "clean": "rm -rf dist",
12
+ "compile": "tsc",
13
+ "build": "yarn make-protos && env $(cat src/config/production.env) webpack",
14
+ "postbuild": "tsc --emitDeclarationOnly --declaration --declarationDir ./dist --skipLibCheck && tsc-alias",
15
+ "prepublishOnly": "yarn clean && yarn build",
16
+ "make-protos": "cd ../../../ && make protos && cd -"
17
+ },
18
+ "dependencies": {
19
+ "google-protobuf": "3.17.3",
20
+ "grpc-web": "1.2.1"
21
+ },
22
+ "devDependencies": {
23
+ "circular-dependency-plugin": "^5.2.2",
24
+ "copy-webpack-plugin": "^6.4.1",
25
+ "file-loader": "^5.1.0",
26
+ "fork-ts-checker-webpack-plugin": "^4.1.0",
27
+ "terser-webpack-plugin": "^2.3.5",
28
+ "ts-loader": "^6.2.1",
29
+ "tsc-alias": "^1.4.1",
30
+ "webpack": "^4.42.0",
31
+ "webpack-bundle-analyzer": "^3.6.1"
32
+ },
33
+ "author": "",
34
+ "description": ""
35
35
  }
package/dist/1.index.js DELETED
@@ -1 +0,0 @@
1
- (this.webpackJsonpTeleopClient=this.webpackJsonpTeleopClient||[]).push([[1],{230:function(n,t,e){"use strict";e.r(t),e.d(t,"LogClient",(function(){return c}));var o=e(35),i=function(n,t,e,o){return new(e||(e=Promise))((function(i,c){function s(n){try{u(o.next(n))}catch(n){c(n)}}function r(n){try{u(o.throw(n))}catch(n){c(n)}}function u(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(s,r)}u((o=o.apply(n,t||[])).next())}))};class c extends o.a{log(n){return i(this,void 0,void 0,(function*(){yield this.fetch("logs",{method:"POST",body:JSON.stringify({logs:n}),allowUnsafeRetries:!0})}))}}}}]);
@@ -1,2 +0,0 @@
1
- import { roles } from "./roles";
2
- export declare type Role = typeof roles[number];
@@ -1 +0,0 @@
1
- export declare const roles: readonly ["customer", "viewer", "operator", "administrator"];