@kosdev-code/kos-ui-sdk 0.1.0-next.865 → 0.1.0-next.867

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/index.cjs CHANGED
@@ -793,7 +793,7 @@ const updateCompanionModelRegistration = (typeId, companionRegistration) => {
793
793
  const TOPIC = "/kos/ui/internal/heartbeat/";
794
794
  const pairedClientHeartbeat = ({
795
795
  relationshipId,
796
- destinationAddress: destinationAddress2,
796
+ destinationAddress,
797
797
  onAbort,
798
798
  waitTime,
799
799
  beatTime
@@ -821,7 +821,7 @@ const pairedClientHeartbeat = ({
821
821
  msg: {},
822
822
  options: {
823
823
  topic: `${TOPIC}${relationshipId}`,
824
- destinationAddress: destinationAddress2
824
+ destinationAddress
825
825
  }
826
826
  });
827
827
  }, _beatTime);
@@ -6430,20 +6430,20 @@ __decorateClass$o([
6430
6430
  LogBlockContainerModelImpl = __decorateClass$o([
6431
6431
  service$8.kosModel(MODEL_TYPE$n)
6432
6432
  ], LogBlockContainerModelImpl);
6433
- const log$g = service$8.KosLog.createLogger({
6434
- name: "log-stream-container-service",
6435
- group: "Services"
6436
- });
6437
- const getKosConnectionId$2 = () => {
6433
+ const getKosConnectionId = () => {
6438
6434
  const params2 = service$8.getQueryParams();
6439
6435
  const connId = params2?.connId;
6440
6436
  const result = connId || window?.kosBridge?.("connId");
6441
- service$8.KosLog.error(`getKosConnectionId: ${result}`);
6437
+ service$8.KosLog.debug(`getKosConnectionId: ${result}`);
6442
6438
  return result;
6443
6439
  };
6444
- const destinationAddress$3 = getKosConnectionId$2();
6440
+ const log$g = service$8.KosLog.createLogger({
6441
+ name: "log-stream-container-service",
6442
+ group: "Services"
6443
+ });
6445
6444
  const SERVICE_PATH$1 = "/api/kos/logs/node/{nodeId}/streams";
6446
6445
  const getLogStreams = async () => {
6446
+ const destinationAddress = getKosConnectionId();
6447
6447
  log$g.debug("sending GET for log-stream-container");
6448
6448
  return await service$8.api.get(
6449
6449
  SERVICE_PATH$1,
@@ -6453,11 +6453,12 @@ const getLogStreams = async () => {
6453
6453
  }
6454
6454
  },
6455
6455
  {
6456
- destinationAddress: destinationAddress$3
6456
+ destinationAddress
6457
6457
  }
6458
6458
  );
6459
6459
  };
6460
6460
  const subscribeToLogStream = async (stream, nodeId = "primary") => {
6461
+ const destinationAddress = getKosConnectionId();
6461
6462
  await service$8.api.post(
6462
6463
  "/api/kos/logs/node/{nodeId}/{stream}/subscribe",
6463
6464
  {
@@ -6468,21 +6469,23 @@ const subscribeToLogStream = async (stream, nodeId = "primary") => {
6468
6469
  },
6469
6470
  void 0,
6470
6471
  {
6471
- destinationAddress: destinationAddress$3
6472
+ destinationAddress
6472
6473
  }
6473
6474
  );
6474
6475
  };
6475
6476
  const unsubscribeFromLogStream = async (stream) => {
6477
+ const destinationAddress = getKosConnectionId();
6476
6478
  await service$8.api.post(
6477
6479
  "/api/kos/logs/node/{nodeId}/{stream}/unsubscribe",
6478
6480
  { path: { nodeId: "primary", stream } },
6479
6481
  void 0,
6480
6482
  {
6481
- destinationAddress: destinationAddress$3
6483
+ destinationAddress
6482
6484
  }
6483
6485
  );
6484
6486
  };
6485
6487
  const createOverride = async () => {
6488
+ const destinationAddress = getKosConnectionId();
6486
6489
  await service$8.api.post(
6487
6490
  "/api/kos/logs/overrides",
6488
6491
  {},
@@ -6493,11 +6496,12 @@ const createOverride = async () => {
6493
6496
  type: "package"
6494
6497
  },
6495
6498
  {
6496
- destinationAddress: destinationAddress$3
6499
+ destinationAddress
6497
6500
  }
6498
6501
  );
6499
6502
  };
6500
6503
  const getLogStreamBlocks = async (stream) => {
6504
+ const destinationAddress = getKosConnectionId();
6501
6505
  const response = await service$8.api.get(
6502
6506
  "/api/kos/logs/node/{nodeId}/{stream}/blocks",
6503
6507
  {
@@ -6507,12 +6511,13 @@ const getLogStreamBlocks = async (stream) => {
6507
6511
  }
6508
6512
  },
6509
6513
  {
6510
- destinationAddress: destinationAddress$3
6514
+ destinationAddress
6511
6515
  }
6512
6516
  );
6513
6517
  return response;
6514
6518
  };
6515
6519
  const getLogStreamBlock = async (stream, blockId) => {
6520
+ const destinationAddress = getKosConnectionId();
6516
6521
  const response = await service$8.api.get(
6517
6522
  "/api/kos/logs/node/{nodeId}/{stream}/blocks/{blockId}",
6518
6523
  {
@@ -6523,7 +6528,7 @@ const getLogStreamBlock = async (stream, blockId) => {
6523
6528
  }
6524
6529
  },
6525
6530
  {
6526
- destinationAddress: destinationAddress$3
6531
+ destinationAddress
6527
6532
  }
6528
6533
  );
6529
6534
  return response;
@@ -6531,7 +6536,6 @@ const getLogStreamBlock = async (stream, blockId) => {
6531
6536
  const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6532
6537
  __proto__: null,
6533
6538
  createOverride,
6534
- getKosConnectionId: getKosConnectionId$2,
6535
6539
  getLogStreamBlock,
6536
6540
  getLogStreamBlocks,
6537
6541
  getLogStreams,
@@ -7046,37 +7050,26 @@ const { getAll: getAll$4, postModel: postModel$1 } = service$8.ServiceFactory.bu
7046
7050
  basePath: `${URL$6}/api/kos/troubles`
7047
7051
  });
7048
7052
  const log$f = service$8.KosLog.createLogger({ name: "trouble-services" });
7049
- const getKosConnectionId$1 = () => {
7050
- const params2 = service$8.getQueryParams();
7051
- const connId = params2?.connId;
7052
- log$f.debug(`connId from query params: ${connId}`);
7053
- log$f.debug(
7054
- `window.kosBridge: ${window?.kosBridge ? "available" : "not available"} - ${window?.kosBridge?.("connId")}`
7055
- );
7056
- const result = connId || window?.kosBridge?.("connId");
7057
- log$f.info(`getKosConnectionId: ${result}`);
7058
- return result;
7059
- };
7060
- const destinationAddress$2 = getKosConnectionId$1();
7061
- log$f.info(`Destination address for trouble services: ${destinationAddress$2}`);
7062
7053
  const getTroubles = async (servicePath) => {
7063
7054
  const isKosTroubles = servicePath.includes("/kos/troubles");
7055
+ const destinationAddress = getKosConnectionId();
7064
7056
  log$f.info(
7065
- `Fetching troubles from ${servicePath} with destination address: ${isKosTroubles ? destinationAddress$2 : "N/A (not a kos troubles path)"}`
7057
+ `Fetching troubles from ${servicePath} with destination address: ${isKosTroubles ? destinationAddress : "N/A (not a kos troubles path)"}`
7066
7058
  );
7067
7059
  const response = await getAll$4({
7068
7060
  urlOverride: `${URL$6}${servicePath}`,
7069
- destinationAddress: isKosTroubles ? destinationAddress$2 : void 0
7061
+ destinationAddress: isKosTroubles ? destinationAddress : void 0
7070
7062
  });
7071
7063
  return response;
7072
7064
  };
7073
7065
  const resolveTrouble = async (troubleId, servicePath = "/api/kos/troubles", tracker) => {
7074
7066
  try {
7075
7067
  const isKosTroubles = servicePath.includes("/kos/troubles");
7068
+ const destinationAddress = getKosConnectionId();
7076
7069
  const response = await postModel$1({
7077
7070
  model: {},
7078
7071
  urlOverride: `${URL$6}${servicePath}/resolve/${troubleId}`,
7079
- destinationAddress: isKosTroubles ? destinationAddress$2 : void 0,
7072
+ destinationAddress: isKosTroubles ? destinationAddress : void 0,
7080
7073
  tracker
7081
7074
  });
7082
7075
  if (response?.data) {
@@ -7096,10 +7089,11 @@ const resolveTrouble = async (troubleId, servicePath = "/api/kos/troubles", trac
7096
7089
  };
7097
7090
  const bulkResolveTroubles = async (troubleIds, servicePath = "/api/kos/troubles", tracker) => {
7098
7091
  try {
7092
+ const destinationAddress = getKosConnectionId();
7099
7093
  const response = await postModel$1({
7100
7094
  model: troubleIds,
7101
7095
  urlOverride: `${URL$6}${servicePath}/resolve/`,
7102
- destinationAddress: destinationAddress$2,
7096
+ destinationAddress,
7103
7097
  tracker
7104
7098
  });
7105
7099
  if (response?.data) {
@@ -7120,7 +7114,6 @@ const bulkResolveTroubles = async (troubleIds, servicePath = "/api/kos/troubles"
7120
7114
  const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7121
7115
  __proto__: null,
7122
7116
  bulkResolveTroubles,
7123
- getKosConnectionId: getKosConnectionId$1,
7124
7117
  getTroubles,
7125
7118
  resolveTrouble
7126
7119
  }, Symbol.toStringTag, { value: "Module" }));
@@ -10802,27 +10795,20 @@ const NetworkInterface = new service$8.KosModelRegistrationFactory({
10802
10795
  class: NetworkInterfaceModelImpl,
10803
10796
  type: MODEL_TYPE$d
10804
10797
  });
10805
- const getKosConnectionId = () => {
10806
- const params2 = service$8.getQueryParams();
10807
- const connId = params2?.connId;
10808
- const result = connId || window?.kosBridge?.("connId");
10809
- service$8.KosLog.debug(`getKosConnectionId: ${result}`);
10810
- return result;
10811
- };
10812
10798
  const { URL: URL$3 } = service$8.resolveServiceUrl();
10813
10799
  const { getAll: getAll$2 } = service$8.ServiceFactory.build({
10814
10800
  basePath: `${URL$3}/api/kos/network/interfaces`
10815
10801
  });
10816
- const destinationAddress$1 = getKosConnectionId();
10817
10802
  const log$b = service$8.KosLog.createLogger({
10818
10803
  name: "network-interface-service",
10819
10804
  group: "Services"
10820
10805
  });
10821
10806
  const getNetworkInterfaces = async () => {
10807
+ const destinationAddress = getKosConnectionId();
10822
10808
  log$b.debug("sending GET for copy-logs");
10823
10809
  try {
10824
10810
  const response = await getAll$2({
10825
- destinationAddress: destinationAddress$1
10811
+ destinationAddress
10826
10812
  });
10827
10813
  return [void 0, response?.data];
10828
10814
  } catch (error) {
@@ -12554,8 +12540,8 @@ const log$6 = service$8.KosLog.createLogger({
12554
12540
  name: "software-info-service",
12555
12541
  group: "Services"
12556
12542
  });
12557
- const destinationAddress = getKosConnectionId();
12558
12543
  const getSoftwareInfos = async (signal) => {
12544
+ const destinationAddress = getKosConnectionId();
12559
12545
  log$6.debug("sending GET for software-info");
12560
12546
  const [error, response] = await api$8.get("/api/kos/manifest/info", void 0, {
12561
12547
  signal,
@@ -12684,10 +12670,10 @@ const login = async (username, password, url = `${service$8.BASE_URL}/api/login`
12684
12670
  return configResponse;
12685
12671
  };
12686
12672
  const studioStartPasswordReset = async (userId) => startPasswordReset(userId, `${service$8.BASE_URL}/api/server/startPasswordReset`, "");
12687
- const startPasswordReset = async (userId, url = `${service$8.BASE_URL}/api/startPasswordReset`, destinationAddress2 = "server") => {
12673
+ const startPasswordReset = async (userId, url = `${service$8.BASE_URL}/api/startPasswordReset`, destinationAddress = "server") => {
12688
12674
  const response = await service$8.kosFetch(`${url}?email=${userId}`, {
12689
12675
  method: `POST`,
12690
- destinationAddress: destinationAddress2
12676
+ destinationAddress
12691
12677
  });
12692
12678
  if (!response.ok) {
12693
12679
  throw Error(