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