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