@kosdev-code/kos-ddk-models 2.1.2 → 3.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.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +3102 -1
- package/index.js.map +1 -0
- package/index.mjs +2190 -1597
- package/index.mjs.map +1 -0
- package/lib/agitation-control/agitation-control-model.d.ts +4 -5
- package/lib/agitation-control/agitation-control-model.d.ts.map +1 -1
- package/lib/agitation-control/agitation-control-registration.d.ts +2 -3
- package/lib/agitation-control/agitation-control-registration.d.ts.map +1 -1
- package/lib/agitation-control/index.d.ts.map +1 -1
- package/lib/agitation-control/types/index.d.ts +1 -3
- package/lib/animation/animation-model.d.ts +1 -2
- package/lib/animation/animation-model.d.ts.map +1 -1
- package/lib/animation/animation-registration.d.ts +1 -2
- package/lib/animation/animation-registration.d.ts.map +1 -1
- package/lib/animation/index.d.ts.map +1 -1
- package/lib/animation/services/animation-services.d.ts +1 -1
- package/lib/animation/services/animation-services.d.ts.map +1 -1
- package/lib/animation/services/index.d.ts.map +1 -1
- package/lib/animation/types/index.d.ts +1 -3
- package/lib/application/application-model.d.ts +5 -6
- package/lib/application/application-model.d.ts.map +1 -1
- package/lib/application/application-registration.d.ts +1 -2
- package/lib/application/application-registration.d.ts.map +1 -1
- package/lib/application/index.d.ts.map +1 -1
- package/lib/application/services/application-services.d.ts +3 -3
- package/lib/application/services/application-services.d.ts.map +1 -1
- package/lib/application/services/index.d.ts.map +1 -1
- package/lib/application/types/index.d.ts +2 -4
- package/lib/auth/auth-model.d.ts +2 -3
- package/lib/auth/auth-model.d.ts.map +1 -1
- package/lib/auth/auth-registration.d.ts +1 -2
- package/lib/auth/auth-registration.d.ts.map +1 -1
- package/lib/auth/index.d.ts.map +1 -1
- package/lib/auth/services/auth-services.d.ts +1 -2
- package/lib/auth/services/auth-services.d.ts.map +1 -1
- package/lib/auth/services/index.d.ts.map +1 -1
- package/lib/auth/types/index.d.ts +1 -3
- package/lib/carb-water/carb-water-model.d.ts +3 -4
- package/lib/carb-water/carb-water-model.d.ts.map +1 -1
- package/lib/carb-water/carb-water-registration.d.ts +2 -3
- package/lib/carb-water/carb-water-registration.d.ts.map +1 -1
- package/lib/carb-water/index.d.ts.map +1 -1
- package/lib/carb-water/services/carb-water-services.d.ts.map +1 -1
- package/lib/carb-water/services/index.d.ts.map +1 -1
- package/lib/copy-logs/copy-logs-model.d.ts +4 -5
- package/lib/copy-logs/copy-logs-model.d.ts.map +1 -1
- package/lib/copy-logs/index.d.ts +1 -1
- package/lib/copy-logs/index.d.ts.map +1 -1
- package/lib/copy-logs/services/copy-logs-services.d.ts +1 -2
- package/lib/copy-logs/services/copy-logs-services.d.ts.map +1 -1
- package/lib/copy-logs/services/index.d.ts.map +1 -1
- package/lib/dashboard-operations/dashboard-operations-model.d.ts +4 -5
- package/lib/dashboard-operations/dashboard-operations-model.d.ts.map +1 -1
- package/lib/dashboard-operations/dashboard-operations-registration.d.ts +1 -2
- package/lib/dashboard-operations/dashboard-operations-registration.d.ts.map +1 -1
- package/lib/dashboard-operations/index.d.ts.map +1 -1
- package/lib/dashboard-operations/services/dashboard-operations-services.d.ts +2 -2
- package/lib/dashboard-operations/services/dashboard-operations-services.d.ts.map +1 -1
- package/lib/dashboard-operations/services/index.d.ts.map +1 -1
- package/lib/dashboard-operations/types/index.d.ts +1 -3
- package/lib/dispenser/dispenser-model.d.ts +1 -2
- package/lib/dispenser/dispenser-model.d.ts.map +1 -1
- package/lib/dispenser/dispenser-registration.d.ts +1 -2
- package/lib/dispenser/dispenser-registration.d.ts.map +1 -1
- package/lib/dispenser/index.d.ts.map +1 -1
- package/lib/dispenser/services/dispenser-services.d.ts +1 -1
- package/lib/dispenser/services/dispenser-services.d.ts.map +1 -1
- package/lib/dispenser/services/index.d.ts.map +1 -1
- package/lib/dispenser/types/index.d.ts +1 -3
- package/lib/dispenser-info/dispenser-info-model.d.ts +1 -2
- package/lib/dispenser-info/dispenser-info-model.d.ts.map +1 -1
- package/lib/dispenser-info/dispenser-info-registration.d.ts +1 -2
- package/lib/dispenser-info/dispenser-info-registration.d.ts.map +1 -1
- package/lib/dispenser-info/index.d.ts.map +1 -1
- package/lib/dispenser-info/services/dispenser-info-services.d.ts +1 -1
- package/lib/dispenser-info/services/dispenser-info-services.d.ts.map +1 -1
- package/lib/dispenser-info/services/index.d.ts.map +1 -1
- package/lib/dispenser-info/types/index.d.ts +1 -3
- package/lib/door/door-model.d.ts +1 -2
- package/lib/door/door-model.d.ts.map +1 -1
- package/lib/door/door-registration.d.ts +2 -3
- package/lib/door/door-registration.d.ts.map +1 -1
- package/lib/door/index.d.ts.map +1 -1
- package/lib/enrollment/enrollment-model.d.ts +1 -2
- package/lib/enrollment/enrollment-model.d.ts.map +1 -1
- package/lib/enrollment/enrollment-registration.d.ts +1 -2
- package/lib/enrollment/enrollment-registration.d.ts.map +1 -1
- package/lib/enrollment/index.d.ts.map +1 -1
- package/lib/enrollment/services/enrollment-services.d.ts +1 -1
- package/lib/enrollment/services/enrollment-services.d.ts.map +1 -1
- package/lib/enrollment/services/index.d.ts.map +1 -1
- package/lib/enrollment/types/index.d.ts +1 -3
- package/lib/extension/index.d.ts.map +1 -1
- package/lib/ingredient-summary/index.d.ts.map +1 -1
- package/lib/ingredient-summary/ingredient-summary-model.d.ts +4 -5
- package/lib/ingredient-summary/ingredient-summary-model.d.ts.map +1 -1
- package/lib/ingredient-summary/ingredient-summary-registration.d.ts +1 -2
- package/lib/ingredient-summary/ingredient-summary-registration.d.ts.map +1 -1
- package/lib/ingredient-summary/types/index.d.ts +2 -4
- package/lib/lockout/index.d.ts.map +1 -1
- package/lib/lockout/lockout-model.d.ts +1 -2
- package/lib/lockout/lockout-model.d.ts.map +1 -1
- package/lib/lockout/lockout-registration.d.ts +2 -3
- package/lib/lockout/lockout-registration.d.ts.map +1 -1
- package/lib/lockout/services/index.d.ts.map +1 -1
- package/lib/lockout/services/lockout-services.d.ts +1 -1
- package/lib/lockout/services/lockout-services.d.ts.map +1 -1
- package/lib/macro-assignment/index.d.ts.map +1 -1
- package/lib/macro-assignment/macro-assignment-model.d.ts +5 -6
- package/lib/macro-assignment/macro-assignment-model.d.ts.map +1 -1
- package/lib/macro-assignment/macro-assignment-registration.d.ts +1 -2
- package/lib/macro-assignment/macro-assignment-registration.d.ts.map +1 -1
- package/lib/macro-assignment/services/index.d.ts.map +1 -1
- package/lib/macro-assignment/services/macro-assignment-services.d.ts +1 -1
- package/lib/macro-assignment/services/macro-assignment-services.d.ts.map +1 -1
- package/lib/macro-assignment/types/index.d.ts +2 -4
- package/lib/network-test/index.d.ts.map +1 -1
- package/lib/network-test/network-test-container-model.d.ts +3 -4
- package/lib/network-test/network-test-container-model.d.ts.map +1 -1
- package/lib/network-test/network-test-container-registration.d.ts +1 -2
- package/lib/network-test/network-test-container-registration.d.ts.map +1 -1
- package/lib/network-test/network-test-model.d.ts +2 -3
- package/lib/network-test/network-test-model.d.ts.map +1 -1
- package/lib/network-test/network-test-registration.d.ts +1 -2
- package/lib/network-test/network-test-registration.d.ts.map +1 -1
- package/lib/network-test/services/index.d.ts.map +1 -1
- package/lib/network-test/services/network-test-services.d.ts +2 -3
- package/lib/network-test/services/network-test-services.d.ts.map +1 -1
- package/lib/network-test/types/index.d.ts +1 -3
- package/lib/nutritive-sweetener/index.d.ts.map +1 -1
- package/lib/nutritive-sweetener/nutritive-sweetener-model.d.ts +7 -8
- package/lib/nutritive-sweetener/nutritive-sweetener-model.d.ts.map +1 -1
- package/lib/nutritive-sweetener/nutritive-sweetener-registration.d.ts +2 -3
- package/lib/nutritive-sweetener/nutritive-sweetener-registration.d.ts.map +1 -1
- package/lib/nutritive-sweetener/services/index.d.ts.map +1 -1
- package/lib/nutritive-sweetener/services/nutritive-sweetener-services.d.ts.map +1 -1
- package/lib/plain-water/index.d.ts.map +1 -1
- package/lib/plain-water/plain-water-model.d.ts +4 -5
- package/lib/plain-water/plain-water-model.d.ts.map +1 -1
- package/lib/plain-water/plain-water-registration.d.ts +2 -3
- package/lib/plain-water/plain-water-registration.d.ts.map +1 -1
- package/lib/plain-water/services/index.d.ts.map +1 -1
- package/lib/plain-water/services/plain-water-services.d.ts.map +1 -1
- package/lib/reboot/index.d.ts.map +1 -1
- package/lib/reboot/reboot-model.d.ts +1 -2
- package/lib/reboot/reboot-model.d.ts.map +1 -1
- package/lib/reboot/reboot-registration.d.ts +1 -2
- package/lib/reboot/reboot-registration.d.ts.map +1 -1
- package/lib/reboot/services/index.d.ts.map +1 -1
- package/lib/reboot/services/reboot-services.d.ts +1 -1
- package/lib/reboot/services/reboot-services.d.ts.map +1 -1
- package/lib/reboot/types/index.d.ts +1 -3
- package/lib/registration.d.ts +1 -2
- package/lib/registration.d.ts.map +1 -1
- package/lib/settings/index.d.ts.map +1 -1
- package/lib/settings/services/index.d.ts.map +1 -1
- package/lib/settings/services/settings-services.d.ts +2 -3
- package/lib/settings/services/settings-services.d.ts.map +1 -1
- package/lib/settings/settings-model.d.ts +1 -2
- package/lib/settings/settings-model.d.ts.map +1 -1
- package/lib/settings/settings-registration.d.ts +1 -2
- package/lib/settings/settings-registration.d.ts.map +1 -1
- package/lib/settings/types/index.d.ts +1 -3
- package/lib/setup-step/index.d.ts.map +1 -1
- package/lib/setup-step/services/index.d.ts.map +1 -1
- package/lib/setup-step/services/setup-step-services.d.ts +2 -2
- package/lib/setup-step/services/setup-step-services.d.ts.map +1 -1
- package/lib/setup-step/setup-step-container-model.d.ts +3 -4
- package/lib/setup-step/setup-step-container-model.d.ts.map +1 -1
- package/lib/setup-step/setup-step-container-registration.d.ts +1 -2
- package/lib/setup-step/setup-step-container-registration.d.ts.map +1 -1
- package/lib/setup-step/setup-step-model.d.ts +1 -2
- package/lib/setup-step/setup-step-model.d.ts.map +1 -1
- package/lib/setup-step/setup-step-registration.d.ts +1 -2
- package/lib/setup-step/setup-step-registration.d.ts.map +1 -1
- package/lib/setup-step/types/index.d.ts +1 -3
- package/lib/trouble-action/index.d.ts.map +1 -1
- package/lib/trouble-action/trouble-action-model.d.ts +2 -3
- package/lib/trouble-action/trouble-action-model.d.ts.map +1 -1
- package/lib/utilities/index.d.ts.map +1 -1
- package/lib/utilities/services/index.d.ts.map +1 -1
- package/lib/utilities/services/utilities-services.d.ts.map +1 -1
- package/lib/utilities/types/index.d.ts +1 -3
- package/lib/utilities/utilities-container-model.d.ts +1 -2
- package/lib/utilities/utilities-container-model.d.ts.map +1 -1
- package/lib/utilities/utilities-container-registration.d.ts +1 -2
- package/lib/utilities/utilities-container-registration.d.ts.map +1 -1
- package/lib/utilities/utilities-model.d.ts +1 -2
- package/lib/utilities/utilities-model.d.ts.map +1 -1
- package/lib/utilities/utilities-registration.d.ts +1 -2
- package/lib/utilities/utilities-registration.d.ts.map +1 -1
- package/lib/utils/assembly-utils.d.ts +2 -3
- package/lib/utils/assembly-utils.d.ts.map +1 -1
- package/lib/utils/holder-view-extension.d.ts +1 -2
- package/lib/utils/holder-view-extension.d.ts.map +1 -1
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/time-utils.d.ts.map +1 -1
- package/lib/utils/trouble-visibility-filter.d.ts +1 -2
- package/lib/utils/trouble-visibility-filter.d.ts.map +1 -1
- package/package.json +5 -5
- package/start/index.d.ts.map +1 -1
- package/start/services/index.d.ts.map +1 -1
- package/start/services/start-services.d.ts +1 -1
- package/start/services/start-services.d.ts.map +1 -1
- package/start/start-model.d.ts +1 -2
- package/start/start-model.d.ts.map +1 -1
- package/start/start-registration.d.ts +2 -3
- package/start/start-registration.d.ts.map +1 -1
- package/types/global.d.ts.map +1 -1
- package/types/index.d.ts.map +1 -1
- package/utils/openapi-index.d.ts.map +1 -1
- package/utils/services/kosdev.ddk/snapshot/service.d.ts +47 -48
- package/utils/services/kosdev.ddk/snapshot/service.d.ts.map +1 -1
- package/utils/services-index.d.ts.map +1 -1
- package/kos-models.json +0 -358
package/index.mjs
CHANGED
|
@@ -1,39 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
basePath: `${
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
1
|
+
import { resolveServiceUrl, ServiceFactory, KosLog, kosTopicHandler, kosModel, kosAction, Kos, isKosModel, createPropKey, kosStateProp, kosConfigProperty, KosModelRegistrationFactory, kosDependency, KosModelContainer, resolveContainerDeltas, kosChild, Device, kosFuture, kosModelEffect, MultipleFutureHandler, FutureEndState, TroubleServices, Troubles, SingletonKosModelRegistrationFactory, getKosCompanionModel, FetchError, StorageDeviceContainer, kosFutureAware, kosLoggerAware, KosDataContainer, TroubleContainer, FutureHandler, troubleByTypeReducer, registerExtensionPoint, ExtensionManager, kosConfigBean, kosStateBean, ObservableData } from "@kosdev-code/kos-ui-sdk";
|
|
2
|
+
import { AGITATION_REQUIRED_TROUBLE, CartridgeAgitatorEvents, FcmPump, FreestyleHolder } from "@kosdev-code/kos-freestyle-sdk";
|
|
3
|
+
import { Assembly, HolderContainer, IngredientContainer } from "@kosdev-code/kos-dispense-sdk";
|
|
4
|
+
const TROUBLE_TYPE_PURGE$1 = "PurgeTrouble";
|
|
5
|
+
const TROUBLE_TYPE_PRIME$1 = "PrimeTrouble";
|
|
6
|
+
const { URL: URL$d } = resolveServiceUrl("AUTH_SERVICE");
|
|
7
|
+
const { getOne: getOne$4, postModel: postModel$4 } = ServiceFactory.build({
|
|
8
|
+
basePath: `${URL$d}/api/auth`
|
|
9
|
+
});
|
|
10
|
+
const log$e = KosLog.createLogger({ name: "auth-service", group: "Services" });
|
|
11
|
+
const getCurrentRole = async () => {
|
|
12
|
+
log$e.debug("sending GET for auth");
|
|
13
|
+
const response = await getOne$4({
|
|
14
|
+
urlOverride: `${URL$d}/api/app/kosdev.ddk/auth/role`
|
|
15
|
+
});
|
|
16
|
+
return response;
|
|
17
|
+
};
|
|
18
|
+
const sendPinCode = async (pinCode) => {
|
|
19
|
+
log$e.debug("sending POST for auth");
|
|
20
|
+
const response = await postModel$4({
|
|
21
|
+
urlOverride: `${URL$d}/api/app/kosdev.ddk/auth/pincode/${pinCode}`,
|
|
22
|
+
model: {}
|
|
23
|
+
});
|
|
24
|
+
return response;
|
|
25
|
+
};
|
|
26
|
+
const index$d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
15
27
|
__proto__: null,
|
|
16
|
-
getCurrentRole
|
|
17
|
-
sendPinCode
|
|
28
|
+
getCurrentRole,
|
|
29
|
+
sendPinCode
|
|
18
30
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
var __defProp$j = Object.defineProperty;
|
|
32
|
+
var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
|
|
33
|
+
var __decorateClass$p = (decorators, target, key, kind) => {
|
|
34
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$p(target, key) : target;
|
|
35
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
36
|
+
if (decorator = decorators[i])
|
|
37
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
38
|
+
if (kind && result) __defProp$j(target, key, result);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
const MODEL_TYPE$p = "auth-model";
|
|
42
|
+
const convertAuthResponse = (response) => response.toLowerCase();
|
|
43
|
+
let AuthModelImpl = class {
|
|
44
|
+
id;
|
|
45
|
+
logger;
|
|
46
|
+
currentRole;
|
|
47
|
+
constructor(modelId, options, context) {
|
|
48
|
+
this.id = modelId;
|
|
49
|
+
this.logger = context.logger;
|
|
50
|
+
this.currentRole = "crew";
|
|
51
|
+
}
|
|
52
|
+
async authorize(pinCode) {
|
|
53
|
+
if (!pinCode) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
const response = await sendPinCode(pinCode);
|
|
57
|
+
if (response?.status === 200) {
|
|
58
|
+
return response.data;
|
|
59
|
+
} else {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
37
62
|
}
|
|
38
63
|
// -------------------LIFECYCLE----------------------------
|
|
39
64
|
async init() {
|
|
@@ -41,112 +66,158 @@ let he = class {
|
|
|
41
66
|
}
|
|
42
67
|
async load() {
|
|
43
68
|
this.logger.debug(`loading auth ${this.id}`);
|
|
44
|
-
const
|
|
45
|
-
(
|
|
46
|
-
this.
|
|
47
|
-
|
|
69
|
+
const response = await getCurrentRole();
|
|
70
|
+
if (response?.status === 200) {
|
|
71
|
+
this.logger.debug(`response ${response.data}`);
|
|
72
|
+
kosAction(() => {
|
|
73
|
+
this.currentRole = convertAuthResponse(response.data);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
48
76
|
}
|
|
49
|
-
handleRoleChange(
|
|
50
|
-
this.currentRole =
|
|
77
|
+
handleRoleChange(role) {
|
|
78
|
+
this.currentRole = convertAuthResponse(role);
|
|
51
79
|
}
|
|
52
|
-
forceRole(
|
|
53
|
-
this.currentRole =
|
|
80
|
+
forceRole(role) {
|
|
81
|
+
this.currentRole = role;
|
|
54
82
|
}
|
|
55
83
|
};
|
|
56
|
-
$
|
|
57
|
-
|
|
84
|
+
__decorateClass$p([
|
|
85
|
+
kosTopicHandler({
|
|
58
86
|
topic: "/app/kosdev.ddk/auth/role",
|
|
59
|
-
websocket:
|
|
87
|
+
websocket: true
|
|
60
88
|
})
|
|
61
|
-
],
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
],
|
|
65
|
-
const
|
|
89
|
+
], AuthModelImpl.prototype, "handleRoleChange", 1);
|
|
90
|
+
AuthModelImpl = __decorateClass$p([
|
|
91
|
+
kosModel(MODEL_TYPE$p)
|
|
92
|
+
], AuthModelImpl);
|
|
93
|
+
const Auth = {
|
|
66
94
|
registration: {
|
|
67
|
-
[
|
|
68
|
-
class:
|
|
69
|
-
singleton:
|
|
95
|
+
[MODEL_TYPE$p]: {
|
|
96
|
+
class: AuthModelImpl,
|
|
97
|
+
singleton: false
|
|
70
98
|
}
|
|
71
99
|
},
|
|
72
|
-
type:
|
|
73
|
-
predicate:
|
|
74
|
-
factory:
|
|
75
|
-
};
|
|
76
|
-
var
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
100
|
+
type: MODEL_TYPE$p,
|
|
101
|
+
predicate: isKosModel(MODEL_TYPE$p),
|
|
102
|
+
factory: Kos.Factory.create(MODEL_TYPE$p)
|
|
103
|
+
};
|
|
104
|
+
var __defProp$i = Object.defineProperty;
|
|
105
|
+
var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
|
|
106
|
+
var __decorateClass$o = (decorators, target, key, kind) => {
|
|
107
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$o(target, key) : target;
|
|
108
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
109
|
+
if (decorator = decorators[i])
|
|
110
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
111
|
+
if (kind && result) __defProp$i(target, key, result);
|
|
112
|
+
return result;
|
|
113
|
+
};
|
|
114
|
+
const MODEL_TYPE$o = "door-model";
|
|
115
|
+
const PROP_PATH = createPropKey("doorPath");
|
|
116
|
+
let DoorModelImpl = class {
|
|
117
|
+
id;
|
|
118
|
+
logger;
|
|
119
|
+
doorPath;
|
|
120
|
+
open;
|
|
121
|
+
ignoreDoor;
|
|
122
|
+
constructor(modelId, options, context) {
|
|
123
|
+
this.id = modelId;
|
|
124
|
+
this.logger = context.logger;
|
|
125
|
+
this.doorPath = options.doorPath;
|
|
90
126
|
}
|
|
91
127
|
get currentState() {
|
|
92
|
-
|
|
128
|
+
if (this.open.value === void 0) {
|
|
129
|
+
return "UNKNOWN";
|
|
130
|
+
}
|
|
131
|
+
return this.open.value ? "OPEN" : "CLOSED";
|
|
93
132
|
}
|
|
94
133
|
get isOpen() {
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
134
|
+
const value = this.open.value === void 0 ? true : this.open.value;
|
|
135
|
+
const ignore = this.ignoreDoor.value;
|
|
136
|
+
if (ignore) {
|
|
137
|
+
this.logger.debug(
|
|
138
|
+
`Door state is being ignored (treating as closed) due to ignoreDoor config property being true.`
|
|
139
|
+
);
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
return value;
|
|
99
143
|
}
|
|
100
144
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
],
|
|
104
|
-
|
|
105
|
-
|
|
145
|
+
__decorateClass$o([
|
|
146
|
+
kosStateProp({ path: PROP_PATH, attribute: "state" })
|
|
147
|
+
], DoorModelImpl.prototype, "open", 2);
|
|
148
|
+
__decorateClass$o([
|
|
149
|
+
kosConfigProperty({
|
|
106
150
|
path: "app:kosdev.ddk:app",
|
|
107
151
|
attribute: "ncui.ignoreDoorStateOnExit"
|
|
108
152
|
})
|
|
109
|
-
],
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
],
|
|
113
|
-
const
|
|
114
|
-
class:
|
|
115
|
-
type:
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
|
|
153
|
+
], DoorModelImpl.prototype, "ignoreDoor", 2);
|
|
154
|
+
DoorModelImpl = __decorateClass$o([
|
|
155
|
+
kosModel(MODEL_TYPE$o)
|
|
156
|
+
], DoorModelImpl);
|
|
157
|
+
const Door = new KosModelRegistrationFactory({
|
|
158
|
+
class: DoorModelImpl,
|
|
159
|
+
type: MODEL_TYPE$o
|
|
160
|
+
});
|
|
161
|
+
const { URL: URL$c } = resolveServiceUrl("SETUP-STEP_SERVICE");
|
|
162
|
+
const { getAll: getAll$9, postModel: postModel$3 } = ServiceFactory.build({
|
|
163
|
+
basePath: `${URL$c}/api/setup-step`
|
|
164
|
+
});
|
|
165
|
+
const log$d = KosLog.createLogger({
|
|
119
166
|
name: "setup-step-service",
|
|
120
167
|
group: "Services"
|
|
121
|
-
})
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
})
|
|
168
|
+
});
|
|
169
|
+
const getSetupSteps = async () => {
|
|
170
|
+
log$d.debug("sending GET for setup-step");
|
|
171
|
+
const response = await getAll$9({
|
|
172
|
+
urlOverride: `${URL$c}/api/app/kosdev.ddk/setup/steps`
|
|
173
|
+
});
|
|
174
|
+
return response;
|
|
175
|
+
};
|
|
176
|
+
const markStepComplete = async (stepId) => {
|
|
177
|
+
log$d.debug("sending POST for setup-step");
|
|
178
|
+
const response = await postModel$3({
|
|
179
|
+
urlOverride: `${URL$c}/api/app/kosdev.ddk/setup/complete/${stepId}`,
|
|
180
|
+
model: {}
|
|
181
|
+
});
|
|
182
|
+
return response;
|
|
183
|
+
};
|
|
184
|
+
const index$c = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
127
185
|
__proto__: null,
|
|
128
|
-
getSetupSteps
|
|
129
|
-
markStepComplete
|
|
186
|
+
getSetupSteps,
|
|
187
|
+
markStepComplete
|
|
130
188
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
131
|
-
var
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
this.
|
|
189
|
+
var __getOwnPropDesc$n = Object.getOwnPropertyDescriptor;
|
|
190
|
+
var __decorateClass$n = (decorators, target, key, kind) => {
|
|
191
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$n(target, key) : target;
|
|
192
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
193
|
+
if (decorator = decorators[i])
|
|
194
|
+
result = decorator(result) || result;
|
|
195
|
+
return result;
|
|
196
|
+
};
|
|
197
|
+
const MODEL_TYPE$n = "setup-step-model";
|
|
198
|
+
let SetupStepModelImpl = class {
|
|
199
|
+
id;
|
|
200
|
+
idx;
|
|
201
|
+
name;
|
|
202
|
+
complete;
|
|
203
|
+
preStep;
|
|
204
|
+
exclusive;
|
|
205
|
+
logger;
|
|
206
|
+
constructor(modelId, options, context) {
|
|
207
|
+
this.id = modelId;
|
|
208
|
+
this.idx = options.idx;
|
|
209
|
+
this.logger = context.logger;
|
|
210
|
+
this.name = options.name;
|
|
211
|
+
this.complete = options.complete;
|
|
212
|
+
this.preStep = options.preStep;
|
|
213
|
+
this.exclusive = options.exclusive;
|
|
214
|
+
}
|
|
215
|
+
updateModel(options) {
|
|
216
|
+
this.name = options.name;
|
|
217
|
+
this.idx = options.idx;
|
|
218
|
+
this.complete = options.complete;
|
|
219
|
+
this.preStep = options.preStep;
|
|
220
|
+
this.exclusive = options.exclusive;
|
|
150
221
|
}
|
|
151
222
|
get titleKey() {
|
|
152
223
|
return `setup.${this.name}.title`;
|
|
@@ -155,10 +226,12 @@ let Ae = class {
|
|
|
155
226
|
return `setup.${this.name}.body`;
|
|
156
227
|
}
|
|
157
228
|
async completeStep() {
|
|
158
|
-
const
|
|
159
|
-
(
|
|
160
|
-
|
|
161
|
-
|
|
229
|
+
const response = await markStepComplete(this.name);
|
|
230
|
+
if (response?.status === 200) {
|
|
231
|
+
kosAction(() => {
|
|
232
|
+
this.complete = true;
|
|
233
|
+
});
|
|
234
|
+
}
|
|
162
235
|
}
|
|
163
236
|
// -------------------LIFECYCLE----------------------------
|
|
164
237
|
async init() {
|
|
@@ -168,88 +241,101 @@ let Ae = class {
|
|
|
168
241
|
this.logger.debug(`loading setup-step ${this.id}`);
|
|
169
242
|
}
|
|
170
243
|
};
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
],
|
|
174
|
-
const
|
|
244
|
+
SetupStepModelImpl = __decorateClass$n([
|
|
245
|
+
kosModel(MODEL_TYPE$n)
|
|
246
|
+
], SetupStepModelImpl);
|
|
247
|
+
const SetupStep = {
|
|
175
248
|
registration: {
|
|
176
|
-
[
|
|
177
|
-
class:
|
|
178
|
-
singleton:
|
|
249
|
+
[MODEL_TYPE$n]: {
|
|
250
|
+
class: SetupStepModelImpl,
|
|
251
|
+
singleton: false
|
|
179
252
|
}
|
|
180
253
|
},
|
|
181
|
-
type:
|
|
182
|
-
predicate:
|
|
183
|
-
factory:
|
|
184
|
-
};
|
|
185
|
-
var
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
254
|
+
type: MODEL_TYPE$n,
|
|
255
|
+
predicate: isKosModel(MODEL_TYPE$n),
|
|
256
|
+
factory: Kos.Factory.create(MODEL_TYPE$n)
|
|
257
|
+
};
|
|
258
|
+
var __defProp$h = Object.defineProperty;
|
|
259
|
+
var __getOwnPropDesc$m = Object.getOwnPropertyDescriptor;
|
|
260
|
+
var __decorateClass$m = (decorators, target, key, kind) => {
|
|
261
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$m(target, key) : target;
|
|
262
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
263
|
+
if (decorator = decorators[i])
|
|
264
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
265
|
+
if (kind && result) __defProp$h(target, key, result);
|
|
266
|
+
return result;
|
|
267
|
+
};
|
|
268
|
+
const MODEL_TYPE$m = "setup-step-container-model";
|
|
269
|
+
function addStep(container) {
|
|
270
|
+
return (step) => {
|
|
271
|
+
const model = SetupStep.factory(step.id)(step);
|
|
272
|
+
model.updateModel(step);
|
|
273
|
+
container.addModel(model);
|
|
195
274
|
};
|
|
196
275
|
}
|
|
197
|
-
function
|
|
198
|
-
return (
|
|
199
|
-
|
|
276
|
+
function removeStep(container) {
|
|
277
|
+
return (id) => {
|
|
278
|
+
container.removeModel(id);
|
|
200
279
|
};
|
|
201
280
|
}
|
|
202
|
-
let
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
this.id =
|
|
210
|
-
|
|
281
|
+
let SetupStepContainerModelImpl = class {
|
|
282
|
+
id;
|
|
283
|
+
_currentStep;
|
|
284
|
+
logger;
|
|
285
|
+
models;
|
|
286
|
+
authModel;
|
|
287
|
+
constructor(modelId, options, context) {
|
|
288
|
+
this.id = modelId;
|
|
289
|
+
this.logger = context.logger;
|
|
290
|
+
this._currentStep = void 0;
|
|
291
|
+
this.models = new KosModelContainer({
|
|
292
|
+
parentId: modelId,
|
|
211
293
|
sortKey: "idx"
|
|
212
294
|
});
|
|
213
295
|
}
|
|
214
296
|
get currentStep() {
|
|
215
297
|
return this._currentStep;
|
|
216
298
|
}
|
|
217
|
-
setCurrentStep(
|
|
218
|
-
const
|
|
219
|
-
|
|
299
|
+
setCurrentStep(id) {
|
|
300
|
+
const step = this.models.getModel(id);
|
|
301
|
+
if (step) {
|
|
302
|
+
this._currentStep = step;
|
|
303
|
+
}
|
|
220
304
|
}
|
|
221
305
|
nextStep() {
|
|
222
|
-
if (!this._currentStep)
|
|
306
|
+
if (!this._currentStep) {
|
|
223
307
|
this._currentStep = this.firstIncompleteStep;
|
|
224
|
-
else {
|
|
225
|
-
const
|
|
226
|
-
|
|
308
|
+
} else {
|
|
309
|
+
const currentIdx = this._currentStep.idx;
|
|
310
|
+
const nextStep = this.models.data.find((step) => step.idx > currentIdx);
|
|
311
|
+
if (nextStep) {
|
|
312
|
+
this._currentStep = nextStep;
|
|
313
|
+
}
|
|
227
314
|
}
|
|
228
315
|
}
|
|
229
316
|
get hasIncompletePreSteps() {
|
|
230
|
-
return this.models.data.some((
|
|
317
|
+
return this.models.data.some((step) => step.preStep && !step.complete);
|
|
231
318
|
}
|
|
232
319
|
get setupRequired() {
|
|
233
|
-
return this.models.data.some((
|
|
320
|
+
return this.models.data.some((step) => !step.complete);
|
|
234
321
|
}
|
|
235
322
|
get firstIncompleteStep() {
|
|
236
|
-
return this.models.data.find((
|
|
323
|
+
return this.models.data.find((step) => !step.complete);
|
|
237
324
|
}
|
|
238
325
|
get isLastStep() {
|
|
239
|
-
|
|
240
|
-
return this.models.data[this.models.data.length - 1].id === ((e = this._currentStep) == null ? void 0 : e.id);
|
|
326
|
+
return this.models.data[this.models.data.length - 1].id === this._currentStep?.id;
|
|
241
327
|
}
|
|
242
328
|
get data() {
|
|
243
329
|
return this.models.data;
|
|
244
330
|
}
|
|
245
|
-
getModel(
|
|
246
|
-
return this.models.getModel(
|
|
331
|
+
getModel(id) {
|
|
332
|
+
return this.models.getModel(id);
|
|
247
333
|
}
|
|
248
|
-
addModel(
|
|
249
|
-
this.models.addModel(
|
|
334
|
+
addModel(model) {
|
|
335
|
+
this.models.addModel(model);
|
|
250
336
|
}
|
|
251
|
-
removeModel(
|
|
252
|
-
this.models.removeModel(
|
|
337
|
+
removeModel(id) {
|
|
338
|
+
this.models.removeModel(id);
|
|
253
339
|
}
|
|
254
340
|
// -------------------LIFECYCLE----------------------------
|
|
255
341
|
async init() {
|
|
@@ -257,156 +343,190 @@ let E = class {
|
|
|
257
343
|
}
|
|
258
344
|
async load() {
|
|
259
345
|
this.logger.debug(`loading setup-step-container container ${this.id}`);
|
|
260
|
-
const
|
|
261
|
-
if (
|
|
262
|
-
const
|
|
263
|
-
(
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
346
|
+
const response = await getSetupSteps();
|
|
347
|
+
if (response?.data) {
|
|
348
|
+
const identifiableSteps = response.data.map(
|
|
349
|
+
(step, index2) => {
|
|
350
|
+
return {
|
|
351
|
+
...step,
|
|
352
|
+
idx: index2,
|
|
353
|
+
id: `setup-${step.name}`
|
|
354
|
+
};
|
|
355
|
+
}
|
|
268
356
|
);
|
|
269
|
-
|
|
357
|
+
resolveContainerDeltas({
|
|
270
358
|
container: this.models,
|
|
271
|
-
onAddItem:
|
|
272
|
-
onRemoveItem:
|
|
273
|
-
})(
|
|
359
|
+
onAddItem: addStep(this),
|
|
360
|
+
onRemoveItem: removeStep(this)
|
|
361
|
+
})(identifiableSteps);
|
|
274
362
|
}
|
|
275
363
|
this.nextStep();
|
|
276
364
|
}
|
|
277
|
-
handleStepChanges(
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
365
|
+
handleStepChanges(steps) {
|
|
366
|
+
const identifiableSteps = steps.map((step, index2) => {
|
|
367
|
+
return {
|
|
368
|
+
...step,
|
|
369
|
+
idx: index2,
|
|
370
|
+
id: `setup-${step.name}`
|
|
371
|
+
};
|
|
372
|
+
});
|
|
373
|
+
resolveContainerDeltas({
|
|
284
374
|
container: this.models,
|
|
285
|
-
onAddItem:
|
|
286
|
-
onRemoveItem:
|
|
287
|
-
})(
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
],
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
],
|
|
296
|
-
|
|
297
|
-
|
|
375
|
+
onAddItem: addStep(this),
|
|
376
|
+
onRemoveItem: removeStep(this)
|
|
377
|
+
})(identifiableSteps);
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
__decorateClass$m([
|
|
381
|
+
kosChild
|
|
382
|
+
], SetupStepContainerModelImpl.prototype, "models", 2);
|
|
383
|
+
__decorateClass$m([
|
|
384
|
+
kosDependency({ modelType: Auth.type })
|
|
385
|
+
], SetupStepContainerModelImpl.prototype, "authModel", 2);
|
|
386
|
+
__decorateClass$m([
|
|
387
|
+
kosTopicHandler({
|
|
298
388
|
topic: "/app/kosdev.ddk/setup/steps",
|
|
299
|
-
websocket:
|
|
389
|
+
websocket: true
|
|
300
390
|
})
|
|
301
|
-
],
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
],
|
|
305
|
-
const
|
|
391
|
+
], SetupStepContainerModelImpl.prototype, "handleStepChanges", 1);
|
|
392
|
+
SetupStepContainerModelImpl = __decorateClass$m([
|
|
393
|
+
kosModel(MODEL_TYPE$m)
|
|
394
|
+
], SetupStepContainerModelImpl);
|
|
395
|
+
const SetupStepContainer = {
|
|
306
396
|
registration: {
|
|
307
|
-
[
|
|
308
|
-
class:
|
|
309
|
-
singleton:
|
|
397
|
+
[MODEL_TYPE$m]: {
|
|
398
|
+
class: SetupStepContainerModelImpl,
|
|
399
|
+
singleton: true
|
|
310
400
|
},
|
|
311
|
-
...
|
|
401
|
+
...SetupStep.registration
|
|
312
402
|
},
|
|
313
|
-
type:
|
|
314
|
-
predicate:
|
|
315
|
-
factory:
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
403
|
+
type: MODEL_TYPE$m,
|
|
404
|
+
predicate: isKosModel(MODEL_TYPE$m),
|
|
405
|
+
factory: Kos.Singleton.create(MODEL_TYPE$m)
|
|
406
|
+
};
|
|
407
|
+
const { URL: URL$b } = resolveServiceUrl("AUTH_SERVICE");
|
|
408
|
+
const { getOne: getOne$3, getAll: getAll$8 } = ServiceFactory.build({
|
|
409
|
+
basePath: `${URL$b}/api/app/kosdev.ddk/ncui/`
|
|
410
|
+
});
|
|
411
|
+
const log$c = KosLog.createLogger({ name: "auth-service", group: "Services" });
|
|
412
|
+
const getCuis = async () => {
|
|
413
|
+
log$c.debug("sending GET for cuis");
|
|
414
|
+
const response = await getAll$8({
|
|
415
|
+
urlOverride: `${URL$b}/api/app/kosdev.ddk/cui`
|
|
322
416
|
});
|
|
323
|
-
if (
|
|
417
|
+
if (response?.status !== 200) {
|
|
324
418
|
throw new Error("Failed to retrieve cuis");
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
419
|
+
}
|
|
420
|
+
return response.data;
|
|
421
|
+
};
|
|
422
|
+
const getNavigation = async () => {
|
|
423
|
+
log$c.debug("sending GET for navigation");
|
|
328
424
|
try {
|
|
329
|
-
const
|
|
330
|
-
urlOverride: `${
|
|
425
|
+
const extensionResponse = await getAll$8({
|
|
426
|
+
urlOverride: `${URL$b}/api/kos/descriptor/app:kosdev.ddk:ncuiDescriptor/kondra.ncui.navigations`
|
|
331
427
|
});
|
|
332
|
-
if (
|
|
333
|
-
|
|
334
|
-
const
|
|
335
|
-
urlOverride: `${
|
|
428
|
+
if (extensionResponse?.status !== 200) {
|
|
429
|
+
log$c.info(`no extensions found, using base data`);
|
|
430
|
+
const response = await getAll$8({
|
|
431
|
+
urlOverride: `${URL$b}/api/kos/descriptor/system:app/kondra.ncui.navigations`
|
|
336
432
|
});
|
|
337
|
-
return
|
|
433
|
+
return response?.data ?? [];
|
|
338
434
|
}
|
|
339
|
-
return
|
|
340
|
-
} catch {
|
|
341
|
-
const
|
|
342
|
-
urlOverride: `${
|
|
435
|
+
return extensionResponse?.data ?? [];
|
|
436
|
+
} catch (error) {
|
|
437
|
+
const response = await getAll$8({
|
|
438
|
+
urlOverride: `${URL$b}/api/kos/descriptor/system:app/kondra.ncui.navigations`
|
|
343
439
|
});
|
|
344
|
-
return
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
const
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
440
|
+
return response?.data ?? [];
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
const navigateToCui = async () => {
|
|
444
|
+
log$c.debug("navigating to CUI");
|
|
445
|
+
const response = await getOne$3({
|
|
446
|
+
urlOverride: `${URL$b}/api/app/kosdev.ddk/cui/open`
|
|
447
|
+
});
|
|
448
|
+
return response;
|
|
449
|
+
};
|
|
450
|
+
const navigateToNCui$1 = async () => {
|
|
451
|
+
log$c.debug("navigating to NCUI");
|
|
452
|
+
const response = await getOne$3({
|
|
453
|
+
urlOverride: `${URL$b}/api/app/kosdev.ddk/ncui/open`
|
|
454
|
+
});
|
|
455
|
+
return response;
|
|
456
|
+
};
|
|
457
|
+
var __defProp$g = Object.defineProperty;
|
|
458
|
+
var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
|
|
459
|
+
var __decorateClass$l = (decorators, target, key, kind) => {
|
|
460
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$l(target, key) : target;
|
|
461
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
462
|
+
if (decorator = decorators[i])
|
|
463
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
464
|
+
if (kind && result) __defProp$g(target, key, result);
|
|
465
|
+
return result;
|
|
466
|
+
};
|
|
467
|
+
const MODEL_TYPE$l = "application-model";
|
|
468
|
+
const flattenNavigationItems = (items, path = "") => items.reduce((acc, item) => {
|
|
469
|
+
const itemPath = path ? `${path}.${item.name}` : item.name;
|
|
470
|
+
acc[itemPath] = { ...item, root: !path };
|
|
471
|
+
if (item.children) {
|
|
472
|
+
const childItems = flattenNavigationItems(item.children, itemPath);
|
|
473
|
+
Object.keys(childItems).forEach((key) => {
|
|
474
|
+
acc[key] = childItems[key];
|
|
362
475
|
});
|
|
363
476
|
}
|
|
364
|
-
return
|
|
477
|
+
return acc;
|
|
365
478
|
}, {});
|
|
366
|
-
let
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
this.id =
|
|
479
|
+
let ApplicationModelImpl = class {
|
|
480
|
+
id;
|
|
481
|
+
device;
|
|
482
|
+
authModel;
|
|
483
|
+
setupStepContainer;
|
|
484
|
+
door;
|
|
485
|
+
ncuiLanguage;
|
|
486
|
+
activeCui;
|
|
487
|
+
fallbackCui;
|
|
488
|
+
_cuis = [];
|
|
489
|
+
_navigationItems = [];
|
|
490
|
+
// @kosConfigProperty({
|
|
491
|
+
// path: 'somewhere.enable.dial.animation',
|
|
492
|
+
// attribute: 'enableDialAnimation',
|
|
493
|
+
// })
|
|
494
|
+
// enableDialAnimation!: KosConfigProperty<boolean>;
|
|
495
|
+
// @kosConfigProperty({
|
|
496
|
+
// path: 'somewhere.enable.modal.animation',
|
|
497
|
+
// attribute: 'enableModalAnimation',
|
|
498
|
+
// })
|
|
499
|
+
// enableModalAnimation!: KosConfigProperty<boolean>;
|
|
500
|
+
// @kosConfigProperty({
|
|
501
|
+
// path: 'somewhere.enable.sidebar.animation',
|
|
502
|
+
// attribute: 'enableSidebarAnimation',
|
|
503
|
+
// })
|
|
504
|
+
// enableSidebarAnimation!: KosConfigProperty<boolean>;
|
|
505
|
+
languages;
|
|
506
|
+
logger;
|
|
507
|
+
constructor(modelId, _options, context) {
|
|
508
|
+
this.id = modelId;
|
|
509
|
+
this.languages = [];
|
|
510
|
+
this._cuis = [];
|
|
511
|
+
this.logger = context.logger;
|
|
512
|
+
this.door = Door.instance("app:kosdev.ddk:service:door:door").options({
|
|
396
513
|
doorPath: "app:kosdev.ddk:service:door:door"
|
|
397
514
|
}).build();
|
|
398
515
|
}
|
|
399
516
|
get setupRequired() {
|
|
400
|
-
return this.authModel.currentRole === "crew" ?
|
|
517
|
+
return this.authModel.currentRole === "crew" ? false : this.setupStepContainer.setupRequired;
|
|
401
518
|
}
|
|
402
519
|
get currentRole() {
|
|
403
520
|
return this.authModel.currentRole;
|
|
404
521
|
}
|
|
405
522
|
get cuis() {
|
|
406
|
-
return this._cuis.reduce((
|
|
523
|
+
return this._cuis.reduce((acc, cui) => {
|
|
524
|
+
acc[cui.appId] = cui;
|
|
525
|
+
return acc;
|
|
526
|
+
}, {});
|
|
407
527
|
}
|
|
408
528
|
get navigationItems() {
|
|
409
|
-
return
|
|
529
|
+
return flattenNavigationItems(this._navigationItems);
|
|
410
530
|
}
|
|
411
531
|
get hasCuiDefined() {
|
|
412
532
|
return !!this.activeCui.value || !!this.fallbackCui.value;
|
|
@@ -415,19 +535,24 @@ let b = class {
|
|
|
415
535
|
return this.door.isOpen;
|
|
416
536
|
}
|
|
417
537
|
async enter() {
|
|
418
|
-
this.logger.info("navigating to NCUI")
|
|
538
|
+
this.logger.info("navigating to NCUI");
|
|
539
|
+
await navigateToNCui$1();
|
|
419
540
|
}
|
|
420
541
|
async exit() {
|
|
421
|
-
this.logger.info("navigating to CUI")
|
|
542
|
+
this.logger.info("navigating to CUI");
|
|
543
|
+
await navigateToCui();
|
|
422
544
|
}
|
|
423
545
|
// -------------------LIFECYCLE----------------------------
|
|
424
546
|
async load() {
|
|
425
|
-
var o, s;
|
|
426
547
|
this.logger.debug(`loading application ${this.id}`);
|
|
427
|
-
const
|
|
428
|
-
this._navigationItems =
|
|
429
|
-
const
|
|
430
|
-
this._cuis =
|
|
548
|
+
const navigationItems = await getNavigation();
|
|
549
|
+
this._navigationItems = navigationItems;
|
|
550
|
+
const cuis = await getCuis();
|
|
551
|
+
this._cuis = cuis;
|
|
552
|
+
if (this.setupStepContainer?.hasIncompletePreSteps) {
|
|
553
|
+
this.authModel?.forceRole("technician");
|
|
554
|
+
}
|
|
555
|
+
this.languages = [
|
|
431
556
|
{
|
|
432
557
|
name: "English",
|
|
433
558
|
locale: "en"
|
|
@@ -435,90 +560,103 @@ let b = class {
|
|
|
435
560
|
];
|
|
436
561
|
}
|
|
437
562
|
};
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
],
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
],
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
],
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
],
|
|
450
|
-
|
|
451
|
-
|
|
563
|
+
__decorateClass$l([
|
|
564
|
+
kosDependency({ modelType: Device.type })
|
|
565
|
+
], ApplicationModelImpl.prototype, "device", 2);
|
|
566
|
+
__decorateClass$l([
|
|
567
|
+
kosDependency({ modelType: Auth.type })
|
|
568
|
+
], ApplicationModelImpl.prototype, "authModel", 2);
|
|
569
|
+
__decorateClass$l([
|
|
570
|
+
kosDependency({ modelType: SetupStepContainer.type })
|
|
571
|
+
], ApplicationModelImpl.prototype, "setupStepContainer", 2);
|
|
572
|
+
__decorateClass$l([
|
|
573
|
+
kosChild
|
|
574
|
+
], ApplicationModelImpl.prototype, "door", 2);
|
|
575
|
+
__decorateClass$l([
|
|
576
|
+
kosConfigProperty({
|
|
452
577
|
path: "app:kosdev.ddk:app",
|
|
453
578
|
attribute: "ncui.ncuiLanguage"
|
|
454
579
|
//updated attribute for language config property
|
|
455
580
|
})
|
|
456
|
-
],
|
|
457
|
-
|
|
458
|
-
|
|
581
|
+
], ApplicationModelImpl.prototype, "ncuiLanguage", 2);
|
|
582
|
+
__decorateClass$l([
|
|
583
|
+
kosConfigProperty({
|
|
459
584
|
path: "app:kosdev.ddk:service:cui",
|
|
460
585
|
attribute: "activeCui"
|
|
461
586
|
})
|
|
462
|
-
],
|
|
463
|
-
|
|
464
|
-
|
|
587
|
+
], ApplicationModelImpl.prototype, "activeCui", 2);
|
|
588
|
+
__decorateClass$l([
|
|
589
|
+
kosConfigProperty({
|
|
465
590
|
path: "app:kosdev.ddk:service:cui",
|
|
466
591
|
attribute: "fallbackCui"
|
|
467
592
|
})
|
|
468
|
-
],
|
|
469
|
-
|
|
470
|
-
l
|
|
471
|
-
],
|
|
472
|
-
const
|
|
593
|
+
], ApplicationModelImpl.prototype, "fallbackCui", 2);
|
|
594
|
+
ApplicationModelImpl = __decorateClass$l([
|
|
595
|
+
kosModel(MODEL_TYPE$l)
|
|
596
|
+
], ApplicationModelImpl);
|
|
597
|
+
const Application = {
|
|
473
598
|
registration: {
|
|
474
|
-
[
|
|
475
|
-
class:
|
|
476
|
-
singleton:
|
|
599
|
+
[MODEL_TYPE$l]: {
|
|
600
|
+
class: ApplicationModelImpl,
|
|
601
|
+
singleton: true
|
|
477
602
|
}
|
|
478
603
|
},
|
|
479
|
-
type:
|
|
480
|
-
predicate:
|
|
481
|
-
factory:
|
|
482
|
-
|
|
604
|
+
type: MODEL_TYPE$l,
|
|
605
|
+
predicate: isKosModel(MODEL_TYPE$l),
|
|
606
|
+
factory: Kos.Singleton.create(
|
|
607
|
+
MODEL_TYPE$l
|
|
483
608
|
)
|
|
484
|
-
}
|
|
609
|
+
};
|
|
610
|
+
const RoleMap = {
|
|
485
611
|
none: 999,
|
|
486
612
|
crew: 0,
|
|
487
613
|
technician: 1,
|
|
488
614
|
manager: 2
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
615
|
+
};
|
|
616
|
+
const troubleVisibilityFilter = (currentRole) => (trouble) => {
|
|
617
|
+
if (trouble.type === AGITATION_REQUIRED_TROUBLE) {
|
|
618
|
+
return false;
|
|
619
|
+
}
|
|
620
|
+
const visibleRole = trouble?.role || "technician";
|
|
621
|
+
if (currentRole && visibleRole) {
|
|
622
|
+
const currentRoleIndex = RoleMap[currentRole.toLowerCase()] ?? RoleMap["crew"];
|
|
623
|
+
const visibleRoleIndex = RoleMap[visibleRole.toLowerCase()] ?? RoleMap["crew"];
|
|
624
|
+
return currentRoleIndex >= visibleRoleIndex;
|
|
625
|
+
}
|
|
626
|
+
return false;
|
|
627
|
+
};
|
|
628
|
+
var __defProp$f = Object.defineProperty;
|
|
629
|
+
var __getOwnPropDesc$k = Object.getOwnPropertyDescriptor;
|
|
630
|
+
var __decorateClass$k = (decorators, target, key, kind) => {
|
|
631
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$k(target, key) : target;
|
|
632
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
633
|
+
if (decorator = decorators[i])
|
|
634
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
635
|
+
if (kind && result) __defProp$f(target, key, result);
|
|
636
|
+
return result;
|
|
637
|
+
};
|
|
638
|
+
const MODEL_TYPE$k = "agitation-control-model";
|
|
639
|
+
const FUTURE_RESOLVE = "resolve";
|
|
640
|
+
const FUTURE_AGITATE = "agitate";
|
|
641
|
+
let AgitationControlModelImpl = class {
|
|
642
|
+
id;
|
|
643
|
+
futureHandler;
|
|
644
|
+
logger;
|
|
645
|
+
troubleContainer;
|
|
646
|
+
_agitationFutureId;
|
|
647
|
+
_canExit = true;
|
|
648
|
+
_exiting = false;
|
|
649
|
+
_isFailed = false;
|
|
650
|
+
disposer;
|
|
651
|
+
application;
|
|
652
|
+
constructor(modelId, options, context) {
|
|
653
|
+
this.id = modelId;
|
|
654
|
+
this.logger = context.logger;
|
|
655
|
+
this.troubleContainer = options.companionParent;
|
|
656
|
+
this.futureHandler = new MultipleFutureHandler(this, FUTURE_RESOLVE);
|
|
657
|
+
}
|
|
658
|
+
set isFailed(value) {
|
|
659
|
+
this._isFailed = value;
|
|
522
660
|
}
|
|
523
661
|
get isFailed() {
|
|
524
662
|
return this._isFailed;
|
|
@@ -529,188 +667,241 @@ let $ = class {
|
|
|
529
667
|
get isAgitating() {
|
|
530
668
|
return !!this._agitationFutureId;
|
|
531
669
|
}
|
|
532
|
-
set exiting(
|
|
533
|
-
this._exiting =
|
|
670
|
+
set exiting(value) {
|
|
671
|
+
this._exiting = value;
|
|
534
672
|
}
|
|
535
673
|
get exiting() {
|
|
536
674
|
return this._exiting;
|
|
537
675
|
}
|
|
538
676
|
get canExit() {
|
|
539
|
-
|
|
677
|
+
const allDeferredCount = this.queuedTroubles.length;
|
|
678
|
+
return allDeferredCount === 0 && this._canExit;
|
|
540
679
|
}
|
|
541
680
|
clearAll() {
|
|
542
|
-
this.queuedTroubles.forEach((
|
|
543
|
-
|
|
681
|
+
this.queuedTroubles.forEach((trouble) => {
|
|
682
|
+
trouble.clearDefer();
|
|
544
683
|
});
|
|
545
684
|
}
|
|
546
685
|
get readyToResolve() {
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
686
|
+
const allDeferredCount = this.queuedTroubles.length;
|
|
687
|
+
const notResolvable = this.queuedTroubles.filter((t) => t.shouldDefer);
|
|
688
|
+
const _readyToResolve = allDeferredCount > 0 && notResolvable.length === 0;
|
|
689
|
+
return this.isDoorClosed && _readyToResolve && this.exiting;
|
|
690
|
+
}
|
|
691
|
+
onFutureUpdate(future) {
|
|
692
|
+
if (future.endState === FutureEndState.Success) {
|
|
693
|
+
this.logger.debug(
|
|
694
|
+
`Resolve deferred troubles future ${future.id} completed successfully`
|
|
695
|
+
);
|
|
696
|
+
this.queuedTroubles.forEach((trouble) => {
|
|
697
|
+
trouble.clearDefer();
|
|
698
|
+
});
|
|
699
|
+
kosAction(() => {
|
|
700
|
+
this._canExit = true;
|
|
701
|
+
this._isFailed = false;
|
|
702
|
+
});
|
|
703
|
+
} else if (future.endState === FutureEndState.Fail || future.endState === FutureEndState.Canceled || future.endState === FutureEndState.Aborted) {
|
|
704
|
+
this.logger.error(`Resolve deferred troubles future ${future.id} failed`);
|
|
705
|
+
this.clearAll();
|
|
706
|
+
kosAction(() => {
|
|
707
|
+
this._canExit = false;
|
|
708
|
+
this._isFailed = true;
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
inProgress = [];
|
|
713
|
+
async resolveDeferredTroubles(tracker) {
|
|
714
|
+
const toResolve = this.queuedTroubles.filter((t) => !t.shouldDefer).map((trouble) => trouble.rawId).filter((id) => !this.inProgress.includes(id));
|
|
715
|
+
this.inProgress.push(...toResolve);
|
|
716
|
+
if (toResolve.length === 0) {
|
|
717
|
+
return void 0;
|
|
718
|
+
}
|
|
719
|
+
const response = await TroubleServices.bulkResolveTroubles(
|
|
720
|
+
toResolve,
|
|
565
721
|
void 0,
|
|
566
|
-
|
|
722
|
+
tracker
|
|
567
723
|
);
|
|
724
|
+
return response;
|
|
568
725
|
}
|
|
569
726
|
get hasQueuedTroubles() {
|
|
570
727
|
return this.queuedTroubles.length > 0;
|
|
571
728
|
}
|
|
572
729
|
get queuedTroubles() {
|
|
573
730
|
return this.troubleContainer.troubles.getIndexByKey(
|
|
574
|
-
|
|
575
|
-
|
|
731
|
+
Troubles.INDEX_TROUBLES_BY_DEFERRED,
|
|
732
|
+
Troubles.TROUBLES_DEFERRED
|
|
576
733
|
);
|
|
577
734
|
}
|
|
578
735
|
get visibleTroubles() {
|
|
579
|
-
const
|
|
580
|
-
return this.troubleContainer.troubles.data.filter(
|
|
736
|
+
const currentRole = this.application.currentRole;
|
|
737
|
+
return this.troubleContainer.troubles.data.filter(troubleVisibilityFilter(currentRole)).filter((trouble) => trouble.type !== AGITATION_REQUIRED_TROUBLE);
|
|
581
738
|
}
|
|
582
739
|
// -------------------LIFECYCLE----------------------------
|
|
583
740
|
get future() {
|
|
584
741
|
return this.futureHandler.future;
|
|
585
742
|
}
|
|
586
743
|
get resolveFuture() {
|
|
587
|
-
return this.futureHandler.getFuture(
|
|
744
|
+
return this.futureHandler.getFuture(FUTURE_RESOLVE);
|
|
588
745
|
}
|
|
589
746
|
get agitateFuture() {
|
|
590
|
-
return this.futureHandler.getFuture(
|
|
747
|
+
return this.futureHandler.getFuture(FUTURE_AGITATE);
|
|
591
748
|
}
|
|
592
|
-
handleAgitationStarted(
|
|
593
|
-
this.logger.info(`Agitation started for ${
|
|
749
|
+
handleAgitationStarted(event) {
|
|
750
|
+
this.logger.info(`Agitation started for ${event.path}`);
|
|
751
|
+
this._agitationFutureId = String(event.futureId);
|
|
594
752
|
}
|
|
595
|
-
handleAgitationEnded(
|
|
596
|
-
this.logger.info(`Agitation ended for ${
|
|
753
|
+
handleAgitationEnded(event) {
|
|
754
|
+
this.logger.info(`Agitation ended for ${event.path}`);
|
|
755
|
+
this._agitationFutureId = void 0;
|
|
597
756
|
}
|
|
598
757
|
async init() {
|
|
599
758
|
this.logger.debug(`initializing agitation-control ${this.id}`);
|
|
600
759
|
}
|
|
601
760
|
unload() {
|
|
602
|
-
this.logger.debug(`unloading agitation-control ${this.id}`)
|
|
761
|
+
this.logger.debug(`unloading agitation-control ${this.id}`);
|
|
762
|
+
if (this.disposer) {
|
|
763
|
+
this.disposer();
|
|
764
|
+
}
|
|
603
765
|
}
|
|
604
766
|
handleReadyToResolve() {
|
|
605
|
-
|
|
767
|
+
if (this.readyToResolve) {
|
|
768
|
+
this.logger.info(`AgitationControl - Resolving deferred troubles`);
|
|
769
|
+
this.resolveDeferredTroubles();
|
|
770
|
+
}
|
|
771
|
+
if (this._agitationFutureId) {
|
|
772
|
+
this.logger.info(`AgitationControl - Agitation started`);
|
|
773
|
+
}
|
|
606
774
|
}
|
|
607
775
|
async load() {
|
|
608
776
|
this.logger.debug(`loading agitation-control ${this.id}`);
|
|
609
777
|
}
|
|
610
778
|
};
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
],
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
],
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
],
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
],
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
dependencies: (
|
|
779
|
+
__decorateClass$k([
|
|
780
|
+
kosDependency({ modelType: Application.type })
|
|
781
|
+
], AgitationControlModelImpl.prototype, "application", 2);
|
|
782
|
+
__decorateClass$k([
|
|
783
|
+
kosFuture({ alias: FUTURE_RESOLVE })
|
|
784
|
+
], AgitationControlModelImpl.prototype, "resolveDeferredTroubles", 1);
|
|
785
|
+
__decorateClass$k([
|
|
786
|
+
kosTopicHandler({ topic: CartridgeAgitatorEvents.TOPIC_AGITATION_STARTED })
|
|
787
|
+
], AgitationControlModelImpl.prototype, "handleAgitationStarted", 1);
|
|
788
|
+
__decorateClass$k([
|
|
789
|
+
kosTopicHandler({ topic: CartridgeAgitatorEvents.TOPIC_AGITATION_ENDED })
|
|
790
|
+
], AgitationControlModelImpl.prototype, "handleAgitationEnded", 1);
|
|
791
|
+
__decorateClass$k([
|
|
792
|
+
kosModelEffect({
|
|
793
|
+
dependencies: (model) => [model.readyToResolve, model._agitationFutureId]
|
|
626
794
|
})
|
|
627
|
-
],
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
],
|
|
631
|
-
const
|
|
632
|
-
class:
|
|
633
|
-
type:
|
|
795
|
+
], AgitationControlModelImpl.prototype, "handleReadyToResolve", 1);
|
|
796
|
+
AgitationControlModelImpl = __decorateClass$k([
|
|
797
|
+
kosModel(MODEL_TYPE$k)
|
|
798
|
+
], AgitationControlModelImpl);
|
|
799
|
+
const AgitationControl = new SingletonKosModelRegistrationFactory({
|
|
800
|
+
class: AgitationControlModelImpl,
|
|
801
|
+
type: MODEL_TYPE$k
|
|
634
802
|
});
|
|
635
|
-
var
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
803
|
+
var __defProp$e = Object.defineProperty;
|
|
804
|
+
var __getOwnPropDesc$j = Object.getOwnPropertyDescriptor;
|
|
805
|
+
var __decorateClass$j = (decorators, target, key, kind) => {
|
|
806
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$j(target, key) : target;
|
|
807
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
808
|
+
if (decorator = decorators[i])
|
|
809
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
810
|
+
if (kind && result) __defProp$e(target, key, result);
|
|
811
|
+
return result;
|
|
812
|
+
};
|
|
813
|
+
const MODEL_TYPE$j = "animation-model";
|
|
814
|
+
let AnimationModelImpl = class {
|
|
815
|
+
id;
|
|
816
|
+
logger;
|
|
817
|
+
disableAll;
|
|
818
|
+
enableDial;
|
|
819
|
+
enableModal;
|
|
820
|
+
enableSideBar;
|
|
821
|
+
constructor(modelId, options, context) {
|
|
822
|
+
this.id = modelId;
|
|
823
|
+
this.logger = context.logger;
|
|
824
|
+
}
|
|
825
|
+
};
|
|
826
|
+
__decorateClass$j([
|
|
827
|
+
kosConfigProperty({
|
|
654
828
|
path: "app:kosdev.ddk:app",
|
|
655
829
|
attribute: "ncui.uiConfig.animations.disableAll"
|
|
656
830
|
})
|
|
657
|
-
],
|
|
658
|
-
|
|
659
|
-
|
|
831
|
+
], AnimationModelImpl.prototype, "disableAll", 2);
|
|
832
|
+
__decorateClass$j([
|
|
833
|
+
kosConfigProperty({
|
|
660
834
|
path: "app:kosdev.ddk:app",
|
|
661
835
|
attribute: "ncui.uiConfig.animations.enableDial"
|
|
662
836
|
})
|
|
663
|
-
],
|
|
664
|
-
|
|
665
|
-
|
|
837
|
+
], AnimationModelImpl.prototype, "enableDial", 2);
|
|
838
|
+
__decorateClass$j([
|
|
839
|
+
kosConfigProperty({
|
|
666
840
|
path: "app:kosdev.ddk:app",
|
|
667
841
|
attribute: "ncui.uiConfig.animations.enableModal"
|
|
668
842
|
})
|
|
669
|
-
],
|
|
670
|
-
|
|
671
|
-
|
|
843
|
+
], AnimationModelImpl.prototype, "enableModal", 2);
|
|
844
|
+
__decorateClass$j([
|
|
845
|
+
kosConfigProperty({
|
|
672
846
|
path: "app:kosdev.ddk:app",
|
|
673
847
|
attribute: "ncui.uiConfig.animations.enableSideBar"
|
|
674
848
|
})
|
|
675
|
-
],
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
],
|
|
679
|
-
const
|
|
849
|
+
], AnimationModelImpl.prototype, "enableSideBar", 2);
|
|
850
|
+
AnimationModelImpl = __decorateClass$j([
|
|
851
|
+
kosModel(MODEL_TYPE$j)
|
|
852
|
+
], AnimationModelImpl);
|
|
853
|
+
const Animation = {
|
|
680
854
|
registration: {
|
|
681
|
-
[
|
|
682
|
-
class:
|
|
683
|
-
singleton:
|
|
855
|
+
[MODEL_TYPE$j]: {
|
|
856
|
+
class: AnimationModelImpl,
|
|
857
|
+
singleton: true
|
|
684
858
|
}
|
|
685
859
|
},
|
|
686
|
-
type:
|
|
687
|
-
predicate:
|
|
688
|
-
factory:
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
}
|
|
860
|
+
type: MODEL_TYPE$j,
|
|
861
|
+
predicate: isKosModel(MODEL_TYPE$j),
|
|
862
|
+
factory: Kos.Singleton.create(MODEL_TYPE$j)
|
|
863
|
+
};
|
|
864
|
+
const { URL: URL$a } = resolveServiceUrl("ANIMATION_SERVICE");
|
|
865
|
+
const { getAll: getAll$7 } = ServiceFactory.build({
|
|
866
|
+
basePath: `${URL$a}/api/animation`
|
|
867
|
+
});
|
|
868
|
+
const log$b = KosLog.createLogger({
|
|
692
869
|
name: "animation-service",
|
|
693
870
|
group: "Services"
|
|
694
|
-
})
|
|
871
|
+
});
|
|
872
|
+
const getAnimations = async () => {
|
|
873
|
+
log$b.debug("sending GET for animation");
|
|
874
|
+
const response = await getAll$7({});
|
|
875
|
+
return response;
|
|
876
|
+
};
|
|
877
|
+
const index$b = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
695
878
|
__proto__: null,
|
|
696
|
-
getAnimations
|
|
879
|
+
getAnimations
|
|
697
880
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
698
|
-
var
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
881
|
+
var __defProp$d = Object.defineProperty;
|
|
882
|
+
var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
|
|
883
|
+
var __decorateClass$i = (decorators, target, key, kind) => {
|
|
884
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$i(target, key) : target;
|
|
885
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
886
|
+
if (decorator = decorators[i])
|
|
887
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
888
|
+
if (kind && result) __defProp$d(target, key, result);
|
|
889
|
+
return result;
|
|
890
|
+
};
|
|
891
|
+
const MODEL_TYPE$i = "carb-water-model";
|
|
892
|
+
let CarbWaterModelImpl = class {
|
|
893
|
+
id;
|
|
894
|
+
assemblyModel;
|
|
895
|
+
logger;
|
|
896
|
+
constructor(modelId, _options, context) {
|
|
897
|
+
this.id = modelId;
|
|
898
|
+
this.logger = context.logger;
|
|
710
899
|
}
|
|
711
900
|
getPump() {
|
|
712
|
-
const
|
|
713
|
-
|
|
901
|
+
const carbHolder = this.assemblyModel.getHoldersByGroup("carb")[0];
|
|
902
|
+
const pump = carbHolder.pumps.data[0];
|
|
903
|
+
const model = getKosCompanionModel(pump, FcmPump.type);
|
|
904
|
+
return model;
|
|
714
905
|
}
|
|
715
906
|
// -------------------LIFECYCLE----------------------------
|
|
716
907
|
async init() {
|
|
@@ -720,102 +911,128 @@ let ye = class {
|
|
|
720
911
|
this.logger.debug(`loading carb-water ${this.id}`);
|
|
721
912
|
}
|
|
722
913
|
};
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
],
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
],
|
|
729
|
-
const
|
|
914
|
+
__decorateClass$i([
|
|
915
|
+
kosDependency({ modelType: Assembly.type })
|
|
916
|
+
], CarbWaterModelImpl.prototype, "assemblyModel", 2);
|
|
917
|
+
CarbWaterModelImpl = __decorateClass$i([
|
|
918
|
+
kosModel(MODEL_TYPE$i)
|
|
919
|
+
], CarbWaterModelImpl);
|
|
920
|
+
const CarbWater = {
|
|
730
921
|
registration: {
|
|
731
|
-
[
|
|
732
|
-
class:
|
|
733
|
-
singleton:
|
|
922
|
+
[MODEL_TYPE$i]: {
|
|
923
|
+
class: CarbWaterModelImpl,
|
|
924
|
+
singleton: false
|
|
734
925
|
}
|
|
735
926
|
},
|
|
736
|
-
type:
|
|
737
|
-
predicate:
|
|
738
|
-
factory:
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
|
|
927
|
+
type: MODEL_TYPE$i,
|
|
928
|
+
predicate: isKosModel(MODEL_TYPE$i),
|
|
929
|
+
factory: Kos.Factory.create(MODEL_TYPE$i)
|
|
930
|
+
};
|
|
931
|
+
const { URL: URL$9 } = resolveServiceUrl("COPY-LOGS_SERVICE");
|
|
932
|
+
const { getAll: getAll$6, getOne: getOne$2, postModel: postModel$2, deleteModel } = ServiceFactory.build({
|
|
933
|
+
basePath: `${URL$9}/api/copy-logs`
|
|
934
|
+
});
|
|
935
|
+
const log$a = KosLog.createLogger({
|
|
742
936
|
name: "copy-logs-service",
|
|
743
937
|
group: "Services"
|
|
744
|
-
})
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
938
|
+
});
|
|
939
|
+
const eraseVolume = async (volumeId, tracker) => {
|
|
940
|
+
const response = await deleteModel({
|
|
941
|
+
tracker,
|
|
942
|
+
id: volumeId,
|
|
943
|
+
urlOverride: `${URL$9}/api/app/kosdev.ddk/copyLogs/${volumeId}`
|
|
749
944
|
});
|
|
750
|
-
if (!
|
|
945
|
+
if (!response?.data) {
|
|
751
946
|
throw new Error("No response from server");
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
947
|
+
}
|
|
948
|
+
return response.data;
|
|
949
|
+
};
|
|
950
|
+
const eraseAndCopyLogsToVolume = async (volumeId, tracker) => {
|
|
951
|
+
const response = await postModel$2({
|
|
755
952
|
model: {},
|
|
756
|
-
tracker
|
|
757
|
-
urlOverride: `${
|
|
953
|
+
tracker,
|
|
954
|
+
urlOverride: `${URL$9}/api/app/kosdev.ddk/copyLogs/eraseAndCopy/${volumeId}`
|
|
758
955
|
});
|
|
759
|
-
if (!
|
|
956
|
+
if (!response?.data) {
|
|
760
957
|
throw new Error("No response from server");
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
958
|
+
}
|
|
959
|
+
return response.data;
|
|
960
|
+
};
|
|
961
|
+
const copyLogFromVolume = async (volumeId, tracker) => {
|
|
962
|
+
const response = await postModel$2({
|
|
764
963
|
model: {},
|
|
765
|
-
tracker
|
|
766
|
-
urlOverride: `${
|
|
964
|
+
tracker,
|
|
965
|
+
urlOverride: `${URL$9}/api/app/kosdev.ddk/copyLogs/${volumeId}`
|
|
767
966
|
});
|
|
768
|
-
if (!
|
|
967
|
+
if (!response?.data) {
|
|
769
968
|
throw new Error("No response from server");
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
969
|
+
}
|
|
970
|
+
return response.data;
|
|
971
|
+
};
|
|
972
|
+
const getVolumes = async () => {
|
|
973
|
+
log$a.debug("sending GET for copy-logs");
|
|
773
974
|
try {
|
|
774
|
-
const
|
|
775
|
-
urlOverride: `${
|
|
975
|
+
const response = await getAll$6({
|
|
976
|
+
urlOverride: `${URL$9}/api/app/kosdev.ddk/copyLogs/volumes/size`
|
|
776
977
|
});
|
|
777
|
-
return [void 0,
|
|
778
|
-
} catch (
|
|
779
|
-
if (
|
|
780
|
-
|
|
978
|
+
return [void 0, response?.data];
|
|
979
|
+
} catch (error) {
|
|
980
|
+
if (error instanceof FetchError) {
|
|
981
|
+
log$a.error(`Error fetching log file size: ${error.payload.error}`);
|
|
982
|
+
return [error.payload.error, void 0];
|
|
983
|
+
}
|
|
781
984
|
}
|
|
782
985
|
return ["unknownError", void 0];
|
|
783
|
-
}
|
|
784
|
-
|
|
986
|
+
};
|
|
987
|
+
const getLogFileSize = async () => {
|
|
988
|
+
log$a.debug("sending GET for log file size");
|
|
785
989
|
try {
|
|
786
|
-
const
|
|
787
|
-
urlOverride: `${
|
|
990
|
+
const response = await getOne$2({
|
|
991
|
+
urlOverride: `${URL$9}/api/app/kosdev.ddk/copyLogs/files/size`
|
|
788
992
|
});
|
|
789
|
-
return [void 0,
|
|
790
|
-
} catch (
|
|
791
|
-
if (
|
|
792
|
-
|
|
993
|
+
return [void 0, response?.data];
|
|
994
|
+
} catch (error) {
|
|
995
|
+
if (error instanceof FetchError) {
|
|
996
|
+
log$a.error(`Error fetching log file size: ${error.payload.error}`);
|
|
997
|
+
return [error.payload.error, void 0];
|
|
998
|
+
}
|
|
793
999
|
}
|
|
794
1000
|
return ["unknownError", void 0];
|
|
795
|
-
}
|
|
1001
|
+
};
|
|
1002
|
+
const index$a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
796
1003
|
__proto__: null,
|
|
797
|
-
copyLogFromVolume
|
|
798
|
-
eraseAndCopyLogsToVolume
|
|
799
|
-
eraseVolume
|
|
800
|
-
getLogFileSize
|
|
801
|
-
getVolumes
|
|
1004
|
+
copyLogFromVolume,
|
|
1005
|
+
eraseAndCopyLogsToVolume,
|
|
1006
|
+
eraseVolume,
|
|
1007
|
+
getLogFileSize,
|
|
1008
|
+
getVolumes
|
|
802
1009
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
803
|
-
var
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
1010
|
+
var __defProp$c = Object.defineProperty;
|
|
1011
|
+
var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
|
|
1012
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1013
|
+
var __decorateClass$h = (decorators, target, key, kind) => {
|
|
1014
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$h(target, key) : target;
|
|
1015
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1016
|
+
if (decorator = decorators[i])
|
|
1017
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1018
|
+
if (kind && result) __defProp$c(target, key, result);
|
|
1019
|
+
return result;
|
|
1020
|
+
};
|
|
1021
|
+
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, key + "", value);
|
|
1022
|
+
const MODEL_TYPE$h = "copy-logs-model";
|
|
1023
|
+
let CopyLogsModelImpl = class {
|
|
1024
|
+
id;
|
|
1025
|
+
_volumes;
|
|
1026
|
+
storageDeviceContainer;
|
|
1027
|
+
_activeVolume;
|
|
1028
|
+
_logFileSize = 0;
|
|
1029
|
+
_actionState = "idle";
|
|
1030
|
+
copyProgress;
|
|
1031
|
+
constructor(modelId) {
|
|
1032
|
+
this.id = modelId;
|
|
1033
|
+
this._volumes = new KosDataContainer();
|
|
1034
|
+
this._activeVolume = void 0;
|
|
1035
|
+
this.copyProgress = {
|
|
819
1036
|
bytesCopied: 0,
|
|
820
1037
|
bytesToCopy: 0,
|
|
821
1038
|
filesCopied: 0,
|
|
@@ -833,19 +1050,20 @@ let _ = class {
|
|
|
833
1050
|
return this._logFileSize;
|
|
834
1051
|
}
|
|
835
1052
|
reset() {
|
|
836
|
-
this.clearActiveVolume()
|
|
1053
|
+
this.clearActiveVolume();
|
|
1054
|
+
this.futureHandler.removeFuture();
|
|
837
1055
|
}
|
|
838
1056
|
clearActiveVolume() {
|
|
839
1057
|
this._activeVolume = void 0;
|
|
840
1058
|
}
|
|
841
|
-
updateActiveVolume(
|
|
842
|
-
this._activeVolume =
|
|
1059
|
+
updateActiveVolume(volume) {
|
|
1060
|
+
this._activeVolume = volume;
|
|
843
1061
|
}
|
|
844
1062
|
get inserted() {
|
|
845
1063
|
return this.storageDeviceContainer.isStorageInserted;
|
|
846
1064
|
}
|
|
847
|
-
updateLogFileSize(
|
|
848
|
-
this._logFileSize =
|
|
1065
|
+
updateLogFileSize(size) {
|
|
1066
|
+
this._logFileSize = size;
|
|
849
1067
|
}
|
|
850
1068
|
get canCopyLogs() {
|
|
851
1069
|
return this.inserted && this._activeVolume;
|
|
@@ -854,170 +1072,235 @@ let _ = class {
|
|
|
854
1072
|
return this._actionState;
|
|
855
1073
|
}
|
|
856
1074
|
get diskFull() {
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
this.
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
1075
|
+
return this.future?.status === FutureEndState.Success && this.copyProgress.filesSkipped > 0;
|
|
1076
|
+
}
|
|
1077
|
+
onFutureUpdate(update) {
|
|
1078
|
+
this.logger.info(`Future update: ${update.status}`);
|
|
1079
|
+
if (update.status === FutureEndState.Success) {
|
|
1080
|
+
this.logger.info(`Future success: ${update.status}`);
|
|
1081
|
+
if (this.diskFull) {
|
|
1082
|
+
kosAction(() => {
|
|
1083
|
+
update.endState = FutureEndState.Fail;
|
|
1084
|
+
update.reason = "errDiskFull";
|
|
1085
|
+
});
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
if (update.status === FutureEndState.Fail) {
|
|
1089
|
+
this.logger.error(`Future failed: ${update.status}`);
|
|
1090
|
+
}
|
|
1091
|
+
if (update.note === "copy") {
|
|
1092
|
+
kosAction(() => {
|
|
1093
|
+
this._actionState = "copying";
|
|
1094
|
+
this.copyProgress = update.clientData || {
|
|
1095
|
+
bytesCopied: 0,
|
|
1096
|
+
bytesToCopy: 0,
|
|
1097
|
+
filesCopied: 0,
|
|
1098
|
+
filesSkipped: 0
|
|
1099
|
+
};
|
|
1100
|
+
});
|
|
1101
|
+
} else {
|
|
1102
|
+
this._actionState = "erasing";
|
|
1103
|
+
kosAction(() => {
|
|
1104
|
+
this.copyProgress = {
|
|
1105
|
+
bytesCopied: 0,
|
|
1106
|
+
bytesToCopy: 0,
|
|
1107
|
+
filesCopied: 0,
|
|
1108
|
+
filesSkipped: 0
|
|
1109
|
+
};
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
878
1112
|
}
|
|
879
|
-
async eraseAndCopyVolume(
|
|
880
|
-
|
|
881
|
-
if (!e)
|
|
1113
|
+
async eraseAndCopyVolume(tracker) {
|
|
1114
|
+
if (!tracker) {
|
|
882
1115
|
throw new Error("No tracker provided");
|
|
883
|
-
|
|
1116
|
+
}
|
|
1117
|
+
kosAction(() => {
|
|
884
1118
|
this._actionState = "erasing";
|
|
885
|
-
})
|
|
886
|
-
|
|
887
|
-
|
|
1119
|
+
});
|
|
1120
|
+
if (!this._activeVolume) {
|
|
1121
|
+
this.logger.error("No active volume selected");
|
|
1122
|
+
throw new Error("No active volume selected");
|
|
1123
|
+
}
|
|
1124
|
+
this.logger.info(`Erasing volume ${this._activeVolume?.name}`);
|
|
1125
|
+
return eraseAndCopyLogsToVolume(this._activeVolume.id, tracker);
|
|
888
1126
|
}
|
|
889
|
-
async eraseVolume(
|
|
890
|
-
|
|
891
|
-
if (!e)
|
|
1127
|
+
async eraseVolume(tracker) {
|
|
1128
|
+
if (!tracker) {
|
|
892
1129
|
throw new Error("No tracker provided");
|
|
893
|
-
|
|
1130
|
+
}
|
|
1131
|
+
kosAction(() => {
|
|
894
1132
|
this._actionState = "erasing";
|
|
895
|
-
})
|
|
896
|
-
|
|
897
|
-
|
|
1133
|
+
});
|
|
1134
|
+
if (!this._activeVolume) {
|
|
1135
|
+
this.logger.error("No active volume selected");
|
|
1136
|
+
throw new Error("No active volume selected");
|
|
1137
|
+
}
|
|
1138
|
+
this.logger.info(`Erasing volume ${this._activeVolume?.name}`);
|
|
1139
|
+
return eraseVolume(this._activeVolume.id, tracker);
|
|
898
1140
|
}
|
|
899
|
-
async copyLogs(
|
|
900
|
-
|
|
901
|
-
if (!e)
|
|
1141
|
+
async copyLogs(tracker) {
|
|
1142
|
+
if (!tracker) {
|
|
902
1143
|
throw new Error("No tracker provided");
|
|
903
|
-
|
|
1144
|
+
}
|
|
1145
|
+
kosAction(() => {
|
|
904
1146
|
this._actionState = "copying";
|
|
905
|
-
})
|
|
906
|
-
|
|
907
|
-
|
|
1147
|
+
});
|
|
1148
|
+
if (!this._activeVolume) {
|
|
1149
|
+
this.logger.error("No active volume selected");
|
|
1150
|
+
throw new Error("No active volume selected");
|
|
1151
|
+
}
|
|
1152
|
+
this.logger.info(`Copying logs to ${this._activeVolume?.name}`);
|
|
1153
|
+
return copyLogFromVolume(this._activeVolume.id, tracker);
|
|
908
1154
|
}
|
|
909
1155
|
handleInsertion() {
|
|
910
|
-
|
|
1156
|
+
if (this.inserted) {
|
|
1157
|
+
this.syncVolumes();
|
|
1158
|
+
} else {
|
|
1159
|
+
this._volumes.clear();
|
|
1160
|
+
this.clearActiveVolume();
|
|
1161
|
+
}
|
|
911
1162
|
}
|
|
912
1163
|
async init() {
|
|
913
1164
|
this.logger.debug(`initializing copy-logs ${this.id}`);
|
|
914
1165
|
}
|
|
915
1166
|
async syncVolumes() {
|
|
916
|
-
const [
|
|
917
|
-
|
|
918
|
-
|
|
1167
|
+
const [volumeError, volumes] = await getVolumes();
|
|
1168
|
+
const [error, logSize] = await getLogFileSize();
|
|
1169
|
+
if (error) {
|
|
1170
|
+
this.logger.error(`Error fetching log file size: ${error}`);
|
|
919
1171
|
return;
|
|
920
1172
|
}
|
|
921
|
-
if (
|
|
922
|
-
this.logger.error(`Error fetching volumes: ${
|
|
1173
|
+
if (volumeError) {
|
|
1174
|
+
this.logger.error(`Error fetching volumes: ${volumeError}`);
|
|
923
1175
|
return;
|
|
924
1176
|
}
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
1177
|
+
if (volumes) {
|
|
1178
|
+
volumes.forEach((volume) => {
|
|
1179
|
+
const storageVolume = this.storageDeviceContainer.getModel(volume.id);
|
|
1180
|
+
if (storageVolume) {
|
|
1181
|
+
const _volume = {
|
|
1182
|
+
id: volume.id,
|
|
1183
|
+
name: storageVolume.label,
|
|
1184
|
+
freeBytes: volume.info.freeBytes,
|
|
1185
|
+
totalBytes: volume.info.totalBytes
|
|
1186
|
+
};
|
|
1187
|
+
this._volumes.addModel(_volume);
|
|
1188
|
+
}
|
|
1189
|
+
});
|
|
1190
|
+
if (volumes.length === 1) {
|
|
1191
|
+
this.updateActiveVolume(this._volumes.data[0]);
|
|
1192
|
+
} else {
|
|
1193
|
+
this.clearActiveVolume();
|
|
935
1194
|
}
|
|
936
|
-
}
|
|
1195
|
+
}
|
|
1196
|
+
if (logSize) {
|
|
1197
|
+
this.logger.info(`Log file size: ${logSize}`);
|
|
1198
|
+
this.updateLogFileSize(parseInt(logSize, 10));
|
|
1199
|
+
}
|
|
937
1200
|
}
|
|
938
1201
|
async activate() {
|
|
939
|
-
this.logger.debug(`activating copy-logs ${this.id}`)
|
|
1202
|
+
this.logger.debug(`activating copy-logs ${this.id}`);
|
|
1203
|
+
await this.syncVolumes();
|
|
940
1204
|
}
|
|
941
1205
|
async load() {
|
|
942
1206
|
this.logger.debug(`loading copy-logs ${this.id}`);
|
|
943
1207
|
}
|
|
944
1208
|
};
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
],
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
],
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
],
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
],
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
dependencies: (
|
|
1209
|
+
__publicField$1(CopyLogsModelImpl, "Registration");
|
|
1210
|
+
__decorateClass$h([
|
|
1211
|
+
kosDependency({ modelType: StorageDeviceContainer.type })
|
|
1212
|
+
], CopyLogsModelImpl.prototype, "storageDeviceContainer", 2);
|
|
1213
|
+
__decorateClass$h([
|
|
1214
|
+
kosFuture()
|
|
1215
|
+
], CopyLogsModelImpl.prototype, "eraseAndCopyVolume", 1);
|
|
1216
|
+
__decorateClass$h([
|
|
1217
|
+
kosFuture()
|
|
1218
|
+
], CopyLogsModelImpl.prototype, "eraseVolume", 1);
|
|
1219
|
+
__decorateClass$h([
|
|
1220
|
+
kosFuture()
|
|
1221
|
+
], CopyLogsModelImpl.prototype, "copyLogs", 1);
|
|
1222
|
+
__decorateClass$h([
|
|
1223
|
+
kosModelEffect({
|
|
1224
|
+
dependencies: (model) => [model.inserted]
|
|
961
1225
|
})
|
|
962
|
-
],
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
],
|
|
968
|
-
const
|
|
1226
|
+
], CopyLogsModelImpl.prototype, "handleInsertion", 1);
|
|
1227
|
+
CopyLogsModelImpl = __decorateClass$h([
|
|
1228
|
+
kosModel({ modelTypeId: MODEL_TYPE$h, singleton: true }),
|
|
1229
|
+
kosFutureAware(),
|
|
1230
|
+
kosLoggerAware()
|
|
1231
|
+
], CopyLogsModelImpl);
|
|
1232
|
+
const CopyLogs = CopyLogsModelImpl.Registration;
|
|
1233
|
+
const log$9 = KosLog.createLogger({
|
|
969
1234
|
name: "dashboard-operations-service",
|
|
970
1235
|
group: "Services"
|
|
971
|
-
})
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
1236
|
+
});
|
|
1237
|
+
const resolveAll = async (troubleIds, tracker) => {
|
|
1238
|
+
log$9.debug("resolveAll");
|
|
1239
|
+
const response = await TroubleServices.bulkResolveTroubles(
|
|
1240
|
+
troubleIds,
|
|
1241
|
+
void 0,
|
|
1242
|
+
tracker
|
|
1243
|
+
);
|
|
1244
|
+
return response;
|
|
1245
|
+
};
|
|
1246
|
+
const resolveTrouble = async (troubleId, tracker) => {
|
|
1247
|
+
log$9.debug("resolveTrouble");
|
|
1248
|
+
const response = await TroubleServices.resolveTrouble(
|
|
1249
|
+
troubleId,
|
|
1250
|
+
void 0,
|
|
1251
|
+
tracker
|
|
1252
|
+
);
|
|
1253
|
+
return response;
|
|
1254
|
+
};
|
|
1255
|
+
const index$9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
980
1256
|
__proto__: null,
|
|
981
|
-
resolveAll
|
|
982
|
-
resolveTrouble
|
|
1257
|
+
resolveAll,
|
|
1258
|
+
resolveTrouble
|
|
983
1259
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
984
|
-
var
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1260
|
+
var __defProp$b = Object.defineProperty;
|
|
1261
|
+
var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
|
|
1262
|
+
var __decorateClass$g = (decorators, target, key, kind) => {
|
|
1263
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$g(target, key) : target;
|
|
1264
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1265
|
+
if (decorator = decorators[i])
|
|
1266
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1267
|
+
if (kind && result) __defProp$b(target, key, result);
|
|
1268
|
+
return result;
|
|
1269
|
+
};
|
|
1270
|
+
const MODEL_TYPE$g = "dashboard-operations-model";
|
|
1271
|
+
function resolvableTroubleFilter(trouble) {
|
|
1272
|
+
return !trouble.deferred;
|
|
992
1273
|
}
|
|
993
|
-
function
|
|
994
|
-
return
|
|
1274
|
+
function deferredTroubleFilter(trouble) {
|
|
1275
|
+
return trouble.deferred;
|
|
995
1276
|
}
|
|
996
|
-
let
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
this.id =
|
|
1277
|
+
let DashboardOperationsModelImpl = class {
|
|
1278
|
+
id;
|
|
1279
|
+
troubles;
|
|
1280
|
+
futureHandler;
|
|
1281
|
+
logger;
|
|
1282
|
+
constructor(modelId, options, context) {
|
|
1283
|
+
this.id = modelId;
|
|
1284
|
+
this.futureHandler = new FutureHandler(this);
|
|
1285
|
+
this.logger = context.logger;
|
|
1003
1286
|
}
|
|
1004
1287
|
get troublesByType() {
|
|
1005
1288
|
return this.troubles.troubles.data.reduce(
|
|
1006
|
-
|
|
1289
|
+
troubleByTypeReducer,
|
|
1007
1290
|
{}
|
|
1008
1291
|
);
|
|
1009
1292
|
}
|
|
1010
1293
|
get queuedPurgeTroubles() {
|
|
1011
|
-
return this.purgeTroubles.filter(
|
|
1294
|
+
return this.purgeTroubles.filter(deferredTroubleFilter);
|
|
1012
1295
|
}
|
|
1013
1296
|
get queuedPrimeTroubles() {
|
|
1014
|
-
return this.primeTroubles.filter(
|
|
1297
|
+
return this.primeTroubles.filter(deferredTroubleFilter);
|
|
1015
1298
|
}
|
|
1016
1299
|
get resolvablePrimeTroubles() {
|
|
1017
|
-
return this.primeTroubles.filter(
|
|
1300
|
+
return this.primeTroubles.filter(resolvableTroubleFilter);
|
|
1018
1301
|
}
|
|
1019
1302
|
get resolvablePurgeTroubles() {
|
|
1020
|
-
return this.purgeTroubles.filter(
|
|
1303
|
+
return this.purgeTroubles.filter(resolvableTroubleFilter);
|
|
1021
1304
|
}
|
|
1022
1305
|
get hasResolvablePurgeTroubles() {
|
|
1023
1306
|
return this.resolvablePurgeTroubles.length > 0;
|
|
@@ -1032,28 +1315,37 @@ let C = class {
|
|
|
1032
1315
|
return this.primeTroubles.length > 0;
|
|
1033
1316
|
}
|
|
1034
1317
|
get purgeTroubles() {
|
|
1035
|
-
return this.troublesByType[
|
|
1318
|
+
return this.troublesByType[TROUBLE_TYPE_PURGE$1] || [];
|
|
1036
1319
|
}
|
|
1037
1320
|
get primeTroubles() {
|
|
1038
|
-
return this.troublesByType[
|
|
1321
|
+
return this.troublesByType[TROUBLE_TYPE_PRIME$1] || [];
|
|
1039
1322
|
}
|
|
1040
1323
|
get future() {
|
|
1041
1324
|
return this.futureHandler.getFuture();
|
|
1042
1325
|
}
|
|
1043
|
-
async resolveAllTroubles(
|
|
1044
|
-
if (!
|
|
1326
|
+
async resolveAllTroubles(type, tracker) {
|
|
1327
|
+
if (!tracker) {
|
|
1045
1328
|
throw new Error("No tracker provided");
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1329
|
+
}
|
|
1330
|
+
const container = type === TROUBLE_TYPE_PURGE$1 ? this.purgeTroubles : this.primeTroubles;
|
|
1331
|
+
const shouldDefer = container.filter((trouble) => trouble.shouldDefer);
|
|
1332
|
+
shouldDefer.forEach((trouble) => {
|
|
1333
|
+
this.logger.info(`Deferring trouble ${trouble.rawId}`);
|
|
1334
|
+
trouble.defer();
|
|
1049
1335
|
});
|
|
1050
|
-
const
|
|
1051
|
-
|
|
1336
|
+
const allTroubles = container.filter((trouble) => !trouble.shouldDefer).map((trouble) => trouble.rawId);
|
|
1337
|
+
if (allTroubles.length === 0) {
|
|
1338
|
+
return void 0;
|
|
1339
|
+
}
|
|
1340
|
+
const response = await resolveAll(allTroubles, tracker);
|
|
1341
|
+
return response;
|
|
1052
1342
|
}
|
|
1053
|
-
async resolveTrouble(
|
|
1054
|
-
if (!
|
|
1343
|
+
async resolveTrouble(troubleId, tracker) {
|
|
1344
|
+
if (!tracker) {
|
|
1055
1345
|
throw new Error("No tracker provided");
|
|
1056
|
-
|
|
1346
|
+
}
|
|
1347
|
+
const response = await resolveTrouble(troubleId, tracker);
|
|
1348
|
+
return response;
|
|
1057
1349
|
}
|
|
1058
1350
|
// -------------------LIFECYCLE----------------------------
|
|
1059
1351
|
async init() {
|
|
@@ -1063,42 +1355,46 @@ let C = class {
|
|
|
1063
1355
|
this.logger.debug(`loading dashboard-operations ${this.id}`);
|
|
1064
1356
|
}
|
|
1065
1357
|
};
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
modelType:
|
|
1358
|
+
__decorateClass$g([
|
|
1359
|
+
kosDependency({
|
|
1360
|
+
modelType: TroubleContainer.type
|
|
1069
1361
|
})
|
|
1070
|
-
],
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
],
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
],
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
],
|
|
1080
|
-
const
|
|
1362
|
+
], DashboardOperationsModelImpl.prototype, "troubles", 2);
|
|
1363
|
+
__decorateClass$g([
|
|
1364
|
+
kosFuture()
|
|
1365
|
+
], DashboardOperationsModelImpl.prototype, "resolveAllTroubles", 1);
|
|
1366
|
+
__decorateClass$g([
|
|
1367
|
+
kosFuture()
|
|
1368
|
+
], DashboardOperationsModelImpl.prototype, "resolveTrouble", 1);
|
|
1369
|
+
DashboardOperationsModelImpl = __decorateClass$g([
|
|
1370
|
+
kosModel(MODEL_TYPE$g)
|
|
1371
|
+
], DashboardOperationsModelImpl);
|
|
1372
|
+
const DashboardOperations = {
|
|
1081
1373
|
registration: {
|
|
1082
|
-
[
|
|
1083
|
-
class:
|
|
1084
|
-
singleton:
|
|
1374
|
+
[MODEL_TYPE$g]: {
|
|
1375
|
+
class: DashboardOperationsModelImpl,
|
|
1376
|
+
singleton: true
|
|
1085
1377
|
}
|
|
1086
1378
|
},
|
|
1087
|
-
type:
|
|
1088
|
-
predicate:
|
|
1089
|
-
factory:
|
|
1090
|
-
};
|
|
1091
|
-
var
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1379
|
+
type: MODEL_TYPE$g,
|
|
1380
|
+
predicate: isKosModel(MODEL_TYPE$g),
|
|
1381
|
+
factory: Kos.Singleton.create(MODEL_TYPE$g)
|
|
1382
|
+
};
|
|
1383
|
+
var __getOwnPropDesc$f = Object.getOwnPropertyDescriptor;
|
|
1384
|
+
var __decorateClass$f = (decorators, target, key, kind) => {
|
|
1385
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$f(target, key) : target;
|
|
1386
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1387
|
+
if (decorator = decorators[i])
|
|
1388
|
+
result = decorator(result) || result;
|
|
1389
|
+
return result;
|
|
1390
|
+
};
|
|
1391
|
+
const MODEL_TYPE$f = "dispenser-model";
|
|
1392
|
+
let DispenserModelImpl = class {
|
|
1393
|
+
id;
|
|
1394
|
+
logger;
|
|
1395
|
+
constructor(modelId, options, context) {
|
|
1396
|
+
this.id = modelId;
|
|
1397
|
+
this.logger = context.logger;
|
|
1102
1398
|
}
|
|
1103
1399
|
updateModel() {
|
|
1104
1400
|
}
|
|
@@ -1110,40 +1406,55 @@ let xe = class {
|
|
|
1110
1406
|
this.logger.debug(`loading dispenser ${this.id}`);
|
|
1111
1407
|
}
|
|
1112
1408
|
};
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
],
|
|
1116
|
-
const
|
|
1409
|
+
DispenserModelImpl = __decorateClass$f([
|
|
1410
|
+
kosModel(MODEL_TYPE$f)
|
|
1411
|
+
], DispenserModelImpl);
|
|
1412
|
+
const Dispenser = {
|
|
1117
1413
|
registration: {
|
|
1118
|
-
[
|
|
1119
|
-
class:
|
|
1120
|
-
singleton:
|
|
1414
|
+
[MODEL_TYPE$f]: {
|
|
1415
|
+
class: DispenserModelImpl,
|
|
1416
|
+
singleton: true
|
|
1121
1417
|
}
|
|
1122
1418
|
},
|
|
1123
|
-
type:
|
|
1124
|
-
predicate:
|
|
1125
|
-
factory:
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
}
|
|
1419
|
+
type: MODEL_TYPE$f,
|
|
1420
|
+
predicate: isKosModel(MODEL_TYPE$f),
|
|
1421
|
+
factory: Kos.Singleton.create(MODEL_TYPE$f)
|
|
1422
|
+
};
|
|
1423
|
+
const { URL: URL$8 } = resolveServiceUrl("DISPENSER_SERVICE");
|
|
1424
|
+
const { getAll: getAll$5 } = ServiceFactory.build({
|
|
1425
|
+
basePath: `${URL$8}/api/dispenser`
|
|
1426
|
+
});
|
|
1427
|
+
const log$8 = KosLog.createLogger({
|
|
1129
1428
|
name: "dispenser-service",
|
|
1130
1429
|
group: "Services"
|
|
1131
|
-
})
|
|
1430
|
+
});
|
|
1431
|
+
const getDispensers = async () => {
|
|
1432
|
+
log$8.debug("sending GET for dispenser");
|
|
1433
|
+
const response = await getAll$5({});
|
|
1434
|
+
return response;
|
|
1435
|
+
};
|
|
1436
|
+
const index$8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1132
1437
|
__proto__: null,
|
|
1133
|
-
getDispensers
|
|
1438
|
+
getDispensers
|
|
1134
1439
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1135
|
-
var
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1440
|
+
var __defProp$a = Object.defineProperty;
|
|
1441
|
+
var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
|
|
1442
|
+
var __decorateClass$e = (decorators, target, key, kind) => {
|
|
1443
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
|
|
1444
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1445
|
+
if (decorator = decorators[i])
|
|
1446
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1447
|
+
if (kind && result) __defProp$a(target, key, result);
|
|
1448
|
+
return result;
|
|
1449
|
+
};
|
|
1450
|
+
const MODEL_TYPE$e = "dispenser-info-model";
|
|
1451
|
+
let DispenserInfoModelImpl = class {
|
|
1452
|
+
logger;
|
|
1453
|
+
id;
|
|
1454
|
+
name;
|
|
1455
|
+
constructor(modelId, _options, context) {
|
|
1456
|
+
this.id = modelId;
|
|
1457
|
+
this.logger = context.logger;
|
|
1147
1458
|
}
|
|
1148
1459
|
// -------------------LIFECYCLE----------------------------
|
|
1149
1460
|
async init() {
|
|
@@ -1153,51 +1464,65 @@ let ve = class {
|
|
|
1153
1464
|
this.logger.debug(`loading dispenser-info ${this.id}`);
|
|
1154
1465
|
}
|
|
1155
1466
|
};
|
|
1156
|
-
|
|
1157
|
-
|
|
1467
|
+
__decorateClass$e([
|
|
1468
|
+
kosConfigProperty({
|
|
1158
1469
|
path: "kos:device",
|
|
1159
1470
|
attribute: "name"
|
|
1160
1471
|
})
|
|
1161
|
-
],
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
],
|
|
1165
|
-
const
|
|
1472
|
+
], DispenserInfoModelImpl.prototype, "name", 2);
|
|
1473
|
+
DispenserInfoModelImpl = __decorateClass$e([
|
|
1474
|
+
kosModel(MODEL_TYPE$e)
|
|
1475
|
+
], DispenserInfoModelImpl);
|
|
1476
|
+
const DispenserInfo = {
|
|
1166
1477
|
registration: {
|
|
1167
|
-
[
|
|
1168
|
-
class:
|
|
1169
|
-
singleton:
|
|
1478
|
+
[MODEL_TYPE$e]: {
|
|
1479
|
+
class: DispenserInfoModelImpl,
|
|
1480
|
+
singleton: false
|
|
1170
1481
|
}
|
|
1171
1482
|
},
|
|
1172
|
-
type:
|
|
1173
|
-
predicate:
|
|
1174
|
-
factory:
|
|
1175
|
-
|
|
1483
|
+
type: MODEL_TYPE$e,
|
|
1484
|
+
predicate: isKosModel(MODEL_TYPE$e),
|
|
1485
|
+
factory: Kos.Factory.create(
|
|
1486
|
+
MODEL_TYPE$e
|
|
1176
1487
|
)
|
|
1177
|
-
}
|
|
1178
|
-
|
|
1179
|
-
}
|
|
1488
|
+
};
|
|
1489
|
+
const { URL: URL$7 } = resolveServiceUrl("DISPENSER-INFO_SERVICE");
|
|
1490
|
+
const { getAll: getAll$4 } = ServiceFactory.build({
|
|
1491
|
+
basePath: `${URL$7}/api/dispenser-info`
|
|
1492
|
+
});
|
|
1493
|
+
const log$7 = KosLog.createLogger({
|
|
1180
1494
|
name: "dispenser-info-service",
|
|
1181
1495
|
group: "Services"
|
|
1182
|
-
})
|
|
1496
|
+
});
|
|
1497
|
+
const getDispenserInfos = async () => {
|
|
1498
|
+
log$7.debug("sending GET for dispenser-info");
|
|
1499
|
+
const response = await getAll$4({});
|
|
1500
|
+
return response;
|
|
1501
|
+
};
|
|
1502
|
+
const index$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1183
1503
|
__proto__: null,
|
|
1184
|
-
getDispenserInfos
|
|
1504
|
+
getDispenserInfos
|
|
1185
1505
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1186
|
-
var
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1506
|
+
var __getOwnPropDesc$d = Object.getOwnPropertyDescriptor;
|
|
1507
|
+
var __decorateClass$d = (decorators, target, key, kind) => {
|
|
1508
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$d(target, key) : target;
|
|
1509
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1510
|
+
if (decorator = decorators[i])
|
|
1511
|
+
result = decorator(result) || result;
|
|
1512
|
+
return result;
|
|
1513
|
+
};
|
|
1514
|
+
const MODEL_TYPE$d = "enrollment-model";
|
|
1515
|
+
let EnrollmentModelImpl = class {
|
|
1516
|
+
id;
|
|
1517
|
+
logger;
|
|
1518
|
+
enrolled;
|
|
1519
|
+
constructor(modelId, _options, context) {
|
|
1520
|
+
this.id = modelId;
|
|
1521
|
+
this.logger = context.logger;
|
|
1522
|
+
this.enrolled = false;
|
|
1523
|
+
}
|
|
1524
|
+
updateModel(options) {
|
|
1525
|
+
console.log("updateModel:", options);
|
|
1201
1526
|
}
|
|
1202
1527
|
// -------------------LIFECYCLE----------------------------
|
|
1203
1528
|
async init() {
|
|
@@ -1207,100 +1532,159 @@ let Ue = class {
|
|
|
1207
1532
|
this.logger.debug(`loading enrollment ${this.id}`);
|
|
1208
1533
|
}
|
|
1209
1534
|
};
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
],
|
|
1213
|
-
const
|
|
1535
|
+
EnrollmentModelImpl = __decorateClass$d([
|
|
1536
|
+
kosModel(MODEL_TYPE$d)
|
|
1537
|
+
], EnrollmentModelImpl);
|
|
1538
|
+
const Enrollment = {
|
|
1214
1539
|
registration: {
|
|
1215
|
-
[
|
|
1216
|
-
class:
|
|
1217
|
-
singleton:
|
|
1540
|
+
[MODEL_TYPE$d]: {
|
|
1541
|
+
class: EnrollmentModelImpl,
|
|
1542
|
+
singleton: true
|
|
1218
1543
|
}
|
|
1219
1544
|
},
|
|
1220
|
-
type:
|
|
1221
|
-
predicate:
|
|
1222
|
-
factory:
|
|
1223
|
-
}
|
|
1224
|
-
|
|
1225
|
-
}
|
|
1545
|
+
type: MODEL_TYPE$d,
|
|
1546
|
+
predicate: isKosModel(MODEL_TYPE$d),
|
|
1547
|
+
factory: Kos.Singleton.create(MODEL_TYPE$d)
|
|
1548
|
+
};
|
|
1549
|
+
const { URL: URL$6 } = resolveServiceUrl("ENROLLMENT_SERVICE");
|
|
1550
|
+
const { getAll: getAll$3 } = ServiceFactory.build({
|
|
1551
|
+
basePath: `${URL$6}/api/enrollment`
|
|
1552
|
+
});
|
|
1553
|
+
const log$6 = KosLog.createLogger({
|
|
1226
1554
|
name: "enrollment-service",
|
|
1227
1555
|
group: "Services"
|
|
1228
|
-
})
|
|
1556
|
+
});
|
|
1557
|
+
const getEnrollments = async () => {
|
|
1558
|
+
log$6.debug("sending GET for enrollment");
|
|
1559
|
+
const response = await getAll$3({});
|
|
1560
|
+
return response;
|
|
1561
|
+
};
|
|
1562
|
+
const index$6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1229
1563
|
__proto__: null,
|
|
1230
|
-
getEnrollments
|
|
1231
|
-
}, Symbol.toStringTag, { value: "Module" }))
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1564
|
+
getEnrollments
|
|
1565
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
1566
|
+
const isMicroGroup = (group) => group.toLowerCase().includes("micros");
|
|
1567
|
+
const isMacroGroup = (group) => !group.toLowerCase().includes("micros");
|
|
1568
|
+
const macroHolderMap = (assembly) => (holderName) => {
|
|
1569
|
+
const holderGroup = assembly?.getHoldersByGroup(holderName);
|
|
1570
|
+
if (!holderGroup) {
|
|
1571
|
+
return null;
|
|
1572
|
+
}
|
|
1573
|
+
return holderGroup.map((holder) => {
|
|
1574
|
+
return { id: holder.id, name: holder.ingredientName, path: holder.path };
|
|
1575
|
+
});
|
|
1576
|
+
};
|
|
1577
|
+
const MACRO_KEYS = ["water", "carb", "ns", "nss"];
|
|
1578
|
+
const EXTENSION_POINT_DASHBOARD_KEY_FACTORY = "dashboardKeyFactory";
|
|
1579
|
+
const dashboardKeyFactories = [];
|
|
1580
|
+
registerExtensionPoint(EXTENSION_POINT_DASHBOARD_KEY_FACTORY, {
|
|
1581
|
+
register: (_id, factory) => {
|
|
1582
|
+
if (dashboardKeyFactories.includes(factory)) {
|
|
1583
|
+
return;
|
|
1584
|
+
}
|
|
1585
|
+
dashboardKeyFactories.push(factory);
|
|
1238
1586
|
},
|
|
1239
|
-
execute: (
|
|
1240
|
-
const
|
|
1241
|
-
for (const
|
|
1242
|
-
const
|
|
1243
|
-
if (
|
|
1244
|
-
return
|
|
1587
|
+
execute: (_id, holder) => {
|
|
1588
|
+
const factories = dashboardKeyFactories.sort((a, b) => a.rank - b.rank);
|
|
1589
|
+
for (const factory of factories) {
|
|
1590
|
+
const key = factory.factory(holder);
|
|
1591
|
+
if (key) {
|
|
1592
|
+
return key;
|
|
1593
|
+
}
|
|
1245
1594
|
}
|
|
1595
|
+
return void 0;
|
|
1246
1596
|
}
|
|
1247
1597
|
});
|
|
1248
|
-
const
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1598
|
+
const registerDashboardKeyFactory = (factory) => {
|
|
1599
|
+
ExtensionManager[EXTENSION_POINT_DASHBOARD_KEY_FACTORY].register(
|
|
1600
|
+
EXTENSION_POINT_DASHBOARD_KEY_FACTORY,
|
|
1601
|
+
factory
|
|
1252
1602
|
);
|
|
1253
|
-
}
|
|
1254
|
-
|
|
1255
|
-
|
|
1603
|
+
};
|
|
1604
|
+
const executeDashboardKeyFactory = (holder) => ExtensionManager[EXTENSION_POINT_DASHBOARD_KEY_FACTORY].execute(
|
|
1605
|
+
EXTENSION_POINT_DASHBOARD_KEY_FACTORY,
|
|
1606
|
+
holder
|
|
1256
1607
|
);
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
const
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
const
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
const
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1608
|
+
ExtensionManager.registerDashboardKeyFactory = registerDashboardKeyFactory;
|
|
1609
|
+
ExtensionManager.executeDashboardKeyFactory = executeDashboardKeyFactory;
|
|
1610
|
+
const HOUR = 3600;
|
|
1611
|
+
const MINUTE = 60;
|
|
1612
|
+
const toTimeComponents = (seconds) => {
|
|
1613
|
+
const hours = Math.floor(seconds / HOUR);
|
|
1614
|
+
const minutes = Math.floor(seconds % HOUR / MINUTE);
|
|
1615
|
+
return { hours, minutes };
|
|
1616
|
+
};
|
|
1617
|
+
const toSeconds = (hours, minutes) => {
|
|
1618
|
+
const time = hours * HOUR + minutes * MINUTE;
|
|
1619
|
+
return time;
|
|
1620
|
+
};
|
|
1621
|
+
const calculateTimeDifference = (date) => {
|
|
1622
|
+
const currentDate = /* @__PURE__ */ new Date();
|
|
1623
|
+
const timeDifference = currentDate.valueOf() - date.valueOf();
|
|
1624
|
+
const minutes = Math.floor(timeDifference / (1e3 * 60));
|
|
1625
|
+
const hours = Math.floor(minutes / 60);
|
|
1626
|
+
const days = Math.floor(hours / 24);
|
|
1627
|
+
const remainingMinutes = minutes % 60;
|
|
1628
|
+
const remainingHours = hours % 24;
|
|
1629
|
+
let result = "";
|
|
1630
|
+
if (days > 0) {
|
|
1631
|
+
result += `${days} day${days > 1 ? "s" : ""} `;
|
|
1632
|
+
}
|
|
1633
|
+
if (remainingHours > 0) {
|
|
1634
|
+
result += `${remainingHours} hour${remainingHours > 1 ? "s" : ""} `;
|
|
1635
|
+
}
|
|
1636
|
+
if (remainingMinutes > 0 || days === 0 && remainingHours === 0) {
|
|
1637
|
+
result += `${remainingMinutes} minute${remainingMinutes > 1 ? "s" : ""} `;
|
|
1638
|
+
}
|
|
1639
|
+
return result;
|
|
1640
|
+
};
|
|
1641
|
+
var __defProp$9 = Object.defineProperty;
|
|
1642
|
+
var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
|
|
1643
|
+
var __decorateClass$c = (decorators, target, key, kind) => {
|
|
1644
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target;
|
|
1645
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1646
|
+
if (decorator = decorators[i])
|
|
1647
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1648
|
+
if (kind && result) __defProp$9(target, key, result);
|
|
1649
|
+
return result;
|
|
1650
|
+
};
|
|
1651
|
+
const MODEL_TYPE$c = "ingredient-summary-model";
|
|
1652
|
+
let IngredientSummaryModelImpl = class {
|
|
1653
|
+
id;
|
|
1654
|
+
assemblyModel;
|
|
1655
|
+
dashboardOperationModel;
|
|
1656
|
+
appModel;
|
|
1657
|
+
logger;
|
|
1658
|
+
constructor(modelId, options, context) {
|
|
1659
|
+
this.id = modelId;
|
|
1660
|
+
this.logger = context.logger;
|
|
1661
|
+
this.dashboardOperationModel = DashboardOperations.factory({});
|
|
1281
1662
|
}
|
|
1282
1663
|
get highPriorityHolders() {
|
|
1283
1664
|
return this.assemblyModel.allHolders.filter(
|
|
1284
|
-
(
|
|
1665
|
+
(holder) => holder.troubles.length > 0 && holder.troubles.find((trouble) => trouble.rank >= 400)
|
|
1285
1666
|
);
|
|
1286
1667
|
}
|
|
1287
1668
|
get actionRequiredHolders() {
|
|
1288
|
-
const
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1669
|
+
const currentRole = this.appModel.currentRole;
|
|
1670
|
+
const filter = troubleVisibilityFilter(currentRole);
|
|
1671
|
+
return this.assemblyModel.allHolders.filter((holder) => {
|
|
1672
|
+
const companionModel = getKosCompanionModel(
|
|
1673
|
+
holder,
|
|
1674
|
+
FreestyleHolder.type
|
|
1293
1675
|
);
|
|
1294
|
-
if (
|
|
1295
|
-
return
|
|
1296
|
-
|
|
1297
|
-
|
|
1676
|
+
if (companionModel?.isRemote) {
|
|
1677
|
+
return false;
|
|
1678
|
+
}
|
|
1679
|
+
const visibleTroubles = holder.troubles.filter(filter);
|
|
1680
|
+
return visibleTroubles.length > 0 && visibleTroubles.find((trouble) => trouble.resolvable);
|
|
1298
1681
|
});
|
|
1299
1682
|
}
|
|
1300
1683
|
get lowLevelHolders() {
|
|
1301
|
-
return this.assemblyModel.allHolders.filter((
|
|
1302
|
-
const
|
|
1303
|
-
|
|
1684
|
+
return this.assemblyModel.allHolders.filter((holder) => {
|
|
1685
|
+
const fillPercent = holder.fillPercent;
|
|
1686
|
+
const hasFuelGuage = holder.hasFuelGuage;
|
|
1687
|
+
return hasFuelGuage && fillPercent < 20;
|
|
1304
1688
|
});
|
|
1305
1689
|
}
|
|
1306
1690
|
// -------------------LIFECYCLE----------------------------
|
|
@@ -1311,53 +1695,69 @@ let L = class {
|
|
|
1311
1695
|
this.logger.debug(`loading ingredient-summary ${this.id}`);
|
|
1312
1696
|
}
|
|
1313
1697
|
};
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
],
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
],
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
],
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
],
|
|
1326
|
-
const
|
|
1698
|
+
__decorateClass$c([
|
|
1699
|
+
kosDependency({ modelType: Assembly.type })
|
|
1700
|
+
], IngredientSummaryModelImpl.prototype, "assemblyModel", 2);
|
|
1701
|
+
__decorateClass$c([
|
|
1702
|
+
kosDependency({ modelType: DashboardOperations.type })
|
|
1703
|
+
], IngredientSummaryModelImpl.prototype, "dashboardOperationModel", 2);
|
|
1704
|
+
__decorateClass$c([
|
|
1705
|
+
kosDependency({ modelType: Application.type })
|
|
1706
|
+
], IngredientSummaryModelImpl.prototype, "appModel", 2);
|
|
1707
|
+
IngredientSummaryModelImpl = __decorateClass$c([
|
|
1708
|
+
kosModel(MODEL_TYPE$c)
|
|
1709
|
+
], IngredientSummaryModelImpl);
|
|
1710
|
+
const IngredientSummary = {
|
|
1327
1711
|
registration: {
|
|
1328
|
-
[
|
|
1329
|
-
class:
|
|
1330
|
-
singleton:
|
|
1712
|
+
[MODEL_TYPE$c]: {
|
|
1713
|
+
class: IngredientSummaryModelImpl,
|
|
1714
|
+
singleton: false
|
|
1331
1715
|
}
|
|
1332
1716
|
},
|
|
1333
|
-
type:
|
|
1334
|
-
predicate:
|
|
1335
|
-
factory:
|
|
1336
|
-
|
|
1717
|
+
type: MODEL_TYPE$c,
|
|
1718
|
+
predicate: isKosModel(MODEL_TYPE$c),
|
|
1719
|
+
factory: Kos.Factory.create(
|
|
1720
|
+
MODEL_TYPE$c
|
|
1337
1721
|
)
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1722
|
+
};
|
|
1723
|
+
const { URL: URL$5 } = resolveServiceUrl("LOCKOUT_SERVICE");
|
|
1724
|
+
const { postModel: postModel$1 } = ServiceFactory.build({
|
|
1725
|
+
basePath: `${URL$5}/api/app/kosdev.ddk/lockout`
|
|
1726
|
+
});
|
|
1727
|
+
const log$5 = KosLog.createLogger({ name: "lockout-service", group: "Services" });
|
|
1728
|
+
const lock = async () => {
|
|
1729
|
+
log$5.info("lock");
|
|
1730
|
+
const response = await postModel$1({
|
|
1346
1731
|
model: {},
|
|
1347
|
-
urlOverride: `${
|
|
1732
|
+
urlOverride: `${URL$5}/api/app/kosdev.ddk/lockout/lockNow`
|
|
1348
1733
|
});
|
|
1349
|
-
return
|
|
1350
|
-
}
|
|
1734
|
+
return response;
|
|
1735
|
+
};
|
|
1736
|
+
const unlock = async (pin) => {
|
|
1737
|
+
log$5.info("unlock");
|
|
1738
|
+
const response = await postModel$1({
|
|
1739
|
+
model: {},
|
|
1740
|
+
urlOverride: `${URL$5}/api/app/kosdev.ddk/lockout/unlock/${pin}`
|
|
1741
|
+
});
|
|
1742
|
+
return response?.data;
|
|
1743
|
+
};
|
|
1744
|
+
const index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1351
1745
|
__proto__: null,
|
|
1352
|
-
lock
|
|
1353
|
-
unlock
|
|
1746
|
+
lock,
|
|
1747
|
+
unlock
|
|
1354
1748
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1355
|
-
var
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1749
|
+
var __defProp$8 = Object.defineProperty;
|
|
1750
|
+
var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
|
|
1751
|
+
var __decorateClass$b = (decorators, target, key, kind) => {
|
|
1752
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target;
|
|
1753
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1754
|
+
if (decorator = decorators[i])
|
|
1755
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1756
|
+
if (kind && result) __defProp$8(target, key, result);
|
|
1757
|
+
return result;
|
|
1359
1758
|
};
|
|
1360
|
-
const
|
|
1759
|
+
const MODEL_TYPE$b = "lockout-model";
|
|
1760
|
+
const scheduleData = [
|
|
1361
1761
|
{ day: "monday", lock: "dayWiseLockConfigMap.Mon.enabled", open: "dayWiseLockConfigMap.Mon.unlockTime", close: "dayWiseLockConfigMap.Mon.lockTime" },
|
|
1362
1762
|
{ day: "tuesday", lock: "dayWiseLockConfigMap.Tue.enabled", open: "dayWiseLockConfigMap.Tue.unlockTime", close: "dayWiseLockConfigMap.Tue.lockTime" },
|
|
1363
1763
|
{ day: "wednesday", lock: "dayWiseLockConfigMap.Wed.enabled", open: "dayWiseLockConfigMap.Wed.unlockTime", close: "dayWiseLockConfigMap.Wed.lockTime" },
|
|
@@ -1366,146 +1766,170 @@ const qt = "lockout-model", Xr = [
|
|
|
1366
1766
|
{ day: "saturday", lock: "dayWiseLockConfigMap.Sat.enabled", open: "dayWiseLockConfigMap.Sat.unlockTime", close: "dayWiseLockConfigMap.Sat.lockTime" },
|
|
1367
1767
|
{ day: "sunday", lock: "dayWiseLockConfigMap.Sun.enabled", open: "dayWiseLockConfigMap.Sun.unlockTime", close: "dayWiseLockConfigMap.Sun.lockTime" }
|
|
1368
1768
|
];
|
|
1369
|
-
let
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
i(this, "cuiLockout");
|
|
1406
|
-
this.id = e, this.logger = o.logger, this.saveMap = /* @__PURE__ */ new Map();
|
|
1407
|
-
}
|
|
1769
|
+
let LockoutModelImpl = class {
|
|
1770
|
+
id;
|
|
1771
|
+
logger;
|
|
1772
|
+
dayEnabledList = [
|
|
1773
|
+
"dayWiseLockConfigMap.Sun.enabled",
|
|
1774
|
+
"dayWiseLockConfigMap.Mon.enabled",
|
|
1775
|
+
"dayWiseLockConfigMap.Tue.enabled",
|
|
1776
|
+
"dayWiseLockConfigMap.Wed.enabled",
|
|
1777
|
+
"dayWiseLockConfigMap.Thu.enabled",
|
|
1778
|
+
"dayWiseLockConfigMap.Fri.enabled",
|
|
1779
|
+
"dayWiseLockConfigMap.Sat.enabled"
|
|
1780
|
+
];
|
|
1781
|
+
dayOpenAtList = [
|
|
1782
|
+
"dayWiseLockConfigMap.Sun.unlockTime",
|
|
1783
|
+
"dayWiseLockConfigMap.Mon.unlockTime",
|
|
1784
|
+
"dayWiseLockConfigMap.Tue.unlockTime",
|
|
1785
|
+
"dayWiseLockConfigMap.Wed.unlockTime",
|
|
1786
|
+
"dayWiseLockConfigMap.Thu.unlockTime",
|
|
1787
|
+
"dayWiseLockConfigMap.Fri.unlockTime",
|
|
1788
|
+
"dayWiseLockConfigMap.Sat.unlockTime"
|
|
1789
|
+
];
|
|
1790
|
+
dayCloseAtList = [
|
|
1791
|
+
"dayWiseLockConfigMap.Sun.lockTime",
|
|
1792
|
+
"dayWiseLockConfigMap.Mon.lockTime",
|
|
1793
|
+
"dayWiseLockConfigMap.Tue.lockTime",
|
|
1794
|
+
"dayWiseLockConfigMap.Wed.lockTime",
|
|
1795
|
+
"dayWiseLockConfigMap.Thu.lockTime",
|
|
1796
|
+
"dayWiseLockConfigMap.Fri.lockTime",
|
|
1797
|
+
"dayWiseLockConfigMap.Sat.lockTime"
|
|
1798
|
+
];
|
|
1799
|
+
saveMap;
|
|
1800
|
+
pin;
|
|
1801
|
+
nextLockSkipped;
|
|
1802
|
+
nextLockTime;
|
|
1803
|
+
nextUnLockTime;
|
|
1804
|
+
cuiLockout;
|
|
1408
1805
|
get enabled() {
|
|
1409
|
-
const
|
|
1806
|
+
const oneTimeLockConfigLockTime = this.getProp(
|
|
1410
1807
|
"oneTimeLockConfig.lockTime"
|
|
1411
|
-
)
|
|
1412
|
-
|
|
1808
|
+
);
|
|
1809
|
+
const oneTimeLockEnabled = oneTimeLockConfigLockTime !== void 0 && oneTimeLockConfigLockTime !== "";
|
|
1810
|
+
const lockScheduleEnabled = this.getProp("lockScheduleEnabled");
|
|
1811
|
+
const enabled = oneTimeLockEnabled || lockScheduleEnabled;
|
|
1812
|
+
return enabled;
|
|
1413
1813
|
}
|
|
1414
1814
|
get schedule() {
|
|
1415
|
-
return
|
|
1815
|
+
return scheduleData;
|
|
1416
1816
|
}
|
|
1417
|
-
|
|
1418
|
-
|
|
1817
|
+
constructor(modelId, _options, context) {
|
|
1818
|
+
this.id = modelId;
|
|
1819
|
+
this.logger = context.logger;
|
|
1820
|
+
this.saveMap = /* @__PURE__ */ new Map();
|
|
1419
1821
|
}
|
|
1420
|
-
|
|
1421
|
-
this.saveMap.
|
|
1822
|
+
getProp(key) {
|
|
1823
|
+
return this.saveMap.get(key);
|
|
1824
|
+
}
|
|
1825
|
+
setProp(key, value) {
|
|
1826
|
+
this.saveMap.set(key, value);
|
|
1422
1827
|
}
|
|
1423
1828
|
// Skip or resume the next lock...
|
|
1424
1829
|
toggleSkip() {
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1830
|
+
const nextLockSkipped = this.nextLockSkipped.value;
|
|
1831
|
+
if (nextLockSkipped === "0") {
|
|
1832
|
+
const nextLockTime = this.nextLockTime.value;
|
|
1833
|
+
if (nextLockTime !== void 0)
|
|
1834
|
+
this.nextLockSkipped.updateProperty(nextLockTime);
|
|
1835
|
+
} else {
|
|
1429
1836
|
this.nextLockSkipped.updateProperty("0");
|
|
1837
|
+
}
|
|
1430
1838
|
}
|
|
1431
|
-
async unlock(
|
|
1432
|
-
return await
|
|
1839
|
+
async unlock(pin) {
|
|
1840
|
+
return await unlock(pin);
|
|
1433
1841
|
}
|
|
1434
1842
|
async save() {
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1843
|
+
this.saveMap.forEach((value, key) => {
|
|
1844
|
+
if (value !== this.cuiLockout.props[key])
|
|
1845
|
+
this.cuiLockout.props[key] = value;
|
|
1846
|
+
});
|
|
1847
|
+
return this.cuiLockout.updateConfigBean();
|
|
1438
1848
|
}
|
|
1439
1849
|
reset() {
|
|
1440
1850
|
this.cuiLockout.props.entries.forEach(
|
|
1441
|
-
([
|
|
1851
|
+
([key, value]) => this.saveMap.set(key, value)
|
|
1442
1852
|
);
|
|
1443
1853
|
}
|
|
1444
1854
|
// -------------------LIFECYCLE----------------------------
|
|
1445
1855
|
async init() {
|
|
1446
|
-
this.logger.debug(`initializing lockout ${this.id}`)
|
|
1447
|
-
|
|
1856
|
+
this.logger.debug(`initializing lockout ${this.id}`);
|
|
1857
|
+
this.cuiLockout.props.entries.forEach(
|
|
1858
|
+
([key, value]) => this.saveMap.set(key, value)
|
|
1448
1859
|
);
|
|
1449
1860
|
}
|
|
1450
1861
|
async load() {
|
|
1451
1862
|
this.logger.debug(`loading lockout ${this.id}`);
|
|
1452
1863
|
}
|
|
1453
1864
|
};
|
|
1454
|
-
|
|
1455
|
-
|
|
1865
|
+
__decorateClass$b([
|
|
1866
|
+
kosConfigProperty({
|
|
1456
1867
|
path: "app:kosdev.ddk:service:cuiLockout",
|
|
1457
1868
|
attribute: "pin"
|
|
1458
1869
|
})
|
|
1459
|
-
],
|
|
1460
|
-
|
|
1461
|
-
|
|
1870
|
+
], LockoutModelImpl.prototype, "pin", 2);
|
|
1871
|
+
__decorateClass$b([
|
|
1872
|
+
kosConfigProperty({
|
|
1462
1873
|
path: "app:kosdev.ddk:service:cuiLockout",
|
|
1463
1874
|
attribute: "nextLockSkipped"
|
|
1464
1875
|
})
|
|
1465
|
-
],
|
|
1466
|
-
|
|
1467
|
-
|
|
1876
|
+
], LockoutModelImpl.prototype, "nextLockSkipped", 2);
|
|
1877
|
+
__decorateClass$b([
|
|
1878
|
+
kosConfigProperty({
|
|
1468
1879
|
path: "app:kosdev.ddk:service:cuiLockout",
|
|
1469
1880
|
attribute: "nextLockTime"
|
|
1470
1881
|
})
|
|
1471
|
-
],
|
|
1472
|
-
|
|
1473
|
-
|
|
1882
|
+
], LockoutModelImpl.prototype, "nextLockTime", 2);
|
|
1883
|
+
__decorateClass$b([
|
|
1884
|
+
kosConfigProperty({
|
|
1474
1885
|
path: "app:kosdev.ddk:service:cuiLockout",
|
|
1475
1886
|
attribute: "nextUnLockTime"
|
|
1476
1887
|
})
|
|
1477
|
-
],
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
],
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
],
|
|
1484
|
-
const
|
|
1485
|
-
class:
|
|
1486
|
-
type:
|
|
1487
|
-
})
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1888
|
+
], LockoutModelImpl.prototype, "nextUnLockTime", 2);
|
|
1889
|
+
__decorateClass$b([
|
|
1890
|
+
kosConfigBean({ path: "app:kosdev.ddk:service:cuiLockout" })
|
|
1891
|
+
], LockoutModelImpl.prototype, "cuiLockout", 2);
|
|
1892
|
+
LockoutModelImpl = __decorateClass$b([
|
|
1893
|
+
kosModel(MODEL_TYPE$b)
|
|
1894
|
+
], LockoutModelImpl);
|
|
1895
|
+
const Lockout = new SingletonKosModelRegistrationFactory({
|
|
1896
|
+
class: LockoutModelImpl,
|
|
1897
|
+
type: MODEL_TYPE$b
|
|
1898
|
+
});
|
|
1899
|
+
const purgeMacroPumps = async (troubleIds, tracker) => {
|
|
1900
|
+
const response = await TroubleServices.bulkResolveTroubles(
|
|
1901
|
+
troubleIds,
|
|
1902
|
+
void 0,
|
|
1903
|
+
tracker
|
|
1904
|
+
);
|
|
1905
|
+
return response;
|
|
1906
|
+
};
|
|
1907
|
+
var __defProp$7 = Object.defineProperty;
|
|
1908
|
+
var __getOwnPropDesc$a = Object.getOwnPropertyDescriptor;
|
|
1909
|
+
var __decorateClass$a = (decorators, target, key, kind) => {
|
|
1910
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target;
|
|
1911
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1912
|
+
if (decorator = decorators[i])
|
|
1913
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
1914
|
+
if (kind && result) __defProp$7(target, key, result);
|
|
1915
|
+
return result;
|
|
1916
|
+
};
|
|
1917
|
+
const MODEL_TYPE$a = "macro-assignment-model";
|
|
1918
|
+
const TROUBLE_TYPE_PURGE = "PurgeTrouble";
|
|
1919
|
+
const TROUBLE_TYPE_PRIME = "PrimeTrouble";
|
|
1920
|
+
let MacroAssignmentModelImpl = class {
|
|
1921
|
+
id;
|
|
1922
|
+
logger;
|
|
1923
|
+
/**
|
|
1924
|
+
* futureHandler is used to handle async operations
|
|
1925
|
+
*/
|
|
1926
|
+
futureHandler;
|
|
1927
|
+
holders;
|
|
1928
|
+
ingredients;
|
|
1929
|
+
constructor(modelId, _options, context) {
|
|
1930
|
+
this.id = modelId;
|
|
1931
|
+
this.futureHandler = new FutureHandler();
|
|
1932
|
+
this.logger = context.logger;
|
|
1509
1933
|
}
|
|
1510
1934
|
/**
|
|
1511
1935
|
* shortcut to the current running future
|
|
@@ -1520,7 +1944,11 @@ let D = class {
|
|
|
1520
1944
|
* by the holders position in the dispenser assembly.
|
|
1521
1945
|
*/
|
|
1522
1946
|
get macroHolders() {
|
|
1523
|
-
return this.holders.holders.getIndexByKey("group", "macros").sort((
|
|
1947
|
+
return this.holders.holders.getIndexByKey("group", "macros").sort((a, b) => {
|
|
1948
|
+
if (a.name < b.name) return -1;
|
|
1949
|
+
if (a.name > b.name) return 1;
|
|
1950
|
+
return 0;
|
|
1951
|
+
});
|
|
1524
1952
|
}
|
|
1525
1953
|
/**
|
|
1526
1954
|
* Returns true if there are any macro holders in the dispenser assembly
|
|
@@ -1534,16 +1962,20 @@ let D = class {
|
|
|
1534
1962
|
* Relying on the indexing of troubles by type to find the purge troubles.
|
|
1535
1963
|
*/
|
|
1536
1964
|
get holderPurgeTroubles() {
|
|
1537
|
-
|
|
1538
|
-
const
|
|
1539
|
-
|
|
1965
|
+
const troubles = this.macroHolders.reduce((acc, curr) => {
|
|
1966
|
+
const purgeTroubles = curr.troublesByType[TROUBLE_TYPE_PURGE] || [];
|
|
1967
|
+
acc = [...acc, ...purgeTroubles];
|
|
1968
|
+
return acc;
|
|
1540
1969
|
}, []);
|
|
1970
|
+
return troubles;
|
|
1541
1971
|
}
|
|
1542
1972
|
get holderPrimeTroubles() {
|
|
1543
|
-
|
|
1544
|
-
const
|
|
1545
|
-
|
|
1973
|
+
const troubles = this.macroHolders.reduce((acc, curr) => {
|
|
1974
|
+
const primeTroubles = curr.troublesByType[TROUBLE_TYPE_PRIME] || [];
|
|
1975
|
+
acc = [...acc, ...primeTroubles];
|
|
1976
|
+
return acc;
|
|
1546
1977
|
}, []);
|
|
1978
|
+
return troubles;
|
|
1547
1979
|
}
|
|
1548
1980
|
/**
|
|
1549
1981
|
* Returns true if there are any purge troubles for the macro holders.
|
|
@@ -1574,59 +2006,77 @@ let D = class {
|
|
|
1574
2006
|
get hasMacroIngredients() {
|
|
1575
2007
|
return this.macroIngredients.length > 0;
|
|
1576
2008
|
}
|
|
1577
|
-
async resolveAll(
|
|
1578
|
-
if (!
|
|
2009
|
+
async resolveAll(type, tracker) {
|
|
2010
|
+
if (!tracker) {
|
|
1579
2011
|
throw new Error("No tracker provided");
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
],
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
],
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
],
|
|
1596
|
-
|
|
2012
|
+
}
|
|
2013
|
+
const container = type === TROUBLE_TYPE_PURGE ? this.holderPurgeTroubles : this.holderPrimeTroubles;
|
|
2014
|
+
const allTroubles = container.map((trouble) => trouble.rawId);
|
|
2015
|
+
const response = await purgeMacroPumps(allTroubles, tracker);
|
|
2016
|
+
return response;
|
|
2017
|
+
}
|
|
2018
|
+
};
|
|
2019
|
+
__decorateClass$a([
|
|
2020
|
+
kosDependency({ modelType: HolderContainer.type })
|
|
2021
|
+
], MacroAssignmentModelImpl.prototype, "holders", 2);
|
|
2022
|
+
__decorateClass$a([
|
|
2023
|
+
kosDependency({ modelType: IngredientContainer.type })
|
|
2024
|
+
], MacroAssignmentModelImpl.prototype, "ingredients", 2);
|
|
2025
|
+
__decorateClass$a([
|
|
2026
|
+
kosFuture()
|
|
2027
|
+
], MacroAssignmentModelImpl.prototype, "resolveAll", 1);
|
|
2028
|
+
MacroAssignmentModelImpl = __decorateClass$a([
|
|
2029
|
+
kosModel(MODEL_TYPE$a)
|
|
2030
|
+
], MacroAssignmentModelImpl);
|
|
2031
|
+
const MacroAssignment = {
|
|
1597
2032
|
registration: {
|
|
1598
|
-
[
|
|
1599
|
-
class:
|
|
1600
|
-
singleton:
|
|
2033
|
+
[MODEL_TYPE$a]: {
|
|
2034
|
+
class: MacroAssignmentModelImpl,
|
|
2035
|
+
singleton: true
|
|
1601
2036
|
}
|
|
1602
2037
|
},
|
|
1603
|
-
type:
|
|
1604
|
-
predicate:
|
|
1605
|
-
factory:
|
|
1606
|
-
|
|
2038
|
+
type: MODEL_TYPE$a,
|
|
2039
|
+
predicate: isKosModel(MODEL_TYPE$a),
|
|
2040
|
+
factory: Kos.Singleton.create(
|
|
2041
|
+
MODEL_TYPE$a
|
|
1607
2042
|
)
|
|
1608
2043
|
};
|
|
1609
|
-
var
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
this.
|
|
2044
|
+
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
2045
|
+
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
2046
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target;
|
|
2047
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2048
|
+
if (decorator = decorators[i])
|
|
2049
|
+
result = decorator(result) || result;
|
|
2050
|
+
return result;
|
|
2051
|
+
};
|
|
2052
|
+
const MODEL_TYPE$9 = "network-test-model";
|
|
2053
|
+
let NetworkTestModelImpl = class {
|
|
2054
|
+
id;
|
|
2055
|
+
group;
|
|
2056
|
+
passed;
|
|
2057
|
+
inProgress;
|
|
2058
|
+
failureTime;
|
|
2059
|
+
timestamp;
|
|
2060
|
+
name;
|
|
2061
|
+
results;
|
|
2062
|
+
logger;
|
|
2063
|
+
constructor(modelId, options, context) {
|
|
2064
|
+
this.id = modelId;
|
|
2065
|
+
this.logger = context.logger;
|
|
2066
|
+
this.group = options.group;
|
|
2067
|
+
this.passed = false;
|
|
2068
|
+
this.inProgress = false;
|
|
2069
|
+
this.name = options.name;
|
|
2070
|
+
this.results = [];
|
|
2071
|
+
}
|
|
2072
|
+
updateModel(options) {
|
|
2073
|
+
this.group = options.group;
|
|
2074
|
+
this.name = options.name;
|
|
2075
|
+
this.passed = options.passed;
|
|
2076
|
+
this.failureTime = options.failureTime;
|
|
2077
|
+
this.inProgress = options.inProgress;
|
|
2078
|
+
this.timestamp = options.timestamp;
|
|
2079
|
+
this.results = options.results;
|
|
1630
2080
|
}
|
|
1631
2081
|
// -------------------LIFECYCLE----------------------------
|
|
1632
2082
|
async init() {
|
|
@@ -1636,75 +2086,94 @@ let We = class {
|
|
|
1636
2086
|
this.logger.debug(`loading network-test ${this.id}`);
|
|
1637
2087
|
}
|
|
1638
2088
|
};
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
],
|
|
1642
|
-
const
|
|
2089
|
+
NetworkTestModelImpl = __decorateClass$9([
|
|
2090
|
+
kosModel(MODEL_TYPE$9)
|
|
2091
|
+
], NetworkTestModelImpl);
|
|
2092
|
+
const NetworkTest = {
|
|
1643
2093
|
registration: {
|
|
1644
|
-
[
|
|
1645
|
-
class:
|
|
1646
|
-
singleton:
|
|
2094
|
+
[MODEL_TYPE$9]: {
|
|
2095
|
+
class: NetworkTestModelImpl,
|
|
2096
|
+
singleton: false
|
|
1647
2097
|
}
|
|
1648
2098
|
},
|
|
1649
|
-
type:
|
|
1650
|
-
predicate:
|
|
1651
|
-
factory:
|
|
1652
|
-
}
|
|
1653
|
-
|
|
1654
|
-
|
|
2099
|
+
type: MODEL_TYPE$9,
|
|
2100
|
+
predicate: isKosModel(MODEL_TYPE$9),
|
|
2101
|
+
factory: Kos.Factory.create(MODEL_TYPE$9)
|
|
2102
|
+
};
|
|
2103
|
+
const { URL: URL$4 } = resolveServiceUrl("NETWORK-TEST_SERVICE");
|
|
2104
|
+
const { getAll: getAll$2, getOne: getOne$1 } = ServiceFactory.build({
|
|
2105
|
+
basePath: `${URL$4}/api/app/ncui/network/tests`
|
|
2106
|
+
});
|
|
2107
|
+
const log$4 = KosLog.createLogger({
|
|
1655
2108
|
name: "network-test-service",
|
|
1656
2109
|
group: "Services"
|
|
1657
|
-
})
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
2110
|
+
});
|
|
2111
|
+
const getNetworkTests = async () => {
|
|
2112
|
+
log$4.debug("sending GET for network-test");
|
|
2113
|
+
const response = await getAll$2({
|
|
2114
|
+
urlOverride: `${URL$4}/api/app/kosdev.ddk/network/tests`
|
|
2115
|
+
});
|
|
2116
|
+
return response?.data;
|
|
2117
|
+
};
|
|
2118
|
+
const getTestsReports = async () => {
|
|
2119
|
+
const response = await getOne$1({
|
|
2120
|
+
urlOverride: `${URL$4}/api/app/kosdev.ddk/network/reports`
|
|
1661
2121
|
});
|
|
1662
|
-
return
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
|
|
2122
|
+
return response?.data;
|
|
2123
|
+
};
|
|
2124
|
+
const performGroupTest = async (group, tracker) => {
|
|
2125
|
+
const response = await getOne$1({
|
|
2126
|
+
urlOverride: `${URL$4}/api/app/kosdev.ddk/network/tests/run/group/${group}`,
|
|
2127
|
+
tracker
|
|
1666
2128
|
});
|
|
1667
|
-
return
|
|
1668
|
-
}
|
|
1669
|
-
|
|
1670
|
-
tracker: t
|
|
1671
|
-
}), di = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2129
|
+
return response;
|
|
2130
|
+
};
|
|
2131
|
+
const index$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1672
2132
|
__proto__: null,
|
|
1673
|
-
getNetworkTests
|
|
1674
|
-
getTestsReports
|
|
1675
|
-
performGroupTest
|
|
2133
|
+
getNetworkTests,
|
|
2134
|
+
getTestsReports,
|
|
2135
|
+
performGroupTest
|
|
1676
2136
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1677
|
-
var
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
2137
|
+
var __defProp$6 = Object.defineProperty;
|
|
2138
|
+
var __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor;
|
|
2139
|
+
var __decorateClass$8 = (decorators, target, key, kind) => {
|
|
2140
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target;
|
|
2141
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2142
|
+
if (decorator = decorators[i])
|
|
2143
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2144
|
+
if (kind && result) __defProp$6(target, key, result);
|
|
2145
|
+
return result;
|
|
2146
|
+
};
|
|
2147
|
+
const MODEL_TYPE$8 = "network-test-container-model";
|
|
2148
|
+
let NetworkTestContainerModelImpl = class {
|
|
2149
|
+
id;
|
|
2150
|
+
logger;
|
|
2151
|
+
lastTested;
|
|
2152
|
+
futureHandler;
|
|
2153
|
+
models;
|
|
2154
|
+
constructor(modelId, options, context) {
|
|
2155
|
+
this.id = modelId;
|
|
2156
|
+
this.logger = context.logger;
|
|
2157
|
+
this.futureHandler = new FutureHandler(this);
|
|
2158
|
+
this.models = new KosModelContainer({
|
|
2159
|
+
parentId: modelId,
|
|
1692
2160
|
indexMap: {
|
|
1693
2161
|
group: "group"
|
|
1694
2162
|
}
|
|
1695
|
-
})
|
|
2163
|
+
});
|
|
2164
|
+
this.lastTested = /* @__PURE__ */ new Date("default");
|
|
1696
2165
|
}
|
|
1697
2166
|
get data() {
|
|
1698
2167
|
return this.models.data;
|
|
1699
2168
|
}
|
|
1700
|
-
addModel(
|
|
1701
|
-
this.models.addModel(
|
|
2169
|
+
addModel(model) {
|
|
2170
|
+
this.models.addModel(model);
|
|
1702
2171
|
}
|
|
1703
|
-
removeModel(
|
|
1704
|
-
this.models.removeModel(
|
|
2172
|
+
removeModel(id) {
|
|
2173
|
+
this.models.removeModel(id);
|
|
1705
2174
|
}
|
|
1706
|
-
getModel(
|
|
1707
|
-
return this.models.getModel(
|
|
2175
|
+
getModel(id) {
|
|
2176
|
+
return this.models.getModel(id);
|
|
1708
2177
|
}
|
|
1709
2178
|
// -------------------LIFECYCLE----------------------------
|
|
1710
2179
|
async init() {
|
|
@@ -1712,99 +2181,119 @@ let ne = class {
|
|
|
1712
2181
|
`initializing network-test-container container ${this.id}`
|
|
1713
2182
|
);
|
|
1714
2183
|
}
|
|
1715
|
-
getLastTested(
|
|
1716
|
-
const
|
|
1717
|
-
|
|
2184
|
+
getLastTested(groupName) {
|
|
2185
|
+
const dateArray = this.models.getIndexByKey("group", groupName).map((obj) => obj.timestamp && new Date(obj.timestamp));
|
|
2186
|
+
const latestDate = Math.max(
|
|
2187
|
+
...dateArray.map((date) => date ? date.getTime() : 0)
|
|
1718
2188
|
);
|
|
1719
|
-
return
|
|
2189
|
+
return latestDate ? calculateTimeDifference(new Date(latestDate)) : "";
|
|
1720
2190
|
}
|
|
1721
2191
|
async load() {
|
|
1722
2192
|
this.logger.debug(`loading network-test-container container ${this.id}`);
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
2193
|
+
const testResponse = await getNetworkTests();
|
|
2194
|
+
const testReportResponse = await getTestsReports();
|
|
2195
|
+
if (testResponse) {
|
|
2196
|
+
testResponse.forEach((item) => {
|
|
2197
|
+
const testModel = NetworkTest.factory(item.id)(item);
|
|
2198
|
+
this.addModel(testModel);
|
|
2199
|
+
});
|
|
2200
|
+
}
|
|
2201
|
+
if (testResponse && testReportResponse) {
|
|
2202
|
+
testResponse.forEach((item) => {
|
|
2203
|
+
const groupReport = testReportResponse?.[item.group];
|
|
2204
|
+
const testReport = groupReport?.[item.id];
|
|
2205
|
+
const testModel = this.getModel(item.id);
|
|
2206
|
+
if (testModel && testReport) {
|
|
2207
|
+
const update = {
|
|
2208
|
+
group: testReport.group,
|
|
2209
|
+
name: testReport.name,
|
|
2210
|
+
passed: testReport.passed,
|
|
2211
|
+
failureTime: testReport.failureTime ? new Date(testReport.failureTime) : void 0,
|
|
2212
|
+
inProgress: testReport.inProgress,
|
|
2213
|
+
timestamp: new Date(testReport.timestamp),
|
|
2214
|
+
results: testReport.results
|
|
2215
|
+
};
|
|
2216
|
+
testModel.updateModel(update);
|
|
2217
|
+
}
|
|
2218
|
+
});
|
|
2219
|
+
}
|
|
1742
2220
|
}
|
|
1743
|
-
async performTest(
|
|
1744
|
-
if (!
|
|
2221
|
+
async performTest(group, tracker) {
|
|
2222
|
+
if (!tracker) {
|
|
1745
2223
|
throw new Error("No tracker provided");
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
group: o.group,
|
|
1758
|
-
name: o.name,
|
|
1759
|
-
passed: o.passed,
|
|
1760
|
-
failureTime: o.failureTime ? new Date(o.failureTime) : void 0,
|
|
1761
|
-
inProgress: o.inProgress,
|
|
1762
|
-
timestamp: new Date(o.timestamp),
|
|
1763
|
-
results: o.results
|
|
1764
|
-
};
|
|
1765
|
-
v(() => {
|
|
1766
|
-
s.updateModel(r);
|
|
2224
|
+
}
|
|
2225
|
+
const result = await performGroupTest(group, tracker);
|
|
2226
|
+
return result?.data;
|
|
2227
|
+
}
|
|
2228
|
+
onFutureUpdate(future) {
|
|
2229
|
+
const { clientData } = future;
|
|
2230
|
+
if (clientData) {
|
|
2231
|
+
clientData.forEach((item) => {
|
|
2232
|
+
const testModel = this.getModel(item.id);
|
|
2233
|
+
kosAction(() => {
|
|
2234
|
+
this.lastTested = this.lastTested > new Date(item.timestamp) ? this.lastTested : new Date(item.timestamp);
|
|
1767
2235
|
});
|
|
1768
|
-
|
|
1769
|
-
|
|
2236
|
+
if (testModel) {
|
|
2237
|
+
const update = {
|
|
2238
|
+
group: item.group,
|
|
2239
|
+
name: item.name,
|
|
2240
|
+
passed: item.passed,
|
|
2241
|
+
failureTime: item.failureTime ? new Date(item.failureTime) : void 0,
|
|
2242
|
+
inProgress: item.inProgress,
|
|
2243
|
+
timestamp: new Date(item.timestamp),
|
|
2244
|
+
results: item.results
|
|
2245
|
+
};
|
|
2246
|
+
kosAction(() => {
|
|
2247
|
+
testModel.updateModel(update);
|
|
2248
|
+
});
|
|
2249
|
+
}
|
|
2250
|
+
});
|
|
2251
|
+
}
|
|
1770
2252
|
}
|
|
1771
2253
|
};
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
],
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
],
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
],
|
|
1781
|
-
const
|
|
2254
|
+
__decorateClass$8([
|
|
2255
|
+
kosChild
|
|
2256
|
+
], NetworkTestContainerModelImpl.prototype, "models", 2);
|
|
2257
|
+
__decorateClass$8([
|
|
2258
|
+
kosFuture()
|
|
2259
|
+
], NetworkTestContainerModelImpl.prototype, "performTest", 1);
|
|
2260
|
+
NetworkTestContainerModelImpl = __decorateClass$8([
|
|
2261
|
+
kosModel(MODEL_TYPE$8)
|
|
2262
|
+
], NetworkTestContainerModelImpl);
|
|
2263
|
+
const NetworkTestContainer = {
|
|
1782
2264
|
registration: {
|
|
1783
|
-
[
|
|
1784
|
-
class:
|
|
1785
|
-
singleton:
|
|
2265
|
+
[MODEL_TYPE$8]: {
|
|
2266
|
+
class: NetworkTestContainerModelImpl,
|
|
2267
|
+
singleton: true
|
|
1786
2268
|
},
|
|
1787
|
-
...
|
|
2269
|
+
...NetworkTest.registration
|
|
1788
2270
|
},
|
|
1789
|
-
type:
|
|
1790
|
-
predicate:
|
|
1791
|
-
factory:
|
|
1792
|
-
};
|
|
1793
|
-
var
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
2271
|
+
type: MODEL_TYPE$8,
|
|
2272
|
+
predicate: isKosModel(MODEL_TYPE$8),
|
|
2273
|
+
factory: Kos.Singleton.create(MODEL_TYPE$8)
|
|
2274
|
+
};
|
|
2275
|
+
var __defProp$5 = Object.defineProperty;
|
|
2276
|
+
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
2277
|
+
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
2278
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target;
|
|
2279
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2280
|
+
if (decorator = decorators[i])
|
|
2281
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2282
|
+
if (kind && result) __defProp$5(target, key, result);
|
|
2283
|
+
return result;
|
|
2284
|
+
};
|
|
2285
|
+
const MODEL_TYPE$7 = "nutritive-sweetener-model";
|
|
2286
|
+
const PATH_PUMP_STATE = createPropKey("statePath");
|
|
2287
|
+
let NutritiveSweetenerModelImpl = class {
|
|
2288
|
+
id;
|
|
2289
|
+
assemblyModel;
|
|
2290
|
+
pumpState;
|
|
2291
|
+
constructor(modelId, _options) {
|
|
2292
|
+
this.id = modelId;
|
|
1805
2293
|
}
|
|
1806
2294
|
get holder() {
|
|
1807
|
-
|
|
2295
|
+
const nsHolder = this.assemblyModel.getHoldersByGroup("ns")[0];
|
|
2296
|
+
return nsHolder;
|
|
1808
2297
|
}
|
|
1809
2298
|
getHolder() {
|
|
1810
2299
|
return this.holder;
|
|
@@ -1819,49 +2308,57 @@ let ae = class {
|
|
|
1819
2308
|
return this.pump;
|
|
1820
2309
|
}
|
|
1821
2310
|
};
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
],
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
path:
|
|
2311
|
+
__decorateClass$7([
|
|
2312
|
+
kosDependency({ modelType: Assembly.type })
|
|
2313
|
+
], NutritiveSweetenerModelImpl.prototype, "assemblyModel", 2);
|
|
2314
|
+
__decorateClass$7([
|
|
2315
|
+
kosStateBean({
|
|
2316
|
+
path: PATH_PUMP_STATE
|
|
1828
2317
|
})
|
|
1829
|
-
],
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
],
|
|
1834
|
-
const
|
|
2318
|
+
], NutritiveSweetenerModelImpl.prototype, "pumpState", 2);
|
|
2319
|
+
NutritiveSweetenerModelImpl = __decorateClass$7([
|
|
2320
|
+
kosModel(MODEL_TYPE$7),
|
|
2321
|
+
kosLoggerAware()
|
|
2322
|
+
], NutritiveSweetenerModelImpl);
|
|
2323
|
+
const NutritiveSweetener = {
|
|
1835
2324
|
registration: {
|
|
1836
|
-
[
|
|
1837
|
-
class:
|
|
1838
|
-
singleton:
|
|
2325
|
+
[MODEL_TYPE$7]: {
|
|
2326
|
+
class: NutritiveSweetenerModelImpl,
|
|
2327
|
+
singleton: false
|
|
1839
2328
|
}
|
|
1840
2329
|
},
|
|
1841
|
-
type:
|
|
1842
|
-
predicate:
|
|
1843
|
-
factory:
|
|
1844
|
-
};
|
|
1845
|
-
var
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
2330
|
+
type: MODEL_TYPE$7,
|
|
2331
|
+
predicate: isKosModel(MODEL_TYPE$7),
|
|
2332
|
+
factory: Kos.Factory.create(MODEL_TYPE$7)
|
|
2333
|
+
};
|
|
2334
|
+
var __defProp$4 = Object.defineProperty;
|
|
2335
|
+
var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
|
|
2336
|
+
var __decorateClass$6 = (decorators, target, key, kind) => {
|
|
2337
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
|
|
2338
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2339
|
+
if (decorator = decorators[i])
|
|
2340
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2341
|
+
if (kind && result) __defProp$4(target, key, result);
|
|
2342
|
+
return result;
|
|
2343
|
+
};
|
|
2344
|
+
const MODEL_TYPE$6 = "plain-water-model";
|
|
2345
|
+
let PlainWaterModelImpl = class {
|
|
2346
|
+
id;
|
|
2347
|
+
assemblyModel;
|
|
2348
|
+
logger;
|
|
2349
|
+
constructor(modelId, _options, context) {
|
|
2350
|
+
this.id = modelId;
|
|
2351
|
+
this.logger = context.logger;
|
|
1857
2352
|
}
|
|
1858
2353
|
getHolder() {
|
|
1859
|
-
|
|
2354
|
+
const waterHolder = this.assemblyModel.getHoldersByGroup("water")[0];
|
|
2355
|
+
return waterHolder;
|
|
1860
2356
|
}
|
|
1861
2357
|
getPump() {
|
|
1862
|
-
|
|
1863
|
-
const
|
|
1864
|
-
|
|
2358
|
+
const waterHolder = this.getHolder();
|
|
2359
|
+
const pump = waterHolder?.pumps?.data?.[0];
|
|
2360
|
+
const model = getKosCompanionModel(pump, FcmPump.type);
|
|
2361
|
+
return model;
|
|
1865
2362
|
}
|
|
1866
2363
|
// -------------------LIFECYCLE----------------------------
|
|
1867
2364
|
async init() {
|
|
@@ -1871,45 +2368,58 @@ let me = class {
|
|
|
1871
2368
|
this.logger.debug(`loading plain-water ${this.id}`);
|
|
1872
2369
|
}
|
|
1873
2370
|
};
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
],
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
],
|
|
1880
|
-
const
|
|
2371
|
+
__decorateClass$6([
|
|
2372
|
+
kosDependency({ modelType: Assembly.type })
|
|
2373
|
+
], PlainWaterModelImpl.prototype, "assemblyModel", 2);
|
|
2374
|
+
PlainWaterModelImpl = __decorateClass$6([
|
|
2375
|
+
kosModel(MODEL_TYPE$6)
|
|
2376
|
+
], PlainWaterModelImpl);
|
|
2377
|
+
const PlainWater = {
|
|
1881
2378
|
registration: {
|
|
1882
|
-
[
|
|
1883
|
-
class:
|
|
1884
|
-
singleton:
|
|
2379
|
+
[MODEL_TYPE$6]: {
|
|
2380
|
+
class: PlainWaterModelImpl,
|
|
2381
|
+
singleton: false
|
|
1885
2382
|
}
|
|
1886
2383
|
},
|
|
1887
|
-
type:
|
|
1888
|
-
predicate:
|
|
1889
|
-
factory:
|
|
1890
|
-
}
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
2384
|
+
type: MODEL_TYPE$6,
|
|
2385
|
+
predicate: isKosModel(MODEL_TYPE$6),
|
|
2386
|
+
factory: Kos.Factory.create(MODEL_TYPE$6)
|
|
2387
|
+
};
|
|
2388
|
+
const { URL: URL$3 } = resolveServiceUrl("REBOOT_SERVICE");
|
|
2389
|
+
const { postModel } = ServiceFactory.build({
|
|
2390
|
+
basePath: `${URL$3}/api/reboot`
|
|
2391
|
+
});
|
|
2392
|
+
const log$3 = KosLog.createLogger({ name: "reboot-service", group: "Services" });
|
|
2393
|
+
const rebootDispenser = async () => {
|
|
2394
|
+
log$3.debug("sending POST call for Reboot Dispenser");
|
|
2395
|
+
const response = await postModel({
|
|
2396
|
+
urlOverride: `${URL$3}/api/app/kosdev.ddk/ncui/reboot`,
|
|
2397
|
+
model: {}
|
|
2398
|
+
});
|
|
2399
|
+
return response;
|
|
2400
|
+
};
|
|
2401
|
+
const index$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1896
2402
|
__proto__: null,
|
|
1897
|
-
rebootDispenser
|
|
2403
|
+
rebootDispenser
|
|
1898
2404
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1899
|
-
var
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
2405
|
+
var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
|
|
2406
|
+
var __decorateClass$5 = (decorators, target, key, kind) => {
|
|
2407
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
|
|
2408
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2409
|
+
if (decorator = decorators[i])
|
|
2410
|
+
result = decorator(result) || result;
|
|
2411
|
+
return result;
|
|
2412
|
+
};
|
|
2413
|
+
const MODEL_TYPE$5 = "reboot-model";
|
|
2414
|
+
let RebootModelImpl = class {
|
|
2415
|
+
id;
|
|
2416
|
+
logger;
|
|
2417
|
+
constructor(modelId, options, context) {
|
|
2418
|
+
this.id = modelId;
|
|
2419
|
+
this.logger = context.logger;
|
|
1910
2420
|
}
|
|
1911
2421
|
async completeReboot() {
|
|
1912
|
-
await
|
|
2422
|
+
await rebootDispenser();
|
|
1913
2423
|
}
|
|
1914
2424
|
updateModel() {
|
|
1915
2425
|
}
|
|
@@ -1921,41 +2431,47 @@ let Ne = class {
|
|
|
1921
2431
|
this.logger.debug(`loading reboot ${this.id}`);
|
|
1922
2432
|
}
|
|
1923
2433
|
};
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
],
|
|
1927
|
-
const
|
|
2434
|
+
RebootModelImpl = __decorateClass$5([
|
|
2435
|
+
kosModel(MODEL_TYPE$5)
|
|
2436
|
+
], RebootModelImpl);
|
|
2437
|
+
const Reboot = {
|
|
1928
2438
|
registration: {
|
|
1929
|
-
[
|
|
1930
|
-
class:
|
|
1931
|
-
singleton:
|
|
2439
|
+
[MODEL_TYPE$5]: {
|
|
2440
|
+
class: RebootModelImpl,
|
|
2441
|
+
singleton: false
|
|
1932
2442
|
}
|
|
1933
2443
|
},
|
|
1934
|
-
type:
|
|
1935
|
-
predicate:
|
|
1936
|
-
factory:
|
|
1937
|
-
};
|
|
1938
|
-
var $
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
2444
|
+
type: MODEL_TYPE$5,
|
|
2445
|
+
predicate: isKosModel(MODEL_TYPE$5),
|
|
2446
|
+
factory: Kos.Factory.create(MODEL_TYPE$5)
|
|
2447
|
+
};
|
|
2448
|
+
var __defProp$3 = Object.defineProperty;
|
|
2449
|
+
var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
|
|
2450
|
+
var __decorateClass$4 = (decorators, target, key, kind) => {
|
|
2451
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
|
|
2452
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2453
|
+
if (decorator = decorators[i])
|
|
2454
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2455
|
+
if (kind && result) __defProp$3(target, key, result);
|
|
2456
|
+
return result;
|
|
2457
|
+
};
|
|
2458
|
+
const MODEL_TYPE$4 = "settings-model";
|
|
2459
|
+
let SettingsModelImpl = class {
|
|
2460
|
+
id;
|
|
2461
|
+
logger;
|
|
2462
|
+
ncuiLanguageData;
|
|
2463
|
+
resolveDelaysMs;
|
|
2464
|
+
dateFormat;
|
|
2465
|
+
timeFormat;
|
|
2466
|
+
hidePlainWaterBev;
|
|
2467
|
+
hideCarbWaterBev;
|
|
2468
|
+
ncuiLanguage;
|
|
2469
|
+
name;
|
|
2470
|
+
activateAndRebootTime;
|
|
2471
|
+
horizontalMode;
|
|
2472
|
+
constructor(modelId, _options, context) {
|
|
2473
|
+
this.id = modelId;
|
|
2474
|
+
this.logger = context.logger;
|
|
1959
2475
|
}
|
|
1960
2476
|
// -------------------LIFECYCLE----------------------------
|
|
1961
2477
|
async ready() {
|
|
@@ -1975,7 +2491,8 @@ let f = class {
|
|
|
1975
2491
|
};
|
|
1976
2492
|
}
|
|
1977
2493
|
async load() {
|
|
1978
|
-
this.logger.debug(`loading settings ${this.id}`)
|
|
2494
|
+
this.logger.debug(`loading settings ${this.id}`);
|
|
2495
|
+
this.ncuiLanguageData = {
|
|
1979
2496
|
status: 200,
|
|
1980
2497
|
data: {
|
|
1981
2498
|
languages: [
|
|
@@ -1991,114 +2508,141 @@ let f = class {
|
|
|
1991
2508
|
this.updateDisplayMode();
|
|
1992
2509
|
}
|
|
1993
2510
|
updateDisplayMode() {
|
|
1994
|
-
this.horizontalMode.value
|
|
2511
|
+
if (this.horizontalMode.value) {
|
|
2512
|
+
document.body.setAttribute("data-dashboard-layout", "horizontal");
|
|
2513
|
+
} else {
|
|
2514
|
+
document.body.setAttribute("data-dashboard-layout", "vertical");
|
|
2515
|
+
}
|
|
1995
2516
|
}
|
|
1996
2517
|
};
|
|
1997
|
-
|
|
1998
|
-
|
|
2518
|
+
__decorateClass$4([
|
|
2519
|
+
kosConfigProperty({
|
|
1999
2520
|
path: "system:app",
|
|
2000
2521
|
attribute: "resolveDelaysMs"
|
|
2001
2522
|
// optionsExpander: () => [],
|
|
2002
2523
|
})
|
|
2003
|
-
],
|
|
2004
|
-
|
|
2005
|
-
|
|
2524
|
+
], SettingsModelImpl.prototype, "resolveDelaysMs", 2);
|
|
2525
|
+
__decorateClass$4([
|
|
2526
|
+
kosConfigProperty({
|
|
2006
2527
|
path: "system:app",
|
|
2007
2528
|
attribute: "dateFormat"
|
|
2008
2529
|
// optionsExpander: () => [],
|
|
2009
2530
|
})
|
|
2010
|
-
],
|
|
2011
|
-
|
|
2012
|
-
|
|
2531
|
+
], SettingsModelImpl.prototype, "dateFormat", 2);
|
|
2532
|
+
__decorateClass$4([
|
|
2533
|
+
kosConfigProperty({
|
|
2013
2534
|
path: "system:app",
|
|
2014
2535
|
attribute: "timeFormat"
|
|
2015
2536
|
// optionsExpander: () => [],
|
|
2016
2537
|
})
|
|
2017
|
-
],
|
|
2018
|
-
|
|
2019
|
-
|
|
2538
|
+
], SettingsModelImpl.prototype, "timeFormat", 2);
|
|
2539
|
+
__decorateClass$4([
|
|
2540
|
+
kosConfigProperty({
|
|
2020
2541
|
path: "app:kosdev.ddk:app",
|
|
2021
2542
|
attribute: "ncui.hidePlainWaterBev"
|
|
2022
2543
|
})
|
|
2023
|
-
],
|
|
2024
|
-
|
|
2025
|
-
|
|
2544
|
+
], SettingsModelImpl.prototype, "hidePlainWaterBev", 2);
|
|
2545
|
+
__decorateClass$4([
|
|
2546
|
+
kosConfigProperty({
|
|
2026
2547
|
path: "app:kosdev.ddk:app",
|
|
2027
2548
|
attribute: "ncui.hideCarbWaterBev"
|
|
2028
2549
|
})
|
|
2029
|
-
],
|
|
2030
|
-
|
|
2031
|
-
|
|
2550
|
+
], SettingsModelImpl.prototype, "hideCarbWaterBev", 2);
|
|
2551
|
+
__decorateClass$4([
|
|
2552
|
+
kosConfigProperty({
|
|
2032
2553
|
path: "app:kosdev.ddk:app",
|
|
2033
2554
|
attribute: "ncui.ncuiLanguage"
|
|
2034
2555
|
})
|
|
2035
|
-
],
|
|
2036
|
-
|
|
2037
|
-
|
|
2556
|
+
], SettingsModelImpl.prototype, "ncuiLanguage", 2);
|
|
2557
|
+
__decorateClass$4([
|
|
2558
|
+
kosConfigProperty({
|
|
2038
2559
|
path: "kos:device",
|
|
2039
2560
|
attribute: "name"
|
|
2040
2561
|
})
|
|
2041
|
-
],
|
|
2042
|
-
|
|
2043
|
-
|
|
2562
|
+
], SettingsModelImpl.prototype, "name", 2);
|
|
2563
|
+
__decorateClass$4([
|
|
2564
|
+
kosConfigProperty({
|
|
2044
2565
|
path: "kos:service:OTA",
|
|
2045
2566
|
attribute: "activateAndRebootTime"
|
|
2046
2567
|
})
|
|
2047
|
-
],
|
|
2048
|
-
|
|
2049
|
-
|
|
2568
|
+
], SettingsModelImpl.prototype, "activateAndRebootTime", 2);
|
|
2569
|
+
__decorateClass$4([
|
|
2570
|
+
kosConfigProperty({
|
|
2050
2571
|
path: "app:kosdev.ddk:app",
|
|
2051
2572
|
attribute: "ncui.uiConfig.display.horizontalMode"
|
|
2052
2573
|
})
|
|
2053
|
-
],
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
dependencies: (
|
|
2574
|
+
], SettingsModelImpl.prototype, "horizontalMode", 2);
|
|
2575
|
+
__decorateClass$4([
|
|
2576
|
+
kosModelEffect({
|
|
2577
|
+
dependencies: (model) => [model.horizontalMode.value]
|
|
2057
2578
|
})
|
|
2058
|
-
],
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
],
|
|
2062
|
-
const
|
|
2579
|
+
], SettingsModelImpl.prototype, "handleUpdateDisplayMode", 1);
|
|
2580
|
+
SettingsModelImpl = __decorateClass$4([
|
|
2581
|
+
kosModel(MODEL_TYPE$4)
|
|
2582
|
+
], SettingsModelImpl);
|
|
2583
|
+
const Settings = {
|
|
2063
2584
|
registration: {
|
|
2064
|
-
[
|
|
2065
|
-
class:
|
|
2066
|
-
singleton:
|
|
2585
|
+
[MODEL_TYPE$4]: {
|
|
2586
|
+
class: SettingsModelImpl,
|
|
2587
|
+
singleton: true
|
|
2067
2588
|
}
|
|
2068
2589
|
},
|
|
2069
|
-
type:
|
|
2070
|
-
predicate:
|
|
2071
|
-
factory:
|
|
2072
|
-
}
|
|
2073
|
-
|
|
2074
|
-
}
|
|
2590
|
+
type: MODEL_TYPE$4,
|
|
2591
|
+
predicate: isKosModel(MODEL_TYPE$4),
|
|
2592
|
+
factory: Kos.Singleton.create(MODEL_TYPE$4)
|
|
2593
|
+
};
|
|
2594
|
+
const { URL: URL$2 } = resolveServiceUrl("SETTINGS_SERVICE");
|
|
2595
|
+
const { getAll: getAll$1 } = ServiceFactory.build({
|
|
2596
|
+
basePath: `${URL$2}/api/settings`
|
|
2597
|
+
});
|
|
2598
|
+
const log$2 = KosLog.createLogger({
|
|
2075
2599
|
name: "settings-service",
|
|
2076
2600
|
group: "Services"
|
|
2077
|
-
})
|
|
2078
|
-
|
|
2079
|
-
|
|
2601
|
+
});
|
|
2602
|
+
const getSettings = async () => {
|
|
2603
|
+
log$2.debug("sending GET for settings");
|
|
2604
|
+
const response = await getAll$1({});
|
|
2605
|
+
return response;
|
|
2606
|
+
};
|
|
2607
|
+
const getNcuiLanguage = async () => {
|
|
2608
|
+
const response = await getAll$1({
|
|
2609
|
+
urlOverride: `${URL$2}api/app/kosdev.ddk/ncui/languages`
|
|
2610
|
+
});
|
|
2611
|
+
return response;
|
|
2612
|
+
};
|
|
2613
|
+
const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2080
2614
|
__proto__: null,
|
|
2081
|
-
getNcuiLanguage
|
|
2082
|
-
getSettings
|
|
2615
|
+
getNcuiLanguage,
|
|
2616
|
+
getSettings
|
|
2083
2617
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2084
|
-
var
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
this.
|
|
2618
|
+
var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
|
|
2619
|
+
var __decorateClass$3 = (decorators, target, key, kind) => {
|
|
2620
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
|
|
2621
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2622
|
+
if (decorator = decorators[i])
|
|
2623
|
+
result = decorator(result) || result;
|
|
2624
|
+
return result;
|
|
2625
|
+
};
|
|
2626
|
+
const MODEL_TYPE$3 = "utilities-model";
|
|
2627
|
+
let UtilitiesModelImpl = class {
|
|
2628
|
+
id;
|
|
2629
|
+
name;
|
|
2630
|
+
options;
|
|
2631
|
+
roles;
|
|
2632
|
+
columnId;
|
|
2633
|
+
logger;
|
|
2634
|
+
constructor(modelId, options, context) {
|
|
2635
|
+
this.id = modelId;
|
|
2636
|
+
this.logger = context.logger;
|
|
2637
|
+
this.name = options.name;
|
|
2638
|
+
this.options = options.options;
|
|
2639
|
+
this.roles = options?.roles;
|
|
2640
|
+
this.columnId = options.columnId;
|
|
2641
|
+
}
|
|
2642
|
+
updateModel(options) {
|
|
2643
|
+
this.name = options.name;
|
|
2644
|
+
this.options = options.options;
|
|
2645
|
+
this.roles = options?.roles;
|
|
2102
2646
|
}
|
|
2103
2647
|
get titleKey() {
|
|
2104
2648
|
return `utility.${this.id}.title`;
|
|
@@ -2114,62 +2658,74 @@ let ze = class {
|
|
|
2114
2658
|
this.logger.debug(`loading utilities ${this.id}`);
|
|
2115
2659
|
}
|
|
2116
2660
|
};
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
],
|
|
2120
|
-
const
|
|
2661
|
+
UtilitiesModelImpl = __decorateClass$3([
|
|
2662
|
+
kosModel(MODEL_TYPE$3)
|
|
2663
|
+
], UtilitiesModelImpl);
|
|
2664
|
+
const Utilities = {
|
|
2121
2665
|
registration: {
|
|
2122
|
-
[
|
|
2123
|
-
class:
|
|
2124
|
-
singleton:
|
|
2666
|
+
[MODEL_TYPE$3]: {
|
|
2667
|
+
class: UtilitiesModelImpl,
|
|
2668
|
+
singleton: false
|
|
2125
2669
|
}
|
|
2126
2670
|
},
|
|
2127
|
-
type:
|
|
2128
|
-
predicate:
|
|
2129
|
-
factory:
|
|
2130
|
-
}
|
|
2131
|
-
|
|
2132
|
-
}
|
|
2671
|
+
type: MODEL_TYPE$3,
|
|
2672
|
+
predicate: isKosModel(MODEL_TYPE$3),
|
|
2673
|
+
factory: Kos.Factory.create(MODEL_TYPE$3)
|
|
2674
|
+
};
|
|
2675
|
+
const { URL: URL$1 } = resolveServiceUrl("UTILITIES_SERVICE");
|
|
2676
|
+
const { getAll } = ServiceFactory.build({
|
|
2677
|
+
basePath: `${URL$1}/api/utilities`
|
|
2678
|
+
});
|
|
2679
|
+
const log$1 = KosLog.createLogger({
|
|
2133
2680
|
name: "utilities-service",
|
|
2134
2681
|
group: "Services"
|
|
2135
|
-
})
|
|
2136
|
-
|
|
2682
|
+
});
|
|
2683
|
+
const getUtilities = async () => {
|
|
2684
|
+
log$1.debug("sending GET for utilities");
|
|
2137
2685
|
try {
|
|
2138
|
-
const
|
|
2139
|
-
urlOverride: `${
|
|
2686
|
+
const extensionResponse = await getAll({
|
|
2687
|
+
urlOverride: `${URL$1}/api/kos/descriptor/app:kosdev.ddk:ncuiDescriptor/kondra.ncui.utilities`
|
|
2140
2688
|
});
|
|
2141
|
-
if (
|
|
2142
|
-
|
|
2143
|
-
const
|
|
2144
|
-
urlOverride: `${
|
|
2689
|
+
if (extensionResponse?.status !== 200) {
|
|
2690
|
+
log$1.info(`no extensions found, using base data`);
|
|
2691
|
+
const response = await getAll({
|
|
2692
|
+
urlOverride: `${URL$1}/api/kos/descriptor/system:app/kondra.ncui.utilities`
|
|
2145
2693
|
});
|
|
2146
|
-
return
|
|
2694
|
+
return response?.data ?? [];
|
|
2147
2695
|
}
|
|
2148
|
-
return
|
|
2149
|
-
} catch (
|
|
2150
|
-
|
|
2151
|
-
const
|
|
2152
|
-
urlOverride: `${
|
|
2696
|
+
return extensionResponse?.data ?? [];
|
|
2697
|
+
} catch (error) {
|
|
2698
|
+
log$1.info(`error fetching utilities: ${error}. Using base data`);
|
|
2699
|
+
const response = await getAll({
|
|
2700
|
+
urlOverride: `${URL$1}/api/kos/descriptor/system:app/kondra.ncui.utilities`
|
|
2153
2701
|
});
|
|
2154
|
-
return
|
|
2702
|
+
return response?.data ?? [];
|
|
2155
2703
|
}
|
|
2156
|
-
}
|
|
2704
|
+
};
|
|
2705
|
+
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2157
2706
|
__proto__: null,
|
|
2158
|
-
getUtilities
|
|
2707
|
+
getUtilities
|
|
2159
2708
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2160
|
-
var
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2709
|
+
var __defProp$2 = Object.defineProperty;
|
|
2710
|
+
var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
|
|
2711
|
+
var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
2712
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
|
|
2713
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2714
|
+
if (decorator = decorators[i])
|
|
2715
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2716
|
+
if (kind && result) __defProp$2(target, key, result);
|
|
2717
|
+
return result;
|
|
2718
|
+
};
|
|
2719
|
+
const MODEL_TYPE$2 = "utilities-container-model";
|
|
2720
|
+
let UtilitiesContainerModelImpl = class {
|
|
2721
|
+
id;
|
|
2722
|
+
logger;
|
|
2723
|
+
_models;
|
|
2724
|
+
constructor(modelId, _options, context) {
|
|
2725
|
+
this.id = modelId;
|
|
2726
|
+
this.logger = context.logger;
|
|
2727
|
+
this._models = new KosModelContainer({
|
|
2728
|
+
parentId: modelId,
|
|
2173
2729
|
sortKey: "id",
|
|
2174
2730
|
indexMap: {
|
|
2175
2731
|
byColumn: "columnId"
|
|
@@ -2183,80 +2739,129 @@ let be = class {
|
|
|
2183
2739
|
return this._models;
|
|
2184
2740
|
}
|
|
2185
2741
|
get columns() {
|
|
2186
|
-
return this._models.getIndexKeys("byColumn").sort((
|
|
2742
|
+
return this._models.getIndexKeys("byColumn").sort((a, b) => a.localeCompare(b));
|
|
2187
2743
|
}
|
|
2188
|
-
addModel(
|
|
2189
|
-
this._models.addModel(
|
|
2744
|
+
addModel(model) {
|
|
2745
|
+
this._models.addModel(model);
|
|
2190
2746
|
}
|
|
2191
|
-
removeModel(
|
|
2192
|
-
this._models.removeModel(
|
|
2747
|
+
removeModel(id) {
|
|
2748
|
+
this._models.removeModel(id);
|
|
2193
2749
|
}
|
|
2194
|
-
getModel(
|
|
2195
|
-
return this._models.getModel(
|
|
2750
|
+
getModel(id) {
|
|
2751
|
+
return this._models.getModel(id);
|
|
2196
2752
|
}
|
|
2197
|
-
getUtilitiesByColumn(
|
|
2198
|
-
return this._models.getIndexByKey("byColumn",
|
|
2753
|
+
getUtilitiesByColumn(id) {
|
|
2754
|
+
return this._models.getIndexByKey("byColumn", id);
|
|
2199
2755
|
}
|
|
2200
2756
|
// -------------------LIFECYCLE----------------------------
|
|
2201
2757
|
async load() {
|
|
2202
2758
|
this.logger.debug(`loading utilities-container container ${this.id}`);
|
|
2203
|
-
const
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
const
|
|
2207
|
-
...
|
|
2208
|
-
columnId: String(
|
|
2209
|
-
}
|
|
2210
|
-
|
|
2759
|
+
const utilitiesResponse = await getUtilities();
|
|
2760
|
+
utilitiesResponse?.forEach((utilityColumnsResponse, columnId) => {
|
|
2761
|
+
utilityColumnsResponse.forEach((utilityResponse) => {
|
|
2762
|
+
const utilityOptions = {
|
|
2763
|
+
...utilityResponse,
|
|
2764
|
+
columnId: String(columnId)
|
|
2765
|
+
};
|
|
2766
|
+
const utilityModel = Utilities.factory(utilityResponse.name)(
|
|
2767
|
+
utilityOptions
|
|
2211
2768
|
);
|
|
2212
|
-
this.addModel(
|
|
2769
|
+
this.addModel(utilityModel);
|
|
2213
2770
|
});
|
|
2214
2771
|
});
|
|
2215
2772
|
}
|
|
2216
2773
|
};
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
],
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
],
|
|
2223
|
-
const
|
|
2774
|
+
__decorateClass$2([
|
|
2775
|
+
kosChild
|
|
2776
|
+
], UtilitiesContainerModelImpl.prototype, "_models", 2);
|
|
2777
|
+
UtilitiesContainerModelImpl = __decorateClass$2([
|
|
2778
|
+
kosModel(MODEL_TYPE$2)
|
|
2779
|
+
], UtilitiesContainerModelImpl);
|
|
2780
|
+
const UtilitiesContainer = {
|
|
2224
2781
|
registration: {
|
|
2225
|
-
[
|
|
2226
|
-
class:
|
|
2227
|
-
singleton:
|
|
2782
|
+
[MODEL_TYPE$2]: {
|
|
2783
|
+
class: UtilitiesContainerModelImpl,
|
|
2784
|
+
singleton: true
|
|
2228
2785
|
},
|
|
2229
|
-
...
|
|
2786
|
+
...Utilities.registration
|
|
2230
2787
|
},
|
|
2231
|
-
type:
|
|
2232
|
-
predicate:
|
|
2233
|
-
factory:
|
|
2234
|
-
}
|
|
2235
|
-
|
|
2236
|
-
...
|
|
2237
|
-
...
|
|
2238
|
-
...
|
|
2239
|
-
...
|
|
2240
|
-
...
|
|
2241
|
-
...
|
|
2242
|
-
...
|
|
2243
|
-
...
|
|
2244
|
-
...
|
|
2245
|
-
...
|
|
2246
|
-
...
|
|
2247
|
-
...
|
|
2248
|
-
...
|
|
2249
|
-
...
|
|
2250
|
-
...
|
|
2251
|
-
...
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2788
|
+
type: MODEL_TYPE$2,
|
|
2789
|
+
predicate: isKosModel(MODEL_TYPE$2),
|
|
2790
|
+
factory: Kos.Singleton.create(MODEL_TYPE$2)
|
|
2791
|
+
};
|
|
2792
|
+
const DDKModels = {
|
|
2793
|
+
...Animation.registration,
|
|
2794
|
+
...Application.registration,
|
|
2795
|
+
...Auth.registration,
|
|
2796
|
+
...CarbWater.registration,
|
|
2797
|
+
...DashboardOperations.registration,
|
|
2798
|
+
...Dispenser.registration,
|
|
2799
|
+
...DispenserInfo.registration,
|
|
2800
|
+
...Enrollment.registration,
|
|
2801
|
+
...IngredientSummary.registration,
|
|
2802
|
+
...MacroAssignment.registration,
|
|
2803
|
+
...NetworkTestContainer.registration,
|
|
2804
|
+
...NutritiveSweetener.registration,
|
|
2805
|
+
...PlainWater.registration,
|
|
2806
|
+
...Reboot.registration,
|
|
2807
|
+
...Settings.registration,
|
|
2808
|
+
...SetupStepContainer.registration,
|
|
2809
|
+
...UtilitiesContainer.registration
|
|
2810
|
+
};
|
|
2811
|
+
var __defProp$1 = Object.defineProperty;
|
|
2812
|
+
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
2813
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2814
|
+
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
2815
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
2816
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2817
|
+
if (decorator = decorators[i])
|
|
2818
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
2819
|
+
if (kind && result) __defProp$1(target, key, result);
|
|
2820
|
+
return result;
|
|
2821
|
+
};
|
|
2822
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
2823
|
+
const MODEL_TYPE$1 = "trouble-action-model";
|
|
2824
|
+
let TroubleActionModelImpl = class {
|
|
2825
|
+
/**
|
|
2826
|
+
* Unique identifier for this model instance.
|
|
2827
|
+
*
|
|
2828
|
+
* Set during construction and used for model lifecycle management
|
|
2829
|
+
* and debugging purposes.
|
|
2830
|
+
*
|
|
2831
|
+
* @category Model Properties
|
|
2832
|
+
*/
|
|
2833
|
+
id;
|
|
2834
|
+
troubleContainer;
|
|
2835
|
+
/**
|
|
2836
|
+
* Observable state object mapping trouble state keys to values.
|
|
2837
|
+
*
|
|
2838
|
+
* This reactive state object is automatically updated when troubles are
|
|
2839
|
+
* added or removed from the system. Keys and values are determined by
|
|
2840
|
+
* the trouble action definitions provided during model initialization.
|
|
2841
|
+
*
|
|
2842
|
+
* State keys that no longer have associated active troubles are set to
|
|
2843
|
+
* undefined.
|
|
2844
|
+
*
|
|
2845
|
+
* @example
|
|
2846
|
+
* ```typescript
|
|
2847
|
+
* // Access state values
|
|
2848
|
+
* const isAgitationRequired = troubleActionModel.state.agitationRequired;
|
|
2849
|
+
*
|
|
2850
|
+
* // State is reactive - updates automatically propagate to React components
|
|
2851
|
+
* ```
|
|
2852
|
+
*
|
|
2853
|
+
* @category Model State
|
|
2854
|
+
*/
|
|
2855
|
+
state;
|
|
2856
|
+
/**
|
|
2857
|
+
* Internal mapping of trouble types to their action definitions.
|
|
2858
|
+
*
|
|
2859
|
+
* Built from the definitions array provided in TroubleActionOptions during
|
|
2860
|
+
* construction. Used for efficient lookup when processing trouble changes.
|
|
2861
|
+
*
|
|
2862
|
+
* @category Internal State
|
|
2863
|
+
*/
|
|
2864
|
+
troubleActionData;
|
|
2260
2865
|
/**
|
|
2261
2866
|
* Creates a new TroubleActionModel instance.
|
|
2262
2867
|
*
|
|
@@ -2270,48 +2875,13 @@ let k = class {
|
|
|
2270
2875
|
*
|
|
2271
2876
|
* @category Lifecycle
|
|
2272
2877
|
*/
|
|
2273
|
-
constructor(
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
* @category Model Properties
|
|
2281
|
-
*/
|
|
2282
|
-
i(this, "id");
|
|
2283
|
-
i(this, "troubleContainer");
|
|
2284
|
-
/**
|
|
2285
|
-
* Observable state object mapping trouble state keys to values.
|
|
2286
|
-
*
|
|
2287
|
-
* This reactive state object is automatically updated when troubles are
|
|
2288
|
-
* added or removed from the system. Keys and values are determined by
|
|
2289
|
-
* the trouble action definitions provided during model initialization.
|
|
2290
|
-
*
|
|
2291
|
-
* State keys that no longer have associated active troubles are set to
|
|
2292
|
-
* undefined.
|
|
2293
|
-
*
|
|
2294
|
-
* @example
|
|
2295
|
-
* ```typescript
|
|
2296
|
-
* // Access state values
|
|
2297
|
-
* const isAgitationRequired = troubleActionModel.state.agitationRequired;
|
|
2298
|
-
*
|
|
2299
|
-
* // State is reactive - updates automatically propagate to React components
|
|
2300
|
-
* ```
|
|
2301
|
-
*
|
|
2302
|
-
* @category Model State
|
|
2303
|
-
*/
|
|
2304
|
-
i(this, "state");
|
|
2305
|
-
/**
|
|
2306
|
-
* Internal mapping of trouble types to their action definitions.
|
|
2307
|
-
*
|
|
2308
|
-
* Built from the definitions array provided in TroubleActionOptions during
|
|
2309
|
-
* construction. Used for efficient lookup when processing trouble changes.
|
|
2310
|
-
*
|
|
2311
|
-
* @category Internal State
|
|
2312
|
-
*/
|
|
2313
|
-
i(this, "troubleActionData");
|
|
2314
|
-
this.id = e, this.state = Eo(), this.troubleActionData = t.definitions.reduce((o, s) => (o[s.troubleType] = s, o), {});
|
|
2878
|
+
constructor(modelId, options) {
|
|
2879
|
+
this.id = modelId;
|
|
2880
|
+
this.state = ObservableData();
|
|
2881
|
+
this.troubleActionData = options.definitions.reduce((acc, curr) => {
|
|
2882
|
+
acc[curr.troubleType] = curr;
|
|
2883
|
+
return acc;
|
|
2884
|
+
}, {});
|
|
2315
2885
|
}
|
|
2316
2886
|
// -------------------LIFECYCLE----------------------------
|
|
2317
2887
|
/**
|
|
@@ -2336,14 +2906,20 @@ let k = class {
|
|
|
2336
2906
|
* @see {@link TroubleContainerModel} for trouble data structure
|
|
2337
2907
|
*/
|
|
2338
2908
|
get activeTrouble() {
|
|
2339
|
-
const
|
|
2340
|
-
if (
|
|
2341
|
-
const
|
|
2909
|
+
const actions = Object.keys(this.troubleActionData);
|
|
2910
|
+
if (actions.length > 0) {
|
|
2911
|
+
const firstAction = actions[0];
|
|
2912
|
+
const troubles = this.troubleContainer.troubles.getIndexByKey(
|
|
2342
2913
|
"byType",
|
|
2343
|
-
|
|
2914
|
+
firstAction
|
|
2344
2915
|
);
|
|
2345
|
-
|
|
2916
|
+
if (troubles.length > 0) {
|
|
2917
|
+
return troubles[0];
|
|
2918
|
+
} else {
|
|
2919
|
+
return void 0;
|
|
2920
|
+
}
|
|
2346
2921
|
}
|
|
2922
|
+
return void 0;
|
|
2347
2923
|
}
|
|
2348
2924
|
/**
|
|
2349
2925
|
* Gets the type of the first active trouble with an associated action definition.
|
|
@@ -2364,59 +2940,75 @@ let k = class {
|
|
|
2364
2940
|
* @category Trouble Access
|
|
2365
2941
|
*/
|
|
2366
2942
|
get activeTroubleType() {
|
|
2367
|
-
|
|
2368
|
-
return (e = this.activeTrouble) == null ? void 0 : e.type;
|
|
2943
|
+
return this.activeTrouble?.type;
|
|
2369
2944
|
}
|
|
2370
2945
|
handleTroubleActions() {
|
|
2371
|
-
const
|
|
2372
|
-
const
|
|
2373
|
-
if (this.troubleActionData[
|
|
2374
|
-
const
|
|
2375
|
-
|
|
2946
|
+
const _state = this.troubleContainer.troubles.data.reduce((acc, curr) => {
|
|
2947
|
+
const _troubleType = curr.type;
|
|
2948
|
+
if (this.troubleActionData[_troubleType]) {
|
|
2949
|
+
const _stateKey = this.troubleActionData[_troubleType].stateKey ?? _troubleType;
|
|
2950
|
+
const _stateValue = this.troubleActionData[_troubleType].stateValue ?? _troubleType;
|
|
2951
|
+
acc[_stateKey] = _stateValue;
|
|
2376
2952
|
}
|
|
2377
|
-
return
|
|
2953
|
+
return acc;
|
|
2378
2954
|
}, {});
|
|
2379
|
-
this.state.setValues(
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
this.
|
|
2955
|
+
this.state.setValues(_state);
|
|
2956
|
+
Object.keys(this.troubleActionData).forEach((key) => {
|
|
2957
|
+
if (this.troubleContainer.troubles.getIndexByKey("byType", key).length === 0) {
|
|
2958
|
+
const _stateKey = this.troubleActionData[key].stateKey ?? key;
|
|
2959
|
+
this.state[_stateKey] = void 0;
|
|
2383
2960
|
}
|
|
2384
2961
|
});
|
|
2385
2962
|
}
|
|
2386
2963
|
};
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
],
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
dependencies: (
|
|
2964
|
+
__publicField(TroubleActionModelImpl, "Registration");
|
|
2965
|
+
__decorateClass$1([
|
|
2966
|
+
kosDependency({ modelType: TroubleContainer.type })
|
|
2967
|
+
], TroubleActionModelImpl.prototype, "troubleContainer", 2);
|
|
2968
|
+
__decorateClass$1([
|
|
2969
|
+
kosModelEffect({
|
|
2970
|
+
dependencies: (model) => [model.troubleContainer.troubles.data]
|
|
2394
2971
|
})
|
|
2395
|
-
],
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
],
|
|
2400
|
-
const
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
})
|
|
2972
|
+
], TroubleActionModelImpl.prototype, "handleTroubleActions", 1);
|
|
2973
|
+
TroubleActionModelImpl = __decorateClass$1([
|
|
2974
|
+
kosModel({ modelTypeId: MODEL_TYPE$1, singleton: true }),
|
|
2975
|
+
kosLoggerAware()
|
|
2976
|
+
], TroubleActionModelImpl);
|
|
2977
|
+
const TroubleAction = TroubleActionModelImpl.Registration;
|
|
2978
|
+
const { URL } = resolveServiceUrl("START_SERVICE");
|
|
2979
|
+
const { getOne } = ServiceFactory.build({
|
|
2980
|
+
basePath: `${URL}/api/start`
|
|
2981
|
+
});
|
|
2982
|
+
const log = KosLog.createLogger({ name: "start-service", group: "Services" });
|
|
2983
|
+
const navigateToNCui = async () => {
|
|
2984
|
+
log.debug("navigating to NCUI");
|
|
2985
|
+
const response = await getOne({
|
|
2986
|
+
urlOverride: `${URL}/api/app/kosdev.ddk/ncui/open`
|
|
2987
|
+
});
|
|
2988
|
+
return response;
|
|
2989
|
+
};
|
|
2990
|
+
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2405
2991
|
__proto__: null,
|
|
2406
|
-
navigateToNCui
|
|
2992
|
+
navigateToNCui
|
|
2407
2993
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2408
|
-
var
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2994
|
+
var __defProp = Object.defineProperty;
|
|
2995
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
2996
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
2997
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
2998
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
2999
|
+
if (decorator = decorators[i])
|
|
3000
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
3001
|
+
if (kind && result) __defProp(target, key, result);
|
|
3002
|
+
return result;
|
|
3003
|
+
};
|
|
3004
|
+
const MODEL_TYPE = "start-model";
|
|
3005
|
+
let StartModelImpl = class {
|
|
3006
|
+
id;
|
|
3007
|
+
logger;
|
|
3008
|
+
troubles;
|
|
3009
|
+
constructor(modelId, options, context) {
|
|
3010
|
+
this.id = modelId;
|
|
3011
|
+
this.logger = context.logger;
|
|
2420
3012
|
}
|
|
2421
3013
|
get firmwareFailed() {
|
|
2422
3014
|
return this.troubles.troubles.getIndexByKey(
|
|
@@ -2431,7 +3023,7 @@ let _e = class {
|
|
|
2431
3023
|
).length > 0;
|
|
2432
3024
|
}
|
|
2433
3025
|
async navigate() {
|
|
2434
|
-
await
|
|
3026
|
+
await navigateToNCui();
|
|
2435
3027
|
}
|
|
2436
3028
|
// -------------------LIFECYCLE----------------------------
|
|
2437
3029
|
async init() {
|
|
@@ -2441,69 +3033,70 @@ let _e = class {
|
|
|
2441
3033
|
this.logger.debug(`loading start ${this.id}`);
|
|
2442
3034
|
}
|
|
2443
3035
|
};
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
],
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
],
|
|
2450
|
-
const
|
|
2451
|
-
class:
|
|
2452
|
-
type:
|
|
3036
|
+
__decorateClass([
|
|
3037
|
+
kosDependency({ modelType: TroubleContainer.type })
|
|
3038
|
+
], StartModelImpl.prototype, "troubles", 2);
|
|
3039
|
+
StartModelImpl = __decorateClass([
|
|
3040
|
+
kosModel(MODEL_TYPE)
|
|
3041
|
+
], StartModelImpl);
|
|
3042
|
+
const Start = new SingletonKosModelRegistrationFactory({
|
|
3043
|
+
class: StartModelImpl,
|
|
3044
|
+
type: MODEL_TYPE
|
|
2453
3045
|
});
|
|
2454
3046
|
export {
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
3047
|
+
AgitationControl,
|
|
3048
|
+
Animation,
|
|
3049
|
+
index$b as AnimationServices,
|
|
3050
|
+
Application,
|
|
3051
|
+
Auth,
|
|
3052
|
+
index$d as AuthServices,
|
|
3053
|
+
CarbWater,
|
|
3054
|
+
CopyLogs,
|
|
3055
|
+
index$a as CopyLogsServices,
|
|
3056
|
+
DDKModels,
|
|
3057
|
+
DashboardOperations,
|
|
3058
|
+
index$9 as DashboardOperationsServices,
|
|
3059
|
+
Dispenser,
|
|
3060
|
+
DispenserInfo,
|
|
3061
|
+
index$7 as DispenserInfoServices,
|
|
3062
|
+
index$8 as DispenserServices,
|
|
3063
|
+
Door,
|
|
3064
|
+
EXTENSION_POINT_DASHBOARD_KEY_FACTORY,
|
|
3065
|
+
Enrollment,
|
|
3066
|
+
index$6 as EnrollmentServices,
|
|
3067
|
+
IngredientSummary,
|
|
3068
|
+
Lockout,
|
|
3069
|
+
index$5 as LockoutServices,
|
|
3070
|
+
MACRO_KEYS,
|
|
3071
|
+
MacroAssignment,
|
|
3072
|
+
NetworkTest,
|
|
3073
|
+
NetworkTestContainer,
|
|
3074
|
+
index$4 as NetworkTestServices,
|
|
3075
|
+
NutritiveSweetener,
|
|
3076
|
+
PlainWater,
|
|
3077
|
+
Reboot,
|
|
3078
|
+
index$3 as RebootServices,
|
|
3079
|
+
Settings,
|
|
3080
|
+
index$2 as SettingsServices,
|
|
3081
|
+
SetupStep,
|
|
3082
|
+
SetupStepContainer,
|
|
3083
|
+
index$c as SetupStepServices,
|
|
3084
|
+
Start,
|
|
3085
|
+
index as StartServices,
|
|
3086
|
+
TROUBLE_TYPE_PRIME$1 as TROUBLE_TYPE_PRIME,
|
|
3087
|
+
TROUBLE_TYPE_PURGE$1 as TROUBLE_TYPE_PURGE,
|
|
3088
|
+
TroubleAction as TroubleActionManager,
|
|
3089
|
+
Utilities,
|
|
3090
|
+
UtilitiesContainer,
|
|
3091
|
+
index$1 as UtilitiesServices,
|
|
3092
|
+
calculateTimeDifference,
|
|
3093
|
+
executeDashboardKeyFactory,
|
|
3094
|
+
isMacroGroup,
|
|
3095
|
+
isMicroGroup,
|
|
3096
|
+
macroHolderMap,
|
|
3097
|
+
registerDashboardKeyFactory,
|
|
3098
|
+
toSeconds,
|
|
3099
|
+
toTimeComponents,
|
|
3100
|
+
troubleVisibilityFilter
|
|
2509
3101
|
};
|
|
3102
|
+
//# sourceMappingURL=index.mjs.map
|