@kosdev-code/kos-ui-sdk 0.1.0-next.865 → 0.1.0-next.868
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/core/core/services/browser-router.d.ts +1 -0
- package/core/core/services/browser-router.d.ts.map +1 -1
- package/core/util/kos-service-request.d.ts +6 -1
- package/core/util/kos-service-request.d.ts.map +1 -1
- package/core/util/service-factory.d.ts +2 -0
- package/core/util/service-factory.d.ts.map +1 -1
- package/{index-CvCXisvT.js → index-D64IOwMG.js} +10 -3
- package/index-D64IOwMG.js.map +1 -0
- package/{index-D8aw-T5w.cjs → index-DsRhHHtS.cjs} +10 -3
- package/index-DsRhHHtS.cjs.map +1 -0
- package/index.cjs +36 -49
- package/index.cjs.map +1 -1
- package/index.js +37 -50
- package/index.js.map +1 -1
- package/models/models/browser-router/browser-router-model.d.ts.map +1 -1
- package/models/models/log-stream/services/log-stream-services.d.ts +0 -1
- package/models/models/log-stream/services/log-stream-services.d.ts.map +1 -1
- package/models/models/network-interface/services/network-interface-services.d.ts.map +1 -1
- package/models/models/software-info/services/software-info-services.d.ts.map +1 -1
- package/models/models/trouble/services/trouble-services.d.ts +0 -1
- package/models/models/trouble/services/trouble-services.d.ts.map +1 -1
- package/package.json +3 -3
- package/testing.cjs +1 -1
- package/testing.js +1 -1
- package/index-CvCXisvT.js.map +0 -1
- package/index-D8aw-T5w.cjs.map +0 -1
package/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const service$8 = require("./index-
|
|
3
|
+
const service$8 = require("./index-DsRhHHtS.cjs");
|
|
4
4
|
const mobx = require("mobx");
|
|
5
5
|
const log$s = require("loglevel");
|
|
6
6
|
const dateFns = require("date-fns");
|
|
@@ -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
|
|
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
|
|
824
|
+
destinationAddress
|
|
825
825
|
}
|
|
826
826
|
});
|
|
827
827
|
}, _beatTime);
|
|
@@ -3492,7 +3492,8 @@ let BrowserRouterModelImpl = class {
|
|
|
3492
3492
|
id: requestId,
|
|
3493
3493
|
method,
|
|
3494
3494
|
path: url,
|
|
3495
|
-
body: data
|
|
3495
|
+
body: data,
|
|
3496
|
+
headers: payload.headers
|
|
3496
3497
|
};
|
|
3497
3498
|
let status = 200;
|
|
3498
3499
|
const res = {
|
|
@@ -6430,20 +6431,20 @@ __decorateClass$o([
|
|
|
6430
6431
|
LogBlockContainerModelImpl = __decorateClass$o([
|
|
6431
6432
|
service$8.kosModel(MODEL_TYPE$n)
|
|
6432
6433
|
], LogBlockContainerModelImpl);
|
|
6433
|
-
const
|
|
6434
|
-
name: "log-stream-container-service",
|
|
6435
|
-
group: "Services"
|
|
6436
|
-
});
|
|
6437
|
-
const getKosConnectionId$2 = () => {
|
|
6434
|
+
const getKosConnectionId = () => {
|
|
6438
6435
|
const params2 = service$8.getQueryParams();
|
|
6439
6436
|
const connId = params2?.connId;
|
|
6440
6437
|
const result = connId || window?.kosBridge?.("connId");
|
|
6441
|
-
service$8.KosLog.
|
|
6438
|
+
service$8.KosLog.debug(`getKosConnectionId: ${result}`);
|
|
6442
6439
|
return result;
|
|
6443
6440
|
};
|
|
6444
|
-
const
|
|
6441
|
+
const log$g = service$8.KosLog.createLogger({
|
|
6442
|
+
name: "log-stream-container-service",
|
|
6443
|
+
group: "Services"
|
|
6444
|
+
});
|
|
6445
6445
|
const SERVICE_PATH$1 = "/api/kos/logs/node/{nodeId}/streams";
|
|
6446
6446
|
const getLogStreams = async () => {
|
|
6447
|
+
const destinationAddress = getKosConnectionId();
|
|
6447
6448
|
log$g.debug("sending GET for log-stream-container");
|
|
6448
6449
|
return await service$8.api.get(
|
|
6449
6450
|
SERVICE_PATH$1,
|
|
@@ -6453,11 +6454,12 @@ const getLogStreams = async () => {
|
|
|
6453
6454
|
}
|
|
6454
6455
|
},
|
|
6455
6456
|
{
|
|
6456
|
-
destinationAddress
|
|
6457
|
+
destinationAddress
|
|
6457
6458
|
}
|
|
6458
6459
|
);
|
|
6459
6460
|
};
|
|
6460
6461
|
const subscribeToLogStream = async (stream, nodeId = "primary") => {
|
|
6462
|
+
const destinationAddress = getKosConnectionId();
|
|
6461
6463
|
await service$8.api.post(
|
|
6462
6464
|
"/api/kos/logs/node/{nodeId}/{stream}/subscribe",
|
|
6463
6465
|
{
|
|
@@ -6468,21 +6470,23 @@ const subscribeToLogStream = async (stream, nodeId = "primary") => {
|
|
|
6468
6470
|
},
|
|
6469
6471
|
void 0,
|
|
6470
6472
|
{
|
|
6471
|
-
destinationAddress
|
|
6473
|
+
destinationAddress
|
|
6472
6474
|
}
|
|
6473
6475
|
);
|
|
6474
6476
|
};
|
|
6475
6477
|
const unsubscribeFromLogStream = async (stream) => {
|
|
6478
|
+
const destinationAddress = getKosConnectionId();
|
|
6476
6479
|
await service$8.api.post(
|
|
6477
6480
|
"/api/kos/logs/node/{nodeId}/{stream}/unsubscribe",
|
|
6478
6481
|
{ path: { nodeId: "primary", stream } },
|
|
6479
6482
|
void 0,
|
|
6480
6483
|
{
|
|
6481
|
-
destinationAddress
|
|
6484
|
+
destinationAddress
|
|
6482
6485
|
}
|
|
6483
6486
|
);
|
|
6484
6487
|
};
|
|
6485
6488
|
const createOverride = async () => {
|
|
6489
|
+
const destinationAddress = getKosConnectionId();
|
|
6486
6490
|
await service$8.api.post(
|
|
6487
6491
|
"/api/kos/logs/overrides",
|
|
6488
6492
|
{},
|
|
@@ -6493,11 +6497,12 @@ const createOverride = async () => {
|
|
|
6493
6497
|
type: "package"
|
|
6494
6498
|
},
|
|
6495
6499
|
{
|
|
6496
|
-
destinationAddress
|
|
6500
|
+
destinationAddress
|
|
6497
6501
|
}
|
|
6498
6502
|
);
|
|
6499
6503
|
};
|
|
6500
6504
|
const getLogStreamBlocks = async (stream) => {
|
|
6505
|
+
const destinationAddress = getKosConnectionId();
|
|
6501
6506
|
const response = await service$8.api.get(
|
|
6502
6507
|
"/api/kos/logs/node/{nodeId}/{stream}/blocks",
|
|
6503
6508
|
{
|
|
@@ -6507,12 +6512,13 @@ const getLogStreamBlocks = async (stream) => {
|
|
|
6507
6512
|
}
|
|
6508
6513
|
},
|
|
6509
6514
|
{
|
|
6510
|
-
destinationAddress
|
|
6515
|
+
destinationAddress
|
|
6511
6516
|
}
|
|
6512
6517
|
);
|
|
6513
6518
|
return response;
|
|
6514
6519
|
};
|
|
6515
6520
|
const getLogStreamBlock = async (stream, blockId) => {
|
|
6521
|
+
const destinationAddress = getKosConnectionId();
|
|
6516
6522
|
const response = await service$8.api.get(
|
|
6517
6523
|
"/api/kos/logs/node/{nodeId}/{stream}/blocks/{blockId}",
|
|
6518
6524
|
{
|
|
@@ -6523,7 +6529,7 @@ const getLogStreamBlock = async (stream, blockId) => {
|
|
|
6523
6529
|
}
|
|
6524
6530
|
},
|
|
6525
6531
|
{
|
|
6526
|
-
destinationAddress
|
|
6532
|
+
destinationAddress
|
|
6527
6533
|
}
|
|
6528
6534
|
);
|
|
6529
6535
|
return response;
|
|
@@ -6531,7 +6537,6 @@ const getLogStreamBlock = async (stream, blockId) => {
|
|
|
6531
6537
|
const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6532
6538
|
__proto__: null,
|
|
6533
6539
|
createOverride,
|
|
6534
|
-
getKosConnectionId: getKosConnectionId$2,
|
|
6535
6540
|
getLogStreamBlock,
|
|
6536
6541
|
getLogStreamBlocks,
|
|
6537
6542
|
getLogStreams,
|
|
@@ -7046,37 +7051,26 @@ const { getAll: getAll$4, postModel: postModel$1 } = service$8.ServiceFactory.bu
|
|
|
7046
7051
|
basePath: `${URL$6}/api/kos/troubles`
|
|
7047
7052
|
});
|
|
7048
7053
|
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
7054
|
const getTroubles = async (servicePath) => {
|
|
7063
7055
|
const isKosTroubles = servicePath.includes("/kos/troubles");
|
|
7056
|
+
const destinationAddress = getKosConnectionId();
|
|
7064
7057
|
log$f.info(
|
|
7065
|
-
`Fetching troubles from ${servicePath} with destination address: ${isKosTroubles ? destinationAddress
|
|
7058
|
+
`Fetching troubles from ${servicePath} with destination address: ${isKosTroubles ? destinationAddress : "N/A (not a kos troubles path)"}`
|
|
7066
7059
|
);
|
|
7067
7060
|
const response = await getAll$4({
|
|
7068
7061
|
urlOverride: `${URL$6}${servicePath}`,
|
|
7069
|
-
destinationAddress: isKosTroubles ? destinationAddress
|
|
7062
|
+
destinationAddress: isKosTroubles ? destinationAddress : void 0
|
|
7070
7063
|
});
|
|
7071
7064
|
return response;
|
|
7072
7065
|
};
|
|
7073
7066
|
const resolveTrouble = async (troubleId, servicePath = "/api/kos/troubles", tracker) => {
|
|
7074
7067
|
try {
|
|
7075
7068
|
const isKosTroubles = servicePath.includes("/kos/troubles");
|
|
7069
|
+
const destinationAddress = getKosConnectionId();
|
|
7076
7070
|
const response = await postModel$1({
|
|
7077
7071
|
model: {},
|
|
7078
7072
|
urlOverride: `${URL$6}${servicePath}/resolve/${troubleId}`,
|
|
7079
|
-
destinationAddress: isKosTroubles ? destinationAddress
|
|
7073
|
+
destinationAddress: isKosTroubles ? destinationAddress : void 0,
|
|
7080
7074
|
tracker
|
|
7081
7075
|
});
|
|
7082
7076
|
if (response?.data) {
|
|
@@ -7096,10 +7090,11 @@ const resolveTrouble = async (troubleId, servicePath = "/api/kos/troubles", trac
|
|
|
7096
7090
|
};
|
|
7097
7091
|
const bulkResolveTroubles = async (troubleIds, servicePath = "/api/kos/troubles", tracker) => {
|
|
7098
7092
|
try {
|
|
7093
|
+
const destinationAddress = getKosConnectionId();
|
|
7099
7094
|
const response = await postModel$1({
|
|
7100
7095
|
model: troubleIds,
|
|
7101
7096
|
urlOverride: `${URL$6}${servicePath}/resolve/`,
|
|
7102
|
-
destinationAddress
|
|
7097
|
+
destinationAddress,
|
|
7103
7098
|
tracker
|
|
7104
7099
|
});
|
|
7105
7100
|
if (response?.data) {
|
|
@@ -7120,7 +7115,6 @@ const bulkResolveTroubles = async (troubleIds, servicePath = "/api/kos/troubles"
|
|
|
7120
7115
|
const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7121
7116
|
__proto__: null,
|
|
7122
7117
|
bulkResolveTroubles,
|
|
7123
|
-
getKosConnectionId: getKosConnectionId$1,
|
|
7124
7118
|
getTroubles,
|
|
7125
7119
|
resolveTrouble
|
|
7126
7120
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -10802,27 +10796,20 @@ const NetworkInterface = new service$8.KosModelRegistrationFactory({
|
|
|
10802
10796
|
class: NetworkInterfaceModelImpl,
|
|
10803
10797
|
type: MODEL_TYPE$d
|
|
10804
10798
|
});
|
|
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
10799
|
const { URL: URL$3 } = service$8.resolveServiceUrl();
|
|
10813
10800
|
const { getAll: getAll$2 } = service$8.ServiceFactory.build({
|
|
10814
10801
|
basePath: `${URL$3}/api/kos/network/interfaces`
|
|
10815
10802
|
});
|
|
10816
|
-
const destinationAddress$1 = getKosConnectionId();
|
|
10817
10803
|
const log$b = service$8.KosLog.createLogger({
|
|
10818
10804
|
name: "network-interface-service",
|
|
10819
10805
|
group: "Services"
|
|
10820
10806
|
});
|
|
10821
10807
|
const getNetworkInterfaces = async () => {
|
|
10808
|
+
const destinationAddress = getKosConnectionId();
|
|
10822
10809
|
log$b.debug("sending GET for copy-logs");
|
|
10823
10810
|
try {
|
|
10824
10811
|
const response = await getAll$2({
|
|
10825
|
-
destinationAddress
|
|
10812
|
+
destinationAddress
|
|
10826
10813
|
});
|
|
10827
10814
|
return [void 0, response?.data];
|
|
10828
10815
|
} catch (error) {
|
|
@@ -12189,7 +12176,7 @@ const updateRegion = async (region) => {
|
|
|
12189
12176
|
regionInfo.updateProperty(region);
|
|
12190
12177
|
};
|
|
12191
12178
|
async function getKosServiceApi() {
|
|
12192
|
-
const { default: API } = await Promise.resolve().then(() => require("./index-
|
|
12179
|
+
const { default: API } = await Promise.resolve().then(() => require("./index-DsRhHHtS.cjs")).then((n) => n.service);
|
|
12193
12180
|
return API;
|
|
12194
12181
|
}
|
|
12195
12182
|
function kosServiceRequest$7(params2) {
|
|
@@ -12554,8 +12541,8 @@ const log$6 = service$8.KosLog.createLogger({
|
|
|
12554
12541
|
name: "software-info-service",
|
|
12555
12542
|
group: "Services"
|
|
12556
12543
|
});
|
|
12557
|
-
const destinationAddress = getKosConnectionId();
|
|
12558
12544
|
const getSoftwareInfos = async (signal) => {
|
|
12545
|
+
const destinationAddress = getKosConnectionId();
|
|
12559
12546
|
log$6.debug("sending GET for software-info");
|
|
12560
12547
|
const [error, response] = await api$8.get("/api/kos/manifest/info", void 0, {
|
|
12561
12548
|
signal,
|
|
@@ -12684,10 +12671,10 @@ const login = async (username, password, url = `${service$8.BASE_URL}/api/login`
|
|
|
12684
12671
|
return configResponse;
|
|
12685
12672
|
};
|
|
12686
12673
|
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`,
|
|
12674
|
+
const startPasswordReset = async (userId, url = `${service$8.BASE_URL}/api/startPasswordReset`, destinationAddress = "server") => {
|
|
12688
12675
|
const response = await service$8.kosFetch(`${url}?email=${userId}`, {
|
|
12689
12676
|
method: `POST`,
|
|
12690
|
-
destinationAddress
|
|
12677
|
+
destinationAddress
|
|
12691
12678
|
});
|
|
12692
12679
|
if (!response.ok) {
|
|
12693
12680
|
throw Error(
|