@stinkycomputing/sesame-api-client 1.5.2 → 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.mjs CHANGED
@@ -23452,11 +23452,12 @@ var CommandList = class {
23452
23452
  }
23453
23453
  applyTransaction(transaction) {
23454
23454
  this.cl.commandList.forEach((item) => {
23455
- if (transaction.transactionId !== void 0) {
23455
+ if (transaction.transactionId !== void 0 && item.transactionId == null) {
23456
23456
  item.transactionId = transaction.transactionId;
23457
23457
  }
23458
23458
  if (transaction.dependencies !== void 0) {
23459
- item.transactionDeps = item.transactionDeps ? item.transactionDeps.concat(transaction.dependencies) : transaction.dependencies;
23459
+ const existing = item.transactionDeps ?? [];
23460
+ item.transactionDeps = [...new Set(existing.concat(transaction.dependencies))];
23460
23461
  }
23461
23462
  });
23462
23463
  }
@@ -23639,7 +23640,7 @@ var CommandList = class {
23639
23640
  }
23640
23641
  }
23641
23642
  item.updateSourceTransport = transportCmd;
23642
- return this.add(item, timeOffsetMs, { transactionId: msg.transactionId, dependencies: [] });
23643
+ return this.add(item, timeOffsetMs, { transactionId: msg.transactionId, dependencies: msg.dependencies });
23643
23644
  }
23644
23645
  sourceUpdate(id, cfg, timeOffsetMs) {
23645
23646
  let item = new sesame.v1.commands.CommandListItem();
@@ -24391,15 +24392,21 @@ var EaseKind = /* @__PURE__ */ ((EaseKind2) => {
24391
24392
  EaseKind2["BACK_INOUT"] = "backInOut";
24392
24393
  return EaseKind2;
24393
24394
  })(EaseKind || {});
24395
+ function appendQueryParam(url, key, value) {
24396
+ if (!value) return url;
24397
+ const separator = url.includes("?") ? "&" : "?";
24398
+ return `${url}${separator}${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
24399
+ }
24394
24400
  var SesameClient = class extends EventEmitter3 {
24395
- constructor(portOrUrl) {
24401
+ constructor(portOrUrl, clientOptions = {}) {
24396
24402
  super();
24397
24403
  this.subscriptions = [];
24398
24404
  this.onMediaPacket = () => {
24399
24405
  };
24400
24406
  this.onCallbackMessage = () => {
24401
24407
  };
24402
- const url = typeof portOrUrl === "number" ? `ws://127.0.0.1:${portOrUrl}/api` : portOrUrl;
24408
+ const baseUrl = typeof portOrUrl === "number" ? `ws://127.0.0.1:${portOrUrl}/api` : portOrUrl;
24409
+ const url = appendQueryParam(baseUrl, "client", clientOptions.wsClientLabel ?? "");
24403
24410
  this.conn = new SesameConnection({
24404
24411
  url,
24405
24412
  autoConnect: true,