@kosdev-code/kos-ddk-models 3.1.1 → 3.1.2
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.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +162 -45
- package/index.js.map +1 -1
- package/index.mjs +162 -45
- package/index.mjs.map +1 -1
- package/lib/carb-water/carb-water-model.d.ts +2 -2
- package/lib/carb-water/carb-water-model.d.ts.map +1 -1
- package/lib/mock/ddk-mock.d.ts +60 -0
- package/lib/mock/ddk-mock.d.ts.map +1 -0
- package/lib/mock/index.d.ts +3 -0
- package/lib/mock/index.d.ts.map +1 -0
- package/lib/mock/ncui-mock-data.d.ts +29 -0
- package/lib/mock/ncui-mock-data.d.ts.map +1 -0
- package/lib/plain-water/plain-water-model.d.ts +3 -3
- package/lib/plain-water/plain-water-model.d.ts.map +1 -1
- package/lib/trouble-action/trouble-action-model.d.ts +3 -2
- package/lib/trouble-action/trouble-action-model.d.ts.map +1 -1
- package/package.json +2 -2
- package/utils/services/kosdev.ddk/snapshot/service.d.ts +1 -1
package/index.mjs
CHANGED
|
@@ -7,16 +7,16 @@ const { URL: URL$d } = resolveServiceUrl("AUTH_SERVICE");
|
|
|
7
7
|
const { getOne: getOne$4, postModel: postModel$4 } = ServiceFactory.build({
|
|
8
8
|
basePath: `${URL$d}/api/auth`
|
|
9
9
|
});
|
|
10
|
-
const log$
|
|
10
|
+
const log$f = KosLog.createLogger({ name: "auth-service", group: "Services" });
|
|
11
11
|
const getCurrentRole = async () => {
|
|
12
|
-
log$
|
|
12
|
+
log$f.debug("sending GET for auth");
|
|
13
13
|
const response = await getOne$4({
|
|
14
14
|
urlOverride: `${URL$d}/api/app/kosdev.ddk/auth/role`
|
|
15
15
|
});
|
|
16
16
|
return response;
|
|
17
17
|
};
|
|
18
18
|
const sendPinCode = async (pinCode) => {
|
|
19
|
-
log$
|
|
19
|
+
log$f.debug("sending POST for auth");
|
|
20
20
|
const response = await postModel$4({
|
|
21
21
|
urlOverride: `${URL$d}/api/app/kosdev.ddk/auth/pincode/${pinCode}`,
|
|
22
22
|
model: {}
|
|
@@ -162,19 +162,19 @@ const { URL: URL$c } = resolveServiceUrl("SETUP-STEP_SERVICE");
|
|
|
162
162
|
const { getAll: getAll$9, postModel: postModel$3 } = ServiceFactory.build({
|
|
163
163
|
basePath: `${URL$c}/api/setup-step`
|
|
164
164
|
});
|
|
165
|
-
const log$
|
|
165
|
+
const log$e = KosLog.createLogger({
|
|
166
166
|
name: "setup-step-service",
|
|
167
167
|
group: "Services"
|
|
168
168
|
});
|
|
169
169
|
const getSetupSteps = async () => {
|
|
170
|
-
log$
|
|
170
|
+
log$e.debug("sending GET for setup-step");
|
|
171
171
|
const response = await getAll$9({
|
|
172
172
|
urlOverride: `${URL$c}/api/app/kosdev.ddk/setup/steps`
|
|
173
173
|
});
|
|
174
174
|
return response;
|
|
175
175
|
};
|
|
176
176
|
const markStepComplete = async (stepId) => {
|
|
177
|
-
log$
|
|
177
|
+
log$e.debug("sending POST for setup-step");
|
|
178
178
|
const response = await postModel$3({
|
|
179
179
|
urlOverride: `${URL$c}/api/app/kosdev.ddk/setup/complete/${stepId}`,
|
|
180
180
|
model: {}
|
|
@@ -408,9 +408,9 @@ const { URL: URL$b } = resolveServiceUrl("AUTH_SERVICE");
|
|
|
408
408
|
const { getOne: getOne$3, getAll: getAll$8 } = ServiceFactory.build({
|
|
409
409
|
basePath: `${URL$b}/api/app/kosdev.ddk/ncui/`
|
|
410
410
|
});
|
|
411
|
-
const log$
|
|
411
|
+
const log$d = KosLog.createLogger({ name: "auth-service", group: "Services" });
|
|
412
412
|
const getCuis = async () => {
|
|
413
|
-
log$
|
|
413
|
+
log$d.debug("sending GET for cuis");
|
|
414
414
|
const response = await getAll$8({
|
|
415
415
|
urlOverride: `${URL$b}/api/app/kosdev.ddk/cui`
|
|
416
416
|
});
|
|
@@ -420,13 +420,13 @@ const getCuis = async () => {
|
|
|
420
420
|
return response.data;
|
|
421
421
|
};
|
|
422
422
|
const getNavigation = async () => {
|
|
423
|
-
log$
|
|
423
|
+
log$d.debug("sending GET for navigation");
|
|
424
424
|
try {
|
|
425
425
|
const extensionResponse = await getAll$8({
|
|
426
426
|
urlOverride: `${URL$b}/api/kos/descriptor/app:kosdev.ddk:ncuiDescriptor/kondra.ncui.navigations`
|
|
427
427
|
});
|
|
428
428
|
if (extensionResponse?.status !== 200) {
|
|
429
|
-
log$
|
|
429
|
+
log$d.info(`no extensions found, using base data`);
|
|
430
430
|
const response = await getAll$8({
|
|
431
431
|
urlOverride: `${URL$b}/api/kos/descriptor/system:app/kondra.ncui.navigations`
|
|
432
432
|
});
|
|
@@ -441,14 +441,14 @@ const getNavigation = async () => {
|
|
|
441
441
|
}
|
|
442
442
|
};
|
|
443
443
|
const navigateToCui = async () => {
|
|
444
|
-
log$
|
|
444
|
+
log$d.debug("navigating to CUI");
|
|
445
445
|
const response = await getOne$3({
|
|
446
446
|
urlOverride: `${URL$b}/api/app/kosdev.ddk/cui/open`
|
|
447
447
|
});
|
|
448
448
|
return response;
|
|
449
449
|
};
|
|
450
450
|
const navigateToNCui$1 = async () => {
|
|
451
|
-
log$
|
|
451
|
+
log$d.debug("navigating to NCUI");
|
|
452
452
|
const response = await getOne$3({
|
|
453
453
|
urlOverride: `${URL$b}/api/app/kosdev.ddk/ncui/open`
|
|
454
454
|
});
|
|
@@ -865,12 +865,12 @@ const { URL: URL$a } = resolveServiceUrl("ANIMATION_SERVICE");
|
|
|
865
865
|
const { getAll: getAll$7 } = ServiceFactory.build({
|
|
866
866
|
basePath: `${URL$a}/api/animation`
|
|
867
867
|
});
|
|
868
|
-
const log$
|
|
868
|
+
const log$c = KosLog.createLogger({
|
|
869
869
|
name: "animation-service",
|
|
870
870
|
group: "Services"
|
|
871
871
|
});
|
|
872
872
|
const getAnimations = async () => {
|
|
873
|
-
log$
|
|
873
|
+
log$c.debug("sending GET for animation");
|
|
874
874
|
const response = await getAll$7({});
|
|
875
875
|
return response;
|
|
876
876
|
};
|
|
@@ -901,7 +901,7 @@ let CarbWaterModelImpl = class {
|
|
|
901
901
|
const carbHolder = this.assemblyModel.getHoldersByGroup("carb")[0];
|
|
902
902
|
const pump = carbHolder.pumps.data[0];
|
|
903
903
|
const model = getKosCompanionModel(pump, FcmPump.type);
|
|
904
|
-
return model;
|
|
904
|
+
return model ?? carbHolder;
|
|
905
905
|
}
|
|
906
906
|
// -------------------LIFECYCLE----------------------------
|
|
907
907
|
async init() {
|
|
@@ -932,7 +932,7 @@ const { URL: URL$9 } = resolveServiceUrl("COPY-LOGS_SERVICE");
|
|
|
932
932
|
const { getAll: getAll$6, getOne: getOne$2, postModel: postModel$2, deleteModel } = ServiceFactory.build({
|
|
933
933
|
basePath: `${URL$9}/api/copy-logs`
|
|
934
934
|
});
|
|
935
|
-
const log$
|
|
935
|
+
const log$b = KosLog.createLogger({
|
|
936
936
|
name: "copy-logs-service",
|
|
937
937
|
group: "Services"
|
|
938
938
|
});
|
|
@@ -970,7 +970,7 @@ const copyLogFromVolume = async (volumeId, tracker) => {
|
|
|
970
970
|
return response.data;
|
|
971
971
|
};
|
|
972
972
|
const getVolumes = async () => {
|
|
973
|
-
log$
|
|
973
|
+
log$b.debug("sending GET for copy-logs");
|
|
974
974
|
try {
|
|
975
975
|
const response = await getAll$6({
|
|
976
976
|
urlOverride: `${URL$9}/api/app/kosdev.ddk/copyLogs/volumes/size`
|
|
@@ -978,14 +978,14 @@ const getVolumes = async () => {
|
|
|
978
978
|
return [void 0, response?.data];
|
|
979
979
|
} catch (error) {
|
|
980
980
|
if (error instanceof FetchError) {
|
|
981
|
-
log$
|
|
981
|
+
log$b.error(`Error fetching log file size: ${error.payload.error}`);
|
|
982
982
|
return [error.payload.error, void 0];
|
|
983
983
|
}
|
|
984
984
|
}
|
|
985
985
|
return ["unknownError", void 0];
|
|
986
986
|
};
|
|
987
987
|
const getLogFileSize = async () => {
|
|
988
|
-
log$
|
|
988
|
+
log$b.debug("sending GET for log file size");
|
|
989
989
|
try {
|
|
990
990
|
const response = await getOne$2({
|
|
991
991
|
urlOverride: `${URL$9}/api/app/kosdev.ddk/copyLogs/files/size`
|
|
@@ -993,7 +993,7 @@ const getLogFileSize = async () => {
|
|
|
993
993
|
return [void 0, response?.data];
|
|
994
994
|
} catch (error) {
|
|
995
995
|
if (error instanceof FetchError) {
|
|
996
|
-
log$
|
|
996
|
+
log$b.error(`Error fetching log file size: ${error.payload.error}`);
|
|
997
997
|
return [error.payload.error, void 0];
|
|
998
998
|
}
|
|
999
999
|
}
|
|
@@ -1230,12 +1230,12 @@ CopyLogsModelImpl = __decorateClass$h([
|
|
|
1230
1230
|
kosLoggerAware()
|
|
1231
1231
|
], CopyLogsModelImpl);
|
|
1232
1232
|
const CopyLogs = CopyLogsModelImpl.Registration;
|
|
1233
|
-
const log$
|
|
1233
|
+
const log$a = KosLog.createLogger({
|
|
1234
1234
|
name: "dashboard-operations-service",
|
|
1235
1235
|
group: "Services"
|
|
1236
1236
|
});
|
|
1237
1237
|
const resolveAll = async (troubleIds, tracker) => {
|
|
1238
|
-
log$
|
|
1238
|
+
log$a.debug("resolveAll");
|
|
1239
1239
|
const response = await TroubleServices.bulkResolveTroubles(
|
|
1240
1240
|
troubleIds,
|
|
1241
1241
|
void 0,
|
|
@@ -1244,7 +1244,7 @@ const resolveAll = async (troubleIds, tracker) => {
|
|
|
1244
1244
|
return response;
|
|
1245
1245
|
};
|
|
1246
1246
|
const resolveTrouble = async (troubleId, tracker) => {
|
|
1247
|
-
log$
|
|
1247
|
+
log$a.debug("resolveTrouble");
|
|
1248
1248
|
const response = await TroubleServices.resolveTrouble(
|
|
1249
1249
|
troubleId,
|
|
1250
1250
|
void 0,
|
|
@@ -1424,12 +1424,12 @@ const { URL: URL$8 } = resolveServiceUrl("DISPENSER_SERVICE");
|
|
|
1424
1424
|
const { getAll: getAll$5 } = ServiceFactory.build({
|
|
1425
1425
|
basePath: `${URL$8}/api/dispenser`
|
|
1426
1426
|
});
|
|
1427
|
-
const log$
|
|
1427
|
+
const log$9 = KosLog.createLogger({
|
|
1428
1428
|
name: "dispenser-service",
|
|
1429
1429
|
group: "Services"
|
|
1430
1430
|
});
|
|
1431
1431
|
const getDispensers = async () => {
|
|
1432
|
-
log$
|
|
1432
|
+
log$9.debug("sending GET for dispenser");
|
|
1433
1433
|
const response = await getAll$5({});
|
|
1434
1434
|
return response;
|
|
1435
1435
|
};
|
|
@@ -1490,12 +1490,12 @@ const { URL: URL$7 } = resolveServiceUrl("DISPENSER-INFO_SERVICE");
|
|
|
1490
1490
|
const { getAll: getAll$4 } = ServiceFactory.build({
|
|
1491
1491
|
basePath: `${URL$7}/api/dispenser-info`
|
|
1492
1492
|
});
|
|
1493
|
-
const log$
|
|
1493
|
+
const log$8 = KosLog.createLogger({
|
|
1494
1494
|
name: "dispenser-info-service",
|
|
1495
1495
|
group: "Services"
|
|
1496
1496
|
});
|
|
1497
1497
|
const getDispenserInfos = async () => {
|
|
1498
|
-
log$
|
|
1498
|
+
log$8.debug("sending GET for dispenser-info");
|
|
1499
1499
|
const response = await getAll$4({});
|
|
1500
1500
|
return response;
|
|
1501
1501
|
};
|
|
@@ -1550,12 +1550,12 @@ const { URL: URL$6 } = resolveServiceUrl("ENROLLMENT_SERVICE");
|
|
|
1550
1550
|
const { getAll: getAll$3 } = ServiceFactory.build({
|
|
1551
1551
|
basePath: `${URL$6}/api/enrollment`
|
|
1552
1552
|
});
|
|
1553
|
-
const log$
|
|
1553
|
+
const log$7 = KosLog.createLogger({
|
|
1554
1554
|
name: "enrollment-service",
|
|
1555
1555
|
group: "Services"
|
|
1556
1556
|
});
|
|
1557
1557
|
const getEnrollments = async () => {
|
|
1558
|
-
log$
|
|
1558
|
+
log$7.debug("sending GET for enrollment");
|
|
1559
1559
|
const response = await getAll$3({});
|
|
1560
1560
|
return response;
|
|
1561
1561
|
};
|
|
@@ -1724,9 +1724,9 @@ const { URL: URL$5 } = resolveServiceUrl("LOCKOUT_SERVICE");
|
|
|
1724
1724
|
const { postModel: postModel$1 } = ServiceFactory.build({
|
|
1725
1725
|
basePath: `${URL$5}/api/app/kosdev.ddk/lockout`
|
|
1726
1726
|
});
|
|
1727
|
-
const log$
|
|
1727
|
+
const log$6 = KosLog.createLogger({ name: "lockout-service", group: "Services" });
|
|
1728
1728
|
const lock = async () => {
|
|
1729
|
-
log$
|
|
1729
|
+
log$6.info("lock");
|
|
1730
1730
|
const response = await postModel$1({
|
|
1731
1731
|
model: {},
|
|
1732
1732
|
urlOverride: `${URL$5}/api/app/kosdev.ddk/lockout/lockNow`
|
|
@@ -1734,7 +1734,7 @@ const lock = async () => {
|
|
|
1734
1734
|
return response;
|
|
1735
1735
|
};
|
|
1736
1736
|
const unlock = async (pin) => {
|
|
1737
|
-
log$
|
|
1737
|
+
log$6.info("unlock");
|
|
1738
1738
|
const response = await postModel$1({
|
|
1739
1739
|
model: {},
|
|
1740
1740
|
urlOverride: `${URL$5}/api/app/kosdev.ddk/lockout/unlock/${pin}`
|
|
@@ -2041,6 +2041,126 @@ const MacroAssignment = {
|
|
|
2041
2041
|
MODEL_TYPE$a
|
|
2042
2042
|
)
|
|
2043
2043
|
};
|
|
2044
|
+
const descriptorValue = (ncui, path) => path.split(".").reduce(
|
|
2045
|
+
(value, key) => value && typeof value === "object" ? value[key] : void 0,
|
|
2046
|
+
{ kondra: { ncui } }
|
|
2047
|
+
);
|
|
2048
|
+
const descriptorSetupSteps = (steps, backend) => steps.map((step) => ({
|
|
2049
|
+
complete: false,
|
|
2050
|
+
preStep: false,
|
|
2051
|
+
exclusive: false,
|
|
2052
|
+
...backend.find((existing) => existing.name === step.name),
|
|
2053
|
+
...step
|
|
2054
|
+
}));
|
|
2055
|
+
const withUtility = (columns, entry, column = columns.length - 1) => columns.length === 0 ? [[entry]] : columns.map((items, i) => i === column ? [...items, entry] : items);
|
|
2056
|
+
const withNavigation = (items, entry, parent) => {
|
|
2057
|
+
if (!parent) return [...items, entry];
|
|
2058
|
+
const [head, ...rest] = parent.split(".");
|
|
2059
|
+
return items.map(
|
|
2060
|
+
(item) => item.name === head ? {
|
|
2061
|
+
...item,
|
|
2062
|
+
children: withNavigation(
|
|
2063
|
+
item.children ?? [],
|
|
2064
|
+
entry,
|
|
2065
|
+
rest.join(".") || void 0
|
|
2066
|
+
)
|
|
2067
|
+
} : item
|
|
2068
|
+
);
|
|
2069
|
+
};
|
|
2070
|
+
const withSetupStep = (steps, entry, before) => {
|
|
2071
|
+
const step = { complete: false, preStep: false, exclusive: false, ...entry };
|
|
2072
|
+
const at = before ? steps.findIndex((s) => s.name === before) : -1;
|
|
2073
|
+
return at < 0 ? [...steps, step] : [...steps.slice(0, at), step, ...steps.slice(at)];
|
|
2074
|
+
};
|
|
2075
|
+
const log$5 = KosLog.createLogger({ name: "ddk-mock" });
|
|
2076
|
+
const NCUI_DESCRIPTOR = "/api/kos/descriptor/app:kosdev.ddk:ncuiDescriptor";
|
|
2077
|
+
const ANY_DESCRIPTOR = "/api/kos/descriptor/:descriptor";
|
|
2078
|
+
const SETUP_STEPS = "/api/app/kosdev.ddk/setup/steps";
|
|
2079
|
+
const onData = (change) => (body) => {
|
|
2080
|
+
const envelope = body;
|
|
2081
|
+
if (envelope?.data === void 0) return body;
|
|
2082
|
+
return { ...envelope, data: change(envelope.data) };
|
|
2083
|
+
};
|
|
2084
|
+
const lastSegment = (path) => path.split("/").pop() ?? "";
|
|
2085
|
+
const createDdkMockHelpers = (kosMock) => {
|
|
2086
|
+
const removeAll = (...handles) => () => handles.forEach((handle) => handle.remove());
|
|
2087
|
+
return {
|
|
2088
|
+
useDescriptor(descriptor) {
|
|
2089
|
+
const ncui = "kondra" in descriptor ? descriptor.kondra.ncui : descriptor;
|
|
2090
|
+
const handles = [
|
|
2091
|
+
kosMock.get(
|
|
2092
|
+
`${NCUI_DESCRIPTOR}/:path`,
|
|
2093
|
+
(req) => ({ data: descriptorValue(ncui, lastSegment(req.path)) }),
|
|
2094
|
+
{
|
|
2095
|
+
id: "ddk-ncui-descriptor",
|
|
2096
|
+
description: "DDK: the descriptor project as the installed NCUI descriptor",
|
|
2097
|
+
// Paths the descriptor does not have reach the backend.
|
|
2098
|
+
when: (req) => descriptorValue(ncui, lastSegment(req.path)) !== void 0
|
|
2099
|
+
}
|
|
2100
|
+
)
|
|
2101
|
+
];
|
|
2102
|
+
const steps = ncui.setup?.steps;
|
|
2103
|
+
if (steps) {
|
|
2104
|
+
handles.push(
|
|
2105
|
+
kosMock.transformResponse(
|
|
2106
|
+
"GET",
|
|
2107
|
+
SETUP_STEPS,
|
|
2108
|
+
onData(
|
|
2109
|
+
(backend) => descriptorSetupSteps(steps, backend)
|
|
2110
|
+
),
|
|
2111
|
+
{ description: "DDK: the descriptor project's setup steps" }
|
|
2112
|
+
)
|
|
2113
|
+
);
|
|
2114
|
+
}
|
|
2115
|
+
return removeAll(...handles);
|
|
2116
|
+
},
|
|
2117
|
+
addUtility(entry, { column } = {}) {
|
|
2118
|
+
return removeAll(
|
|
2119
|
+
kosMock.transformResponse(
|
|
2120
|
+
"GET",
|
|
2121
|
+
`${ANY_DESCRIPTOR}/kondra.ncui.utilities`,
|
|
2122
|
+
onData(
|
|
2123
|
+
(columns) => withUtility(columns, entry, column)
|
|
2124
|
+
),
|
|
2125
|
+
{ description: `DDK: utility ${entry.name}` }
|
|
2126
|
+
)
|
|
2127
|
+
);
|
|
2128
|
+
},
|
|
2129
|
+
addNavigation(entry, { parent } = {}) {
|
|
2130
|
+
return removeAll(
|
|
2131
|
+
kosMock.transformResponse(
|
|
2132
|
+
"GET",
|
|
2133
|
+
`${ANY_DESCRIPTOR}/kondra.ncui.navigations`,
|
|
2134
|
+
onData(
|
|
2135
|
+
(items) => withNavigation(items, entry, parent)
|
|
2136
|
+
),
|
|
2137
|
+
{ description: `DDK: navigation ${entry.name}` }
|
|
2138
|
+
)
|
|
2139
|
+
);
|
|
2140
|
+
},
|
|
2141
|
+
addSetupStep(entry, { before } = {}) {
|
|
2142
|
+
return removeAll(
|
|
2143
|
+
kosMock.transformResponse(
|
|
2144
|
+
"GET",
|
|
2145
|
+
SETUP_STEPS,
|
|
2146
|
+
onData(
|
|
2147
|
+
(steps) => withSetupStep(steps, entry, before)
|
|
2148
|
+
),
|
|
2149
|
+
{ description: `DDK: setup step ${entry.name}` }
|
|
2150
|
+
)
|
|
2151
|
+
);
|
|
2152
|
+
}
|
|
2153
|
+
};
|
|
2154
|
+
};
|
|
2155
|
+
const registerDdkMock = () => {
|
|
2156
|
+
const kosMock = globalThis.KosMock;
|
|
2157
|
+
if (typeof kosMock?.extend !== "function") return;
|
|
2158
|
+
try {
|
|
2159
|
+
kosMock.extend("ddk", createDdkMockHelpers);
|
|
2160
|
+
} catch (error) {
|
|
2161
|
+
log$5.warn("kosMock.ddk not registered", error?.message);
|
|
2162
|
+
}
|
|
2163
|
+
};
|
|
2044
2164
|
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
2045
2165
|
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
2046
2166
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
|
|
@@ -2358,7 +2478,7 @@ let PlainWaterModelImpl = class {
|
|
|
2358
2478
|
const waterHolder = this.getHolder();
|
|
2359
2479
|
const pump = waterHolder?.pumps?.data?.[0];
|
|
2360
2480
|
const model = getKosCompanionModel(pump, FcmPump.type);
|
|
2361
|
-
return model;
|
|
2481
|
+
return model ?? waterHolder;
|
|
2362
2482
|
}
|
|
2363
2483
|
// -------------------LIFECYCLE----------------------------
|
|
2364
2484
|
async init() {
|
|
@@ -2888,8 +3008,9 @@ let TroubleActionModelImpl = class {
|
|
|
2888
3008
|
* Gets the first active trouble that has an associated action definition.
|
|
2889
3009
|
*
|
|
2890
3010
|
* Returns the first trouble found that matches any of the configured trouble
|
|
2891
|
-
* action definitions
|
|
2892
|
-
*
|
|
3011
|
+
* action definitions, checking the trouble types in definition order. If
|
|
3012
|
+
* troubles of several defined types are active, the earliest-defined type wins
|
|
3013
|
+
* (in the DDK hosts, plugin load order).
|
|
2893
3014
|
*
|
|
2894
3015
|
* @returns The active trouble model, or undefined if no matching troubles exist
|
|
2895
3016
|
*
|
|
@@ -2906,18 +3027,12 @@ let TroubleActionModelImpl = class {
|
|
|
2906
3027
|
* @see {@link TroubleContainerModel} for trouble data structure
|
|
2907
3028
|
*/
|
|
2908
3029
|
get activeTrouble() {
|
|
2909
|
-
const
|
|
2910
|
-
|
|
2911
|
-
const firstAction = actions[0];
|
|
2912
|
-
const troubles = this.troubleContainer.troubles.getIndexByKey(
|
|
3030
|
+
for (const troubleType of Object.keys(this.troubleActionData)) {
|
|
3031
|
+
const [trouble] = this.troubleContainer.troubles.getIndexByKey(
|
|
2913
3032
|
"byType",
|
|
2914
|
-
|
|
3033
|
+
troubleType
|
|
2915
3034
|
);
|
|
2916
|
-
if (
|
|
2917
|
-
return troubles[0];
|
|
2918
|
-
} else {
|
|
2919
|
-
return void 0;
|
|
2920
|
-
}
|
|
3035
|
+
if (trouble) return trouble;
|
|
2921
3036
|
}
|
|
2922
3037
|
return void 0;
|
|
2923
3038
|
}
|
|
@@ -3090,11 +3205,13 @@ export {
|
|
|
3090
3205
|
UtilitiesContainer,
|
|
3091
3206
|
index$1 as UtilitiesServices,
|
|
3092
3207
|
calculateTimeDifference,
|
|
3208
|
+
createDdkMockHelpers,
|
|
3093
3209
|
executeDashboardKeyFactory,
|
|
3094
3210
|
isMacroGroup,
|
|
3095
3211
|
isMicroGroup,
|
|
3096
3212
|
macroHolderMap,
|
|
3097
3213
|
registerDashboardKeyFactory,
|
|
3214
|
+
registerDdkMock,
|
|
3098
3215
|
toSeconds,
|
|
3099
3216
|
toTimeComponents,
|
|
3100
3217
|
troubleVisibilityFilter
|