@stinkycomputing/sesame-api-client 1.10.0-alpha.2 → 1.10.0-alpha.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.
package/README.md CHANGED
@@ -259,14 +259,19 @@ ws.addEventListener('message', async (evt) => {
259
259
  | `dataType` | Payload type | Direction |
260
260
  |------------|-------------|-----------|
261
261
  | `'json'` | `unknown` (parsed JSON) | server → client |
262
- | `'transport-status'` | `sesame.v1.status.TransportEvent` | server → client |
262
+ | `'transport-status'` | `sesame.v1.status.TransportStatus` (every transportable source) | server → client |
263
263
  | `'audio-state'` | `sesame.v1.audio.AudioMixerStatus` | server → client |
264
+ | `'output-status'` | `sesame.v1.outputs.OutputStatus` | server → client |
265
+ | `'source-status'` | `sesame.v1.sources.SourceStatus` | server → client |
266
+ | `'engine-status'` | `sesame.v1.status.Status` (full monitor status) | server → client |
264
267
  | `'transport-control'` | `sesame.v1.sources.TransportControlRequest` | client → server |
265
268
  | `'audio-control'` | `sesame.v1.audio.AudioControlRequest` | client → server |
269
+ | `'output-control'` | `sesame.v1.outputs.OutputControlRequest` | client → server |
270
+ | `'source-control'` | `sesame.v1.sources.SourceControlRequest` | client → server |
266
271
 
267
272
  ### Sending Remote Control (source stream → server)
268
273
 
269
- Send control frames over a WebSocket **source** connection (inbound to the server). The server resolves the target node from the metadata binding - no ID is needed in the payload.
274
+ Send control frames over a WebSocket **source** connection (inbound to the server). Audio control resolves the target mixer from the metadata binding, so no ID is needed in the payload. Transport control tracks are bound to the reserved target `sources` and the request names the source in `sourceId`.
270
275
 
271
276
  ```typescript
272
277
  import { buildAudioControlFrame, buildTransportControlFrame, sesame } from '@stinkycomputing/sesame-api-client';
@@ -286,8 +291,9 @@ ws.send(buildAudioControlFrame('sesame.audio.control.v1', {
286
291
  }],
287
292
  }));
288
293
 
289
- // Queue a transport command on a bound source
294
+ // Queue a transport command on a source (track bound to the reserved target `sources`)
290
295
  ws.send(buildTransportControlFrame('sesame.transport.control.v1', {
296
+ sourceId: 'file-1',
291
297
  cmdType: sesame.v1.sources.SourceTransportCommandType.SOURCE_TRANSPORT_CMD_PLAY,
292
298
  }));
293
299
  ```
@@ -11374,6 +11374,7 @@ var sesame = $root.sesame = (() => {
11374
11374
  }
11375
11375
  TransportControlRequest.prototype.cmdType = 0;
11376
11376
  TransportControlRequest.prototype.value = null;
11377
+ TransportControlRequest.prototype.sourceId = "";
11377
11378
  TransportControlRequest.create = function create(properties) {
11378
11379
  return new TransportControlRequest(properties);
11379
11380
  };
@@ -11390,6 +11391,11 @@ var sesame = $root.sesame = (() => {
11390
11391
  /* id 2, wireType 2 =*/
11391
11392
  18
11392
11393
  ).fork()).ldelim();
11394
+ if (message.sourceId != null && Object.hasOwnProperty.call(message, "sourceId"))
11395
+ writer.uint32(
11396
+ /* id 3, wireType 2 =*/
11397
+ 26
11398
+ ).string(message.sourceId);
11393
11399
  return writer;
11394
11400
  };
11395
11401
  TransportControlRequest.encodeDelimited = function encodeDelimited(message, writer) {
@@ -11412,6 +11418,10 @@ var sesame = $root.sesame = (() => {
11412
11418
  message.value = $root.sesame.v1.common.PropValue.decode(reader, reader.uint32());
11413
11419
  break;
11414
11420
  }
11421
+ case 3: {
11422
+ message.sourceId = reader.string();
11423
+ break;
11424
+ }
11415
11425
  default:
11416
11426
  reader.skipType(tag & 7);
11417
11427
  break;
@@ -11455,6 +11465,10 @@ var sesame = $root.sesame = (() => {
11455
11465
  if (error)
11456
11466
  return "value." + error;
11457
11467
  }
11468
+ if (message.sourceId != null && message.hasOwnProperty("sourceId")) {
11469
+ if (!$util.isString(message.sourceId))
11470
+ return "sourceId: string expected";
11471
+ }
11458
11472
  return null;
11459
11473
  };
11460
11474
  TransportControlRequest.fromObject = function fromObject(object) {
@@ -11542,6 +11556,8 @@ var sesame = $root.sesame = (() => {
11542
11556
  throw TypeError(".sesame.v1.sources.TransportControlRequest.value: object expected");
11543
11557
  message.value = $root.sesame.v1.common.PropValue.fromObject(object.value);
11544
11558
  }
11559
+ if (object.sourceId != null)
11560
+ message.sourceId = String(object.sourceId);
11545
11561
  return message;
11546
11562
  };
11547
11563
  TransportControlRequest.toObject = function toObject(message, options) {
@@ -11551,11 +11567,14 @@ var sesame = $root.sesame = (() => {
11551
11567
  if (options.defaults) {
11552
11568
  object.cmdType = options.enums === String ? "SOURCE_TRANSPORT_CMD_UNSPECIFIED" : 0;
11553
11569
  object.value = null;
11570
+ object.sourceId = "";
11554
11571
  }
11555
11572
  if (message.cmdType != null && message.hasOwnProperty("cmdType"))
11556
11573
  object.cmdType = options.enums === String ? $root.sesame.v1.sources.SourceTransportCommandType[message.cmdType] === void 0 ? message.cmdType : $root.sesame.v1.sources.SourceTransportCommandType[message.cmdType] : message.cmdType;
11557
11574
  if (message.value != null && message.hasOwnProperty("value"))
11558
11575
  object.value = $root.sesame.v1.common.PropValue.toObject(message.value, options);
11576
+ if (message.sourceId != null && message.hasOwnProperty("sourceId"))
11577
+ object.sourceId = message.sourceId;
11559
11578
  return object;
11560
11579
  };
11561
11580
  TransportControlRequest.prototype.toJSON = function toJSON() {
@@ -17699,6 +17718,114 @@ var sesame = $root.sesame = (() => {
17699
17718
  };
17700
17719
  return TransportEvent;
17701
17720
  }();
17721
+ status.TransportStatus = function() {
17722
+ function TransportStatus(properties) {
17723
+ this.sources = [];
17724
+ if (properties) {
17725
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
17726
+ if (properties[keys[i]] != null)
17727
+ this[keys[i]] = properties[keys[i]];
17728
+ }
17729
+ }
17730
+ TransportStatus.prototype.sources = $util.emptyArray;
17731
+ TransportStatus.create = function create(properties) {
17732
+ return new TransportStatus(properties);
17733
+ };
17734
+ TransportStatus.encode = function encode(message, writer) {
17735
+ if (!writer)
17736
+ writer = $Writer.create();
17737
+ if (message.sources != null && message.sources.length)
17738
+ for (let i = 0; i < message.sources.length; ++i)
17739
+ $root.sesame.v1.status.TransportEvent.encode(message.sources[i], writer.uint32(
17740
+ /* id 1, wireType 2 =*/
17741
+ 10
17742
+ ).fork()).ldelim();
17743
+ return writer;
17744
+ };
17745
+ TransportStatus.encodeDelimited = function encodeDelimited(message, writer) {
17746
+ return this.encode(message, writer).ldelim();
17747
+ };
17748
+ TransportStatus.decode = function decode(reader, length, error) {
17749
+ if (!(reader instanceof $Reader))
17750
+ reader = $Reader.create(reader);
17751
+ let end = length === void 0 ? reader.len : reader.pos + length, message = new $root.sesame.v1.status.TransportStatus();
17752
+ while (reader.pos < end) {
17753
+ let tag = reader.uint32();
17754
+ if (tag === error)
17755
+ break;
17756
+ switch (tag >>> 3) {
17757
+ case 1: {
17758
+ if (!(message.sources && message.sources.length))
17759
+ message.sources = [];
17760
+ message.sources.push($root.sesame.v1.status.TransportEvent.decode(reader, reader.uint32()));
17761
+ break;
17762
+ }
17763
+ default:
17764
+ reader.skipType(tag & 7);
17765
+ break;
17766
+ }
17767
+ }
17768
+ return message;
17769
+ };
17770
+ TransportStatus.decodeDelimited = function decodeDelimited(reader) {
17771
+ if (!(reader instanceof $Reader))
17772
+ reader = new $Reader(reader);
17773
+ return this.decode(reader, reader.uint32());
17774
+ };
17775
+ TransportStatus.verify = function verify(message) {
17776
+ if (typeof message !== "object" || message === null)
17777
+ return "object expected";
17778
+ if (message.sources != null && message.hasOwnProperty("sources")) {
17779
+ if (!Array.isArray(message.sources))
17780
+ return "sources: array expected";
17781
+ for (let i = 0; i < message.sources.length; ++i) {
17782
+ let error = $root.sesame.v1.status.TransportEvent.verify(message.sources[i]);
17783
+ if (error)
17784
+ return "sources." + error;
17785
+ }
17786
+ }
17787
+ return null;
17788
+ };
17789
+ TransportStatus.fromObject = function fromObject(object) {
17790
+ if (object instanceof $root.sesame.v1.status.TransportStatus)
17791
+ return object;
17792
+ let message = new $root.sesame.v1.status.TransportStatus();
17793
+ if (object.sources) {
17794
+ if (!Array.isArray(object.sources))
17795
+ throw TypeError(".sesame.v1.status.TransportStatus.sources: array expected");
17796
+ message.sources = [];
17797
+ for (let i = 0; i < object.sources.length; ++i) {
17798
+ if (typeof object.sources[i] !== "object")
17799
+ throw TypeError(".sesame.v1.status.TransportStatus.sources: object expected");
17800
+ message.sources[i] = $root.sesame.v1.status.TransportEvent.fromObject(object.sources[i]);
17801
+ }
17802
+ }
17803
+ return message;
17804
+ };
17805
+ TransportStatus.toObject = function toObject(message, options) {
17806
+ if (!options)
17807
+ options = {};
17808
+ let object = {};
17809
+ if (options.arrays || options.defaults)
17810
+ object.sources = [];
17811
+ if (message.sources && message.sources.length) {
17812
+ object.sources = [];
17813
+ for (let j = 0; j < message.sources.length; ++j)
17814
+ object.sources[j] = $root.sesame.v1.status.TransportEvent.toObject(message.sources[j], options);
17815
+ }
17816
+ return object;
17817
+ };
17818
+ TransportStatus.prototype.toJSON = function toJSON() {
17819
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
17820
+ };
17821
+ TransportStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
17822
+ if (typeUrlPrefix === void 0) {
17823
+ typeUrlPrefix = "type.googleapis.com";
17824
+ }
17825
+ return typeUrlPrefix + "/sesame.v1.status.TransportStatus";
17826
+ };
17827
+ return TransportStatus;
17828
+ }();
17702
17829
  status.MetadataEvent = function() {
17703
17830
  function MetadataEvent(properties) {
17704
17831
  if (properties) {
@@ -29180,7 +29307,7 @@ function parseDataFrame(frame) {
29180
29307
  return {
29181
29308
  dataType: "transport-status",
29182
29309
  trackName,
29183
- event: sesame.v1.status.TransportEvent.decode(payload)
29310
+ status: sesame.v1.status.TransportStatus.decode(payload)
29184
29311
  };
29185
29312
  case sesame.v1.wire.DataType.DATA_TYPE_AUDIO_STATE:
29186
29313
  return {
@@ -29200,6 +29327,36 @@ function parseDataFrame(frame) {
29200
29327
  trackName,
29201
29328
  request: sesame.v1.audio.AudioControlRequest.decode(payload)
29202
29329
  };
29330
+ case sesame.v1.wire.DataType.DATA_TYPE_OUTPUT_CONTROL:
29331
+ return {
29332
+ dataType: "output-control",
29333
+ trackName,
29334
+ request: sesame.v1.outputs.OutputControlRequest.decode(payload)
29335
+ };
29336
+ case sesame.v1.wire.DataType.DATA_TYPE_SOURCE_CONTROL:
29337
+ return {
29338
+ dataType: "source-control",
29339
+ trackName,
29340
+ request: sesame.v1.sources.SourceControlRequest.decode(payload)
29341
+ };
29342
+ case sesame.v1.wire.DataType.DATA_TYPE_OUTPUT_STATUS:
29343
+ return {
29344
+ dataType: "output-status",
29345
+ trackName,
29346
+ status: sesame.v1.outputs.OutputStatus.decode(payload)
29347
+ };
29348
+ case sesame.v1.wire.DataType.DATA_TYPE_SOURCE_STATUS:
29349
+ return {
29350
+ dataType: "source-status",
29351
+ trackName,
29352
+ status: sesame.v1.sources.SourceStatus.decode(payload)
29353
+ };
29354
+ case sesame.v1.wire.DataType.DATA_TYPE_ENGINE_STATUS:
29355
+ return {
29356
+ dataType: "engine-status",
29357
+ trackName,
29358
+ status: sesame.v1.status.Status.decode(payload)
29359
+ };
29203
29360
  case sesame.v1.wire.DataType.DATA_TYPE_BINARY:
29204
29361
  return { dataType: "binary", trackName, data: payload };
29205
29362
  default:
@@ -29262,6 +29419,16 @@ function buildSourceControlFrame(trackName, request) {
29262
29419
  payload
29263
29420
  );
29264
29421
  }
29422
+ function buildOutputControlFrame(trackName, request) {
29423
+ const payload = sesame.v1.outputs.OutputControlRequest.encode(request).finish();
29424
+ return WireProtocol.serialize(
29425
+ {
29426
+ type: sesame.v1.wire.FrameType.FRAME_TYPE_DATA,
29427
+ data: { dataType: sesame.v1.wire.DataType.DATA_TYPE_OUTPUT_CONTROL, trackName }
29428
+ },
29429
+ payload
29430
+ );
29431
+ }
29265
29432
  function buildBinaryDataFrame(trackName, payload) {
29266
29433
  return WireProtocol.serialize(
29267
29434
  {
@@ -29970,6 +30137,7 @@ export {
29970
30137
  WireProtocol,
29971
30138
  buildAudioControlFrame,
29972
30139
  buildBinaryDataFrame,
30140
+ buildOutputControlFrame,
29973
30141
  buildSourceControlFrame,
29974
30142
  buildTransportControlFrame,
29975
30143
  getLogger,