@kosdev-code/kos-ddk-models 2.0.0
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/constants.d.ts +3 -0
- package/constants.d.ts.map +1 -0
- package/index.d.ts +30 -0
- package/index.d.ts.map +1 -0
- package/index.js +1 -0
- package/index.mjs +2609 -0
- package/lib/agitation-control/agitation-control-model.d.ts +50 -0
- package/lib/agitation-control/agitation-control-model.d.ts.map +1 -0
- package/lib/agitation-control/agitation-control-registration.d.ts +89 -0
- package/lib/agitation-control/agitation-control-registration.d.ts.map +1 -0
- package/lib/agitation-control/index.d.ts +4 -0
- package/lib/agitation-control/index.d.ts.map +1 -0
- package/lib/agitation-control/types/index.d.ts +7 -0
- package/lib/animation/animation-model.d.ts +14 -0
- package/lib/animation/animation-model.d.ts.map +1 -0
- package/lib/animation/animation-registration.d.ts +86 -0
- package/lib/animation/animation-registration.d.ts.map +1 -0
- package/lib/animation/index.d.ts +4 -0
- package/lib/animation/index.d.ts.map +1 -0
- package/lib/animation/services/animation-services.d.ts +10 -0
- package/lib/animation/services/animation-services.d.ts.map +1 -0
- package/lib/animation/services/index.d.ts +2 -0
- package/lib/animation/services/index.d.ts.map +1 -0
- package/lib/animation/types/index.d.ts +14 -0
- package/lib/application/application-model.d.ts +33 -0
- package/lib/application/application-model.d.ts.map +1 -0
- package/lib/application/application-registration.d.ts +86 -0
- package/lib/application/application-registration.d.ts.map +1 -0
- package/lib/application/index.d.ts +4 -0
- package/lib/application/index.d.ts.map +1 -0
- package/lib/application/services/application-services.d.ts +29 -0
- package/lib/application/services/application-services.d.ts.map +1 -0
- package/lib/application/services/index.d.ts +2 -0
- package/lib/application/services/index.d.ts.map +1 -0
- package/lib/application/types/index.d.ts +31 -0
- package/lib/auth/auth-model.d.ts +17 -0
- package/lib/auth/auth-model.d.ts.map +1 -0
- package/lib/auth/auth-registration.d.ts +84 -0
- package/lib/auth/auth-registration.d.ts.map +1 -0
- package/lib/auth/index.d.ts +4 -0
- package/lib/auth/index.d.ts.map +1 -0
- package/lib/auth/services/auth-services.d.ts +10 -0
- package/lib/auth/services/auth-services.d.ts.map +1 -0
- package/lib/auth/services/index.d.ts +2 -0
- package/lib/auth/services/index.d.ts.map +1 -0
- package/lib/auth/types/index.d.ts +12 -0
- package/lib/carb-water/carb-water-model.d.ts +18 -0
- package/lib/carb-water/carb-water-model.d.ts.map +1 -0
- package/lib/carb-water/carb-water-registration.d.ts +85 -0
- package/lib/carb-water/carb-water-registration.d.ts.map +1 -0
- package/lib/carb-water/index.d.ts +4 -0
- package/lib/carb-water/index.d.ts.map +1 -0
- package/lib/carb-water/services/carb-water-services.d.ts +6 -0
- package/lib/carb-water/services/carb-water-services.d.ts.map +1 -0
- package/lib/carb-water/services/index.d.ts +2 -0
- package/lib/carb-water/services/index.d.ts.map +1 -0
- package/lib/carb-water/types/index.d.ts +1 -0
- package/lib/copy-logs/copy-logs-model.d.ts +45 -0
- package/lib/copy-logs/copy-logs-model.d.ts.map +1 -0
- package/lib/copy-logs/copy-logs-registration.d.ts +89 -0
- package/lib/copy-logs/copy-logs-registration.d.ts.map +1 -0
- package/lib/copy-logs/index.d.ts +5 -0
- package/lib/copy-logs/index.d.ts.map +1 -0
- package/lib/copy-logs/services/copy-logs-services.d.ts +22 -0
- package/lib/copy-logs/services/copy-logs-services.d.ts.map +1 -0
- package/lib/copy-logs/services/index.d.ts +2 -0
- package/lib/copy-logs/services/index.d.ts.map +1 -0
- package/lib/copy-logs/types/index.d.ts +8 -0
- package/lib/dashboard-operations/dashboard-operations-model.d.ts +28 -0
- package/lib/dashboard-operations/dashboard-operations-model.d.ts.map +1 -0
- package/lib/dashboard-operations/dashboard-operations-registration.d.ts +86 -0
- package/lib/dashboard-operations/dashboard-operations-registration.d.ts.map +1 -0
- package/lib/dashboard-operations/index.d.ts +4 -0
- package/lib/dashboard-operations/index.d.ts.map +1 -0
- package/lib/dashboard-operations/services/dashboard-operations-services.d.ts +7 -0
- package/lib/dashboard-operations/services/dashboard-operations-services.d.ts.map +1 -0
- package/lib/dashboard-operations/services/index.d.ts +2 -0
- package/lib/dashboard-operations/services/index.d.ts.map +1 -0
- package/lib/dashboard-operations/types/index.d.ts +21 -0
- package/lib/dispenser/dispenser-model.d.ts +13 -0
- package/lib/dispenser/dispenser-model.d.ts.map +1 -0
- package/lib/dispenser/dispenser-registration.d.ts +86 -0
- package/lib/dispenser/dispenser-registration.d.ts.map +1 -0
- package/lib/dispenser/index.d.ts +4 -0
- package/lib/dispenser/index.d.ts.map +1 -0
- package/lib/dispenser/services/dispenser-services.d.ts +10 -0
- package/lib/dispenser/services/dispenser-services.d.ts.map +1 -0
- package/lib/dispenser/services/index.d.ts +2 -0
- package/lib/dispenser/services/index.d.ts.map +1 -0
- package/lib/dispenser/types/index.d.ts +9 -0
- package/lib/dispenser-info/dispenser-info-model.d.ts +13 -0
- package/lib/dispenser-info/dispenser-info-model.d.ts.map +1 -0
- package/lib/dispenser-info/dispenser-info-registration.d.ts +84 -0
- package/lib/dispenser-info/dispenser-info-registration.d.ts.map +1 -0
- package/lib/dispenser-info/index.d.ts +4 -0
- package/lib/dispenser-info/index.d.ts.map +1 -0
- package/lib/dispenser-info/services/dispenser-info-services.d.ts +10 -0
- package/lib/dispenser-info/services/dispenser-info-services.d.ts.map +1 -0
- package/lib/dispenser-info/services/index.d.ts +2 -0
- package/lib/dispenser-info/services/index.d.ts.map +1 -0
- package/lib/dispenser-info/types/index.d.ts +10 -0
- package/lib/door/door-model.d.ts +20 -0
- package/lib/door/door-model.d.ts.map +1 -0
- package/lib/door/door-registration.d.ts +87 -0
- package/lib/door/door-registration.d.ts.map +1 -0
- package/lib/door/index.d.ts +4 -0
- package/lib/door/index.d.ts.map +1 -0
- package/lib/door/types/index.d.ts +3 -0
- package/lib/enrollment/enrollment-model.d.ts +14 -0
- package/lib/enrollment/enrollment-model.d.ts.map +1 -0
- package/lib/enrollment/enrollment-registration.d.ts +84 -0
- package/lib/enrollment/enrollment-registration.d.ts.map +1 -0
- package/lib/enrollment/index.d.ts +4 -0
- package/lib/enrollment/index.d.ts.map +1 -0
- package/lib/enrollment/services/enrollment-services.d.ts +10 -0
- package/lib/enrollment/services/enrollment-services.d.ts.map +1 -0
- package/lib/enrollment/services/index.d.ts +2 -0
- package/lib/enrollment/services/index.d.ts.map +1 -0
- package/lib/enrollment/types/index.d.ts +10 -0
- package/lib/extension/index.d.ts +2 -0
- package/lib/extension/index.d.ts.map +1 -0
- package/lib/fcm-pump/fcm-pump-model.d.ts +28 -0
- package/lib/fcm-pump/fcm-pump-model.d.ts.map +1 -0
- package/lib/fcm-pump/fcm-pump-registration.d.ts +87 -0
- package/lib/fcm-pump/fcm-pump-registration.d.ts.map +1 -0
- package/lib/fcm-pump/index.d.ts +5 -0
- package/lib/fcm-pump/index.d.ts.map +1 -0
- package/lib/fcm-pump/services/fcm-pump-services.d.ts +17 -0
- package/lib/fcm-pump/services/fcm-pump-services.d.ts.map +1 -0
- package/lib/fcm-pump/services/index.d.ts +2 -0
- package/lib/fcm-pump/services/index.d.ts.map +1 -0
- package/lib/fcm-pump/types/index.d.ts +5 -0
- package/lib/ingredient-summary/index.d.ts +3 -0
- package/lib/ingredient-summary/index.d.ts.map +1 -0
- package/lib/ingredient-summary/ingredient-summary-model.d.ts +18 -0
- package/lib/ingredient-summary/ingredient-summary-model.d.ts.map +1 -0
- package/lib/ingredient-summary/ingredient-summary-registration.d.ts +84 -0
- package/lib/ingredient-summary/ingredient-summary-registration.d.ts.map +1 -0
- package/lib/ingredient-summary/types/index.d.ts +11 -0
- package/lib/lfcv-pump/index.d.ts +5 -0
- package/lib/lfcv-pump/index.d.ts.map +1 -0
- package/lib/lfcv-pump/lfcv-pump-model.d.ts +20 -0
- package/lib/lfcv-pump/lfcv-pump-model.d.ts.map +1 -0
- package/lib/lfcv-pump/lfcv-pump-registration.d.ts +87 -0
- package/lib/lfcv-pump/lfcv-pump-registration.d.ts.map +1 -0
- package/lib/lfcv-pump/services/index.d.ts +2 -0
- package/lib/lfcv-pump/services/index.d.ts.map +1 -0
- package/lib/lfcv-pump/services/lfcv-pump-services.d.ts +10 -0
- package/lib/lfcv-pump/services/lfcv-pump-services.d.ts.map +1 -0
- package/lib/lfcv-pump/types/index.d.ts +5 -0
- package/lib/lockout/index.d.ts +5 -0
- package/lib/lockout/index.d.ts.map +1 -0
- package/lib/lockout/lockout-model.d.ts +79 -0
- package/lib/lockout/lockout-model.d.ts.map +1 -0
- package/lib/lockout/lockout-registration.d.ts +89 -0
- package/lib/lockout/lockout-registration.d.ts.map +1 -0
- package/lib/lockout/services/index.d.ts +2 -0
- package/lib/lockout/services/index.d.ts.map +1 -0
- package/lib/lockout/services/lockout-services.d.ts +3 -0
- package/lib/lockout/services/lockout-services.d.ts.map +1 -0
- package/lib/lockout/types/index.d.ts +1 -0
- package/lib/macro-assignment/index.d.ts +3 -0
- package/lib/macro-assignment/index.d.ts.map +1 -0
- package/lib/macro-assignment/macro-assignment-model.d.ts +78 -0
- package/lib/macro-assignment/macro-assignment-model.d.ts.map +1 -0
- package/lib/macro-assignment/macro-assignment-registration.d.ts +86 -0
- package/lib/macro-assignment/macro-assignment-registration.d.ts.map +1 -0
- package/lib/macro-assignment/services/index.d.ts +2 -0
- package/lib/macro-assignment/services/index.d.ts.map +1 -0
- package/lib/macro-assignment/services/macro-assignment-services.d.ts +2 -0
- package/lib/macro-assignment/services/macro-assignment-services.d.ts.map +1 -0
- package/lib/macro-assignment/types/index.d.ts +39 -0
- package/lib/network-test/index.d.ts +5 -0
- package/lib/network-test/index.d.ts.map +1 -0
- package/lib/network-test/network-test-container-model.d.ts +23 -0
- package/lib/network-test/network-test-container-model.d.ts.map +1 -0
- package/lib/network-test/network-test-container-registration.d.ts +86 -0
- package/lib/network-test/network-test-container-registration.d.ts.map +1 -0
- package/lib/network-test/network-test-model.d.ts +21 -0
- package/lib/network-test/network-test-model.d.ts.map +1 -0
- package/lib/network-test/network-test-registration.d.ts +84 -0
- package/lib/network-test/network-test-registration.d.ts.map +1 -0
- package/lib/network-test/services/index.d.ts +2 -0
- package/lib/network-test/services/index.d.ts.map +1 -0
- package/lib/network-test/services/network-test-services.d.ts +37 -0
- package/lib/network-test/services/network-test-services.d.ts.map +1 -0
- package/lib/network-test/types/index.d.ts +44 -0
- package/lib/nutritive-sweetener/index.d.ts +4 -0
- package/lib/nutritive-sweetener/index.d.ts.map +1 -0
- package/lib/nutritive-sweetener/nutritive-sweetener-model.d.ts +18 -0
- package/lib/nutritive-sweetener/nutritive-sweetener-model.d.ts.map +1 -0
- package/lib/nutritive-sweetener/nutritive-sweetener-registration.d.ts +85 -0
- package/lib/nutritive-sweetener/nutritive-sweetener-registration.d.ts.map +1 -0
- package/lib/nutritive-sweetener/services/index.d.ts +2 -0
- package/lib/nutritive-sweetener/services/index.d.ts.map +1 -0
- package/lib/nutritive-sweetener/services/nutritive-sweetener-services.d.ts +6 -0
- package/lib/nutritive-sweetener/services/nutritive-sweetener-services.d.ts.map +1 -0
- package/lib/nutritive-sweetener/types/index.d.ts +1 -0
- package/lib/plain-water/index.d.ts +4 -0
- package/lib/plain-water/index.d.ts.map +1 -0
- package/lib/plain-water/plain-water-model.d.ts +19 -0
- package/lib/plain-water/plain-water-model.d.ts.map +1 -0
- package/lib/plain-water/plain-water-registration.d.ts +85 -0
- package/lib/plain-water/plain-water-registration.d.ts.map +1 -0
- package/lib/plain-water/services/index.d.ts +2 -0
- package/lib/plain-water/services/index.d.ts.map +1 -0
- package/lib/plain-water/services/plain-water-services.d.ts +6 -0
- package/lib/plain-water/services/plain-water-services.d.ts.map +1 -0
- package/lib/plain-water/types/index.d.ts +1 -0
- package/lib/reboot/index.d.ts +4 -0
- package/lib/reboot/index.d.ts.map +1 -0
- package/lib/reboot/reboot-model.d.ts +14 -0
- package/lib/reboot/reboot-model.d.ts.map +1 -0
- package/lib/reboot/reboot-registration.d.ts +84 -0
- package/lib/reboot/reboot-registration.d.ts.map +1 -0
- package/lib/reboot/services/index.d.ts +2 -0
- package/lib/reboot/services/index.d.ts.map +1 -0
- package/lib/reboot/services/reboot-services.d.ts +2 -0
- package/lib/reboot/services/reboot-services.d.ts.map +1 -0
- package/lib/reboot/types/index.d.ts +8 -0
- package/lib/registration.d.ts +4 -0
- package/lib/registration.d.ts.map +1 -0
- package/lib/settings/index.d.ts +4 -0
- package/lib/settings/index.d.ts.map +1 -0
- package/lib/settings/services/index.d.ts +2 -0
- package/lib/settings/services/index.d.ts.map +1 -0
- package/lib/settings/services/settings-services.d.ts +13 -0
- package/lib/settings/services/settings-services.d.ts.map +1 -0
- package/lib/settings/settings-model.d.ts +23 -0
- package/lib/settings/settings-model.d.ts.map +1 -0
- package/lib/settings/settings-registration.d.ts +86 -0
- package/lib/settings/settings-registration.d.ts.map +1 -0
- package/lib/settings/types/index.d.ts +26 -0
- package/lib/setup-step/index.d.ts +5 -0
- package/lib/setup-step/index.d.ts.map +1 -0
- package/lib/setup-step/services/index.d.ts +2 -0
- package/lib/setup-step/services/index.d.ts.map +1 -0
- package/lib/setup-step/services/setup-step-services.d.ts +13 -0
- package/lib/setup-step/services/setup-step-services.d.ts.map +1 -0
- package/lib/setup-step/setup-step-container-model.d.ts +29 -0
- package/lib/setup-step/setup-step-container-model.d.ts.map +1 -0
- package/lib/setup-step/setup-step-container-registration.d.ts +86 -0
- package/lib/setup-step/setup-step-container-registration.d.ts.map +1 -0
- package/lib/setup-step/setup-step-model.d.ts +21 -0
- package/lib/setup-step/setup-step-model.d.ts.map +1 -0
- package/lib/setup-step/setup-step-registration.d.ts +84 -0
- package/lib/setup-step/setup-step-registration.d.ts.map +1 -0
- package/lib/setup-step/types/index.d.ts +40 -0
- package/lib/trouble-action/index.d.ts +4 -0
- package/lib/trouble-action/index.d.ts.map +1 -0
- package/lib/trouble-action/trouble-action-model.d.ts +20 -0
- package/lib/trouble-action/trouble-action-model.d.ts.map +1 -0
- package/lib/trouble-action/trouble-action-registration.d.ts +89 -0
- package/lib/trouble-action/trouble-action-registration.d.ts.map +1 -0
- package/lib/trouble-action/types/index.d.ts +8 -0
- package/lib/utilities/index.d.ts +5 -0
- package/lib/utilities/index.d.ts.map +1 -0
- package/lib/utilities/services/index.d.ts +2 -0
- package/lib/utilities/services/index.d.ts.map +1 -0
- package/lib/utilities/services/utilities-services.d.ts +13 -0
- package/lib/utilities/services/utilities-services.d.ts.map +1 -0
- package/lib/utilities/types/index.d.ts +32 -0
- package/lib/utilities/utilities-container-model.d.ts +19 -0
- package/lib/utilities/utilities-container-model.d.ts.map +1 -0
- package/lib/utilities/utilities-container-registration.d.ts +86 -0
- package/lib/utilities/utilities-container-registration.d.ts.map +1 -0
- package/lib/utilities/utilities-model.d.ts +19 -0
- package/lib/utilities/utilities-model.d.ts.map +1 -0
- package/lib/utilities/utilities-registration.d.ts +84 -0
- package/lib/utilities/utilities-registration.d.ts.map +1 -0
- package/lib/utils/assembly-utils.d.ts +17 -0
- package/lib/utils/assembly-utils.d.ts.map +1 -0
- package/lib/utils/holder-view-extension.d.ts +16 -0
- package/lib/utils/holder-view-extension.d.ts.map +1 -0
- package/lib/utils/index.d.ts +5 -0
- package/lib/utils/index.d.ts.map +1 -0
- package/lib/utils/time-utils.d.ts +9 -0
- package/lib/utils/time-utils.d.ts.map +1 -0
- package/lib/utils/trouble-visibility-filter.d.ts +5 -0
- package/lib/utils/trouble-visibility-filter.d.ts.map +1 -0
- package/package.json +20 -0
- package/start/index.d.ts +5 -0
- package/start/index.d.ts.map +1 -0
- package/start/services/index.d.ts +2 -0
- package/start/services/index.d.ts.map +1 -0
- package/start/services/start-services.d.ts +6 -0
- package/start/services/start-services.d.ts.map +1 -0
- package/start/start-model.d.ts +17 -0
- package/start/start-model.d.ts.map +1 -0
- package/start/start-registration.d.ts +89 -0
- package/start/start-registration.d.ts.map +1 -0
- package/start/types/index.d.ts +1 -0
- package/types/global.d.ts +19 -0
- package/types/global.d.ts.map +1 -0
- package/types/index.d.ts +2 -0
- package/types/index.d.ts.map +1 -0
- package/utils/openapi.d.ts +9271 -0
package/index.mjs
ADDED
|
@@ -0,0 +1,2609 @@
|
|
|
1
|
+
var Mr = Object.defineProperty;
|
|
2
|
+
var Sr = (e, t, r) => t in e ? Mr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var i = (e, t, r) => (Sr(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import { resolveServiceUrl as h, ServiceFactory as f, KosLog as p, kosTopicHandler as Me, kosModel as l, kosAction as y, isKosModel as c, Kos as d, createPropKey as wr, kosStateProp as Er, KosModelRegistrationFactory as Ye, kosDependency as g, KosModelContainer as Ge, resolveContainerDeltas as st, kosChild as Se, Device as Cr, kosConfigProperty as u, kosFuture as _, kosModelEffect as gt, MultipleFutureHandler as Lr, FutureEndState as b, TroubleServices as we, Troubles as it, SingletonKosModelRegistrationFactory as le, FetchError as qe, FutureManager as C, FutureHandler as ce, getKosCompanionModel as ht, StorageDeviceContainer as Dr, KosDataContainer as kr, TroubleContainer as Qe, troubleByTypeReducer as Ir, registerExtensionPoint as Rr, ExtensionManager as Ee, kosConfigBean as Fr, ObservableData as Ar, kosAutoEffect as xr } from "@kosdev-code/kos-ui-sdk";
|
|
5
|
+
import { AGITATION_REQUIRED_TROUBLE as ft, CartridgeAgitatorEvents as mt } from "@kosdev-code/kos-freestyle-sdk";
|
|
6
|
+
import { Assembly as Ce, HolderContainer as jr, IngredientContainer as Ur } from "@kosdev-code/kos-dispense-sdk";
|
|
7
|
+
const nt = "PurgeTrouble", Vr = "PrimeTrouble", { URL: Xe } = h("AUTH_SERVICE"), { getOne: Hr, postModel: Wr } = f.build({
|
|
8
|
+
basePath: `${Xe}/api/auth`
|
|
9
|
+
}), yt = p.createLogger({ name: "auth-service", group: "Services" }), bt = async () => (yt.debug("sending GET for auth"), await Hr({
|
|
10
|
+
urlOverride: `${Xe}/api/app/kosdev.ddk/auth/role`
|
|
11
|
+
})), vt = async (e) => (yt.debug("sending POST for auth"), await Wr({
|
|
12
|
+
urlOverride: `${Xe}/api/app/kosdev.ddk/auth/pincode/${e}`,
|
|
13
|
+
model: {}
|
|
14
|
+
})), gi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
15
|
+
__proto__: null,
|
|
16
|
+
getCurrentRole: bt,
|
|
17
|
+
sendPinCode: vt
|
|
18
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
19
|
+
var Nr = Object.defineProperty, zr = Object.getOwnPropertyDescriptor, _t = (e, t, r, s) => {
|
|
20
|
+
for (var o = s > 1 ? void 0 : s ? zr(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
21
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
22
|
+
return s && o && Nr(t, r, o), o;
|
|
23
|
+
};
|
|
24
|
+
const V = "auth-model", at = (e) => e.toLowerCase();
|
|
25
|
+
let fe = class {
|
|
26
|
+
constructor(e, t, r) {
|
|
27
|
+
i(this, "id");
|
|
28
|
+
i(this, "logger");
|
|
29
|
+
i(this, "currentRole");
|
|
30
|
+
this.id = e, this.logger = r.logger, this.currentRole = "crew";
|
|
31
|
+
}
|
|
32
|
+
async authorize(e) {
|
|
33
|
+
if (!e)
|
|
34
|
+
return !1;
|
|
35
|
+
const t = await vt(e);
|
|
36
|
+
return (t == null ? void 0 : t.status) === 200 ? t.data : !1;
|
|
37
|
+
}
|
|
38
|
+
// -------------------LIFECYCLE----------------------------
|
|
39
|
+
async init() {
|
|
40
|
+
this.logger.debug(`initializing auth ${this.id}`);
|
|
41
|
+
}
|
|
42
|
+
async load() {
|
|
43
|
+
this.logger.debug(`loading auth ${this.id}`);
|
|
44
|
+
const e = await bt();
|
|
45
|
+
(e == null ? void 0 : e.status) === 200 && (this.logger.debug(`response ${e.data}`), y(() => {
|
|
46
|
+
this.currentRole = at(e.data);
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
handleRoleChange(e) {
|
|
50
|
+
this.currentRole = at(e);
|
|
51
|
+
}
|
|
52
|
+
forceRole(e) {
|
|
53
|
+
this.currentRole = e;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
_t([
|
|
57
|
+
Me({
|
|
58
|
+
topic: "/app/kosdev.ddk/auth/role",
|
|
59
|
+
websocket: !0
|
|
60
|
+
})
|
|
61
|
+
], fe.prototype, "handleRoleChange", 1);
|
|
62
|
+
fe = _t([
|
|
63
|
+
l(V)
|
|
64
|
+
], fe);
|
|
65
|
+
const Je = {
|
|
66
|
+
registration: {
|
|
67
|
+
[V]: {
|
|
68
|
+
class: fe,
|
|
69
|
+
singleton: !1
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
type: V,
|
|
73
|
+
predicate: c(V),
|
|
74
|
+
factory: d.Factory.create(V)
|
|
75
|
+
};
|
|
76
|
+
var Br = Object.defineProperty, Kr = Object.getOwnPropertyDescriptor, $t = (e, t, r, s) => {
|
|
77
|
+
for (var o = s > 1 ? void 0 : s ? Kr(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
78
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
79
|
+
return s && o && Br(t, r, o), o;
|
|
80
|
+
};
|
|
81
|
+
const Tt = "door-model", Yr = wr("doorPath");
|
|
82
|
+
let me = class {
|
|
83
|
+
constructor(e, t, r) {
|
|
84
|
+
i(this, "id");
|
|
85
|
+
i(this, "logger");
|
|
86
|
+
i(this, "doorPath");
|
|
87
|
+
i(this, "open");
|
|
88
|
+
this.id = e, this.logger = r.logger, this.doorPath = t.doorPath;
|
|
89
|
+
}
|
|
90
|
+
get currentState() {
|
|
91
|
+
return this.open.value === void 0 ? "UNKNOWN" : this.open.value ? "OPEN" : "CLOSED";
|
|
92
|
+
}
|
|
93
|
+
get isOpen() {
|
|
94
|
+
return this.open.value === void 0 ? !0 : this.open.value;
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
$t([
|
|
98
|
+
Er({ path: Yr, attribute: "state" })
|
|
99
|
+
], me.prototype, "open", 2);
|
|
100
|
+
me = $t([
|
|
101
|
+
l(Tt)
|
|
102
|
+
], me);
|
|
103
|
+
const Gr = new Ye({
|
|
104
|
+
class: me,
|
|
105
|
+
type: Tt
|
|
106
|
+
}), { URL: Ze } = h("SETUP-STEP_SERVICE"), { getAll: qr, postModel: Qr } = f.build({
|
|
107
|
+
basePath: `${Ze}/api/setup-step`
|
|
108
|
+
}), Pt = p.createLogger({
|
|
109
|
+
name: "setup-step-service",
|
|
110
|
+
group: "Services"
|
|
111
|
+
}), Ot = async () => (Pt.debug("sending GET for setup-step"), await qr({
|
|
112
|
+
urlOverride: `${Ze}/api/app/kosdev.ddk/setup/steps`
|
|
113
|
+
})), Mt = async (e) => (Pt.debug("sending POST for setup-step"), await Qr({
|
|
114
|
+
urlOverride: `${Ze}/api/app/kosdev.ddk/setup/complete/${e}`,
|
|
115
|
+
model: {}
|
|
116
|
+
})), hi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
117
|
+
__proto__: null,
|
|
118
|
+
getSetupSteps: Ot,
|
|
119
|
+
markStepComplete: Mt
|
|
120
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
121
|
+
var Xr = Object.defineProperty, Jr = Object.getOwnPropertyDescriptor, Zr = (e, t, r, s) => {
|
|
122
|
+
for (var o = s > 1 ? void 0 : s ? Jr(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
123
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
124
|
+
return s && o && Xr(t, r, o), o;
|
|
125
|
+
};
|
|
126
|
+
const H = "setup-step-model";
|
|
127
|
+
let je = class {
|
|
128
|
+
constructor(e, t, r) {
|
|
129
|
+
i(this, "id");
|
|
130
|
+
i(this, "idx");
|
|
131
|
+
i(this, "name");
|
|
132
|
+
i(this, "complete");
|
|
133
|
+
i(this, "preStep");
|
|
134
|
+
i(this, "exclusive");
|
|
135
|
+
i(this, "logger");
|
|
136
|
+
this.id = e, this.idx = t.idx, this.logger = r.logger, this.name = t.name, this.complete = t.complete, this.preStep = t.preStep, this.exclusive = t.exclusive;
|
|
137
|
+
}
|
|
138
|
+
updateModel(e) {
|
|
139
|
+
this.name = e.name, this.idx = e.idx, this.complete = e.complete, this.preStep = e.preStep, this.exclusive = e.exclusive;
|
|
140
|
+
}
|
|
141
|
+
get titleKey() {
|
|
142
|
+
return `setup.${this.name}.title`;
|
|
143
|
+
}
|
|
144
|
+
get bodyKey() {
|
|
145
|
+
return `setup.${this.name}.body`;
|
|
146
|
+
}
|
|
147
|
+
async completeStep() {
|
|
148
|
+
const e = await Mt(this.name);
|
|
149
|
+
(e == null ? void 0 : e.status) === 200 && y(() => {
|
|
150
|
+
this.complete = !0;
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
// -------------------LIFECYCLE----------------------------
|
|
154
|
+
async init() {
|
|
155
|
+
this.logger.debug(`initializing setup-step ${this.id}`);
|
|
156
|
+
}
|
|
157
|
+
async load() {
|
|
158
|
+
this.logger.debug(`loading setup-step ${this.id}`);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
je = Zr([
|
|
162
|
+
l(H)
|
|
163
|
+
], je);
|
|
164
|
+
const St = {
|
|
165
|
+
registration: {
|
|
166
|
+
[H]: {
|
|
167
|
+
class: je,
|
|
168
|
+
singleton: !1
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
type: H,
|
|
172
|
+
predicate: c(H),
|
|
173
|
+
factory: d.Factory.create(H)
|
|
174
|
+
};
|
|
175
|
+
var eo = Object.defineProperty, to = Object.getOwnPropertyDescriptor, Le = (e, t, r, s) => {
|
|
176
|
+
for (var o = s > 1 ? void 0 : s ? to(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
177
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
178
|
+
return s && o && eo(t, r, o), o;
|
|
179
|
+
};
|
|
180
|
+
const W = "setup-step-container-model";
|
|
181
|
+
function lt(e) {
|
|
182
|
+
return (t) => {
|
|
183
|
+
const r = St.factory(t.id)(t);
|
|
184
|
+
r.updateModel(t), e.addModel(r);
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
function ct(e) {
|
|
188
|
+
return (t) => {
|
|
189
|
+
e.removeModel(t);
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
let L = class {
|
|
193
|
+
constructor(e, t, r) {
|
|
194
|
+
i(this, "id");
|
|
195
|
+
i(this, "_currentStep");
|
|
196
|
+
i(this, "logger");
|
|
197
|
+
i(this, "models");
|
|
198
|
+
i(this, "authModel");
|
|
199
|
+
this.id = e, this.logger = r.logger, this._currentStep = void 0, this.models = new Ge({
|
|
200
|
+
parentId: e,
|
|
201
|
+
sortKey: "idx"
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
get currentStep() {
|
|
205
|
+
return this._currentStep;
|
|
206
|
+
}
|
|
207
|
+
setCurrentStep(e) {
|
|
208
|
+
const t = this.models.getModel(e);
|
|
209
|
+
t && (this._currentStep = t);
|
|
210
|
+
}
|
|
211
|
+
nextStep() {
|
|
212
|
+
if (!this._currentStep)
|
|
213
|
+
this._currentStep = this.firstIncompleteStep;
|
|
214
|
+
else {
|
|
215
|
+
const e = this._currentStep.idx, t = this.models.data.find((r) => r.idx > e);
|
|
216
|
+
t && (this._currentStep = t);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
get hasIncompletePreSteps() {
|
|
220
|
+
return this.models.data.some((e) => e.preStep && !e.complete);
|
|
221
|
+
}
|
|
222
|
+
get setupRequired() {
|
|
223
|
+
return this.models.data.some((e) => !e.complete);
|
|
224
|
+
}
|
|
225
|
+
get firstIncompleteStep() {
|
|
226
|
+
return this.models.data.find((e) => !e.complete);
|
|
227
|
+
}
|
|
228
|
+
get isLastStep() {
|
|
229
|
+
var e;
|
|
230
|
+
return this.models.data[this.models.data.length - 1].id === ((e = this._currentStep) == null ? void 0 : e.id);
|
|
231
|
+
}
|
|
232
|
+
get data() {
|
|
233
|
+
return this.models.data;
|
|
234
|
+
}
|
|
235
|
+
getModel(e) {
|
|
236
|
+
return this.models.getModel(e);
|
|
237
|
+
}
|
|
238
|
+
addModel(e) {
|
|
239
|
+
this.models.addModel(e);
|
|
240
|
+
}
|
|
241
|
+
removeModel(e) {
|
|
242
|
+
this.models.removeModel(e);
|
|
243
|
+
}
|
|
244
|
+
// -------------------LIFECYCLE----------------------------
|
|
245
|
+
async init() {
|
|
246
|
+
this.logger.debug(`initializing setup-step-container container ${this.id}`);
|
|
247
|
+
}
|
|
248
|
+
async load() {
|
|
249
|
+
this.logger.debug(`loading setup-step-container container ${this.id}`);
|
|
250
|
+
const e = await Ot();
|
|
251
|
+
if (e != null && e.data) {
|
|
252
|
+
const t = e.data.map(
|
|
253
|
+
(r, s) => ({
|
|
254
|
+
...r,
|
|
255
|
+
idx: s,
|
|
256
|
+
id: `setup-${r.name}`
|
|
257
|
+
})
|
|
258
|
+
);
|
|
259
|
+
st({
|
|
260
|
+
container: this.models,
|
|
261
|
+
onAddItem: lt(this),
|
|
262
|
+
onRemoveItem: ct(this)
|
|
263
|
+
})(t);
|
|
264
|
+
}
|
|
265
|
+
this.nextStep();
|
|
266
|
+
}
|
|
267
|
+
handleStepChanges(e) {
|
|
268
|
+
const t = e.map((r, s) => ({
|
|
269
|
+
...r,
|
|
270
|
+
idx: s,
|
|
271
|
+
id: `setup-${r.name}`
|
|
272
|
+
}));
|
|
273
|
+
st({
|
|
274
|
+
container: this.models,
|
|
275
|
+
onAddItem: lt(this),
|
|
276
|
+
onRemoveItem: ct(this)
|
|
277
|
+
})(t);
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
Le([
|
|
281
|
+
Se
|
|
282
|
+
], L.prototype, "models", 2);
|
|
283
|
+
Le([
|
|
284
|
+
g({ modelType: Je.type })
|
|
285
|
+
], L.prototype, "authModel", 2);
|
|
286
|
+
Le([
|
|
287
|
+
Me({
|
|
288
|
+
topic: "/app/kosdev.ddk/setup/steps",
|
|
289
|
+
websocket: !0
|
|
290
|
+
})
|
|
291
|
+
], L.prototype, "handleStepChanges", 1);
|
|
292
|
+
L = Le([
|
|
293
|
+
l(W)
|
|
294
|
+
], L);
|
|
295
|
+
const wt = {
|
|
296
|
+
registration: {
|
|
297
|
+
[W]: {
|
|
298
|
+
class: L,
|
|
299
|
+
singleton: !0
|
|
300
|
+
},
|
|
301
|
+
...St.registration
|
|
302
|
+
},
|
|
303
|
+
type: W,
|
|
304
|
+
predicate: c(W),
|
|
305
|
+
factory: d.Singleton.create(W)
|
|
306
|
+
}, { URL: de } = h("AUTH_SERVICE"), { getOne: Et, getAll: Ct } = f.build({
|
|
307
|
+
basePath: `${de}/api/app/kosdev.ddk/ncui/`
|
|
308
|
+
}), De = p.createLogger({ name: "auth-service", group: "Services" }), ro = async () => {
|
|
309
|
+
De.debug("sending GET for cuis");
|
|
310
|
+
const e = await Ct({
|
|
311
|
+
urlOverride: `${de}/api/app/kosdev.ddk/cui`
|
|
312
|
+
});
|
|
313
|
+
if ((e == null ? void 0 : e.status) !== 200)
|
|
314
|
+
throw new Error("Failed to retrieve cuis");
|
|
315
|
+
return e.data;
|
|
316
|
+
}, oo = async () => {
|
|
317
|
+
De.debug("sending GET for navigation");
|
|
318
|
+
const e = await Ct({
|
|
319
|
+
urlOverride: `${de}/api/kos/descriptor/system:app/kondra.ncui.navigations`
|
|
320
|
+
});
|
|
321
|
+
if ((e == null ? void 0 : e.status) !== 200)
|
|
322
|
+
throw new Error("Failed to retrieve navigation data");
|
|
323
|
+
return e.data;
|
|
324
|
+
}, so = async () => (De.debug("navigating to CUI"), await Et({
|
|
325
|
+
urlOverride: `${de}/api/app/kosdev.ddk/cui/open`
|
|
326
|
+
})), io = async () => (De.debug("navigating to NCUI"), await Et({
|
|
327
|
+
urlOverride: `${de}/api/app/kosdev.ddk/ncui/open`
|
|
328
|
+
}));
|
|
329
|
+
var no = Object.defineProperty, ao = Object.getOwnPropertyDescriptor, S = (e, t, r, s) => {
|
|
330
|
+
for (var o = s > 1 ? void 0 : s ? ao(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
331
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
332
|
+
return s && o && no(t, r, o), o;
|
|
333
|
+
};
|
|
334
|
+
const N = "application-model", Lt = (e, t = "") => e.reduce((r, s) => {
|
|
335
|
+
const o = t ? `${t}.${s.name}` : s.name;
|
|
336
|
+
if (r[o] = { ...s, root: !t }, s.children) {
|
|
337
|
+
const a = Lt(s.children, o);
|
|
338
|
+
Object.keys(a).forEach((n) => {
|
|
339
|
+
r[n] = a[n];
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
return r;
|
|
343
|
+
}, {});
|
|
344
|
+
let $ = class {
|
|
345
|
+
constructor(e, t, r) {
|
|
346
|
+
i(this, "id");
|
|
347
|
+
i(this, "device");
|
|
348
|
+
i(this, "authModel");
|
|
349
|
+
i(this, "setupStepContainer");
|
|
350
|
+
i(this, "door");
|
|
351
|
+
i(this, "ncuiLanguage");
|
|
352
|
+
i(this, "activeCui");
|
|
353
|
+
i(this, "fallbackCui");
|
|
354
|
+
i(this, "_cuis", []);
|
|
355
|
+
i(this, "_navigationItems", []);
|
|
356
|
+
// @kosConfigProperty({
|
|
357
|
+
// path: 'somewhere.enable.dial.animation',
|
|
358
|
+
// attribute: 'enableDialAnimation',
|
|
359
|
+
// })
|
|
360
|
+
// enableDialAnimation!: KosConfigProperty<boolean>;
|
|
361
|
+
// @kosConfigProperty({
|
|
362
|
+
// path: 'somewhere.enable.modal.animation',
|
|
363
|
+
// attribute: 'enableModalAnimation',
|
|
364
|
+
// })
|
|
365
|
+
// enableModalAnimation!: KosConfigProperty<boolean>;
|
|
366
|
+
// @kosConfigProperty({
|
|
367
|
+
// path: 'somewhere.enable.sidebar.animation',
|
|
368
|
+
// attribute: 'enableSidebarAnimation',
|
|
369
|
+
// })
|
|
370
|
+
// enableSidebarAnimation!: KosConfigProperty<boolean>;
|
|
371
|
+
i(this, "languages");
|
|
372
|
+
i(this, "logger");
|
|
373
|
+
this.id = e, this.languages = [], this._cuis = [], this.logger = r.logger, this.door = Gr.instance("app:kosdev.ddk:service:door:door").options({
|
|
374
|
+
doorPath: "app:kosdev.ddk:service:door:door"
|
|
375
|
+
}).build();
|
|
376
|
+
}
|
|
377
|
+
get setupRequired() {
|
|
378
|
+
return this.authModel.currentRole === "crew" ? !1 : this.setupStepContainer.setupRequired;
|
|
379
|
+
}
|
|
380
|
+
get currentRole() {
|
|
381
|
+
return this.authModel.currentRole;
|
|
382
|
+
}
|
|
383
|
+
get cuis() {
|
|
384
|
+
return this._cuis.reduce((e, t) => (e[t.name] = t, e), {});
|
|
385
|
+
}
|
|
386
|
+
get navigationItems() {
|
|
387
|
+
return Lt(this._navigationItems);
|
|
388
|
+
}
|
|
389
|
+
get hasCuiDefined() {
|
|
390
|
+
return !!this.activeCui.value || !!this.fallbackCui.value;
|
|
391
|
+
}
|
|
392
|
+
get doorIsOpen() {
|
|
393
|
+
return this.door.isOpen;
|
|
394
|
+
}
|
|
395
|
+
async enter() {
|
|
396
|
+
this.logger.info("navigating to NCUI"), await io();
|
|
397
|
+
}
|
|
398
|
+
async exit() {
|
|
399
|
+
this.logger.info("navigating to CUI"), await so();
|
|
400
|
+
}
|
|
401
|
+
// -------------------LIFECYCLE----------------------------
|
|
402
|
+
async load() {
|
|
403
|
+
var r, s;
|
|
404
|
+
this.logger.debug(`loading application ${this.id}`);
|
|
405
|
+
const e = await oo();
|
|
406
|
+
this._navigationItems = e;
|
|
407
|
+
const t = await ro();
|
|
408
|
+
this._cuis = t, (r = this.setupStepContainer) != null && r.hasIncompletePreSteps && ((s = this.authModel) == null || s.forceRole("technician")), this.languages = [
|
|
409
|
+
{
|
|
410
|
+
name: "English",
|
|
411
|
+
locale: "en"
|
|
412
|
+
}
|
|
413
|
+
];
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
S([
|
|
417
|
+
g({ modelType: Cr.type })
|
|
418
|
+
], $.prototype, "device", 2);
|
|
419
|
+
S([
|
|
420
|
+
g({ modelType: Je.type })
|
|
421
|
+
], $.prototype, "authModel", 2);
|
|
422
|
+
S([
|
|
423
|
+
g({ modelType: wt.type })
|
|
424
|
+
], $.prototype, "setupStepContainer", 2);
|
|
425
|
+
S([
|
|
426
|
+
Se
|
|
427
|
+
], $.prototype, "door", 2);
|
|
428
|
+
S([
|
|
429
|
+
u({
|
|
430
|
+
path: "app:kosdev.ddk:app",
|
|
431
|
+
attribute: "ncui.ncuiLanguage"
|
|
432
|
+
//updated attribute for language config property
|
|
433
|
+
})
|
|
434
|
+
], $.prototype, "ncuiLanguage", 2);
|
|
435
|
+
S([
|
|
436
|
+
u({
|
|
437
|
+
path: "app:kosdev.ddk:service:cui",
|
|
438
|
+
attribute: "activeCui"
|
|
439
|
+
})
|
|
440
|
+
], $.prototype, "activeCui", 2);
|
|
441
|
+
S([
|
|
442
|
+
u({
|
|
443
|
+
path: "app:kosdev.ddk:service:cui",
|
|
444
|
+
attribute: "fallbackCui"
|
|
445
|
+
})
|
|
446
|
+
], $.prototype, "fallbackCui", 2);
|
|
447
|
+
$ = S([
|
|
448
|
+
l(N)
|
|
449
|
+
], $);
|
|
450
|
+
const et = {
|
|
451
|
+
registration: {
|
|
452
|
+
[N]: {
|
|
453
|
+
class: $,
|
|
454
|
+
singleton: !0
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
type: N,
|
|
458
|
+
predicate: c(N),
|
|
459
|
+
factory: d.Singleton.create(
|
|
460
|
+
N
|
|
461
|
+
)
|
|
462
|
+
}, he = {
|
|
463
|
+
none: 999,
|
|
464
|
+
crew: 0,
|
|
465
|
+
technician: 1,
|
|
466
|
+
manager: 2
|
|
467
|
+
}, Dt = (e) => (t) => {
|
|
468
|
+
if (t.type === ft)
|
|
469
|
+
return !1;
|
|
470
|
+
const r = (t == null ? void 0 : t.role) || "technician";
|
|
471
|
+
if (e && r) {
|
|
472
|
+
const s = he[e.toLowerCase()] ?? he.crew, o = he[r.toLowerCase()] ?? he.crew;
|
|
473
|
+
return s >= o;
|
|
474
|
+
}
|
|
475
|
+
return !1;
|
|
476
|
+
};
|
|
477
|
+
var lo = Object.defineProperty, co = Object.getOwnPropertyDescriptor, F = (e, t, r, s) => {
|
|
478
|
+
for (var o = s > 1 ? void 0 : s ? co(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
479
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
480
|
+
return s && o && lo(t, r, o), o;
|
|
481
|
+
};
|
|
482
|
+
const kt = "agitation-control-model", Ue = "resolve", uo = "agitate";
|
|
483
|
+
let P = class {
|
|
484
|
+
constructor(e, t, r) {
|
|
485
|
+
i(this, "id");
|
|
486
|
+
i(this, "futureHandler");
|
|
487
|
+
i(this, "logger");
|
|
488
|
+
i(this, "troubleContainer");
|
|
489
|
+
i(this, "_agitationFutureId");
|
|
490
|
+
i(this, "_canExit", !0);
|
|
491
|
+
i(this, "_exiting", !1);
|
|
492
|
+
i(this, "_isFailed", !1);
|
|
493
|
+
i(this, "disposer");
|
|
494
|
+
i(this, "application");
|
|
495
|
+
i(this, "inProgress", []);
|
|
496
|
+
this.id = e, this.logger = r.logger, this.troubleContainer = t.companionParent, this.futureHandler = new Lr(this, Ue);
|
|
497
|
+
}
|
|
498
|
+
set isFailed(e) {
|
|
499
|
+
this._isFailed = e;
|
|
500
|
+
}
|
|
501
|
+
get isFailed() {
|
|
502
|
+
return this._isFailed;
|
|
503
|
+
}
|
|
504
|
+
get isDoorClosed() {
|
|
505
|
+
return !this.application.doorIsOpen;
|
|
506
|
+
}
|
|
507
|
+
get isAgitating() {
|
|
508
|
+
return !!this._agitationFutureId;
|
|
509
|
+
}
|
|
510
|
+
set exiting(e) {
|
|
511
|
+
this._exiting = e;
|
|
512
|
+
}
|
|
513
|
+
get exiting() {
|
|
514
|
+
return this._exiting;
|
|
515
|
+
}
|
|
516
|
+
get canExit() {
|
|
517
|
+
return this.queuedTroubles.length === 0 && this._canExit;
|
|
518
|
+
}
|
|
519
|
+
clearAll() {
|
|
520
|
+
this.queuedTroubles.forEach((e) => {
|
|
521
|
+
e.clearDefer();
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
get readyToResolve() {
|
|
525
|
+
const e = this.queuedTroubles.length, t = this.queuedTroubles.filter((s) => s.shouldDefer), r = e > 0 && t.length === 0;
|
|
526
|
+
return this.isDoorClosed && r && this.exiting;
|
|
527
|
+
}
|
|
528
|
+
onFutureUpdate(e) {
|
|
529
|
+
e.endState === b.Success ? (this.logger.debug(
|
|
530
|
+
`Resolve deferred troubles future ${e.id} completed successfully`
|
|
531
|
+
), this.queuedTroubles.forEach((t) => {
|
|
532
|
+
t.clearDefer();
|
|
533
|
+
}), y(() => {
|
|
534
|
+
this._canExit = !0, this._isFailed = !1;
|
|
535
|
+
})) : (e.endState === b.Fail || e.endState === b.Canceled || e.endState === b.Aborted) && (this.logger.error(`Resolve deferred troubles future ${e.id} failed`), this.clearAll(), y(() => {
|
|
536
|
+
this._canExit = !1, this._isFailed = !0;
|
|
537
|
+
}));
|
|
538
|
+
}
|
|
539
|
+
async resolveDeferredTroubles(e) {
|
|
540
|
+
const t = this.queuedTroubles.filter((s) => !s.shouldDefer).map((s) => s.rawId).filter((s) => !this.inProgress.includes(s));
|
|
541
|
+
return this.inProgress.push(...t), t.length === 0 ? void 0 : await we.bulkResolveTroubles(
|
|
542
|
+
t,
|
|
543
|
+
e
|
|
544
|
+
);
|
|
545
|
+
}
|
|
546
|
+
get hasQueuedTroubles() {
|
|
547
|
+
return this.queuedTroubles.length > 0;
|
|
548
|
+
}
|
|
549
|
+
get queuedTroubles() {
|
|
550
|
+
return this.troubleContainer.troubles.getIndexByKey(
|
|
551
|
+
it.INDEX_TROUBLES_BY_DEFERRED,
|
|
552
|
+
it.TROUBLES_DEFERRED
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
get visibleTroubles() {
|
|
556
|
+
const e = this.application.currentRole;
|
|
557
|
+
return this.troubleContainer.troubles.data.filter(Dt(e)).filter((t) => t.type !== ft);
|
|
558
|
+
}
|
|
559
|
+
// -------------------LIFECYCLE----------------------------
|
|
560
|
+
get future() {
|
|
561
|
+
return this.futureHandler.future;
|
|
562
|
+
}
|
|
563
|
+
get resolveFuture() {
|
|
564
|
+
return this.futureHandler.getFuture(Ue);
|
|
565
|
+
}
|
|
566
|
+
get agitateFuture() {
|
|
567
|
+
return this.futureHandler.getFuture(uo);
|
|
568
|
+
}
|
|
569
|
+
handleAgitationStarted(e) {
|
|
570
|
+
this.logger.info(`Agitation started for ${e.path}`), this._agitationFutureId = String(e.futureId);
|
|
571
|
+
}
|
|
572
|
+
handleAgitationEnded(e) {
|
|
573
|
+
this.logger.info(`Agitation ended for ${e.path}`), this._agitationFutureId = void 0;
|
|
574
|
+
}
|
|
575
|
+
async init() {
|
|
576
|
+
this.logger.debug(`initializing agitation-control ${this.id}`);
|
|
577
|
+
}
|
|
578
|
+
unload() {
|
|
579
|
+
this.logger.debug(`unloading agitation-control ${this.id}`), this.disposer && this.disposer();
|
|
580
|
+
}
|
|
581
|
+
handleReadyToResolve() {
|
|
582
|
+
this.readyToResolve && (this.logger.info("AgitationControl - Resolving deferred troubles"), this.resolveDeferredTroubles()), this._agitationFutureId && this.logger.info("AgitationControl - Agitation started");
|
|
583
|
+
}
|
|
584
|
+
async load() {
|
|
585
|
+
this.logger.debug(`loading agitation-control ${this.id}`);
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
F([
|
|
589
|
+
g({ modelType: et.type })
|
|
590
|
+
], P.prototype, "application", 2);
|
|
591
|
+
F([
|
|
592
|
+
_({ alias: Ue })
|
|
593
|
+
], P.prototype, "resolveDeferredTroubles", 1);
|
|
594
|
+
F([
|
|
595
|
+
Me({ topic: mt.TOPIC_AGITATION_STARTED })
|
|
596
|
+
], P.prototype, "handleAgitationStarted", 1);
|
|
597
|
+
F([
|
|
598
|
+
Me({ topic: mt.TOPIC_AGITATION_ENDED })
|
|
599
|
+
], P.prototype, "handleAgitationEnded", 1);
|
|
600
|
+
F([
|
|
601
|
+
gt({
|
|
602
|
+
dependencies: (e) => [e.readyToResolve, e._agitationFutureId]
|
|
603
|
+
})
|
|
604
|
+
], P.prototype, "handleReadyToResolve", 1);
|
|
605
|
+
P = F([
|
|
606
|
+
l(kt)
|
|
607
|
+
], P);
|
|
608
|
+
const fi = new le({
|
|
609
|
+
class: P,
|
|
610
|
+
type: kt
|
|
611
|
+
});
|
|
612
|
+
var po = Object.defineProperty, go = Object.getOwnPropertyDescriptor, ue = (e, t, r, s) => {
|
|
613
|
+
for (var o = s > 1 ? void 0 : s ? go(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
614
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
615
|
+
return s && o && po(t, r, o), o;
|
|
616
|
+
};
|
|
617
|
+
const z = "animation-model";
|
|
618
|
+
let E = class {
|
|
619
|
+
constructor(e, t, r) {
|
|
620
|
+
i(this, "id");
|
|
621
|
+
i(this, "logger");
|
|
622
|
+
i(this, "disableAll");
|
|
623
|
+
i(this, "enableDial");
|
|
624
|
+
i(this, "enableModal");
|
|
625
|
+
i(this, "enableSideBar");
|
|
626
|
+
this.id = e, this.logger = r.logger;
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
ue([
|
|
630
|
+
u({
|
|
631
|
+
path: "app:kosdev.ddk:app",
|
|
632
|
+
attribute: "ncui.uiConfig.animations.disableAll"
|
|
633
|
+
})
|
|
634
|
+
], E.prototype, "disableAll", 2);
|
|
635
|
+
ue([
|
|
636
|
+
u({
|
|
637
|
+
path: "app:kosdev.ddk:app",
|
|
638
|
+
attribute: "ncui.uiConfig.animations.enableDial"
|
|
639
|
+
})
|
|
640
|
+
], E.prototype, "enableDial", 2);
|
|
641
|
+
ue([
|
|
642
|
+
u({
|
|
643
|
+
path: "app:kosdev.ddk:app",
|
|
644
|
+
attribute: "ncui.uiConfig.animations.enableModal"
|
|
645
|
+
})
|
|
646
|
+
], E.prototype, "enableModal", 2);
|
|
647
|
+
ue([
|
|
648
|
+
u({
|
|
649
|
+
path: "app:kosdev.ddk:app",
|
|
650
|
+
attribute: "ncui.uiConfig.animations.enableSideBar"
|
|
651
|
+
})
|
|
652
|
+
], E.prototype, "enableSideBar", 2);
|
|
653
|
+
E = ue([
|
|
654
|
+
l(z)
|
|
655
|
+
], E);
|
|
656
|
+
const ho = {
|
|
657
|
+
registration: {
|
|
658
|
+
[z]: {
|
|
659
|
+
class: E,
|
|
660
|
+
singleton: !0
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
type: z,
|
|
664
|
+
predicate: c(z),
|
|
665
|
+
factory: d.Singleton.create(z)
|
|
666
|
+
}, { URL: fo } = h("ANIMATION_SERVICE"), { getAll: mo } = f.build({
|
|
667
|
+
basePath: `${fo}/api/animation`
|
|
668
|
+
}), yo = p.createLogger({
|
|
669
|
+
name: "animation-service",
|
|
670
|
+
group: "Services"
|
|
671
|
+
}), bo = async () => (yo.debug("sending GET for animation"), await mo({})), mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
672
|
+
__proto__: null,
|
|
673
|
+
getAnimations: bo
|
|
674
|
+
}, Symbol.toStringTag, { value: "Module" })), { URL: A } = h("FCM-PUMP_SERVICE"), { postModel: pe } = f.build({
|
|
675
|
+
basePath: `${A}/api/fcm-pump`
|
|
676
|
+
}), m = p.createLogger({
|
|
677
|
+
name: "fcm-pump-service",
|
|
678
|
+
group: "Services"
|
|
679
|
+
}), It = async (e) => {
|
|
680
|
+
var t, r, s, o, a;
|
|
681
|
+
m.debug(
|
|
682
|
+
`performElectricalTest - sending POST request to /api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`
|
|
683
|
+
);
|
|
684
|
+
try {
|
|
685
|
+
const n = await pe({
|
|
686
|
+
model: {},
|
|
687
|
+
urlOverride: `${A}/api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`
|
|
688
|
+
});
|
|
689
|
+
return m.debug("performElectricalTest - response:", n), ((n == null ? void 0 : n.status) === 200 || (n == null ? void 0 : n.status) === 499) && ((t = n.data) != null && t.error) ? [n.data.error || "unknownError", n.data] : [void 0, n == null ? void 0 : n.data];
|
|
690
|
+
} catch (n) {
|
|
691
|
+
if (m.error(
|
|
692
|
+
`performElectricalTest - sending POST request to /api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`,
|
|
693
|
+
n
|
|
694
|
+
), n instanceof qe) {
|
|
695
|
+
const w = ((s = (r = n.payload) == null ? void 0 : r.data) == null ? void 0 : s.error) || ((o = n.payload) == null ? void 0 : o.error) || "unknownError";
|
|
696
|
+
return [w, ((a = n.payload) == null ? void 0 : a.data) || { error: w }];
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
return ["unknownError", { error: "unknownError" }];
|
|
700
|
+
}, Rt = async (e, t) => {
|
|
701
|
+
m.debug(
|
|
702
|
+
`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/preCalibrate`
|
|
703
|
+
);
|
|
704
|
+
try {
|
|
705
|
+
const r = await pe({
|
|
706
|
+
model: {},
|
|
707
|
+
urlOverride: `${A}/api/ext/freestyle/fcm/calibration/${e}/preCalibrate`,
|
|
708
|
+
tracker: t
|
|
709
|
+
});
|
|
710
|
+
return m.debug("performPreCalibrate - response:", r), r != null && r.data && C.initiateFuture(r.data), r == null ? void 0 : r.data;
|
|
711
|
+
} catch (r) {
|
|
712
|
+
m.error(
|
|
713
|
+
`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/preCalibrate`,
|
|
714
|
+
r
|
|
715
|
+
);
|
|
716
|
+
const s = {
|
|
717
|
+
id: t || "",
|
|
718
|
+
endState: b.Fail,
|
|
719
|
+
tracker: t,
|
|
720
|
+
reason: "Failed to resolve trouble"
|
|
721
|
+
};
|
|
722
|
+
return C.initiateFuture(s), s;
|
|
723
|
+
}
|
|
724
|
+
}, Ft = async (e, t) => {
|
|
725
|
+
m.debug(
|
|
726
|
+
`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/calibrate`
|
|
727
|
+
);
|
|
728
|
+
try {
|
|
729
|
+
const r = await pe({
|
|
730
|
+
model: {},
|
|
731
|
+
urlOverride: `${A}/api/ext/freestyle/fcm/calibration/${e}/calibrate`,
|
|
732
|
+
tracker: t
|
|
733
|
+
});
|
|
734
|
+
return m.debug("performPreCalibrate - response:", r), r != null && r.data && C.initiateFuture(r.data), r == null ? void 0 : r.data;
|
|
735
|
+
} catch (r) {
|
|
736
|
+
m.error(
|
|
737
|
+
`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/calibrate`,
|
|
738
|
+
r
|
|
739
|
+
);
|
|
740
|
+
const s = {
|
|
741
|
+
id: t || "",
|
|
742
|
+
endState: b.Fail,
|
|
743
|
+
tracker: t,
|
|
744
|
+
reason: "Failed to resolve trouble"
|
|
745
|
+
};
|
|
746
|
+
return C.initiateFuture(s), s;
|
|
747
|
+
}
|
|
748
|
+
}, At = async (e, t, r) => {
|
|
749
|
+
m.debug(
|
|
750
|
+
`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/verify/${t}`
|
|
751
|
+
);
|
|
752
|
+
try {
|
|
753
|
+
const s = await pe({
|
|
754
|
+
model: {},
|
|
755
|
+
urlOverride: `${A}/api/ext/freestyle/fcm/calibration/${e}/verify/${t}`,
|
|
756
|
+
tracker: r
|
|
757
|
+
});
|
|
758
|
+
return m.debug("performVerify - response:", s), s != null && s.data && C.initiateFuture(s.data), s == null ? void 0 : s.data;
|
|
759
|
+
} catch (s) {
|
|
760
|
+
m.error(
|
|
761
|
+
`performVerify - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/verify/${t}`,
|
|
762
|
+
s
|
|
763
|
+
);
|
|
764
|
+
const o = {
|
|
765
|
+
id: r || "",
|
|
766
|
+
endState: b.Fail,
|
|
767
|
+
tracker: r,
|
|
768
|
+
reason: "Failed to resolve trouble"
|
|
769
|
+
};
|
|
770
|
+
return C.initiateFuture(o), o;
|
|
771
|
+
}
|
|
772
|
+
}, xt = async (e, t, r) => {
|
|
773
|
+
m.debug(
|
|
774
|
+
`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`
|
|
775
|
+
);
|
|
776
|
+
try {
|
|
777
|
+
const s = await pe({
|
|
778
|
+
model: {},
|
|
779
|
+
urlOverride: `${A}/api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`
|
|
780
|
+
});
|
|
781
|
+
return m.debug("performPreCalibrate - response:", s), s == null ? void 0 : s.data;
|
|
782
|
+
} catch (s) {
|
|
783
|
+
m.error(
|
|
784
|
+
`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`,
|
|
785
|
+
s
|
|
786
|
+
);
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
}, yi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
790
|
+
__proto__: null,
|
|
791
|
+
performCalibrate: Ft,
|
|
792
|
+
performComplete: xt,
|
|
793
|
+
performElectricalTest: It,
|
|
794
|
+
performPreCalibrate: Rt,
|
|
795
|
+
performVerify: At
|
|
796
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
797
|
+
var vo = Object.defineProperty, _o = Object.getOwnPropertyDescriptor, ke = (e, t, r, s) => {
|
|
798
|
+
for (var o = s > 1 ? void 0 : s ? _o(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
799
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
800
|
+
return s && o && vo(t, r, o), o;
|
|
801
|
+
};
|
|
802
|
+
const jt = "fcm-pump-model", $o = p.createLogger({ name: "fcm-pump-model" });
|
|
803
|
+
let D = class {
|
|
804
|
+
constructor(e, t, r) {
|
|
805
|
+
i(this, "id");
|
|
806
|
+
i(this, "logger");
|
|
807
|
+
i(this, "pumpModel");
|
|
808
|
+
i(this, "futureHandler");
|
|
809
|
+
this.id = e, this.logger = r.logger, this.pumpModel = t.companionParent, this.futureHandler = new ce(this);
|
|
810
|
+
}
|
|
811
|
+
get future() {
|
|
812
|
+
return this.futureHandler.future;
|
|
813
|
+
}
|
|
814
|
+
get name() {
|
|
815
|
+
return this.pumpModel.name;
|
|
816
|
+
}
|
|
817
|
+
get canPour() {
|
|
818
|
+
return this.pumpModel.canPour;
|
|
819
|
+
}
|
|
820
|
+
get isPouring() {
|
|
821
|
+
return this.pumpModel.isPouring;
|
|
822
|
+
}
|
|
823
|
+
async cancelPour() {
|
|
824
|
+
return this.pumpModel.cancelPour();
|
|
825
|
+
}
|
|
826
|
+
performIntent(e) {
|
|
827
|
+
return this.pumpModel.performIntent(e);
|
|
828
|
+
}
|
|
829
|
+
async performElectricalTest() {
|
|
830
|
+
const [e, t] = await It(this.pumpModel.path);
|
|
831
|
+
return e && $o.error(`Failed to perform electrical test on pump ${this.id}`, e), t;
|
|
832
|
+
}
|
|
833
|
+
getChildren() {
|
|
834
|
+
return [...this.futureHandler.allFutures];
|
|
835
|
+
}
|
|
836
|
+
async performPreCalibrate(e) {
|
|
837
|
+
return Rt(this.pumpModel.path, e);
|
|
838
|
+
}
|
|
839
|
+
async performCalibrate(e) {
|
|
840
|
+
return Ft(this.pumpModel.path, e);
|
|
841
|
+
}
|
|
842
|
+
async performVerify(e, t) {
|
|
843
|
+
return At(this.pumpModel.path, e, t);
|
|
844
|
+
}
|
|
845
|
+
async performComplete(e, t) {
|
|
846
|
+
return xt(this.pumpModel.path, e, t);
|
|
847
|
+
}
|
|
848
|
+
// -------------------LIFECYCLE----------------------------
|
|
849
|
+
async init() {
|
|
850
|
+
this.logger.debug(`initializing fcm-pump ${this.id}`);
|
|
851
|
+
}
|
|
852
|
+
async load() {
|
|
853
|
+
this.logger.debug(`loading fcm-pump ${this.id}`);
|
|
854
|
+
}
|
|
855
|
+
};
|
|
856
|
+
ke([
|
|
857
|
+
_()
|
|
858
|
+
], D.prototype, "performPreCalibrate", 1);
|
|
859
|
+
ke([
|
|
860
|
+
_()
|
|
861
|
+
], D.prototype, "performCalibrate", 1);
|
|
862
|
+
ke([
|
|
863
|
+
_()
|
|
864
|
+
], D.prototype, "performVerify", 1);
|
|
865
|
+
D = ke([
|
|
866
|
+
l(jt)
|
|
867
|
+
], D);
|
|
868
|
+
const Ut = new Ye({
|
|
869
|
+
class: D,
|
|
870
|
+
type: jt
|
|
871
|
+
});
|
|
872
|
+
var To = Object.defineProperty, Po = Object.getOwnPropertyDescriptor, Vt = (e, t, r, s) => {
|
|
873
|
+
for (var o = s > 1 ? void 0 : s ? Po(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
874
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
875
|
+
return s && o && To(t, r, o), o;
|
|
876
|
+
};
|
|
877
|
+
const B = "carb-water-model";
|
|
878
|
+
let ye = class {
|
|
879
|
+
constructor(e, t, r) {
|
|
880
|
+
i(this, "id");
|
|
881
|
+
i(this, "assemblyModel");
|
|
882
|
+
i(this, "logger");
|
|
883
|
+
this.id = e, this.logger = r.logger;
|
|
884
|
+
}
|
|
885
|
+
getPump() {
|
|
886
|
+
const t = this.assemblyModel.getHoldersByGroup("carb")[0].pumps.data[0];
|
|
887
|
+
return ht(t, Ut.type);
|
|
888
|
+
}
|
|
889
|
+
// -------------------LIFECYCLE----------------------------
|
|
890
|
+
async init() {
|
|
891
|
+
this.logger.debug(`initializing carb-water ${this.id}`);
|
|
892
|
+
}
|
|
893
|
+
async load() {
|
|
894
|
+
this.logger.debug(`loading carb-water ${this.id}`);
|
|
895
|
+
}
|
|
896
|
+
};
|
|
897
|
+
Vt([
|
|
898
|
+
g({ modelType: Ce.type })
|
|
899
|
+
], ye.prototype, "assemblyModel", 2);
|
|
900
|
+
ye = Vt([
|
|
901
|
+
l(B)
|
|
902
|
+
], ye);
|
|
903
|
+
const Oo = {
|
|
904
|
+
registration: {
|
|
905
|
+
[B]: {
|
|
906
|
+
class: ye,
|
|
907
|
+
singleton: !1
|
|
908
|
+
}
|
|
909
|
+
},
|
|
910
|
+
type: B,
|
|
911
|
+
predicate: c(B),
|
|
912
|
+
factory: d.Factory.create(B)
|
|
913
|
+
}, { URL: x } = h("COPY-LOGS_SERVICE"), { getAll: Mo, getOne: So, postModel: Ht, deleteModel: wo } = f.build({
|
|
914
|
+
basePath: `${x}/api/copy-logs`
|
|
915
|
+
}), be = p.createLogger({
|
|
916
|
+
name: "copy-logs-service",
|
|
917
|
+
group: "Services"
|
|
918
|
+
}), Wt = async (e, t) => {
|
|
919
|
+
const r = await wo({
|
|
920
|
+
tracker: t,
|
|
921
|
+
id: e,
|
|
922
|
+
urlOverride: `${x}/api/app/kosdev.ddk/copyLogs/${e}`
|
|
923
|
+
});
|
|
924
|
+
if (!(r != null && r.data))
|
|
925
|
+
throw new Error("No response from server");
|
|
926
|
+
return r.data;
|
|
927
|
+
}, Nt = async (e, t) => {
|
|
928
|
+
const r = await Ht({
|
|
929
|
+
model: {},
|
|
930
|
+
tracker: t,
|
|
931
|
+
urlOverride: `${x}/api/app/kosdev.ddk/copyLogs/eraseAndCopy/${e}`
|
|
932
|
+
});
|
|
933
|
+
if (!(r != null && r.data))
|
|
934
|
+
throw new Error("No response from server");
|
|
935
|
+
return r.data;
|
|
936
|
+
}, zt = async (e, t) => {
|
|
937
|
+
const r = await Ht({
|
|
938
|
+
model: {},
|
|
939
|
+
tracker: t,
|
|
940
|
+
urlOverride: `${x}/api/app/kosdev.ddk/copyLogs/${e}`
|
|
941
|
+
});
|
|
942
|
+
if (!(r != null && r.data))
|
|
943
|
+
throw new Error("No response from server");
|
|
944
|
+
return r.data;
|
|
945
|
+
}, Bt = async () => {
|
|
946
|
+
be.debug("sending GET for copy-logs");
|
|
947
|
+
try {
|
|
948
|
+
const e = await Mo({
|
|
949
|
+
urlOverride: `${x}/api/app/kosdev.ddk/copyLogs/volumes/size`
|
|
950
|
+
});
|
|
951
|
+
return [void 0, e == null ? void 0 : e.data];
|
|
952
|
+
} catch (e) {
|
|
953
|
+
if (e instanceof qe)
|
|
954
|
+
return be.error(`Error fetching log file size: ${e.payload.error}`), [e.payload.error, void 0];
|
|
955
|
+
}
|
|
956
|
+
return ["unknownError", void 0];
|
|
957
|
+
}, Kt = async () => {
|
|
958
|
+
be.debug("sending GET for log file size");
|
|
959
|
+
try {
|
|
960
|
+
const e = await So({
|
|
961
|
+
urlOverride: `${x}/api/app/kosdev.ddk/copyLogs/files/size`
|
|
962
|
+
});
|
|
963
|
+
return [void 0, e == null ? void 0 : e.data];
|
|
964
|
+
} catch (e) {
|
|
965
|
+
if (e instanceof qe)
|
|
966
|
+
return be.error(`Error fetching log file size: ${e.payload.error}`), [e.payload.error, void 0];
|
|
967
|
+
}
|
|
968
|
+
return ["unknownError", void 0];
|
|
969
|
+
}, bi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
970
|
+
__proto__: null,
|
|
971
|
+
copyLogFromVolume: zt,
|
|
972
|
+
eraseAndCopyLogsToVolume: Nt,
|
|
973
|
+
eraseVolume: Wt,
|
|
974
|
+
getLogFileSize: Kt,
|
|
975
|
+
getVolumes: Bt
|
|
976
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
977
|
+
var Eo = Object.defineProperty, Co = Object.getOwnPropertyDescriptor, j = (e, t, r, s) => {
|
|
978
|
+
for (var o = s > 1 ? void 0 : s ? Co(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
979
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
980
|
+
return s && o && Eo(t, r, o), o;
|
|
981
|
+
};
|
|
982
|
+
const Yt = "copy-logs-model";
|
|
983
|
+
let O = class {
|
|
984
|
+
constructor(e, t, r) {
|
|
985
|
+
i(this, "id");
|
|
986
|
+
i(this, "logger");
|
|
987
|
+
i(this, "_volumes");
|
|
988
|
+
i(this, "futureHandler");
|
|
989
|
+
i(this, "storageDeviceContainer");
|
|
990
|
+
i(this, "_activeVolume");
|
|
991
|
+
i(this, "_logFileSize", 0);
|
|
992
|
+
i(this, "_actionState", "idle");
|
|
993
|
+
i(this, "copyProgress");
|
|
994
|
+
this.id = e, this.logger = r.logger, this._volumes = new kr(), this.futureHandler = new ce(this), this._activeVolume = void 0, this.copyProgress = {
|
|
995
|
+
bytesCopied: 0,
|
|
996
|
+
bytesToCopy: 0,
|
|
997
|
+
filesCopied: 0,
|
|
998
|
+
filesSkipped: 0
|
|
999
|
+
};
|
|
1000
|
+
}
|
|
1001
|
+
// -------------------LIFECYCLE----------------------------
|
|
1002
|
+
get volumes() {
|
|
1003
|
+
return this._volumes.data;
|
|
1004
|
+
}
|
|
1005
|
+
get activeVolume() {
|
|
1006
|
+
return this._activeVolume;
|
|
1007
|
+
}
|
|
1008
|
+
get logFileSize() {
|
|
1009
|
+
return this._logFileSize;
|
|
1010
|
+
}
|
|
1011
|
+
reset() {
|
|
1012
|
+
this.clearActiveVolume(), this.futureHandler.removeFuture();
|
|
1013
|
+
}
|
|
1014
|
+
clearActiveVolume() {
|
|
1015
|
+
this._activeVolume = void 0;
|
|
1016
|
+
}
|
|
1017
|
+
updateActiveVolume(e) {
|
|
1018
|
+
this._activeVolume = e;
|
|
1019
|
+
}
|
|
1020
|
+
get inserted() {
|
|
1021
|
+
return this.storageDeviceContainer.isStorageInserted;
|
|
1022
|
+
}
|
|
1023
|
+
updateLogFileSize(e) {
|
|
1024
|
+
this._logFileSize = e;
|
|
1025
|
+
}
|
|
1026
|
+
get canCopyLogs() {
|
|
1027
|
+
return this.inserted && this._activeVolume;
|
|
1028
|
+
}
|
|
1029
|
+
get future() {
|
|
1030
|
+
return this.futureHandler.future;
|
|
1031
|
+
}
|
|
1032
|
+
get actionState() {
|
|
1033
|
+
return this._actionState;
|
|
1034
|
+
}
|
|
1035
|
+
get diskFull() {
|
|
1036
|
+
var e;
|
|
1037
|
+
return ((e = this.future) == null ? void 0 : e.status) === b.Success && this.copyProgress.filesSkipped > 0;
|
|
1038
|
+
}
|
|
1039
|
+
onFutureUpdate(e) {
|
|
1040
|
+
this.logger.info(`Future update: ${e.status}`), e.status === b.Success && (this.logger.info(`Future success: ${e.status}`), this.diskFull && y(() => {
|
|
1041
|
+
e.endState = b.Fail, e.reason = "errDiskFull";
|
|
1042
|
+
})), e.status === b.Fail && this.logger.error(`Future failed: ${e.status}`), e.note === "copy" ? y(() => {
|
|
1043
|
+
this._actionState = "copying", this.copyProgress = e.clientData || {
|
|
1044
|
+
bytesCopied: 0,
|
|
1045
|
+
bytesToCopy: 0,
|
|
1046
|
+
filesCopied: 0,
|
|
1047
|
+
filesSkipped: 0
|
|
1048
|
+
};
|
|
1049
|
+
}) : (this._actionState = "erasing", y(() => {
|
|
1050
|
+
this.copyProgress = {
|
|
1051
|
+
bytesCopied: 0,
|
|
1052
|
+
bytesToCopy: 0,
|
|
1053
|
+
filesCopied: 0,
|
|
1054
|
+
filesSkipped: 0
|
|
1055
|
+
};
|
|
1056
|
+
}));
|
|
1057
|
+
}
|
|
1058
|
+
async eraseAndCopyVolume(e) {
|
|
1059
|
+
var t;
|
|
1060
|
+
if (!e)
|
|
1061
|
+
throw new Error("No tracker provided");
|
|
1062
|
+
if (y(() => {
|
|
1063
|
+
this._actionState = "erasing";
|
|
1064
|
+
}), !this._activeVolume)
|
|
1065
|
+
throw this.logger.error("No active volume selected"), new Error("No active volume selected");
|
|
1066
|
+
return this.logger.info(`Erasing volume ${(t = this._activeVolume) == null ? void 0 : t.name}`), Nt(this._activeVolume.id, e);
|
|
1067
|
+
}
|
|
1068
|
+
async eraseVolume(e) {
|
|
1069
|
+
var t;
|
|
1070
|
+
if (!e)
|
|
1071
|
+
throw new Error("No tracker provided");
|
|
1072
|
+
if (y(() => {
|
|
1073
|
+
this._actionState = "erasing";
|
|
1074
|
+
}), !this._activeVolume)
|
|
1075
|
+
throw this.logger.error("No active volume selected"), new Error("No active volume selected");
|
|
1076
|
+
return this.logger.info(`Erasing volume ${(t = this._activeVolume) == null ? void 0 : t.name}`), Wt(this._activeVolume.id, e);
|
|
1077
|
+
}
|
|
1078
|
+
async copyLogs(e) {
|
|
1079
|
+
var t;
|
|
1080
|
+
if (!e)
|
|
1081
|
+
throw new Error("No tracker provided");
|
|
1082
|
+
if (y(() => {
|
|
1083
|
+
this._actionState = "copying";
|
|
1084
|
+
}), !this._activeVolume)
|
|
1085
|
+
throw this.logger.error("No active volume selected"), new Error("No active volume selected");
|
|
1086
|
+
return this.logger.info(`Copying logs to ${(t = this._activeVolume) == null ? void 0 : t.name}`), zt(this._activeVolume.id, e);
|
|
1087
|
+
}
|
|
1088
|
+
handleInsertion() {
|
|
1089
|
+
this.inserted ? this.syncVolumes() : (this._volumes.clear(), this.clearActiveVolume());
|
|
1090
|
+
}
|
|
1091
|
+
async init() {
|
|
1092
|
+
this.logger.debug(`initializing copy-logs ${this.id}`);
|
|
1093
|
+
}
|
|
1094
|
+
async syncVolumes() {
|
|
1095
|
+
const [e, t] = await Bt(), [r, s] = await Kt();
|
|
1096
|
+
if (r) {
|
|
1097
|
+
this.logger.error(`Error fetching log file size: ${r}`);
|
|
1098
|
+
return;
|
|
1099
|
+
}
|
|
1100
|
+
if (e) {
|
|
1101
|
+
this.logger.error(`Error fetching volumes: ${e}`);
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
1104
|
+
t && (t.forEach((o) => {
|
|
1105
|
+
const a = this.storageDeviceContainer.getModel(o.id);
|
|
1106
|
+
if (a) {
|
|
1107
|
+
const n = {
|
|
1108
|
+
id: o.id,
|
|
1109
|
+
name: a.label,
|
|
1110
|
+
freeBytes: o.info.freeBytes,
|
|
1111
|
+
totalBytes: o.info.totalBytes
|
|
1112
|
+
};
|
|
1113
|
+
this._volumes.addModel(n);
|
|
1114
|
+
}
|
|
1115
|
+
}), t.length === 1 ? this.updateActiveVolume(this._volumes.data[0]) : this.clearActiveVolume()), s && (this.logger.info(`Log file size: ${s}`), this.updateLogFileSize(parseInt(s, 10)));
|
|
1116
|
+
}
|
|
1117
|
+
async activate() {
|
|
1118
|
+
this.logger.debug(`activating copy-logs ${this.id}`), await this.syncVolumes();
|
|
1119
|
+
}
|
|
1120
|
+
async load() {
|
|
1121
|
+
this.logger.debug(`loading copy-logs ${this.id}`);
|
|
1122
|
+
}
|
|
1123
|
+
};
|
|
1124
|
+
j([
|
|
1125
|
+
g({ modelType: Dr.type })
|
|
1126
|
+
], O.prototype, "storageDeviceContainer", 2);
|
|
1127
|
+
j([
|
|
1128
|
+
_()
|
|
1129
|
+
], O.prototype, "eraseAndCopyVolume", 1);
|
|
1130
|
+
j([
|
|
1131
|
+
_()
|
|
1132
|
+
], O.prototype, "eraseVolume", 1);
|
|
1133
|
+
j([
|
|
1134
|
+
_()
|
|
1135
|
+
], O.prototype, "copyLogs", 1);
|
|
1136
|
+
j([
|
|
1137
|
+
gt({
|
|
1138
|
+
dependencies: (e) => [e.inserted]
|
|
1139
|
+
})
|
|
1140
|
+
], O.prototype, "handleInsertion", 1);
|
|
1141
|
+
O = j([
|
|
1142
|
+
l(Yt)
|
|
1143
|
+
], O);
|
|
1144
|
+
const vi = new le({
|
|
1145
|
+
class: O,
|
|
1146
|
+
type: Yt
|
|
1147
|
+
}), Gt = p.createLogger({
|
|
1148
|
+
name: "dashboard-operations-service",
|
|
1149
|
+
group: "Services"
|
|
1150
|
+
}), qt = async (e, t) => (Gt.debug("resolveAll"), await we.bulkResolveTroubles(
|
|
1151
|
+
e,
|
|
1152
|
+
t
|
|
1153
|
+
)), Qt = async (e, t) => (Gt.debug("resolveTrouble"), await we.resolveTrouble(e, t)), _i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1154
|
+
__proto__: null,
|
|
1155
|
+
resolveAll: qt,
|
|
1156
|
+
resolveTrouble: Qt
|
|
1157
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1158
|
+
var Lo = Object.defineProperty, Do = Object.getOwnPropertyDescriptor, Ie = (e, t, r, s) => {
|
|
1159
|
+
for (var o = s > 1 ? void 0 : s ? Do(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
1160
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
1161
|
+
return s && o && Lo(t, r, o), o;
|
|
1162
|
+
};
|
|
1163
|
+
const K = "dashboard-operations-model";
|
|
1164
|
+
function dt(e) {
|
|
1165
|
+
return !e.deferred;
|
|
1166
|
+
}
|
|
1167
|
+
function ut(e) {
|
|
1168
|
+
return e.deferred;
|
|
1169
|
+
}
|
|
1170
|
+
let k = class {
|
|
1171
|
+
constructor(e, t, r) {
|
|
1172
|
+
i(this, "id");
|
|
1173
|
+
i(this, "troubles");
|
|
1174
|
+
i(this, "futureHandler");
|
|
1175
|
+
i(this, "logger");
|
|
1176
|
+
this.id = e, this.futureHandler = new ce(this), this.logger = r.logger;
|
|
1177
|
+
}
|
|
1178
|
+
get troublesByType() {
|
|
1179
|
+
return this.troubles.troubles.data.reduce(
|
|
1180
|
+
Ir,
|
|
1181
|
+
{}
|
|
1182
|
+
);
|
|
1183
|
+
}
|
|
1184
|
+
get queuedPurgeTroubles() {
|
|
1185
|
+
return this.purgeTroubles.filter(ut);
|
|
1186
|
+
}
|
|
1187
|
+
get queuedPrimeTroubles() {
|
|
1188
|
+
return this.primeTroubles.filter(ut);
|
|
1189
|
+
}
|
|
1190
|
+
get resolvablePrimeTroubles() {
|
|
1191
|
+
return this.primeTroubles.filter(dt);
|
|
1192
|
+
}
|
|
1193
|
+
get resolvablePurgeTroubles() {
|
|
1194
|
+
return this.purgeTroubles.filter(dt);
|
|
1195
|
+
}
|
|
1196
|
+
get hasResolvablePurgeTroubles() {
|
|
1197
|
+
return this.resolvablePurgeTroubles.length > 0;
|
|
1198
|
+
}
|
|
1199
|
+
get hasResolvablePrimeTroubles() {
|
|
1200
|
+
return this.resolvablePrimeTroubles.length > 0;
|
|
1201
|
+
}
|
|
1202
|
+
get hasPurgeTroubles() {
|
|
1203
|
+
return this.purgeTroubles.length > 0;
|
|
1204
|
+
}
|
|
1205
|
+
get hasPrimeTroubles() {
|
|
1206
|
+
return this.primeTroubles.length > 0;
|
|
1207
|
+
}
|
|
1208
|
+
get purgeTroubles() {
|
|
1209
|
+
return this.troublesByType[nt] || [];
|
|
1210
|
+
}
|
|
1211
|
+
get primeTroubles() {
|
|
1212
|
+
return this.troublesByType[Vr] || [];
|
|
1213
|
+
}
|
|
1214
|
+
get future() {
|
|
1215
|
+
return this.futureHandler.getFuture();
|
|
1216
|
+
}
|
|
1217
|
+
async resolveAllTroubles(e, t) {
|
|
1218
|
+
if (!t)
|
|
1219
|
+
throw new Error("No tracker provided");
|
|
1220
|
+
const r = e === nt ? this.purgeTroubles : this.primeTroubles;
|
|
1221
|
+
r.filter((n) => n.shouldDefer).forEach((n) => {
|
|
1222
|
+
this.logger.info(`Deferring trouble ${n.rawId}`), n.defer();
|
|
1223
|
+
});
|
|
1224
|
+
const o = r.filter((n) => !n.shouldDefer).map((n) => n.rawId);
|
|
1225
|
+
return o.length === 0 ? void 0 : await qt(o, t);
|
|
1226
|
+
}
|
|
1227
|
+
async resolveTrouble(e, t) {
|
|
1228
|
+
if (!t)
|
|
1229
|
+
throw new Error("No tracker provided");
|
|
1230
|
+
return await Qt(e, t);
|
|
1231
|
+
}
|
|
1232
|
+
// -------------------LIFECYCLE----------------------------
|
|
1233
|
+
async init() {
|
|
1234
|
+
this.logger.debug(`initializing dashboard-operations ${this.id}`);
|
|
1235
|
+
}
|
|
1236
|
+
async load() {
|
|
1237
|
+
this.logger.debug(`loading dashboard-operations ${this.id}`);
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1240
|
+
Ie([
|
|
1241
|
+
g({ modelType: Qe.type })
|
|
1242
|
+
], k.prototype, "troubles", 2);
|
|
1243
|
+
Ie([
|
|
1244
|
+
_()
|
|
1245
|
+
], k.prototype, "resolveAllTroubles", 1);
|
|
1246
|
+
Ie([
|
|
1247
|
+
_()
|
|
1248
|
+
], k.prototype, "resolveTrouble", 1);
|
|
1249
|
+
k = Ie([
|
|
1250
|
+
l(K)
|
|
1251
|
+
], k);
|
|
1252
|
+
const tt = {
|
|
1253
|
+
registration: {
|
|
1254
|
+
[K]: {
|
|
1255
|
+
class: k,
|
|
1256
|
+
singleton: !0
|
|
1257
|
+
}
|
|
1258
|
+
},
|
|
1259
|
+
type: K,
|
|
1260
|
+
predicate: c(K),
|
|
1261
|
+
factory: d.Singleton.create(K)
|
|
1262
|
+
};
|
|
1263
|
+
var ko = Object.defineProperty, Io = Object.getOwnPropertyDescriptor, Ro = (e, t, r, s) => {
|
|
1264
|
+
for (var o = s > 1 ? void 0 : s ? Io(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
1265
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
1266
|
+
return s && o && ko(t, r, o), o;
|
|
1267
|
+
};
|
|
1268
|
+
const Y = "dispenser-model";
|
|
1269
|
+
let Ve = class {
|
|
1270
|
+
constructor(e, t, r) {
|
|
1271
|
+
i(this, "id");
|
|
1272
|
+
i(this, "logger");
|
|
1273
|
+
this.id = e, this.logger = r.logger;
|
|
1274
|
+
}
|
|
1275
|
+
updateModel() {
|
|
1276
|
+
}
|
|
1277
|
+
// -------------------LIFECYCLE----------------------------
|
|
1278
|
+
async init() {
|
|
1279
|
+
this.logger.debug(`initializing dispenser ${this.id}`);
|
|
1280
|
+
}
|
|
1281
|
+
async load() {
|
|
1282
|
+
this.logger.debug(`loading dispenser ${this.id}`);
|
|
1283
|
+
}
|
|
1284
|
+
};
|
|
1285
|
+
Ve = Ro([
|
|
1286
|
+
l(Y)
|
|
1287
|
+
], Ve);
|
|
1288
|
+
const Fo = {
|
|
1289
|
+
registration: {
|
|
1290
|
+
[Y]: {
|
|
1291
|
+
class: Ve,
|
|
1292
|
+
singleton: !0
|
|
1293
|
+
}
|
|
1294
|
+
},
|
|
1295
|
+
type: Y,
|
|
1296
|
+
predicate: c(Y),
|
|
1297
|
+
factory: d.Singleton.create(Y)
|
|
1298
|
+
}, { URL: Ao } = h("DISPENSER_SERVICE"), { getAll: xo } = f.build({
|
|
1299
|
+
basePath: `${Ao}/api/dispenser`
|
|
1300
|
+
}), jo = p.createLogger({
|
|
1301
|
+
name: "dispenser-service",
|
|
1302
|
+
group: "Services"
|
|
1303
|
+
}), Uo = async () => (jo.debug("sending GET for dispenser"), await xo({})), $i = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1304
|
+
__proto__: null,
|
|
1305
|
+
getDispensers: Uo
|
|
1306
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1307
|
+
var Vo = Object.defineProperty, Ho = Object.getOwnPropertyDescriptor, Xt = (e, t, r, s) => {
|
|
1308
|
+
for (var o = s > 1 ? void 0 : s ? Ho(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
1309
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
1310
|
+
return s && o && Vo(t, r, o), o;
|
|
1311
|
+
};
|
|
1312
|
+
const G = "dispenser-info-model";
|
|
1313
|
+
let ve = class {
|
|
1314
|
+
constructor(e, t, r) {
|
|
1315
|
+
i(this, "logger");
|
|
1316
|
+
i(this, "id");
|
|
1317
|
+
i(this, "name");
|
|
1318
|
+
this.id = e, this.logger = r.logger;
|
|
1319
|
+
}
|
|
1320
|
+
// -------------------LIFECYCLE----------------------------
|
|
1321
|
+
async init() {
|
|
1322
|
+
this.logger.debug(`initializing dispenser-info ${this.id}`);
|
|
1323
|
+
}
|
|
1324
|
+
async load() {
|
|
1325
|
+
this.logger.debug(`loading dispenser-info ${this.id}`);
|
|
1326
|
+
}
|
|
1327
|
+
};
|
|
1328
|
+
Xt([
|
|
1329
|
+
u({
|
|
1330
|
+
path: "kos:device",
|
|
1331
|
+
attribute: "name"
|
|
1332
|
+
})
|
|
1333
|
+
], ve.prototype, "name", 2);
|
|
1334
|
+
ve = Xt([
|
|
1335
|
+
l(G)
|
|
1336
|
+
], ve);
|
|
1337
|
+
const Wo = {
|
|
1338
|
+
registration: {
|
|
1339
|
+
[G]: {
|
|
1340
|
+
class: ve,
|
|
1341
|
+
singleton: !1
|
|
1342
|
+
}
|
|
1343
|
+
},
|
|
1344
|
+
type: G,
|
|
1345
|
+
predicate: c(G),
|
|
1346
|
+
factory: d.Factory.create(
|
|
1347
|
+
G
|
|
1348
|
+
)
|
|
1349
|
+
}, { URL: No } = h("DISPENSER-INFO_SERVICE"), { getAll: zo } = f.build({
|
|
1350
|
+
basePath: `${No}/api/dispenser-info`
|
|
1351
|
+
}), Bo = p.createLogger({
|
|
1352
|
+
name: "dispenser-info-service",
|
|
1353
|
+
group: "Services"
|
|
1354
|
+
}), Ko = async () => (Bo.debug("sending GET for dispenser-info"), await zo({})), Ti = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1355
|
+
__proto__: null,
|
|
1356
|
+
getDispenserInfos: Ko
|
|
1357
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1358
|
+
var Yo = Object.defineProperty, Go = Object.getOwnPropertyDescriptor, qo = (e, t, r, s) => {
|
|
1359
|
+
for (var o = s > 1 ? void 0 : s ? Go(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
1360
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
1361
|
+
return s && o && Yo(t, r, o), o;
|
|
1362
|
+
};
|
|
1363
|
+
const q = "enrollment-model";
|
|
1364
|
+
let He = class {
|
|
1365
|
+
constructor(e, t, r) {
|
|
1366
|
+
i(this, "id");
|
|
1367
|
+
i(this, "logger");
|
|
1368
|
+
i(this, "enrolled");
|
|
1369
|
+
this.id = e, this.logger = r.logger, this.enrolled = !1;
|
|
1370
|
+
}
|
|
1371
|
+
updateModel(e) {
|
|
1372
|
+
console.log("updateModel:", e);
|
|
1373
|
+
}
|
|
1374
|
+
// -------------------LIFECYCLE----------------------------
|
|
1375
|
+
async init() {
|
|
1376
|
+
this.logger.debug(`initializing enrollment ${this.id}`);
|
|
1377
|
+
}
|
|
1378
|
+
async load() {
|
|
1379
|
+
this.logger.debug(`loading enrollment ${this.id}`);
|
|
1380
|
+
}
|
|
1381
|
+
};
|
|
1382
|
+
He = qo([
|
|
1383
|
+
l(q)
|
|
1384
|
+
], He);
|
|
1385
|
+
const Qo = {
|
|
1386
|
+
registration: {
|
|
1387
|
+
[q]: {
|
|
1388
|
+
class: He,
|
|
1389
|
+
singleton: !0
|
|
1390
|
+
}
|
|
1391
|
+
},
|
|
1392
|
+
type: q,
|
|
1393
|
+
predicate: c(q),
|
|
1394
|
+
factory: d.Singleton.create(q)
|
|
1395
|
+
}, { URL: Xo } = h("ENROLLMENT_SERVICE"), { getAll: Jo } = f.build({
|
|
1396
|
+
basePath: `${Xo}/api/enrollment`
|
|
1397
|
+
}), Zo = p.createLogger({
|
|
1398
|
+
name: "enrollment-service",
|
|
1399
|
+
group: "Services"
|
|
1400
|
+
}), es = async () => (Zo.debug("sending GET for enrollment"), await Jo({})), Pi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1401
|
+
__proto__: null,
|
|
1402
|
+
getEnrollments: es
|
|
1403
|
+
}, Symbol.toStringTag, { value: "Module" })), Oi = (e) => e.toLowerCase().includes("micros"), Mi = (e) => !e.toLowerCase().includes("micros"), Si = (e) => (t) => {
|
|
1404
|
+
const r = e == null ? void 0 : e.getHoldersByGroup(t);
|
|
1405
|
+
return r ? r.map((s) => ({ id: s.id, name: s.ingredientName, path: s.path })) : null;
|
|
1406
|
+
}, wi = ["water", "carb", "ns", "nss"], ne = "dashboardKeyFactory", xe = [];
|
|
1407
|
+
Rr(ne, {
|
|
1408
|
+
register: (e, t) => {
|
|
1409
|
+
xe.includes(t) || xe.push(t);
|
|
1410
|
+
},
|
|
1411
|
+
execute: (e, t) => {
|
|
1412
|
+
const r = xe.sort((s, o) => s.rank - o.rank);
|
|
1413
|
+
for (const s of r) {
|
|
1414
|
+
const o = s.factory(t);
|
|
1415
|
+
if (o)
|
|
1416
|
+
return o;
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
});
|
|
1420
|
+
const ts = (e) => {
|
|
1421
|
+
Ee[ne].register(
|
|
1422
|
+
ne,
|
|
1423
|
+
e
|
|
1424
|
+
);
|
|
1425
|
+
}, rs = (e) => Ee[ne].execute(
|
|
1426
|
+
ne,
|
|
1427
|
+
e
|
|
1428
|
+
);
|
|
1429
|
+
Ee.registerDashboardKeyFactory = ts;
|
|
1430
|
+
Ee.executeDashboardKeyFactory = rs;
|
|
1431
|
+
const We = 3600, Jt = 60, Ei = (e) => {
|
|
1432
|
+
const t = Math.floor(e / We), r = Math.floor(e % We / Jt);
|
|
1433
|
+
return { hours: t, minutes: r };
|
|
1434
|
+
}, Ci = (e, t) => e * We + t * Jt, os = (e) => {
|
|
1435
|
+
const r = (/* @__PURE__ */ new Date()).valueOf() - e.valueOf(), s = Math.floor(r / (1e3 * 60)), o = Math.floor(s / 60), a = Math.floor(o / 24), n = s % 60, w = o % 24;
|
|
1436
|
+
let ge = "";
|
|
1437
|
+
return a > 0 && (ge += `${a} day${a > 1 ? "s" : ""} `), w > 0 && (ge += `${w} hour${w > 1 ? "s" : ""} `), (n > 0 || a === 0 && w === 0) && (ge += `${n} minute${n > 1 ? "s" : ""} `), ge;
|
|
1438
|
+
};
|
|
1439
|
+
var ss = Object.defineProperty, is = Object.getOwnPropertyDescriptor, Re = (e, t, r, s) => {
|
|
1440
|
+
for (var o = s > 1 ? void 0 : s ? is(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
1441
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
1442
|
+
return s && o && ss(t, r, o), o;
|
|
1443
|
+
};
|
|
1444
|
+
const Q = "ingredient-summary-model";
|
|
1445
|
+
let I = class {
|
|
1446
|
+
constructor(e, t, r) {
|
|
1447
|
+
i(this, "id");
|
|
1448
|
+
i(this, "assemblyModel");
|
|
1449
|
+
i(this, "dashboardOperationModel");
|
|
1450
|
+
i(this, "appModel");
|
|
1451
|
+
i(this, "logger");
|
|
1452
|
+
this.id = e, this.logger = r.logger, this.dashboardOperationModel = tt.factory({});
|
|
1453
|
+
}
|
|
1454
|
+
get highPriorityHolders() {
|
|
1455
|
+
return this.assemblyModel.allHolders.filter(
|
|
1456
|
+
(e) => e.troubles.length > 0 && e.troubles.find((t) => t.rank >= 400)
|
|
1457
|
+
);
|
|
1458
|
+
}
|
|
1459
|
+
get actionRequiredHolders() {
|
|
1460
|
+
const e = this.appModel.currentRole, t = Dt(e);
|
|
1461
|
+
return this.assemblyModel.allHolders.filter((r) => {
|
|
1462
|
+
const s = r.troubles.filter(t);
|
|
1463
|
+
return s.length > 0 && s.find((o) => o.resolvable);
|
|
1464
|
+
});
|
|
1465
|
+
}
|
|
1466
|
+
get lowLevelHolders() {
|
|
1467
|
+
return this.assemblyModel.allHolders.filter((e) => {
|
|
1468
|
+
const t = e.fillPercent;
|
|
1469
|
+
return e.hasFuelGuage && t < 20;
|
|
1470
|
+
});
|
|
1471
|
+
}
|
|
1472
|
+
// -------------------LIFECYCLE----------------------------
|
|
1473
|
+
async init() {
|
|
1474
|
+
this.logger.debug(`initializing ingredient-summary ${this.id}`);
|
|
1475
|
+
}
|
|
1476
|
+
async load() {
|
|
1477
|
+
this.logger.debug(`loading ingredient-summary ${this.id}`);
|
|
1478
|
+
}
|
|
1479
|
+
};
|
|
1480
|
+
Re([
|
|
1481
|
+
g({ modelType: Ce.type })
|
|
1482
|
+
], I.prototype, "assemblyModel", 2);
|
|
1483
|
+
Re([
|
|
1484
|
+
g({ modelType: tt.type })
|
|
1485
|
+
], I.prototype, "dashboardOperationModel", 2);
|
|
1486
|
+
Re([
|
|
1487
|
+
g({ modelType: et.type })
|
|
1488
|
+
], I.prototype, "appModel", 2);
|
|
1489
|
+
I = Re([
|
|
1490
|
+
l(Q)
|
|
1491
|
+
], I);
|
|
1492
|
+
const ns = {
|
|
1493
|
+
registration: {
|
|
1494
|
+
[Q]: {
|
|
1495
|
+
class: I,
|
|
1496
|
+
singleton: !1
|
|
1497
|
+
}
|
|
1498
|
+
},
|
|
1499
|
+
type: Q,
|
|
1500
|
+
predicate: c(Q),
|
|
1501
|
+
factory: d.Factory.create(
|
|
1502
|
+
Q
|
|
1503
|
+
)
|
|
1504
|
+
};
|
|
1505
|
+
var as = Object.defineProperty, ls = Object.getOwnPropertyDescriptor, cs = (e, t, r, s) => {
|
|
1506
|
+
for (var o = s > 1 ? void 0 : s ? ls(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
1507
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
1508
|
+
return s && o && as(t, r, o), o;
|
|
1509
|
+
};
|
|
1510
|
+
const Zt = "lfcv-pump-model";
|
|
1511
|
+
let Ne = class {
|
|
1512
|
+
constructor(e, t, r) {
|
|
1513
|
+
i(this, "id");
|
|
1514
|
+
i(this, "logger");
|
|
1515
|
+
i(this, "pumpModel");
|
|
1516
|
+
this.id = e, this.logger = r.logger, this.pumpModel = t.companionParent;
|
|
1517
|
+
}
|
|
1518
|
+
get name() {
|
|
1519
|
+
return this.pumpModel.name;
|
|
1520
|
+
}
|
|
1521
|
+
get canPour() {
|
|
1522
|
+
return this.pumpModel.canPour;
|
|
1523
|
+
}
|
|
1524
|
+
get isPouring() {
|
|
1525
|
+
return this.pumpModel.isPouring;
|
|
1526
|
+
}
|
|
1527
|
+
async cancelPour() {
|
|
1528
|
+
return this.pumpModel.cancelPour();
|
|
1529
|
+
}
|
|
1530
|
+
performIntent(e) {
|
|
1531
|
+
return this.pumpModel.performIntent(e);
|
|
1532
|
+
}
|
|
1533
|
+
// -------------------LIFECYCLE----------------------------
|
|
1534
|
+
async init() {
|
|
1535
|
+
this.logger.debug(`initializing lfcv-pump ${this.id}`);
|
|
1536
|
+
}
|
|
1537
|
+
async load() {
|
|
1538
|
+
this.logger.debug(`loading lfcv-pump ${this.id}`);
|
|
1539
|
+
}
|
|
1540
|
+
};
|
|
1541
|
+
Ne = cs([
|
|
1542
|
+
l(Zt)
|
|
1543
|
+
], Ne);
|
|
1544
|
+
const Li = new Ye({
|
|
1545
|
+
class: Ne,
|
|
1546
|
+
type: Zt
|
|
1547
|
+
}), { URL: ds } = h("LFCV-PUMP_SERVICE"), { getAll: us } = f.build({
|
|
1548
|
+
basePath: `${ds}/api/lfcv-pump`
|
|
1549
|
+
}), ps = p.createLogger({
|
|
1550
|
+
name: "lfcv-pump-service",
|
|
1551
|
+
group: "Services"
|
|
1552
|
+
}), gs = async () => (ps.debug("sending GET for lfcv-pump"), await us({})), Di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1553
|
+
__proto__: null,
|
|
1554
|
+
getLfcvPumps: gs
|
|
1555
|
+
}, Symbol.toStringTag, { value: "Module" })), { URL: rt } = h("LOCKOUT_SERVICE"), { postModel: er } = f.build({
|
|
1556
|
+
basePath: `${rt}/api/app/kosdev.ddk/lockout`
|
|
1557
|
+
}), tr = p.createLogger({ name: "lockout-service", group: "Services" }), hs = async () => (tr.info("lock"), await er({
|
|
1558
|
+
model: {},
|
|
1559
|
+
urlOverride: `${rt}/api/app/kosdev.ddk/lockout/lockNow`
|
|
1560
|
+
})), rr = async (e) => {
|
|
1561
|
+
tr.info("unlock");
|
|
1562
|
+
const t = await er({
|
|
1563
|
+
model: {},
|
|
1564
|
+
urlOverride: `${rt}/api/app/kosdev.ddk/lockout/unlock/${e}`
|
|
1565
|
+
});
|
|
1566
|
+
return t == null ? void 0 : t.data;
|
|
1567
|
+
}, ki = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1568
|
+
__proto__: null,
|
|
1569
|
+
lock: hs,
|
|
1570
|
+
unlock: rr
|
|
1571
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1572
|
+
var fs = Object.defineProperty, ms = Object.getOwnPropertyDescriptor, U = (e, t, r, s) => {
|
|
1573
|
+
for (var o = s > 1 ? void 0 : s ? ms(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
1574
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
1575
|
+
return s && o && fs(t, r, o), o;
|
|
1576
|
+
};
|
|
1577
|
+
const or = "lockout-model", ys = [
|
|
1578
|
+
{ day: "monday", lock: "dayWiseLockConfigMap.Mon.enabled", open: "dayWiseLockConfigMap.Mon.unlockTime", close: "dayWiseLockConfigMap.Mon.lockTime" },
|
|
1579
|
+
{ day: "tuesday", lock: "dayWiseLockConfigMap.Tue.enabled", open: "dayWiseLockConfigMap.Tue.unlockTime", close: "dayWiseLockConfigMap.Tue.lockTime" },
|
|
1580
|
+
{ day: "wednesday", lock: "dayWiseLockConfigMap.Wed.enabled", open: "dayWiseLockConfigMap.Wed.unlockTime", close: "dayWiseLockConfigMap.Wed.lockTime" },
|
|
1581
|
+
{ day: "thursday", lock: "dayWiseLockConfigMap.Thu.enabled", open: "dayWiseLockConfigMap.Thu.unlockTime", close: "dayWiseLockConfigMap.Thu.lockTime" },
|
|
1582
|
+
{ day: "friday", lock: "dayWiseLockConfigMap.Fri.enabled", open: "dayWiseLockConfigMap.Fri.unlockTime", close: "dayWiseLockConfigMap.Fri.lockTime" },
|
|
1583
|
+
{ day: "saturday", lock: "dayWiseLockConfigMap.Sat.enabled", open: "dayWiseLockConfigMap.Sat.unlockTime", close: "dayWiseLockConfigMap.Sat.lockTime" },
|
|
1584
|
+
{ day: "sunday", lock: "dayWiseLockConfigMap.Sun.enabled", open: "dayWiseLockConfigMap.Sun.unlockTime", close: "dayWiseLockConfigMap.Sun.lockTime" }
|
|
1585
|
+
];
|
|
1586
|
+
let M = class {
|
|
1587
|
+
constructor(e, t, r) {
|
|
1588
|
+
i(this, "id");
|
|
1589
|
+
i(this, "logger");
|
|
1590
|
+
i(this, "dayEnabledList", [
|
|
1591
|
+
"dayWiseLockConfigMap.Sun.enabled",
|
|
1592
|
+
"dayWiseLockConfigMap.Mon.enabled",
|
|
1593
|
+
"dayWiseLockConfigMap.Tue.enabled",
|
|
1594
|
+
"dayWiseLockConfigMap.Wed.enabled",
|
|
1595
|
+
"dayWiseLockConfigMap.Thu.enabled",
|
|
1596
|
+
"dayWiseLockConfigMap.Fri.enabled",
|
|
1597
|
+
"dayWiseLockConfigMap.Sat.enabled"
|
|
1598
|
+
]);
|
|
1599
|
+
i(this, "dayOpenAtList", [
|
|
1600
|
+
"dayWiseLockConfigMap.Sun.unlockTime",
|
|
1601
|
+
"dayWiseLockConfigMap.Mon.unlockTime",
|
|
1602
|
+
"dayWiseLockConfigMap.Tue.unlockTime",
|
|
1603
|
+
"dayWiseLockConfigMap.Wed.unlockTime",
|
|
1604
|
+
"dayWiseLockConfigMap.Thu.unlockTime",
|
|
1605
|
+
"dayWiseLockConfigMap.Fri.unlockTime",
|
|
1606
|
+
"dayWiseLockConfigMap.Sat.unlockTime"
|
|
1607
|
+
]);
|
|
1608
|
+
i(this, "dayCloseAtList", [
|
|
1609
|
+
"dayWiseLockConfigMap.Sun.lockTime",
|
|
1610
|
+
"dayWiseLockConfigMap.Mon.lockTime",
|
|
1611
|
+
"dayWiseLockConfigMap.Tue.lockTime",
|
|
1612
|
+
"dayWiseLockConfigMap.Wed.lockTime",
|
|
1613
|
+
"dayWiseLockConfigMap.Thu.lockTime",
|
|
1614
|
+
"dayWiseLockConfigMap.Fri.lockTime",
|
|
1615
|
+
"dayWiseLockConfigMap.Sat.lockTime"
|
|
1616
|
+
]);
|
|
1617
|
+
i(this, "saveMap");
|
|
1618
|
+
i(this, "pin");
|
|
1619
|
+
i(this, "nextLockSkipped");
|
|
1620
|
+
i(this, "nextLockTime");
|
|
1621
|
+
i(this, "nextUnLockTime");
|
|
1622
|
+
i(this, "cuiLockout");
|
|
1623
|
+
this.id = e, this.logger = r.logger, this.saveMap = /* @__PURE__ */ new Map();
|
|
1624
|
+
}
|
|
1625
|
+
get enabled() {
|
|
1626
|
+
const e = this.getProp(
|
|
1627
|
+
"oneTimeLockConfig.lockTime"
|
|
1628
|
+
), t = e !== void 0 && e !== "", r = this.getProp("lockScheduleEnabled");
|
|
1629
|
+
return t || r;
|
|
1630
|
+
}
|
|
1631
|
+
get schedule() {
|
|
1632
|
+
return ys;
|
|
1633
|
+
}
|
|
1634
|
+
getProp(e) {
|
|
1635
|
+
return this.saveMap.get(e);
|
|
1636
|
+
}
|
|
1637
|
+
setProp(e, t) {
|
|
1638
|
+
this.saveMap.set(e, t);
|
|
1639
|
+
}
|
|
1640
|
+
// Skip or resume the next lock...
|
|
1641
|
+
toggleSkip() {
|
|
1642
|
+
if (this.nextLockSkipped.value === "0") {
|
|
1643
|
+
const t = this.nextLockTime.value;
|
|
1644
|
+
t !== void 0 && this.nextLockSkipped.updateProperty(t);
|
|
1645
|
+
} else
|
|
1646
|
+
this.nextLockSkipped.updateProperty("0");
|
|
1647
|
+
}
|
|
1648
|
+
async unlock(e) {
|
|
1649
|
+
return await rr(e);
|
|
1650
|
+
}
|
|
1651
|
+
async save() {
|
|
1652
|
+
return this.saveMap.forEach((e, t) => {
|
|
1653
|
+
e !== this.cuiLockout.props[t] && (this.cuiLockout.props[t] = e);
|
|
1654
|
+
}), this.cuiLockout.updateConfigBean();
|
|
1655
|
+
}
|
|
1656
|
+
reset() {
|
|
1657
|
+
this.cuiLockout.props.entries.forEach(
|
|
1658
|
+
([e, t]) => this.saveMap.set(e, t)
|
|
1659
|
+
);
|
|
1660
|
+
}
|
|
1661
|
+
// -------------------LIFECYCLE----------------------------
|
|
1662
|
+
async init() {
|
|
1663
|
+
this.logger.debug(`initializing lockout ${this.id}`), this.cuiLockout.props.entries.forEach(
|
|
1664
|
+
([e, t]) => this.saveMap.set(e, t)
|
|
1665
|
+
);
|
|
1666
|
+
}
|
|
1667
|
+
async load() {
|
|
1668
|
+
this.logger.debug(`loading lockout ${this.id}`);
|
|
1669
|
+
}
|
|
1670
|
+
};
|
|
1671
|
+
U([
|
|
1672
|
+
u({
|
|
1673
|
+
path: "app:kosdev.ddk:service:cuiLockout",
|
|
1674
|
+
attribute: "pin"
|
|
1675
|
+
})
|
|
1676
|
+
], M.prototype, "pin", 2);
|
|
1677
|
+
U([
|
|
1678
|
+
u({
|
|
1679
|
+
path: "app:kosdev.ddk:service:cuiLockout",
|
|
1680
|
+
attribute: "nextLockSkipped"
|
|
1681
|
+
})
|
|
1682
|
+
], M.prototype, "nextLockSkipped", 2);
|
|
1683
|
+
U([
|
|
1684
|
+
u({
|
|
1685
|
+
path: "app:kosdev.ddk:service:cuiLockout",
|
|
1686
|
+
attribute: "nextLockTime"
|
|
1687
|
+
})
|
|
1688
|
+
], M.prototype, "nextLockTime", 2);
|
|
1689
|
+
U([
|
|
1690
|
+
u({
|
|
1691
|
+
path: "app:kosdev.ddk:service:cuiLockout",
|
|
1692
|
+
attribute: "nextUnLockTime"
|
|
1693
|
+
})
|
|
1694
|
+
], M.prototype, "nextUnLockTime", 2);
|
|
1695
|
+
U([
|
|
1696
|
+
Fr({ path: "app:kosdev.ddk:service:cuiLockout" })
|
|
1697
|
+
], M.prototype, "cuiLockout", 2);
|
|
1698
|
+
M = U([
|
|
1699
|
+
l(or)
|
|
1700
|
+
], M);
|
|
1701
|
+
const Ii = new le({
|
|
1702
|
+
class: M,
|
|
1703
|
+
type: or
|
|
1704
|
+
}), bs = async (e, t) => await we.bulkResolveTroubles(
|
|
1705
|
+
e,
|
|
1706
|
+
t
|
|
1707
|
+
);
|
|
1708
|
+
var vs = Object.defineProperty, _s = Object.getOwnPropertyDescriptor, Fe = (e, t, r, s) => {
|
|
1709
|
+
for (var o = s > 1 ? void 0 : s ? _s(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
1710
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
1711
|
+
return s && o && vs(t, r, o), o;
|
|
1712
|
+
};
|
|
1713
|
+
const X = "macro-assignment-model", pt = "PurgeTrouble", $s = "PrimeTrouble";
|
|
1714
|
+
let R = class {
|
|
1715
|
+
constructor(e, t, r) {
|
|
1716
|
+
i(this, "id");
|
|
1717
|
+
i(this, "logger");
|
|
1718
|
+
/**
|
|
1719
|
+
* futureHandler is used to handle async operations
|
|
1720
|
+
*/
|
|
1721
|
+
i(this, "futureHandler");
|
|
1722
|
+
i(this, "holders");
|
|
1723
|
+
i(this, "ingredients");
|
|
1724
|
+
this.id = e, this.futureHandler = new ce(), this.logger = r.logger;
|
|
1725
|
+
}
|
|
1726
|
+
/**
|
|
1727
|
+
* shortcut to the current running future
|
|
1728
|
+
*/
|
|
1729
|
+
get future() {
|
|
1730
|
+
return this.futureHandler.future;
|
|
1731
|
+
}
|
|
1732
|
+
/**
|
|
1733
|
+
* Represents the subset of holder that are identified as holding macros.
|
|
1734
|
+
*
|
|
1735
|
+
* This is determined by the group property of the holder which is determined
|
|
1736
|
+
* by the holders position in the dispenser assembly.
|
|
1737
|
+
*/
|
|
1738
|
+
get macroHolders() {
|
|
1739
|
+
return this.holders.holders.getIndexByKey("group", "macros").sort((e, t) => e.name < t.name ? -1 : e.name > t.name ? 1 : 0);
|
|
1740
|
+
}
|
|
1741
|
+
/**
|
|
1742
|
+
* Returns true if there are any macro holders in the dispenser assembly
|
|
1743
|
+
*/
|
|
1744
|
+
get hasMacroHolders() {
|
|
1745
|
+
return this.macroHolders.length > 0;
|
|
1746
|
+
}
|
|
1747
|
+
/**
|
|
1748
|
+
* Returns all of the purge troubles for the macro holders.
|
|
1749
|
+
*
|
|
1750
|
+
* Relying on the indexing of troubles by type to find the purge troubles.
|
|
1751
|
+
*/
|
|
1752
|
+
get holderPurgeTroubles() {
|
|
1753
|
+
return this.macroHolders.reduce((t, r) => {
|
|
1754
|
+
const s = r.troublesByType[pt] || [];
|
|
1755
|
+
return t = [...t, ...s], t;
|
|
1756
|
+
}, []);
|
|
1757
|
+
}
|
|
1758
|
+
get holderPrimeTroubles() {
|
|
1759
|
+
return this.macroHolders.reduce((t, r) => {
|
|
1760
|
+
const s = r.troublesByType[$s] || [];
|
|
1761
|
+
return t = [...t, ...s], t;
|
|
1762
|
+
}, []);
|
|
1763
|
+
}
|
|
1764
|
+
/**
|
|
1765
|
+
* Returns true if there are any purge troubles for the macro holders.
|
|
1766
|
+
*/
|
|
1767
|
+
get hasHolderPurgeTroubles() {
|
|
1768
|
+
return this.holderPurgeTroubles.length > 0;
|
|
1769
|
+
}
|
|
1770
|
+
get hasHolderPrimeTroubles() {
|
|
1771
|
+
return this.holderPrimeTroubles.length > 0;
|
|
1772
|
+
}
|
|
1773
|
+
/**
|
|
1774
|
+
* Represents the subset of ingredients that are identified as macros
|
|
1775
|
+
*
|
|
1776
|
+
* This is determined by the `ingredientMacro` property of the ingredient
|
|
1777
|
+
* which is derived from the `bib` and `sweetener` properties of the ingredient.
|
|
1778
|
+
*
|
|
1779
|
+
* The `ingredientMacro` property is set by the `ingredientDataMapper` extension point.
|
|
1780
|
+
*
|
|
1781
|
+
* The macro ingredients are indexed by the `ingredientIndexExtension` extension point using
|
|
1782
|
+
* the `ingredientMacro` property.
|
|
1783
|
+
*/
|
|
1784
|
+
get macroIngredients() {
|
|
1785
|
+
return this.ingredients.ingredients.getIndexByKey("macro", "macro");
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1788
|
+
* Returns true if there are any macro ingredients in the dispenser brandset
|
|
1789
|
+
*/
|
|
1790
|
+
get hasMacroIngredients() {
|
|
1791
|
+
return this.macroIngredients.length > 0;
|
|
1792
|
+
}
|
|
1793
|
+
async resolveAll(e, t) {
|
|
1794
|
+
if (!t)
|
|
1795
|
+
throw new Error("No tracker provided");
|
|
1796
|
+
const s = (e === pt ? this.holderPurgeTroubles : this.holderPrimeTroubles).map((a) => a.rawId);
|
|
1797
|
+
return await bs(s, t);
|
|
1798
|
+
}
|
|
1799
|
+
};
|
|
1800
|
+
Fe([
|
|
1801
|
+
g({ modelType: jr.type })
|
|
1802
|
+
], R.prototype, "holders", 2);
|
|
1803
|
+
Fe([
|
|
1804
|
+
g({ modelType: Ur.type })
|
|
1805
|
+
], R.prototype, "ingredients", 2);
|
|
1806
|
+
Fe([
|
|
1807
|
+
_()
|
|
1808
|
+
], R.prototype, "resolveAll", 1);
|
|
1809
|
+
R = Fe([
|
|
1810
|
+
l(X)
|
|
1811
|
+
], R);
|
|
1812
|
+
const Ts = {
|
|
1813
|
+
registration: {
|
|
1814
|
+
[X]: {
|
|
1815
|
+
class: R,
|
|
1816
|
+
singleton: !0
|
|
1817
|
+
}
|
|
1818
|
+
},
|
|
1819
|
+
type: X,
|
|
1820
|
+
predicate: c(X),
|
|
1821
|
+
factory: d.Singleton.create(
|
|
1822
|
+
X
|
|
1823
|
+
)
|
|
1824
|
+
};
|
|
1825
|
+
var Ps = Object.defineProperty, Os = Object.getOwnPropertyDescriptor, Ms = (e, t, r, s) => {
|
|
1826
|
+
for (var o = s > 1 ? void 0 : s ? Os(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
1827
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
1828
|
+
return s && o && Ps(t, r, o), o;
|
|
1829
|
+
};
|
|
1830
|
+
const J = "network-test-model";
|
|
1831
|
+
let ze = class {
|
|
1832
|
+
constructor(e, t, r) {
|
|
1833
|
+
i(this, "id");
|
|
1834
|
+
i(this, "group");
|
|
1835
|
+
i(this, "passed");
|
|
1836
|
+
i(this, "inProgress");
|
|
1837
|
+
i(this, "failureTime");
|
|
1838
|
+
i(this, "timestamp");
|
|
1839
|
+
i(this, "name");
|
|
1840
|
+
i(this, "results");
|
|
1841
|
+
i(this, "logger");
|
|
1842
|
+
this.id = e, this.logger = r.logger, this.group = t.group, this.passed = !1, this.inProgress = !1, this.name = t.name, this.results = [];
|
|
1843
|
+
}
|
|
1844
|
+
updateModel(e) {
|
|
1845
|
+
this.group = e.group, this.name = e.name, this.passed = e.passed, this.failureTime = e.failureTime, this.inProgress = e.inProgress, this.timestamp = e.timestamp, this.results = e.results;
|
|
1846
|
+
}
|
|
1847
|
+
// -------------------LIFECYCLE----------------------------
|
|
1848
|
+
async init() {
|
|
1849
|
+
this.logger.debug(`initializing network-test ${this.id}`);
|
|
1850
|
+
}
|
|
1851
|
+
async load() {
|
|
1852
|
+
this.logger.debug(`loading network-test ${this.id}`);
|
|
1853
|
+
}
|
|
1854
|
+
};
|
|
1855
|
+
ze = Ms([
|
|
1856
|
+
l(J)
|
|
1857
|
+
], ze);
|
|
1858
|
+
const sr = {
|
|
1859
|
+
registration: {
|
|
1860
|
+
[J]: {
|
|
1861
|
+
class: ze,
|
|
1862
|
+
singleton: !1
|
|
1863
|
+
}
|
|
1864
|
+
},
|
|
1865
|
+
type: J,
|
|
1866
|
+
predicate: c(J),
|
|
1867
|
+
factory: d.Factory.create(J)
|
|
1868
|
+
}, { URL: Ae } = h("NETWORK-TEST_SERVICE"), { getAll: Ss, getOne: ir } = f.build({
|
|
1869
|
+
basePath: `${Ae}/api/app/ncui/network/tests`
|
|
1870
|
+
}), ws = p.createLogger({
|
|
1871
|
+
name: "network-test-service",
|
|
1872
|
+
group: "Services"
|
|
1873
|
+
}), nr = async () => {
|
|
1874
|
+
ws.debug("sending GET for network-test");
|
|
1875
|
+
const e = await Ss({
|
|
1876
|
+
urlOverride: `${Ae}/api/app/kosdev.ddk/network/tests`
|
|
1877
|
+
});
|
|
1878
|
+
return e == null ? void 0 : e.data;
|
|
1879
|
+
}, ar = async () => {
|
|
1880
|
+
const e = await ir({
|
|
1881
|
+
urlOverride: `${Ae}/api/app/kosdev.ddk/network/reports`
|
|
1882
|
+
});
|
|
1883
|
+
return e == null ? void 0 : e.data;
|
|
1884
|
+
}, lr = async (e, t) => await ir({
|
|
1885
|
+
urlOverride: `${Ae}/api/app/kosdev.ddk/network/tests/run/group/${e}`,
|
|
1886
|
+
tracker: t
|
|
1887
|
+
}), Ri = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1888
|
+
__proto__: null,
|
|
1889
|
+
getNetworkTests: nr,
|
|
1890
|
+
getTestsReports: ar,
|
|
1891
|
+
performGroupTest: lr
|
|
1892
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1893
|
+
var Es = Object.defineProperty, Cs = Object.getOwnPropertyDescriptor, ot = (e, t, r, s) => {
|
|
1894
|
+
for (var o = s > 1 ? void 0 : s ? Cs(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
1895
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
1896
|
+
return s && o && Es(t, r, o), o;
|
|
1897
|
+
};
|
|
1898
|
+
const Z = "network-test-container-model";
|
|
1899
|
+
let ae = class {
|
|
1900
|
+
constructor(e, t, r) {
|
|
1901
|
+
i(this, "id");
|
|
1902
|
+
i(this, "logger");
|
|
1903
|
+
i(this, "lastTested");
|
|
1904
|
+
i(this, "futureHandler");
|
|
1905
|
+
i(this, "models");
|
|
1906
|
+
this.id = e, this.logger = r.logger, this.futureHandler = new ce(this), this.models = new Ge({
|
|
1907
|
+
parentId: e,
|
|
1908
|
+
indexMap: {
|
|
1909
|
+
group: "group"
|
|
1910
|
+
}
|
|
1911
|
+
}), this.lastTested = /* @__PURE__ */ new Date("default");
|
|
1912
|
+
}
|
|
1913
|
+
get data() {
|
|
1914
|
+
return this.models.data;
|
|
1915
|
+
}
|
|
1916
|
+
addModel(e) {
|
|
1917
|
+
this.models.addModel(e);
|
|
1918
|
+
}
|
|
1919
|
+
removeModel(e) {
|
|
1920
|
+
this.models.removeModel(e);
|
|
1921
|
+
}
|
|
1922
|
+
getModel(e) {
|
|
1923
|
+
return this.models.getModel(e);
|
|
1924
|
+
}
|
|
1925
|
+
// -------------------LIFECYCLE----------------------------
|
|
1926
|
+
async init() {
|
|
1927
|
+
this.logger.debug(
|
|
1928
|
+
`initializing network-test-container container ${this.id}`
|
|
1929
|
+
);
|
|
1930
|
+
}
|
|
1931
|
+
getLastTested(e) {
|
|
1932
|
+
const t = this.models.getIndexByKey("group", e).map((s) => s.timestamp && new Date(s.timestamp)), r = Math.max(
|
|
1933
|
+
...t.map((s) => s ? s.getTime() : 0)
|
|
1934
|
+
);
|
|
1935
|
+
return r ? os(new Date(r)) : "";
|
|
1936
|
+
}
|
|
1937
|
+
async load() {
|
|
1938
|
+
this.logger.debug(`loading network-test-container container ${this.id}`);
|
|
1939
|
+
const e = await nr(), t = await ar();
|
|
1940
|
+
e && e.forEach((r) => {
|
|
1941
|
+
const s = sr.factory(r.id)(r);
|
|
1942
|
+
this.addModel(s);
|
|
1943
|
+
}), e && t && e.forEach((r) => {
|
|
1944
|
+
const s = t == null ? void 0 : t[r.group], o = s == null ? void 0 : s[r.id], a = this.getModel(r.id);
|
|
1945
|
+
if (a && o) {
|
|
1946
|
+
const n = {
|
|
1947
|
+
group: o.group,
|
|
1948
|
+
name: o.name,
|
|
1949
|
+
passed: o.passed,
|
|
1950
|
+
failureTime: o.failureTime ? new Date(o.failureTime) : void 0,
|
|
1951
|
+
inProgress: o.inProgress,
|
|
1952
|
+
timestamp: new Date(o.timestamp),
|
|
1953
|
+
results: o.results
|
|
1954
|
+
};
|
|
1955
|
+
a.updateModel(n);
|
|
1956
|
+
}
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
async performTest(e, t) {
|
|
1960
|
+
if (!t)
|
|
1961
|
+
throw new Error("No tracker provided");
|
|
1962
|
+
const r = await lr(e, t);
|
|
1963
|
+
return r == null ? void 0 : r.data;
|
|
1964
|
+
}
|
|
1965
|
+
onFutureUpdate(e) {
|
|
1966
|
+
const { clientData: t } = e;
|
|
1967
|
+
t && t.forEach((r) => {
|
|
1968
|
+
const s = this.getModel(r.id);
|
|
1969
|
+
if (y(() => {
|
|
1970
|
+
this.lastTested = this.lastTested > new Date(r.timestamp) ? this.lastTested : new Date(r.timestamp);
|
|
1971
|
+
}), s) {
|
|
1972
|
+
const o = {
|
|
1973
|
+
group: r.group,
|
|
1974
|
+
name: r.name,
|
|
1975
|
+
passed: r.passed,
|
|
1976
|
+
failureTime: r.failureTime ? new Date(r.failureTime) : void 0,
|
|
1977
|
+
inProgress: r.inProgress,
|
|
1978
|
+
timestamp: new Date(r.timestamp),
|
|
1979
|
+
results: r.results
|
|
1980
|
+
};
|
|
1981
|
+
y(() => {
|
|
1982
|
+
s.updateModel(o);
|
|
1983
|
+
});
|
|
1984
|
+
}
|
|
1985
|
+
});
|
|
1986
|
+
}
|
|
1987
|
+
};
|
|
1988
|
+
ot([
|
|
1989
|
+
Se
|
|
1990
|
+
], ae.prototype, "models", 2);
|
|
1991
|
+
ot([
|
|
1992
|
+
_()
|
|
1993
|
+
], ae.prototype, "performTest", 1);
|
|
1994
|
+
ae = ot([
|
|
1995
|
+
l(Z)
|
|
1996
|
+
], ae);
|
|
1997
|
+
const Ls = {
|
|
1998
|
+
registration: {
|
|
1999
|
+
[Z]: {
|
|
2000
|
+
class: ae,
|
|
2001
|
+
singleton: !0
|
|
2002
|
+
},
|
|
2003
|
+
...sr.registration
|
|
2004
|
+
},
|
|
2005
|
+
type: Z,
|
|
2006
|
+
predicate: c(Z),
|
|
2007
|
+
factory: d.Singleton.create(Z)
|
|
2008
|
+
};
|
|
2009
|
+
var Ds = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, cr = (e, t, r, s) => {
|
|
2010
|
+
for (var o = s > 1 ? void 0 : s ? ks(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
2011
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
2012
|
+
return s && o && Ds(t, r, o), o;
|
|
2013
|
+
};
|
|
2014
|
+
const ee = "nutritive-sweetener-model";
|
|
2015
|
+
let _e = class {
|
|
2016
|
+
constructor(e, t, r) {
|
|
2017
|
+
i(this, "id");
|
|
2018
|
+
i(this, "assemblyModel");
|
|
2019
|
+
i(this, "logger");
|
|
2020
|
+
this.id = e, this.logger = r.logger;
|
|
2021
|
+
}
|
|
2022
|
+
getHolder() {
|
|
2023
|
+
return this.assemblyModel.getHoldersByGroup("ns")[0];
|
|
2024
|
+
}
|
|
2025
|
+
getPump() {
|
|
2026
|
+
return this.getHolder().pumps.data[0];
|
|
2027
|
+
}
|
|
2028
|
+
// -------------------LIFECYCLE----------------------------
|
|
2029
|
+
async init() {
|
|
2030
|
+
this.logger.debug(`initializing nutritive-sweetener ${this.id}`);
|
|
2031
|
+
}
|
|
2032
|
+
async load() {
|
|
2033
|
+
this.logger.debug(`loading nutritive-sweetener ${this.id}`);
|
|
2034
|
+
}
|
|
2035
|
+
};
|
|
2036
|
+
cr([
|
|
2037
|
+
g({ modelType: Ce.type })
|
|
2038
|
+
], _e.prototype, "assemblyModel", 2);
|
|
2039
|
+
_e = cr([
|
|
2040
|
+
l(ee)
|
|
2041
|
+
], _e);
|
|
2042
|
+
const Is = {
|
|
2043
|
+
registration: {
|
|
2044
|
+
[ee]: {
|
|
2045
|
+
class: _e,
|
|
2046
|
+
singleton: !1
|
|
2047
|
+
}
|
|
2048
|
+
},
|
|
2049
|
+
type: ee,
|
|
2050
|
+
predicate: c(ee),
|
|
2051
|
+
factory: d.Factory.create(ee)
|
|
2052
|
+
};
|
|
2053
|
+
var Rs = Object.defineProperty, Fs = Object.getOwnPropertyDescriptor, dr = (e, t, r, s) => {
|
|
2054
|
+
for (var o = s > 1 ? void 0 : s ? Fs(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
2055
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
2056
|
+
return s && o && Rs(t, r, o), o;
|
|
2057
|
+
};
|
|
2058
|
+
const te = "plain-water-model";
|
|
2059
|
+
let $e = class {
|
|
2060
|
+
constructor(e, t, r) {
|
|
2061
|
+
i(this, "id");
|
|
2062
|
+
i(this, "assemblyModel");
|
|
2063
|
+
i(this, "logger");
|
|
2064
|
+
this.id = e, this.logger = r.logger;
|
|
2065
|
+
}
|
|
2066
|
+
getHolder() {
|
|
2067
|
+
return this.assemblyModel.getHoldersByGroup("water")[0];
|
|
2068
|
+
}
|
|
2069
|
+
getPump() {
|
|
2070
|
+
var s, o;
|
|
2071
|
+
const e = this.getHolder(), t = (o = (s = e == null ? void 0 : e.pumps) == null ? void 0 : s.data) == null ? void 0 : o[0];
|
|
2072
|
+
return ht(t, Ut.type);
|
|
2073
|
+
}
|
|
2074
|
+
// -------------------LIFECYCLE----------------------------
|
|
2075
|
+
async init() {
|
|
2076
|
+
this.logger.debug(`initializing plain-water ${this.id}`);
|
|
2077
|
+
}
|
|
2078
|
+
async load() {
|
|
2079
|
+
this.logger.debug(`loading plain-water ${this.id}`);
|
|
2080
|
+
}
|
|
2081
|
+
};
|
|
2082
|
+
dr([
|
|
2083
|
+
g({ modelType: Ce.type })
|
|
2084
|
+
], $e.prototype, "assemblyModel", 2);
|
|
2085
|
+
$e = dr([
|
|
2086
|
+
l(te)
|
|
2087
|
+
], $e);
|
|
2088
|
+
const As = {
|
|
2089
|
+
registration: {
|
|
2090
|
+
[te]: {
|
|
2091
|
+
class: $e,
|
|
2092
|
+
singleton: !1
|
|
2093
|
+
}
|
|
2094
|
+
},
|
|
2095
|
+
type: te,
|
|
2096
|
+
predicate: c(te),
|
|
2097
|
+
factory: d.Factory.create(te)
|
|
2098
|
+
}, { URL: ur } = h("REBOOT_SERVICE"), { postModel: xs } = f.build({
|
|
2099
|
+
basePath: `${ur}/api/reboot`
|
|
2100
|
+
}), js = p.createLogger({ name: "reboot-service", group: "Services" }), pr = async () => (js.debug("sending POST call for Reboot Dispenser"), await xs({
|
|
2101
|
+
urlOverride: `${ur}/api/app/kosdev.ddk/ncui/reboot`,
|
|
2102
|
+
model: {}
|
|
2103
|
+
})), Fi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2104
|
+
__proto__: null,
|
|
2105
|
+
rebootDispenser: pr
|
|
2106
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2107
|
+
var Us = Object.defineProperty, Vs = Object.getOwnPropertyDescriptor, Hs = (e, t, r, s) => {
|
|
2108
|
+
for (var o = s > 1 ? void 0 : s ? Vs(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
2109
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
2110
|
+
return s && o && Us(t, r, o), o;
|
|
2111
|
+
};
|
|
2112
|
+
const re = "reboot-model";
|
|
2113
|
+
let Be = class {
|
|
2114
|
+
constructor(e, t, r) {
|
|
2115
|
+
i(this, "id");
|
|
2116
|
+
i(this, "logger");
|
|
2117
|
+
this.id = e, this.logger = r.logger;
|
|
2118
|
+
}
|
|
2119
|
+
async completeReboot() {
|
|
2120
|
+
await pr();
|
|
2121
|
+
}
|
|
2122
|
+
updateModel() {
|
|
2123
|
+
}
|
|
2124
|
+
// -------------------LIFECYCLE----------------------------
|
|
2125
|
+
async init() {
|
|
2126
|
+
this.logger.debug(`initializing reboot ${this.id}`);
|
|
2127
|
+
}
|
|
2128
|
+
async load() {
|
|
2129
|
+
this.logger.debug(`loading reboot ${this.id}`);
|
|
2130
|
+
}
|
|
2131
|
+
};
|
|
2132
|
+
Be = Hs([
|
|
2133
|
+
l(re)
|
|
2134
|
+
], Be);
|
|
2135
|
+
const Ws = {
|
|
2136
|
+
registration: {
|
|
2137
|
+
[re]: {
|
|
2138
|
+
class: Be,
|
|
2139
|
+
singleton: !1
|
|
2140
|
+
}
|
|
2141
|
+
},
|
|
2142
|
+
type: re,
|
|
2143
|
+
predicate: c(re),
|
|
2144
|
+
factory: d.Factory.create(re)
|
|
2145
|
+
};
|
|
2146
|
+
var Ns = Object.defineProperty, zs = Object.getOwnPropertyDescriptor, T = (e, t, r, s) => {
|
|
2147
|
+
for (var o = s > 1 ? void 0 : s ? zs(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
2148
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
2149
|
+
return s && o && Ns(t, r, o), o;
|
|
2150
|
+
};
|
|
2151
|
+
const oe = "settings-model";
|
|
2152
|
+
let v = class {
|
|
2153
|
+
constructor(e, t, r) {
|
|
2154
|
+
i(this, "id");
|
|
2155
|
+
i(this, "logger");
|
|
2156
|
+
i(this, "ncuiLanguageData");
|
|
2157
|
+
i(this, "resolveDelaysMs");
|
|
2158
|
+
i(this, "dateFormat");
|
|
2159
|
+
i(this, "timeFormat");
|
|
2160
|
+
i(this, "hidePlainWaterBev");
|
|
2161
|
+
i(this, "hideCarbWaterBev");
|
|
2162
|
+
i(this, "ncuiLanguage");
|
|
2163
|
+
i(this, "name");
|
|
2164
|
+
i(this, "activateAndRebootTime");
|
|
2165
|
+
this.id = e, this.logger = r.logger;
|
|
2166
|
+
}
|
|
2167
|
+
updateModel(e) {
|
|
2168
|
+
}
|
|
2169
|
+
// -------------------LIFECYCLE----------------------------
|
|
2170
|
+
async init() {
|
|
2171
|
+
this.logger.debug(`initializing settings ${this.id}`);
|
|
2172
|
+
}
|
|
2173
|
+
async getNcuiLanguageList() {
|
|
2174
|
+
this.ncuiLanguageData = {
|
|
2175
|
+
status: 200,
|
|
2176
|
+
data: {
|
|
2177
|
+
languages: [
|
|
2178
|
+
{
|
|
2179
|
+
name: "English",
|
|
2180
|
+
locale: "en"
|
|
2181
|
+
}
|
|
2182
|
+
]
|
|
2183
|
+
}
|
|
2184
|
+
};
|
|
2185
|
+
}
|
|
2186
|
+
async load() {
|
|
2187
|
+
this.logger.debug(`loading settings ${this.id}`), this.ncuiLanguageData = {
|
|
2188
|
+
status: 200,
|
|
2189
|
+
data: {
|
|
2190
|
+
languages: [
|
|
2191
|
+
{
|
|
2192
|
+
name: "English",
|
|
2193
|
+
locale: "en"
|
|
2194
|
+
}
|
|
2195
|
+
]
|
|
2196
|
+
}
|
|
2197
|
+
};
|
|
2198
|
+
}
|
|
2199
|
+
};
|
|
2200
|
+
T([
|
|
2201
|
+
u({
|
|
2202
|
+
path: "system:app",
|
|
2203
|
+
attribute: "resolveDelaysMs"
|
|
2204
|
+
// optionsExpander: () => [],
|
|
2205
|
+
})
|
|
2206
|
+
], v.prototype, "resolveDelaysMs", 2);
|
|
2207
|
+
T([
|
|
2208
|
+
u({
|
|
2209
|
+
path: "system:app",
|
|
2210
|
+
attribute: "dateFormat"
|
|
2211
|
+
// optionsExpander: () => [],
|
|
2212
|
+
})
|
|
2213
|
+
], v.prototype, "dateFormat", 2);
|
|
2214
|
+
T([
|
|
2215
|
+
u({
|
|
2216
|
+
path: "system:app",
|
|
2217
|
+
attribute: "timeFormat"
|
|
2218
|
+
// optionsExpander: () => [],
|
|
2219
|
+
})
|
|
2220
|
+
], v.prototype, "timeFormat", 2);
|
|
2221
|
+
T([
|
|
2222
|
+
u({
|
|
2223
|
+
path: "app:kosdev.ddk:app",
|
|
2224
|
+
attribute: "ncui.hidePlainWaterBev"
|
|
2225
|
+
})
|
|
2226
|
+
], v.prototype, "hidePlainWaterBev", 2);
|
|
2227
|
+
T([
|
|
2228
|
+
u({
|
|
2229
|
+
path: "app:kosdev.ddk:app",
|
|
2230
|
+
attribute: "ncui.hideCarbWaterBev"
|
|
2231
|
+
})
|
|
2232
|
+
], v.prototype, "hideCarbWaterBev", 2);
|
|
2233
|
+
T([
|
|
2234
|
+
u({
|
|
2235
|
+
path: "app:kosdev.ddk:app",
|
|
2236
|
+
attribute: "ncui.ncuiLanguage"
|
|
2237
|
+
})
|
|
2238
|
+
], v.prototype, "ncuiLanguage", 2);
|
|
2239
|
+
T([
|
|
2240
|
+
u({
|
|
2241
|
+
path: "kos:device",
|
|
2242
|
+
attribute: "name"
|
|
2243
|
+
})
|
|
2244
|
+
], v.prototype, "name", 2);
|
|
2245
|
+
T([
|
|
2246
|
+
u({
|
|
2247
|
+
path: "kos:service:OTA",
|
|
2248
|
+
attribute: "activateAndRebootTime"
|
|
2249
|
+
})
|
|
2250
|
+
], v.prototype, "activateAndRebootTime", 2);
|
|
2251
|
+
v = T([
|
|
2252
|
+
l(oe)
|
|
2253
|
+
], v);
|
|
2254
|
+
const Bs = {
|
|
2255
|
+
registration: {
|
|
2256
|
+
[oe]: {
|
|
2257
|
+
class: v,
|
|
2258
|
+
singleton: !0
|
|
2259
|
+
}
|
|
2260
|
+
},
|
|
2261
|
+
type: oe,
|
|
2262
|
+
predicate: c(oe),
|
|
2263
|
+
factory: d.Singleton.create(oe)
|
|
2264
|
+
}, { URL: gr } = h("SETTINGS_SERVICE"), { getAll: hr } = f.build({
|
|
2265
|
+
basePath: `${gr}/api/settings`
|
|
2266
|
+
}), Ks = p.createLogger({
|
|
2267
|
+
name: "settings-service",
|
|
2268
|
+
group: "Services"
|
|
2269
|
+
}), Ys = async () => (Ks.debug("sending GET for settings"), await hr({})), Gs = async () => await hr({
|
|
2270
|
+
urlOverride: `${gr}api/app/kosdev.ddk/ncui/languages`
|
|
2271
|
+
}), Ai = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2272
|
+
__proto__: null,
|
|
2273
|
+
getNcuiLanguage: Gs,
|
|
2274
|
+
getSettings: Ys
|
|
2275
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2276
|
+
var qs = Object.defineProperty, Qs = Object.getOwnPropertyDescriptor, Xs = (e, t, r, s) => {
|
|
2277
|
+
for (var o = s > 1 ? void 0 : s ? Qs(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
2278
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
2279
|
+
return s && o && qs(t, r, o), o;
|
|
2280
|
+
};
|
|
2281
|
+
const se = "utilities-model";
|
|
2282
|
+
let Ke = class {
|
|
2283
|
+
constructor(e, t, r) {
|
|
2284
|
+
i(this, "id");
|
|
2285
|
+
i(this, "name");
|
|
2286
|
+
i(this, "options");
|
|
2287
|
+
i(this, "roles");
|
|
2288
|
+
i(this, "columnId");
|
|
2289
|
+
i(this, "logger");
|
|
2290
|
+
this.id = e, this.logger = r.logger, this.name = t.name, this.options = t.options, this.roles = t == null ? void 0 : t.roles, this.columnId = t.columnId;
|
|
2291
|
+
}
|
|
2292
|
+
updateModel(e) {
|
|
2293
|
+
this.name = e.name, this.options = e.options, this.roles = e == null ? void 0 : e.roles;
|
|
2294
|
+
}
|
|
2295
|
+
get titleKey() {
|
|
2296
|
+
return `utility.${this.id}.title`;
|
|
2297
|
+
}
|
|
2298
|
+
get bodyKey() {
|
|
2299
|
+
return `utility.${this.id}.body`;
|
|
2300
|
+
}
|
|
2301
|
+
// -------------------LIFECYCLE----------------------------
|
|
2302
|
+
async init() {
|
|
2303
|
+
this.logger.debug(`initializing utilities ${this.id}`);
|
|
2304
|
+
}
|
|
2305
|
+
async load() {
|
|
2306
|
+
this.logger.debug(`loading utilities ${this.id}`);
|
|
2307
|
+
}
|
|
2308
|
+
};
|
|
2309
|
+
Ke = Xs([
|
|
2310
|
+
l(se)
|
|
2311
|
+
], Ke);
|
|
2312
|
+
const fr = {
|
|
2313
|
+
registration: {
|
|
2314
|
+
[se]: {
|
|
2315
|
+
class: Ke,
|
|
2316
|
+
singleton: !1
|
|
2317
|
+
}
|
|
2318
|
+
},
|
|
2319
|
+
type: se,
|
|
2320
|
+
predicate: c(se),
|
|
2321
|
+
factory: d.Factory.create(se)
|
|
2322
|
+
}, { URL: mr } = h("UTILITIES_SERVICE"), { getAll: Js } = f.build({
|
|
2323
|
+
basePath: `${mr}/api/utilities`
|
|
2324
|
+
}), Zs = p.createLogger({
|
|
2325
|
+
name: "utilities-service",
|
|
2326
|
+
group: "Services"
|
|
2327
|
+
}), yr = async () => {
|
|
2328
|
+
Zs.debug("sending GET for utilities");
|
|
2329
|
+
const e = await Js({
|
|
2330
|
+
urlOverride: `${mr}/api/kos/descriptor/system:app/kondra.ncui.utilities`
|
|
2331
|
+
});
|
|
2332
|
+
return e == null ? void 0 : e.data;
|
|
2333
|
+
}, xi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2334
|
+
__proto__: null,
|
|
2335
|
+
getUtilities: yr
|
|
2336
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2337
|
+
var ei = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, br = (e, t, r, s) => {
|
|
2338
|
+
for (var o = s > 1 ? void 0 : s ? ti(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
2339
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
2340
|
+
return s && o && ei(t, r, o), o;
|
|
2341
|
+
};
|
|
2342
|
+
const ie = "utilities-container-model";
|
|
2343
|
+
let Te = class {
|
|
2344
|
+
constructor(e, t, r) {
|
|
2345
|
+
i(this, "id");
|
|
2346
|
+
i(this, "logger");
|
|
2347
|
+
i(this, "_models");
|
|
2348
|
+
this.id = e, this.logger = r.logger, this._models = new Ge({
|
|
2349
|
+
parentId: e,
|
|
2350
|
+
sortKey: "id",
|
|
2351
|
+
indexMap: {
|
|
2352
|
+
byColumn: "columnId"
|
|
2353
|
+
}
|
|
2354
|
+
});
|
|
2355
|
+
}
|
|
2356
|
+
get data() {
|
|
2357
|
+
return this._models.data;
|
|
2358
|
+
}
|
|
2359
|
+
get models() {
|
|
2360
|
+
return this._models;
|
|
2361
|
+
}
|
|
2362
|
+
get columns() {
|
|
2363
|
+
return this._models.getIndexKeys("byColumn").sort((e, t) => e.localeCompare(t));
|
|
2364
|
+
}
|
|
2365
|
+
addModel(e) {
|
|
2366
|
+
this._models.addModel(e);
|
|
2367
|
+
}
|
|
2368
|
+
removeModel(e) {
|
|
2369
|
+
this._models.removeModel(e);
|
|
2370
|
+
}
|
|
2371
|
+
getModel(e) {
|
|
2372
|
+
return this._models.getModel(e);
|
|
2373
|
+
}
|
|
2374
|
+
getUtilitiesByColumn(e) {
|
|
2375
|
+
return this._models.getIndexByKey("byColumn", e);
|
|
2376
|
+
}
|
|
2377
|
+
// -------------------LIFECYCLE----------------------------
|
|
2378
|
+
async load() {
|
|
2379
|
+
this.logger.debug(`loading utilities-container container ${this.id}`);
|
|
2380
|
+
const e = await yr();
|
|
2381
|
+
e == null || e.forEach((t, r) => {
|
|
2382
|
+
t.forEach((s) => {
|
|
2383
|
+
const o = {
|
|
2384
|
+
...s,
|
|
2385
|
+
columnId: String(r)
|
|
2386
|
+
}, a = fr.factory(s.name)(
|
|
2387
|
+
o
|
|
2388
|
+
);
|
|
2389
|
+
this.addModel(a);
|
|
2390
|
+
});
|
|
2391
|
+
});
|
|
2392
|
+
}
|
|
2393
|
+
};
|
|
2394
|
+
br([
|
|
2395
|
+
Se
|
|
2396
|
+
], Te.prototype, "_models", 2);
|
|
2397
|
+
Te = br([
|
|
2398
|
+
l(ie)
|
|
2399
|
+
], Te);
|
|
2400
|
+
const ri = {
|
|
2401
|
+
registration: {
|
|
2402
|
+
[ie]: {
|
|
2403
|
+
class: Te,
|
|
2404
|
+
singleton: !0
|
|
2405
|
+
},
|
|
2406
|
+
...fr.registration
|
|
2407
|
+
},
|
|
2408
|
+
type: ie,
|
|
2409
|
+
predicate: c(ie),
|
|
2410
|
+
factory: d.Singleton.create(ie)
|
|
2411
|
+
}, ji = {
|
|
2412
|
+
...ho.registration,
|
|
2413
|
+
...et.registration,
|
|
2414
|
+
...Je.registration,
|
|
2415
|
+
...Oo.registration,
|
|
2416
|
+
...tt.registration,
|
|
2417
|
+
...Fo.registration,
|
|
2418
|
+
...Wo.registration,
|
|
2419
|
+
...Qo.registration,
|
|
2420
|
+
...ns.registration,
|
|
2421
|
+
...Ts.registration,
|
|
2422
|
+
...Ls.registration,
|
|
2423
|
+
...Is.registration,
|
|
2424
|
+
...As.registration,
|
|
2425
|
+
...Ws.registration,
|
|
2426
|
+
...Bs.registration,
|
|
2427
|
+
...wt.registration,
|
|
2428
|
+
...ri.registration
|
|
2429
|
+
};
|
|
2430
|
+
var oi = Object.defineProperty, si = Object.getOwnPropertyDescriptor, vr = (e, t, r, s) => {
|
|
2431
|
+
for (var o = s > 1 ? void 0 : s ? si(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
2432
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
2433
|
+
return s && o && oi(t, r, o), o;
|
|
2434
|
+
};
|
|
2435
|
+
const _r = "trouble-action-model";
|
|
2436
|
+
let Pe = class {
|
|
2437
|
+
constructor(e, t, r) {
|
|
2438
|
+
i(this, "id");
|
|
2439
|
+
i(this, "logger");
|
|
2440
|
+
i(this, "troubleContainer");
|
|
2441
|
+
i(this, "disposer");
|
|
2442
|
+
i(this, "state");
|
|
2443
|
+
i(this, "troubleActionData");
|
|
2444
|
+
this.id = e, this.logger = r.logger, this.state = Ar(), this.troubleActionData = t.definitions.reduce((s, o) => (s[o.troubleType] = o, s), {});
|
|
2445
|
+
}
|
|
2446
|
+
// -------------------LIFECYCLE----------------------------
|
|
2447
|
+
get activeTrouble() {
|
|
2448
|
+
const e = Object.keys(this.troubleActionData);
|
|
2449
|
+
if (e.length > 0) {
|
|
2450
|
+
const t = e[0], r = this.troubleContainer.troubles.getIndexByKey(
|
|
2451
|
+
"byType",
|
|
2452
|
+
t
|
|
2453
|
+
);
|
|
2454
|
+
return r.length > 0 ? r[0] : void 0;
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
get activeTroubleType() {
|
|
2458
|
+
var e;
|
|
2459
|
+
return (e = this.activeTrouble) == null ? void 0 : e.type;
|
|
2460
|
+
}
|
|
2461
|
+
async init() {
|
|
2462
|
+
this.logger.debug(`initializing trouble-action ${this.id}`), this.disposer = xr(() => {
|
|
2463
|
+
const e = this.troubleContainer.troubles.data.reduce((t, r) => {
|
|
2464
|
+
const s = r.type;
|
|
2465
|
+
if (this.troubleActionData[s]) {
|
|
2466
|
+
const o = this.troubleActionData[s].stateKey ?? s, a = this.troubleActionData[s].stateValue ?? s;
|
|
2467
|
+
t[o] = a;
|
|
2468
|
+
}
|
|
2469
|
+
return t;
|
|
2470
|
+
}, {});
|
|
2471
|
+
this.state.setValues(e), Object.keys(this.troubleActionData).forEach((t) => {
|
|
2472
|
+
if (this.troubleContainer.troubles.getIndexByKey("byType", t).length === 0) {
|
|
2473
|
+
const r = this.troubleActionData[t].stateKey ?? t;
|
|
2474
|
+
this.state[r] = void 0;
|
|
2475
|
+
}
|
|
2476
|
+
});
|
|
2477
|
+
});
|
|
2478
|
+
}
|
|
2479
|
+
unload() {
|
|
2480
|
+
var e;
|
|
2481
|
+
(e = this.disposer) == null || e.call(this);
|
|
2482
|
+
}
|
|
2483
|
+
async load() {
|
|
2484
|
+
this.logger.debug(`loading trouble-action ${this.id}`);
|
|
2485
|
+
}
|
|
2486
|
+
};
|
|
2487
|
+
vr([
|
|
2488
|
+
g({ modelType: Qe.type })
|
|
2489
|
+
], Pe.prototype, "troubleContainer", 2);
|
|
2490
|
+
Pe = vr([
|
|
2491
|
+
l(_r)
|
|
2492
|
+
], Pe);
|
|
2493
|
+
const Ui = new le({
|
|
2494
|
+
class: Pe,
|
|
2495
|
+
type: _r
|
|
2496
|
+
}), { URL: $r } = h("START_SERVICE"), { getOne: ii } = f.build({
|
|
2497
|
+
basePath: `${$r}/api/start`
|
|
2498
|
+
}), ni = p.createLogger({ name: "start-service", group: "Services" }), Tr = async () => (ni.debug("navigating to NCUI"), await ii({
|
|
2499
|
+
urlOverride: `${$r}/api/app/kosdev.ddk/ncui/open`
|
|
2500
|
+
})), Vi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2501
|
+
__proto__: null,
|
|
2502
|
+
navigateToNCui: Tr
|
|
2503
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2504
|
+
var ai = Object.defineProperty, li = Object.getOwnPropertyDescriptor, Pr = (e, t, r, s) => {
|
|
2505
|
+
for (var o = s > 1 ? void 0 : s ? li(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
2506
|
+
(n = e[a]) && (o = (s ? n(t, r, o) : n(o)) || o);
|
|
2507
|
+
return s && o && ai(t, r, o), o;
|
|
2508
|
+
};
|
|
2509
|
+
const Or = "start-model";
|
|
2510
|
+
let Oe = class {
|
|
2511
|
+
constructor(e, t, r) {
|
|
2512
|
+
i(this, "id");
|
|
2513
|
+
i(this, "logger");
|
|
2514
|
+
i(this, "troubles");
|
|
2515
|
+
this.id = e, this.logger = r.logger;
|
|
2516
|
+
}
|
|
2517
|
+
get firmwareFailed() {
|
|
2518
|
+
return this.troubles.troubles.getIndexByKey(
|
|
2519
|
+
"byType",
|
|
2520
|
+
"FirmwareUpdateFailedTrouble"
|
|
2521
|
+
).length > 0;
|
|
2522
|
+
}
|
|
2523
|
+
get firmwareInProgress() {
|
|
2524
|
+
return this.troubles.troubles.getIndexByKey(
|
|
2525
|
+
"byType",
|
|
2526
|
+
"FirmwareUpdateInProgressTrouble"
|
|
2527
|
+
).length > 0;
|
|
2528
|
+
}
|
|
2529
|
+
async navigate() {
|
|
2530
|
+
await Tr();
|
|
2531
|
+
}
|
|
2532
|
+
// -------------------LIFECYCLE----------------------------
|
|
2533
|
+
async init() {
|
|
2534
|
+
this.logger.debug(`initializing start ${this.id}`);
|
|
2535
|
+
}
|
|
2536
|
+
async load() {
|
|
2537
|
+
this.logger.debug(`loading start ${this.id}`);
|
|
2538
|
+
}
|
|
2539
|
+
};
|
|
2540
|
+
Pr([
|
|
2541
|
+
g({ modelType: Qe.type })
|
|
2542
|
+
], Oe.prototype, "troubles", 2);
|
|
2543
|
+
Oe = Pr([
|
|
2544
|
+
l(Or)
|
|
2545
|
+
], Oe);
|
|
2546
|
+
const Hi = new le({
|
|
2547
|
+
class: Oe,
|
|
2548
|
+
type: Or
|
|
2549
|
+
});
|
|
2550
|
+
export {
|
|
2551
|
+
fi as AgitationControl,
|
|
2552
|
+
ho as Animation,
|
|
2553
|
+
mi as AnimationServices,
|
|
2554
|
+
et as Application,
|
|
2555
|
+
Je as Auth,
|
|
2556
|
+
gi as AuthServices,
|
|
2557
|
+
Oo as CarbWater,
|
|
2558
|
+
vi as CopyLogs,
|
|
2559
|
+
bi as CopyLogsServices,
|
|
2560
|
+
ji as DDKModels,
|
|
2561
|
+
tt as DashboardOperations,
|
|
2562
|
+
_i as DashboardOperationsServices,
|
|
2563
|
+
Fo as Dispenser,
|
|
2564
|
+
Wo as DispenserInfo,
|
|
2565
|
+
Ti as DispenserInfoServices,
|
|
2566
|
+
$i as DispenserServices,
|
|
2567
|
+
Gr as Door,
|
|
2568
|
+
ne as EXTENSION_POINT_DASHBOARD_KEY_FACTORY,
|
|
2569
|
+
Qo as Enrollment,
|
|
2570
|
+
Pi as EnrollmentServices,
|
|
2571
|
+
Ut as FcmPump,
|
|
2572
|
+
yi as FcmPumpServices,
|
|
2573
|
+
ns as IngredientSummary,
|
|
2574
|
+
Li as LfcvPump,
|
|
2575
|
+
Di as LfcvPumpServices,
|
|
2576
|
+
Ii as Lockout,
|
|
2577
|
+
ki as LockoutServices,
|
|
2578
|
+
wi as MACRO_KEYS,
|
|
2579
|
+
Ts as MacroAssignment,
|
|
2580
|
+
sr as NetworkTest,
|
|
2581
|
+
Ls as NetworkTestContainer,
|
|
2582
|
+
Ri as NetworkTestServices,
|
|
2583
|
+
Is as NutritiveSweetener,
|
|
2584
|
+
As as PlainWater,
|
|
2585
|
+
Ws as Reboot,
|
|
2586
|
+
Fi as RebootServices,
|
|
2587
|
+
Bs as Settings,
|
|
2588
|
+
Ai as SettingsServices,
|
|
2589
|
+
St as SetupStep,
|
|
2590
|
+
wt as SetupStepContainer,
|
|
2591
|
+
hi as SetupStepServices,
|
|
2592
|
+
Hi as Start,
|
|
2593
|
+
Vi as StartServices,
|
|
2594
|
+
Vr as TROUBLE_TYPE_PRIME,
|
|
2595
|
+
nt as TROUBLE_TYPE_PURGE,
|
|
2596
|
+
Ui as TroubleActionManager,
|
|
2597
|
+
fr as Utilities,
|
|
2598
|
+
ri as UtilitiesContainer,
|
|
2599
|
+
xi as UtilitiesServices,
|
|
2600
|
+
os as calculateTimeDifference,
|
|
2601
|
+
rs as executeDashboardKeyFactory,
|
|
2602
|
+
Mi as isMacroGroup,
|
|
2603
|
+
Oi as isMicroGroup,
|
|
2604
|
+
Si as macroHolderMap,
|
|
2605
|
+
ts as registerDashboardKeyFactory,
|
|
2606
|
+
Ci as toSeconds,
|
|
2607
|
+
Ei as toTimeComponents,
|
|
2608
|
+
Dt as troubleVisibilityFilter
|
|
2609
|
+
};
|