@stinkycomputing/sesame-api-client 1.5.1 → 1.5.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/dist/index.cjs CHANGED
@@ -4925,6 +4925,7 @@ var sesame = $root.sesame = (() => {
4925
4925
  values[valuesById[13] = "SOURCE_TRANSPORT_CMD_SKIP_NEXT"] = 13;
4926
4926
  values[valuesById[14] = "SOURCE_TRANSPORT_CMD_TRANSITIONS_DISABLED"] = 14;
4927
4927
  values[valuesById[15] = "SOURCE_TRANSPORT_CMD_SET_SCRUBBING"] = 15;
4928
+ values[valuesById[16] = "SOURCE_TRANSPORT_CMD_SET_END_NOTIFICATION"] = 16;
4928
4929
  return values;
4929
4930
  }();
4930
4931
  sources.SourceTextureSize = function() {
@@ -8586,6 +8587,7 @@ var sesame = $root.sesame = (() => {
8586
8587
  case 13:
8587
8588
  case 14:
8588
8589
  case 15:
8590
+ case 16:
8589
8591
  break;
8590
8592
  }
8591
8593
  if (message.value != null && message.hasOwnProperty("value")) {
@@ -8672,6 +8674,10 @@ var sesame = $root.sesame = (() => {
8672
8674
  case 15:
8673
8675
  message.cmdType = 15;
8674
8676
  break;
8677
+ case "SOURCE_TRANSPORT_CMD_SET_END_NOTIFICATION":
8678
+ case 16:
8679
+ message.cmdType = 16;
8680
+ break;
8675
8681
  }
8676
8682
  if (object.value != null) {
8677
8683
  if (typeof object.value !== "object")
@@ -9140,6 +9146,7 @@ var sesame = $root.sesame = (() => {
9140
9146
  case 13:
9141
9147
  case 14:
9142
9148
  case 15:
9149
+ case 16:
9143
9150
  break;
9144
9151
  }
9145
9152
  if (message.value != null && message.hasOwnProperty("value")) {
@@ -9224,6 +9231,10 @@ var sesame = $root.sesame = (() => {
9224
9231
  case 15:
9225
9232
  message.cmdType = 15;
9226
9233
  break;
9234
+ case "SOURCE_TRANSPORT_CMD_SET_END_NOTIFICATION":
9235
+ case 16:
9236
+ message.cmdType = 16;
9237
+ break;
9227
9238
  }
9228
9239
  if (object.value != null) {
9229
9240
  if (typeof object.value !== "object")
@@ -14425,6 +14436,7 @@ var sesame = $root.sesame = (() => {
14425
14436
  TransportEvent.prototype.preroll = 0;
14426
14437
  TransportEvent.prototype.postroll = 0;
14427
14438
  TransportEvent.prototype.metadata = null;
14439
+ TransportEvent.prototype.nearEnd = false;
14428
14440
  TransportEvent.create = function create(properties) {
14429
14441
  return new TransportEvent(properties);
14430
14442
  };
@@ -14521,6 +14533,11 @@ var sesame = $root.sesame = (() => {
14521
14533
  /* id 18, wireType 2 =*/
14522
14534
  146
14523
14535
  ).fork()).ldelim();
14536
+ if (message.nearEnd != null && Object.hasOwnProperty.call(message, "nearEnd"))
14537
+ writer.uint32(
14538
+ /* id 19, wireType 0 =*/
14539
+ 152
14540
+ ).bool(message.nearEnd);
14524
14541
  return writer;
14525
14542
  };
14526
14543
  TransportEvent.encodeDelimited = function encodeDelimited(message, writer) {
@@ -14607,6 +14624,10 @@ var sesame = $root.sesame = (() => {
14607
14624
  message.metadata = $root.sesame.v1.common.TransportMetadata.decode(reader, reader.uint32());
14608
14625
  break;
14609
14626
  }
14627
+ case 19: {
14628
+ message.nearEnd = reader.bool();
14629
+ break;
14630
+ }
14610
14631
  default:
14611
14632
  reader.skipType(tag & 7);
14612
14633
  break;
@@ -14702,6 +14723,10 @@ var sesame = $root.sesame = (() => {
14702
14723
  if (error)
14703
14724
  return "metadata." + error;
14704
14725
  }
14726
+ if (message.nearEnd != null && message.hasOwnProperty("nearEnd")) {
14727
+ if (typeof message.nearEnd !== "boolean")
14728
+ return "nearEnd: boolean expected";
14729
+ }
14705
14730
  return null;
14706
14731
  };
14707
14732
  TransportEvent.fromObject = function fromObject(object) {
@@ -14829,6 +14854,8 @@ var sesame = $root.sesame = (() => {
14829
14854
  throw TypeError(".sesame.v1.status.TransportEvent.metadata: object expected");
14830
14855
  message.metadata = $root.sesame.v1.common.TransportMetadata.fromObject(object.metadata);
14831
14856
  }
14857
+ if (object.nearEnd != null)
14858
+ message.nearEnd = Boolean(object.nearEnd);
14832
14859
  return message;
14833
14860
  };
14834
14861
  TransportEvent.toObject = function toObject(message, options) {
@@ -14882,6 +14909,7 @@ var sesame = $root.sesame = (() => {
14882
14909
  object.preroll = 0;
14883
14910
  object.postroll = 0;
14884
14911
  object.metadata = null;
14912
+ object.nearEnd = false;
14885
14913
  }
14886
14914
  if (message.sourceId != null && message.hasOwnProperty("sourceId"))
14887
14915
  object.sourceId = message.sourceId;
@@ -14940,6 +14968,8 @@ var sesame = $root.sesame = (() => {
14940
14968
  object.postroll = message.postroll;
14941
14969
  if (message.metadata != null && message.hasOwnProperty("metadata"))
14942
14970
  object.metadata = $root.sesame.v1.common.TransportMetadata.toObject(message.metadata, options);
14971
+ if (message.nearEnd != null && message.hasOwnProperty("nearEnd"))
14972
+ object.nearEnd = message.nearEnd;
14943
14973
  return object;
14944
14974
  };
14945
14975
  TransportEvent.prototype.toJSON = function toJSON() {
@@ -23484,11 +23514,12 @@ var CommandList = class {
23484
23514
  }
23485
23515
  applyTransaction(transaction) {
23486
23516
  this.cl.commandList.forEach((item) => {
23487
- if (transaction.transactionId !== void 0) {
23517
+ if (transaction.transactionId !== void 0 && item.transactionId == null) {
23488
23518
  item.transactionId = transaction.transactionId;
23489
23519
  }
23490
23520
  if (transaction.dependencies !== void 0) {
23491
- item.transactionDeps = item.transactionDeps ? item.transactionDeps.concat(transaction.dependencies) : transaction.dependencies;
23521
+ const existing = item.transactionDeps ?? [];
23522
+ item.transactionDeps = [...new Set(existing.concat(transaction.dependencies))];
23492
23523
  }
23493
23524
  });
23494
23525
  }
@@ -23671,7 +23702,7 @@ var CommandList = class {
23671
23702
  }
23672
23703
  }
23673
23704
  item.updateSourceTransport = transportCmd;
23674
- return this.add(item, timeOffsetMs, { transactionId: msg.transactionId, dependencies: [] });
23705
+ return this.add(item, timeOffsetMs, { transactionId: msg.transactionId, dependencies: msg.dependencies });
23675
23706
  }
23676
23707
  sourceUpdate(id, cfg, timeOffsetMs) {
23677
23708
  let item = new sesame.v1.commands.CommandListItem();
@@ -24423,15 +24454,21 @@ var EaseKind = /* @__PURE__ */ ((EaseKind2) => {
24423
24454
  EaseKind2["BACK_INOUT"] = "backInOut";
24424
24455
  return EaseKind2;
24425
24456
  })(EaseKind || {});
24457
+ function appendQueryParam(url, key, value) {
24458
+ if (!value) return url;
24459
+ const separator = url.includes("?") ? "&" : "?";
24460
+ return `${url}${separator}${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
24461
+ }
24426
24462
  var SesameClient = class extends import_events3.EventEmitter {
24427
- constructor(portOrUrl) {
24463
+ constructor(portOrUrl, clientOptions = {}) {
24428
24464
  super();
24429
24465
  this.subscriptions = [];
24430
24466
  this.onMediaPacket = () => {
24431
24467
  };
24432
24468
  this.onCallbackMessage = () => {
24433
24469
  };
24434
- const url = typeof portOrUrl === "number" ? `ws://127.0.0.1:${portOrUrl}/api` : portOrUrl;
24470
+ const baseUrl = typeof portOrUrl === "number" ? `ws://127.0.0.1:${portOrUrl}/api` : portOrUrl;
24471
+ const url = appendQueryParam(baseUrl, "client", clientOptions.wsClientLabel ?? "");
24435
24472
  this.conn = new SesameConnection({
24436
24473
  url,
24437
24474
  autoConnect: true,