@kosdev-code/kos-freestyle-sdk 2.1.39 → 3.0.1
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/extension-utils-BFJb3AYW.cjs +344 -0
- package/extension-utils-BFJb3AYW.cjs.map +1 -0
- package/extension-utils-uGVieAa8.js +345 -0
- package/extension-utils-uGVieAa8.js.map +1 -0
- package/index.cjs +46 -1
- package/index.cjs.map +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +44 -48
- package/index.js.map +1 -1
- package/models/constants/index.d.ts.map +1 -1
- package/models/index.d.ts.map +1 -1
- package/models/models/agitation-required-trouble/agitation-required-trouble-model.d.ts +2 -3
- package/models/models/agitation-required-trouble/agitation-required-trouble-model.d.ts.map +1 -1
- package/models/models/agitation-required-trouble/index.d.ts.map +1 -1
- package/models/models/agitation-required-trouble/types/index.d.ts +1 -3
- package/models/models/carb-agitator/carb-agitator-model.d.ts +3 -4
- package/models/models/carb-agitator/carb-agitator-model.d.ts.map +1 -1
- package/models/models/carb-agitator/index.d.ts.map +1 -1
- package/models/models/carb-agitator/services/carb-tank-services.d.ts +0 -1
- package/models/models/carb-agitator/services/carb-tank-services.d.ts.map +1 -1
- package/models/models/cartridge-agitator/cartridge-agitator-container-model.d.ts +2 -3
- package/models/models/cartridge-agitator/cartridge-agitator-container-model.d.ts.map +1 -1
- package/models/models/cartridge-agitator/cartridge-agitator-container-registration.d.ts +2 -3
- package/models/models/cartridge-agitator/cartridge-agitator-container-registration.d.ts.map +1 -1
- package/models/models/cartridge-agitator/cartridge-agitator-model.d.ts +1 -2
- package/models/models/cartridge-agitator/cartridge-agitator-model.d.ts.map +1 -1
- package/models/models/cartridge-agitator/cartridge-agitator-registration.d.ts +2 -3
- package/models/models/cartridge-agitator/cartridge-agitator-registration.d.ts.map +1 -1
- package/models/models/cartridge-agitator/index.d.ts.map +1 -1
- package/models/models/cartridge-agitator/services/cartridge-agitator-services.d.ts +0 -1
- package/models/models/cartridge-agitator/services/cartridge-agitator-services.d.ts.map +1 -1
- package/models/models/cgp-pump/cgp-pump-model.d.ts +3 -4
- package/models/models/cgp-pump/cgp-pump-model.d.ts.map +1 -1
- package/models/models/cgp-pump/index.d.ts.map +1 -1
- package/models/models/cgp-pump/types/index.d.ts +1 -3
- package/models/models/fcm-pump/fcm-pump-model.d.ts +2 -3
- package/models/models/fcm-pump/fcm-pump-model.d.ts.map +1 -1
- package/models/models/fcm-pump/fcm-pump-registration.d.ts +2 -3
- package/models/models/fcm-pump/fcm-pump-registration.d.ts.map +1 -1
- package/models/models/fcm-pump/index.d.ts.map +1 -1
- package/models/models/fcm-pump/services/fcm-pump-services.d.ts +0 -1
- package/models/models/fcm-pump/services/fcm-pump-services.d.ts.map +1 -1
- package/models/models/fcm-pump/services/index.d.ts.map +1 -1
- package/models/models/fcm-pump/types/index.d.ts +1 -3
- package/models/models/freestyle-assembly/freestyle-assembly-model.d.ts +7 -8
- package/models/models/freestyle-assembly/freestyle-assembly-model.d.ts.map +1 -1
- package/models/models/freestyle-assembly/freestyle-assembly-registration.d.ts +2 -3
- package/models/models/freestyle-assembly/freestyle-assembly-registration.d.ts.map +1 -1
- package/models/models/freestyle-assembly/index.d.ts.map +1 -1
- package/models/models/freestyle-assembly/types/index.d.ts +1 -3
- package/models/models/freestyle-holder/freestyle-holder-model.d.ts +2 -3
- package/models/models/freestyle-holder/freestyle-holder-model.d.ts.map +1 -1
- package/models/models/freestyle-holder/freestyle-holder-registration.d.ts +2 -3
- package/models/models/freestyle-holder/freestyle-holder-registration.d.ts.map +1 -1
- package/models/models/freestyle-holder/index.d.ts.map +1 -1
- package/models/models/freestyle-holder/types/index.d.ts +1 -3
- package/models/models/freestyle-nozzle/freestyle-nozzle-model.d.ts +2 -3
- package/models/models/freestyle-nozzle/freestyle-nozzle-model.d.ts.map +1 -1
- package/models/models/freestyle-nozzle/freestyle-nozzle-registration.d.ts +2 -3
- package/models/models/freestyle-nozzle/freestyle-nozzle-registration.d.ts.map +1 -1
- package/models/models/freestyle-nozzle/index.d.ts.map +1 -1
- package/models/models/freestyle-nozzle/services/freestyle-nozzle-services.d.ts.map +1 -1
- package/models/models/freestyle-nozzle/services/index.d.ts.map +1 -1
- package/models/models/freestyle-nozzle/types/index.d.ts +1 -3
- package/models/models/freestyle-pump/freestyle-pump-model.d.ts +2 -3
- package/models/models/freestyle-pump/freestyle-pump-model.d.ts.map +1 -1
- package/models/models/freestyle-pump/freestyle-pump-registration.d.ts +2 -3
- package/models/models/freestyle-pump/freestyle-pump-registration.d.ts.map +1 -1
- package/models/models/freestyle-pump/index.d.ts.map +1 -1
- package/models/models/freestyle-pump/services/freestyle-pump-services.d.ts.map +1 -1
- package/models/models/freestyle-pump/services/index.d.ts.map +1 -1
- package/models/models/freestyle-pump/types/index.d.ts +1 -3
- package/models/models/ice-agitator/ice-agitator-model.d.ts +2 -3
- package/models/models/ice-agitator/ice-agitator-model.d.ts.map +1 -1
- package/models/models/ice-agitator/index.d.ts.map +1 -1
- package/models/models/ice-agitator/services/ice-agitator-services.d.ts +0 -1
- package/models/models/ice-agitator/services/ice-agitator-services.d.ts.map +1 -1
- package/models/models/ice-agitator/services/index.d.ts.map +1 -1
- package/models/models/index.d.ts.map +1 -1
- package/models/models/lfcv-pump/index.d.ts.map +1 -1
- package/models/models/lfcv-pump/lfcv-pump-model.d.ts +2 -3
- package/models/models/lfcv-pump/lfcv-pump-model.d.ts.map +1 -1
- package/models/models/lfcv-pump/types/index.d.ts +1 -3
- package/models/models/remote-tray/index.d.ts.map +1 -1
- package/models/models/remote-tray/remote-tray-container-model.d.ts +1 -2
- package/models/models/remote-tray/remote-tray-container-model.d.ts.map +1 -1
- package/models/models/remote-tray/remote-tray-container-registration.d.ts +2 -3
- package/models/models/remote-tray/remote-tray-container-registration.d.ts.map +1 -1
- package/models/models/remote-tray/remote-tray-model.d.ts +3 -4
- package/models/models/remote-tray/remote-tray-model.d.ts.map +1 -1
- package/models/models/remote-tray/remote-tray-registration.d.ts +2 -3
- package/models/models/remote-tray/remote-tray-registration.d.ts.map +1 -1
- package/models/models/spm-pump/index.d.ts.map +1 -1
- package/models/models/spm-pump/services/index.d.ts.map +1 -1
- package/models/models/spm-pump/services/spm-pump-services.d.ts +0 -1
- package/models/models/spm-pump/services/spm-pump-services.d.ts.map +1 -1
- package/models/models/spm-pump/spm-pump-model.d.ts +2 -3
- package/models/models/spm-pump/spm-pump-model.d.ts.map +1 -1
- package/models/models/spm-pump/spm-pump-registration.d.ts +2 -3
- package/models/models/spm-pump/spm-pump-registration.d.ts.map +1 -1
- package/models/models/spm-pump/types/index.d.ts +1 -3
- package/models/models/types/assembly.d.ts +3 -4
- package/models/models/types/assembly.d.ts.map +1 -1
- package/models/models/types/ingredients.d.ts +0 -1
- package/models/models/types/ingredients.d.ts.map +1 -1
- package/models/models/types/pumps.d.ts +0 -1
- package/models/models/types/pumps.d.ts.map +1 -1
- package/models/utils/extension-utils.d.ts +2 -3
- package/models/utils/extension-utils.d.ts.map +1 -1
- package/models/utils/extensions/assembly/assembly-data-mapper.d.ts +2 -3
- package/models/utils/extensions/assembly/assembly-data-mapper.d.ts.map +1 -1
- package/models/utils/extensions/assembly/types.d.ts +2 -3
- package/models/utils/extensions/assembly/types.d.ts.map +1 -1
- package/models/utils/extensions/availability/freestyle-loader.d.ts +1 -2
- package/models/utils/extensions/availability/freestyle-loader.d.ts.map +1 -1
- package/models/utils/extensions/availability/freestyle-mapper.d.ts +2 -3
- package/models/utils/extensions/availability/freestyle-mapper.d.ts.map +1 -1
- package/models/utils/extensions/availability/middleware/assets.d.ts +1 -2
- package/models/utils/extensions/availability/middleware/assets.d.ts.map +1 -1
- package/models/utils/extensions/availability/middleware/beverage-screen.d.ts +1 -2
- package/models/utils/extensions/availability/middleware/beverage-screen.d.ts.map +1 -1
- package/models/utils/extensions/availability/middleware/beverages.d.ts +1 -2
- package/models/utils/extensions/availability/middleware/beverages.d.ts.map +1 -1
- package/models/utils/extensions/availability/middleware/brand-screen.d.ts +1 -2
- package/models/utils/extensions/availability/middleware/brand-screen.d.ts.map +1 -1
- package/models/utils/extensions/availability/middleware/brands.d.ts +1 -2
- package/models/utils/extensions/availability/middleware/brands.d.ts.map +1 -1
- package/models/utils/extensions/availability/middleware/copy-input.d.ts +0 -1
- package/models/utils/extensions/availability/middleware/copy-input.d.ts.map +1 -1
- package/models/utils/extensions/availability/middleware/flavors.d.ts +1 -2
- package/models/utils/extensions/availability/middleware/flavors.d.ts.map +1 -1
- package/models/utils/extensions/availability/middleware/nutrition.d.ts +1 -2
- package/models/utils/extensions/availability/middleware/nutrition.d.ts.map +1 -1
- package/models/utils/extensions/availability/middleware/related-brands.d.ts +1 -2
- package/models/utils/extensions/availability/middleware/related-brands.d.ts.map +1 -1
- package/models/utils/extensions/availability/types.d.ts.map +1 -1
- package/models/utils/extensions/availability/util/locate-brand.d.ts.map +1 -1
- package/models/utils/extensions/availability/util/process-related-brand.d.ts +0 -1
- package/models/utils/extensions/availability/util/process-related-brand.d.ts.map +1 -1
- package/models/utils/extensions/ingredient/index.d.ts.map +1 -1
- package/models/utils/extensions/ingredient/model-extension.d.ts +1 -2
- package/models/utils/extensions/ingredient/model-extension.d.ts.map +1 -1
- package/models/utils/extensions/pourable/select-pourable-mapper.d.ts +0 -1
- package/models/utils/extensions/pourable/select-pourable-mapper.d.ts.map +1 -1
- package/models/utils/extensions/trouble/trouble-utils.d.ts +0 -1
- package/models/utils/extensions/trouble/trouble-utils.d.ts.map +1 -1
- package/models/utils/freestyle-registration-manager.d.ts +9 -10
- package/models/utils/freestyle-registration-manager.d.ts.map +1 -1
- package/models/utils/index.d.ts.map +1 -1
- package/models/utils/openapi-index.d.ts.map +1 -1
- package/models/utils/services/freestyle/1.6.5/service.d.ts +34 -35
- package/models/utils/services/freestyle/1.6.5/service.d.ts.map +1 -1
- package/models/utils/services/freestyle/1.8.1/service.d.ts +34 -35
- package/models/utils/services/freestyle/1.8.1/service.d.ts.map +1 -1
- package/models/utils/services/freestyle/daily/service.d.ts +34 -35
- package/models/utils/services/freestyle/daily/service.d.ts.map +1 -1
- package/models/utils/services/handle/1.8.1/service.d.ts +34 -35
- package/models/utils/services/handle/1.8.1/service.d.ts.map +1 -1
- package/models/utils/services/handle/daily/service.d.ts +34 -35
- package/models/utils/services/handle/daily/service.d.ts.map +1 -1
- package/models/utils/services-index.d.ts.map +1 -1
- package/models.cjs +38 -1
- package/models.cjs.map +1 -1
- package/models.d.ts +1 -0
- package/models.js +35 -37
- package/models.js.map +1 -1
- package/package.json +9 -10
- package/service-BRuYqmJg.js +2277 -0
- package/service-BRuYqmJg.js.map +1 -0
- package/service-E5IuBoLR.cjs +2276 -0
- package/service-E5IuBoLR.cjs.map +1 -0
- package/ui/contexts/index.d.ts.map +1 -1
- package/ui/hooks/freestyle-assembly/index.d.ts.map +1 -1
- package/ui/hooks/freestyle-assembly/use-freestyle-assembly.d.ts +0 -1
- package/ui/hooks/freestyle-assembly/use-freestyle-assembly.d.ts.map +1 -1
- package/ui/hooks/freestyle-nozzle/index.d.ts.map +1 -1
- package/ui/hooks/freestyle-nozzle/use-freestyle-nozzle.d.ts +0 -1
- package/ui/hooks/freestyle-nozzle/use-freestyle-nozzle.d.ts.map +1 -1
- package/ui/hooks/ice-agitator/index.d.ts.map +1 -1
- package/ui/hooks/ice-agitator/use-ice-agitator.d.ts +1 -2
- package/ui/hooks/ice-agitator/use-ice-agitator.d.ts.map +1 -1
- package/ui/hooks/ice-agitator/with-ice-agitator.d.ts +0 -1
- package/ui/hooks/ice-agitator/with-ice-agitator.d.ts.map +1 -1
- package/ui/hooks/index.d.ts.map +1 -1
- package/ui/hooks/nutrition/index.d.ts.map +1 -1
- package/ui/hooks/nutrition/use-nutrition-info.d.ts +0 -1
- package/ui/hooks/nutrition/use-nutrition-info.d.ts.map +1 -1
- package/ui/index.d.ts.map +1 -1
- package/ui.cjs +8 -1
- package/ui.cjs.map +1 -1
- package/ui.d.ts +1 -0
- package/ui.js +6 -11
- package/ui.js.map +1 -1
- package/use-nutrition-info-B1EB2iYY.js +68 -0
- package/use-nutrition-info-B1EB2iYY.js.map +1 -0
- package/use-nutrition-info-BDv3r-Gf.cjs +67 -0
- package/use-nutrition-info-BDv3r-Gf.cjs.map +1 -0
- package/extension-utils-CFD54lr3.js +0 -237
- package/extension-utils-CFD54lr3.js.map +0 -1
- package/extension-utils-D3-Gwy8G.cjs +0 -2
- package/extension-utils-D3-Gwy8G.cjs.map +0 -1
- package/kos-models.json +0 -180
- package/service-8u3gW6pr.cjs +0 -2
- package/service-8u3gW6pr.cjs.map +0 -1
- package/service-DildzPxj.js +0 -1910
- package/service-DildzPxj.js.map +0 -1
- package/use-nutrition-info-DMKLi-5k.cjs +0 -2
- package/use-nutrition-info-DMKLi-5k.cjs.map +0 -1
- package/use-nutrition-info-DP_JHkR0.js +0 -52
- package/use-nutrition-info-DP_JHkR0.js.map +0 -1
package/service-DildzPxj.js
DELETED
|
@@ -1,1910 +0,0 @@
|
|
|
1
|
-
var Pt = Object.defineProperty;
|
|
2
|
-
var vt = (e, t, r) => t in e ? Pt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
-
var s = (e, t, r) => (vt(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
-
import { resolveServiceUrl as M, ServiceFactory as R, KosLog as C, createPropKey as G, kosStateProp as O, kosConfigProperty as b, kosStateEntry as Pe, kosStateExit as _t, kosStateGuard as ve, kosFuture as I, kosModel as f, kosLoggerAware as D, kosCompanion as oe, kosFutureAware as xe, kosStateMachine as Tt, DependencyLifecycle as qe, KosModelContainer as It, kosChild as Ge, kosModelEffect as _e, EventBus as k, KosModelRegistrationFactory as F, SingletonKosModelRegistrationFactory as Te, FetchError as Ie, FutureManager as y, FutureEndState as U, FutureHandler as Ue, kosParentAware as je, KosFeatureFlags as de, getKosCompanionModel as $t, getKosModelSync as A, kosContainerAware as Ct, KosContextManager as Ot, kosAction as Z, KOS_MODEL_ID as $, kosMultipleFutureAware as Et, kosTopicHandler as St, modelTypeEventTopicFactory as At, RegistrationManager as m, registerCoreModels as wt, Trouble as Mt, ExtensionManager as pe, EXTENSION_TROUBLE_DATA_MAPPER as ge, createClient as H, kosServiceRequest as B } from "@kosdev-code/kos-ui-sdk";
|
|
5
|
-
import { PourState as d, Assembly as Ve, KosModelRegistry as Rt, registerDispenseModels as Dt, Nozzle as Ft, Pump as Nt, Holder as zt, PumpContainer as Lt, PumpIndex as xt } from "@kosdev-code/kos-dispense-sdk";
|
|
6
|
-
const { URL: He } = M("ICE_AGITATOR_SERVICE"), { postModel: qt } = R.build({
|
|
7
|
-
basePath: `${He}/api/ext/freestyle/ice`
|
|
8
|
-
});
|
|
9
|
-
C.createLogger({
|
|
10
|
-
name: "carb-tank-service",
|
|
11
|
-
group: "Services"
|
|
12
|
-
});
|
|
13
|
-
const Gt = async (e, t) => {
|
|
14
|
-
const r = await qt({
|
|
15
|
-
model: {},
|
|
16
|
-
tracker: t,
|
|
17
|
-
urlOverride: `${He}/api/handle/${e}/test`
|
|
18
|
-
});
|
|
19
|
-
if (!(r != null && r.data))
|
|
20
|
-
throw new Error("No response from server");
|
|
21
|
-
return r == null ? void 0 : r.data;
|
|
22
|
-
};
|
|
23
|
-
var Be = Object.defineProperty, Ut = Object.getOwnPropertyDescriptor, jt = (e, t, r) => t in e ? Be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, P = (e, t, r, o) => {
|
|
24
|
-
for (var a = o > 1 ? void 0 : o ? Ut(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
25
|
-
(i = e[n]) && (a = (o ? i(t, r, a) : i(a)) || a);
|
|
26
|
-
return o && a && Be(t, r, a), a;
|
|
27
|
-
}, Vt = (e, t, r) => (jt(e, t + "", r), r);
|
|
28
|
-
const Ht = "carb-agitator-model", $e = G("statePath");
|
|
29
|
-
let g = class {
|
|
30
|
-
/**
|
|
31
|
-
* Creates a new carb agitator model instance.
|
|
32
|
-
*
|
|
33
|
-
* @param modelId - Unique identifier for this instance
|
|
34
|
-
* @param options - Configuration options including name
|
|
35
|
-
* @param context - KOS creation context providing assembly paths
|
|
36
|
-
*/
|
|
37
|
-
constructor(e, t, r) {
|
|
38
|
-
/**
|
|
39
|
-
* Unique identifier for this carb agitator instance.
|
|
40
|
-
*/
|
|
41
|
-
s(this, "id");
|
|
42
|
-
/**
|
|
43
|
-
* Display name for this carb agitator.
|
|
44
|
-
*/
|
|
45
|
-
s(this, "name");
|
|
46
|
-
/**
|
|
47
|
-
* Device path for carb tank operations.
|
|
48
|
-
*/
|
|
49
|
-
s(this, "path");
|
|
50
|
-
/**
|
|
51
|
-
* State path for accessing probe and filling status.
|
|
52
|
-
*/
|
|
53
|
-
s(this, "statePath");
|
|
54
|
-
s(this, "highProbeWet");
|
|
55
|
-
s(this, "lowProbeWet");
|
|
56
|
-
s(this, "filling");
|
|
57
|
-
s(this, "enabled");
|
|
58
|
-
var a;
|
|
59
|
-
this.id = e, this.name = t.name, this.path = ((a = r.kosContext.get("assembly-feature-carbTank")) == null ? void 0 : a.path) || "";
|
|
60
|
-
const o = r.kosContext.get("assembly-state-path-carbTank");
|
|
61
|
-
this.statePath = o;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Gets the carb holder associated with this agitator.
|
|
65
|
-
*
|
|
66
|
-
* Retrieves the first holder from the "carb" group in the parent assembly.
|
|
67
|
-
*
|
|
68
|
-
* @returns The carb holder model, or undefined if not found
|
|
69
|
-
*/
|
|
70
|
-
get holder() {
|
|
71
|
-
var t;
|
|
72
|
-
return (t = this.getCompanionParent()) == null ? void 0 : t.getHoldersByGroup("carb")[0];
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Gets the pump associated with the carb holder.
|
|
76
|
-
*
|
|
77
|
-
* Returns the first pump from the holder's pump collection.
|
|
78
|
-
*
|
|
79
|
-
* @returns The pump model, or undefined if holder or pump not available
|
|
80
|
-
*/
|
|
81
|
-
get pump() {
|
|
82
|
-
var e;
|
|
83
|
-
return (e = this.holder) == null ? void 0 : e.pumps.data[0];
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Indicates whether the carb tank is currently being filled.
|
|
87
|
-
*
|
|
88
|
-
* @returns true if the filling state property indicates active filling
|
|
89
|
-
*/
|
|
90
|
-
get isFilling() {
|
|
91
|
-
return !!this.filling.value;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Indicates whether the carb tank has been initialized.
|
|
95
|
-
*
|
|
96
|
-
* @returns true if the carb tank enabled configuration is set to true
|
|
97
|
-
*/
|
|
98
|
-
get isCarbInitialized() {
|
|
99
|
-
return !!this.enabled.value;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Indicates whether carb tank activation is allowed.
|
|
103
|
-
*
|
|
104
|
-
* Activation is only allowed when the carb tank is not already enabled.
|
|
105
|
-
*
|
|
106
|
-
* @returns true if the carb tank can be activated
|
|
107
|
-
*/
|
|
108
|
-
get canActivate() {
|
|
109
|
-
return !this.enabled.value;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Indicates whether the workflow can proceed past carb initialization.
|
|
113
|
-
*
|
|
114
|
-
* The workflow can proceed when the state machine is in either INITIALIZED
|
|
115
|
-
* (carb tank activated) or SKIPPED (user chose to bypass carbonation).
|
|
116
|
-
*
|
|
117
|
-
* @returns true if ready to proceed with beverage operations
|
|
118
|
-
*/
|
|
119
|
-
get canProceed() {
|
|
120
|
-
return this.isInState(
|
|
121
|
-
"INITIALIZED"
|
|
122
|
-
/* INITIALIZED */
|
|
123
|
-
) || this.isInState(
|
|
124
|
-
"SKIPPED"
|
|
125
|
-
/* SKIPPED */
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
handleActivationStart() {
|
|
129
|
-
this.logger.info("Carb tank activation started");
|
|
130
|
-
}
|
|
131
|
-
handleActivationComplete() {
|
|
132
|
-
this.logger.info("Carb tank initialized");
|
|
133
|
-
}
|
|
134
|
-
handleInitialized() {
|
|
135
|
-
this.logger.info("Carb tank ready to proceed");
|
|
136
|
-
}
|
|
137
|
-
handleSkipped() {
|
|
138
|
-
this.logger.info("Proceeding without carbinator");
|
|
139
|
-
}
|
|
140
|
-
async activateCarbTank() {
|
|
141
|
-
this.transition("ACTIVATE"), this.enabled.updateProperty(!0), this.transition("ACTIVATION_COMPLETE");
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Deactivates the carb tank and resets to uninitialized state.
|
|
145
|
-
*
|
|
146
|
-
* This method:
|
|
147
|
-
* 1. Updates the enabled configuration property to false
|
|
148
|
-
* 2. Transitions back to UNINITIALIZED state
|
|
149
|
-
*
|
|
150
|
-
* Can be called from any state.
|
|
151
|
-
*/
|
|
152
|
-
async deactivateCarbTank() {
|
|
153
|
-
this.enabled.updateProperty(!1), this.transition("RESET");
|
|
154
|
-
}
|
|
155
|
-
skip() {
|
|
156
|
-
this.transition("SKIP");
|
|
157
|
-
}
|
|
158
|
-
reset() {
|
|
159
|
-
this.enabled.updateProperty(!1), this.transition("RESET");
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Toggles the carb tank between enabled and disabled states.
|
|
163
|
-
*
|
|
164
|
-
* If currently enabled, calls {@link deactivateCarbTank}.
|
|
165
|
-
* If currently disabled, calls {@link activateCarbTank}.
|
|
166
|
-
*/
|
|
167
|
-
toggleCarbTank() {
|
|
168
|
-
this.enabled.value ? this.deactivateCarbTank() : this.activateCarbTank();
|
|
169
|
-
}
|
|
170
|
-
handleTestCarbTank(e) {
|
|
171
|
-
if (!e)
|
|
172
|
-
throw new Error("No tracker provided");
|
|
173
|
-
return this.logger.info(`testing carb tank: ${this.id}`), Gt(this.path, e);
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
Vt(g, "Registration");
|
|
177
|
-
P([
|
|
178
|
-
O({
|
|
179
|
-
path: $e,
|
|
180
|
-
attribute: "highProbeWet"
|
|
181
|
-
})
|
|
182
|
-
], g.prototype, "highProbeWet", 2);
|
|
183
|
-
P([
|
|
184
|
-
O({
|
|
185
|
-
path: $e,
|
|
186
|
-
attribute: "lowProbeWet"
|
|
187
|
-
})
|
|
188
|
-
], g.prototype, "lowProbeWet", 2);
|
|
189
|
-
P([
|
|
190
|
-
O({
|
|
191
|
-
path: $e,
|
|
192
|
-
attribute: "filling"
|
|
193
|
-
})
|
|
194
|
-
], g.prototype, "filling", 2);
|
|
195
|
-
P([
|
|
196
|
-
b({
|
|
197
|
-
path: "assembly:core:board:macksm:carbTank:carbTank",
|
|
198
|
-
attribute: "enabled"
|
|
199
|
-
})
|
|
200
|
-
], g.prototype, "enabled", 2);
|
|
201
|
-
P([
|
|
202
|
-
Pe(
|
|
203
|
-
"ACTIVATING"
|
|
204
|
-
/* ACTIVATING */
|
|
205
|
-
)
|
|
206
|
-
], g.prototype, "handleActivationStart", 1);
|
|
207
|
-
P([
|
|
208
|
-
_t(
|
|
209
|
-
"ACTIVATING"
|
|
210
|
-
/* ACTIVATING */
|
|
211
|
-
)
|
|
212
|
-
], g.prototype, "handleActivationComplete", 1);
|
|
213
|
-
P([
|
|
214
|
-
Pe(
|
|
215
|
-
"INITIALIZED"
|
|
216
|
-
/* INITIALIZED */
|
|
217
|
-
)
|
|
218
|
-
], g.prototype, "handleInitialized", 1);
|
|
219
|
-
P([
|
|
220
|
-
Pe(
|
|
221
|
-
"SKIPPED"
|
|
222
|
-
/* SKIPPED */
|
|
223
|
-
)
|
|
224
|
-
], g.prototype, "handleSkipped", 1);
|
|
225
|
-
P([
|
|
226
|
-
ve({ allowedStates: [
|
|
227
|
-
"UNINITIALIZED"
|
|
228
|
-
/* UNINITIALIZED */
|
|
229
|
-
] })
|
|
230
|
-
], g.prototype, "activateCarbTank", 1);
|
|
231
|
-
P([
|
|
232
|
-
ve({ allowedStates: [
|
|
233
|
-
"UNINITIALIZED"
|
|
234
|
-
/* UNINITIALIZED */
|
|
235
|
-
] })
|
|
236
|
-
], g.prototype, "skip", 1);
|
|
237
|
-
P([
|
|
238
|
-
ve({
|
|
239
|
-
allowedStates: [
|
|
240
|
-
"INITIALIZED",
|
|
241
|
-
"SKIPPED"
|
|
242
|
-
/* SKIPPED */
|
|
243
|
-
]
|
|
244
|
-
})
|
|
245
|
-
], g.prototype, "reset", 1);
|
|
246
|
-
P([
|
|
247
|
-
I()
|
|
248
|
-
], g.prototype, "handleTestCarbTank", 1);
|
|
249
|
-
g = P([
|
|
250
|
-
f({ modelTypeId: Ht, singleton: !1 }),
|
|
251
|
-
D(),
|
|
252
|
-
oe({ mode: "composition", lifecycle: qe.LOAD }),
|
|
253
|
-
xe(),
|
|
254
|
-
Tt(
|
|
255
|
-
{
|
|
256
|
-
initial: "UNINITIALIZED",
|
|
257
|
-
states: {
|
|
258
|
-
UNINITIALIZED: {
|
|
259
|
-
on: {
|
|
260
|
-
ACTIVATE: "ACTIVATING",
|
|
261
|
-
SKIP: "SKIPPED"
|
|
262
|
-
/* SKIPPED */
|
|
263
|
-
}
|
|
264
|
-
},
|
|
265
|
-
ACTIVATING: {
|
|
266
|
-
on: {
|
|
267
|
-
ACTIVATION_COMPLETE: "INITIALIZED"
|
|
268
|
-
/* INITIALIZED */
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
INITIALIZED: {
|
|
272
|
-
on: {
|
|
273
|
-
RESET: "UNINITIALIZED"
|
|
274
|
-
/* UNINITIALIZED */
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
SKIPPED: {
|
|
278
|
-
on: {
|
|
279
|
-
RESET: "UNINITIALIZED"
|
|
280
|
-
/* UNINITIALIZED */
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
throwOnInvalid: !1
|
|
287
|
-
// Graceful handling for button clicks
|
|
288
|
-
}
|
|
289
|
-
)
|
|
290
|
-
], g);
|
|
291
|
-
const Ke = g.Registration;
|
|
292
|
-
var Bt = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, Ye = (e, t, r, o) => {
|
|
293
|
-
for (var a = o > 1 ? void 0 : o ? Kt(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
294
|
-
(i = e[n]) && (a = (o ? i(t, r, a) : i(a)) || a);
|
|
295
|
-
return o && a && Bt(t, r, a), a;
|
|
296
|
-
};
|
|
297
|
-
const We = "cartridge-agitator-container-model";
|
|
298
|
-
let Q = class {
|
|
299
|
-
constructor(e, t, r) {
|
|
300
|
-
s(this, "id");
|
|
301
|
-
s(this, "logger");
|
|
302
|
-
s(this, "_models");
|
|
303
|
-
this.id = e, this.logger = r.logger, this._models = new It({
|
|
304
|
-
parentId: e
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
getModel(e) {
|
|
308
|
-
return this._models.getModel(e);
|
|
309
|
-
}
|
|
310
|
-
get models() {
|
|
311
|
-
return this._models;
|
|
312
|
-
}
|
|
313
|
-
get data() {
|
|
314
|
-
return this._models.data;
|
|
315
|
-
}
|
|
316
|
-
addModel(e) {
|
|
317
|
-
this._models.addModel(e);
|
|
318
|
-
}
|
|
319
|
-
removeModel(e) {
|
|
320
|
-
this._models.removeModel(e);
|
|
321
|
-
}
|
|
322
|
-
// -------------------LIFECYCLE----------------------------
|
|
323
|
-
async init() {
|
|
324
|
-
this.logger.debug(
|
|
325
|
-
`initializing cartridge-agitator-container container ${this.id}`
|
|
326
|
-
);
|
|
327
|
-
}
|
|
328
|
-
async load() {
|
|
329
|
-
this.logger.debug(
|
|
330
|
-
`loading cartridge-agitator-container container ${this.id}`
|
|
331
|
-
);
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
Ye([
|
|
335
|
-
Ge
|
|
336
|
-
], Q.prototype, "_models", 2);
|
|
337
|
-
Q = Ye([
|
|
338
|
-
f(We)
|
|
339
|
-
], Q);
|
|
340
|
-
const { URL: Ze } = M("CARTRIDGE_AGITATOR_SERVICE"), { postModel: Yt } = R.build({
|
|
341
|
-
basePath: `${Ze}/api/ext/freestyle/freestyle/ice`
|
|
342
|
-
}), Wt = async (e, t) => {
|
|
343
|
-
const r = await Yt({
|
|
344
|
-
model: {},
|
|
345
|
-
tracker: t,
|
|
346
|
-
urlOverride: `${Ze}/api/handle/${e}/test`
|
|
347
|
-
});
|
|
348
|
-
if (!(r != null && r.data))
|
|
349
|
-
throw new Error("No response from server");
|
|
350
|
-
return r.data;
|
|
351
|
-
};
|
|
352
|
-
var Zt = Object.defineProperty, kt = Object.getOwnPropertyDescriptor, ie = (e, t, r, o) => {
|
|
353
|
-
for (var a = o > 1 ? void 0 : o ? kt(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
354
|
-
(i = e[n]) && (a = (o ? i(t, r, a) : i(a)) || a);
|
|
355
|
-
return o && a && Zt(t, r, a), a;
|
|
356
|
-
};
|
|
357
|
-
const ke = "cartridge-agitator-model";
|
|
358
|
-
class X {
|
|
359
|
-
}
|
|
360
|
-
s(X, "TOPIC_AGITATION_STARTED", "/kos/events/ddk/agitation-started"), s(X, "TOPIC_AGITATION_ENDED", "/kos/events/ddk/agitation-ended");
|
|
361
|
-
const Qt = G("statePath");
|
|
362
|
-
let z = class {
|
|
363
|
-
constructor(e, t) {
|
|
364
|
-
s(this, "id");
|
|
365
|
-
s(this, "agitating");
|
|
366
|
-
s(this, "path");
|
|
367
|
-
s(this, "statePath");
|
|
368
|
-
s(this, "name");
|
|
369
|
-
this.id = e, this.path = t.path, this.name = t.name, this.statePath = t.statePath;
|
|
370
|
-
}
|
|
371
|
-
get isAgitating() {
|
|
372
|
-
return !!this.agitating.value;
|
|
373
|
-
}
|
|
374
|
-
async testAgitate(e) {
|
|
375
|
-
if (!e)
|
|
376
|
-
throw new Error("No tracker provided");
|
|
377
|
-
return this.logger.info(`agitating cartridge-agitator ${this.id}`), Wt(this.path, e);
|
|
378
|
-
}
|
|
379
|
-
handleAgitation() {
|
|
380
|
-
var e;
|
|
381
|
-
this.isAgitating ? (this.logger.info(`agitating cartridge-agitator ${this.id}`), k.publish(X.TOPIC_AGITATION_STARTED, {
|
|
382
|
-
path: this.path,
|
|
383
|
-
futureId: (e = this.future) == null ? void 0 : e.futureId
|
|
384
|
-
})) : k.publish(X.TOPIC_AGITATION_ENDED, {
|
|
385
|
-
path: this.path
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
ie([
|
|
390
|
-
O({ path: Qt, attribute: "agitating" })
|
|
391
|
-
], z.prototype, "agitating", 2);
|
|
392
|
-
ie([
|
|
393
|
-
I()
|
|
394
|
-
], z.prototype, "testAgitate", 1);
|
|
395
|
-
ie([
|
|
396
|
-
_e({
|
|
397
|
-
dependencies: (e) => [e.isAgitating]
|
|
398
|
-
})
|
|
399
|
-
], z.prototype, "handleAgitation", 1);
|
|
400
|
-
z = ie([
|
|
401
|
-
f(ke),
|
|
402
|
-
xe(),
|
|
403
|
-
D()
|
|
404
|
-
], z);
|
|
405
|
-
const Qe = new F({
|
|
406
|
-
class: z,
|
|
407
|
-
type: ke
|
|
408
|
-
}), Ce = new Te({
|
|
409
|
-
class: Q,
|
|
410
|
-
type: We
|
|
411
|
-
});
|
|
412
|
-
Ce.addRelatedModel(Qe);
|
|
413
|
-
var Xe = Object.defineProperty, Xt = Object.getOwnPropertyDescriptor, Jt = (e, t, r) => t in e ? Xe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, se = (e, t, r, o) => {
|
|
414
|
-
for (var a = o > 1 ? void 0 : o ? Xt(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
415
|
-
(i = e[n]) && (a = (o ? i(t, r, a) : i(a)) || a);
|
|
416
|
-
return o && a && Xe(t, r, a), a;
|
|
417
|
-
}, er = (e, t, r) => (Jt(e, t + "", r), r);
|
|
418
|
-
const tr = "cgp-pump-model", Oe = G("statePath");
|
|
419
|
-
let w = class {
|
|
420
|
-
constructor(e, t) {
|
|
421
|
-
s(this, "highProbeWet");
|
|
422
|
-
s(this, "lowProbeWet");
|
|
423
|
-
s(this, "filling");
|
|
424
|
-
s(this, "id");
|
|
425
|
-
s(this, "state");
|
|
426
|
-
var r;
|
|
427
|
-
this.id = e, this.state = ((r = t.data) == null ? void 0 : r.state) ?? { name: "unknown", path: "" };
|
|
428
|
-
}
|
|
429
|
-
get statePath() {
|
|
430
|
-
return this.state.path;
|
|
431
|
-
}
|
|
432
|
-
};
|
|
433
|
-
er(w, "Registration");
|
|
434
|
-
se([
|
|
435
|
-
O({
|
|
436
|
-
path: Oe,
|
|
437
|
-
attribute: "highProbeWet"
|
|
438
|
-
})
|
|
439
|
-
], w.prototype, "highProbeWet", 2);
|
|
440
|
-
se([
|
|
441
|
-
O({
|
|
442
|
-
path: Oe,
|
|
443
|
-
attribute: "lowProbeWet"
|
|
444
|
-
})
|
|
445
|
-
], w.prototype, "lowProbeWet", 2);
|
|
446
|
-
se([
|
|
447
|
-
O({
|
|
448
|
-
path: Oe,
|
|
449
|
-
attribute: "filling"
|
|
450
|
-
})
|
|
451
|
-
], w.prototype, "filling", 2);
|
|
452
|
-
w = se([
|
|
453
|
-
f({ modelTypeId: tr, singleton: !1 }),
|
|
454
|
-
oe({
|
|
455
|
-
mode: "composition"
|
|
456
|
-
}),
|
|
457
|
-
D()
|
|
458
|
-
], w);
|
|
459
|
-
const rr = w.Registration, { URL: j } = M("FCM-PUMP_SERVICE"), { postModel: K } = R.build({
|
|
460
|
-
basePath: `${j}/api/fcm-pump`
|
|
461
|
-
}), h = C.createLogger({
|
|
462
|
-
name: "fcm-pump-service",
|
|
463
|
-
group: "Services"
|
|
464
|
-
}), ar = async (e) => {
|
|
465
|
-
var t, r, o, a, n;
|
|
466
|
-
h.debug(
|
|
467
|
-
`performElectricalTest - sending POST request to /api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`
|
|
468
|
-
);
|
|
469
|
-
try {
|
|
470
|
-
const i = await K({
|
|
471
|
-
model: {},
|
|
472
|
-
urlOverride: `${j}/api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`
|
|
473
|
-
});
|
|
474
|
-
return h.debug("performElectricalTest - response:", i), ((i == null ? void 0 : i.status) === 200 || (i == null ? void 0 : i.status) === 499) && ((t = i.data) != null && t.error) ? [i.data.error || "unknownError", i.data] : [void 0, i == null ? void 0 : i.data];
|
|
475
|
-
} catch (i) {
|
|
476
|
-
if (h.error(
|
|
477
|
-
`performElectricalTest - sending POST request to /api/ext/freestyle/fcm/diagnostics/${e}/electricalTest`,
|
|
478
|
-
i
|
|
479
|
-
), i instanceof Ie) {
|
|
480
|
-
const u = ((o = (r = i.payload) == null ? void 0 : r.data) == null ? void 0 : o.error) || ((a = i.payload) == null ? void 0 : a.error) || "unknownError";
|
|
481
|
-
return [u, ((n = i.payload) == null ? void 0 : n.data) || { error: u }];
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
return ["unknownError", { error: "unknownError" }];
|
|
485
|
-
}, or = async (e, t) => {
|
|
486
|
-
h.debug(
|
|
487
|
-
`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/preCalibrate`
|
|
488
|
-
);
|
|
489
|
-
try {
|
|
490
|
-
const r = await K({
|
|
491
|
-
model: {},
|
|
492
|
-
urlOverride: `${j}/api/ext/freestyle/fcm/calibration/${e}/preCalibrate`,
|
|
493
|
-
tracker: t
|
|
494
|
-
});
|
|
495
|
-
return h.debug("performPreCalibrate - response:", r), r != null && r.data && y.initiateFuture(r.data), r == null ? void 0 : r.data;
|
|
496
|
-
} catch (r) {
|
|
497
|
-
h.error(
|
|
498
|
-
`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/preCalibrate`,
|
|
499
|
-
r
|
|
500
|
-
);
|
|
501
|
-
const o = {
|
|
502
|
-
id: t || "",
|
|
503
|
-
endState: U.Fail,
|
|
504
|
-
tracker: t,
|
|
505
|
-
reason: "Failed to resolve trouble"
|
|
506
|
-
};
|
|
507
|
-
return y.initiateFuture(o), o;
|
|
508
|
-
}
|
|
509
|
-
}, ir = async (e, t) => {
|
|
510
|
-
h.debug(
|
|
511
|
-
`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/calibrate`
|
|
512
|
-
);
|
|
513
|
-
try {
|
|
514
|
-
const r = await K({
|
|
515
|
-
model: {},
|
|
516
|
-
urlOverride: `${j}/api/ext/freestyle/fcm/calibration/${e}/calibrate`,
|
|
517
|
-
tracker: t
|
|
518
|
-
});
|
|
519
|
-
return h.debug("performPreCalibrate - response:", r), r != null && r.data && y.initiateFuture(r.data), r == null ? void 0 : r.data;
|
|
520
|
-
} catch (r) {
|
|
521
|
-
h.error(
|
|
522
|
-
`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/calibrate`,
|
|
523
|
-
r
|
|
524
|
-
);
|
|
525
|
-
const o = {
|
|
526
|
-
id: t || "",
|
|
527
|
-
endState: U.Fail,
|
|
528
|
-
tracker: t,
|
|
529
|
-
reason: "Failed to resolve trouble"
|
|
530
|
-
};
|
|
531
|
-
return y.initiateFuture(o), o;
|
|
532
|
-
}
|
|
533
|
-
}, sr = async (e, t, r) => {
|
|
534
|
-
h.debug(
|
|
535
|
-
`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/verify/${t}`
|
|
536
|
-
);
|
|
537
|
-
try {
|
|
538
|
-
const o = await K({
|
|
539
|
-
model: {},
|
|
540
|
-
urlOverride: `${j}/api/ext/freestyle/fcm/calibration/${e}/verify/${t}`,
|
|
541
|
-
tracker: r
|
|
542
|
-
});
|
|
543
|
-
return h.debug("performVerify - response:", o), o != null && o.data && y.initiateFuture(o.data), o == null ? void 0 : o.data;
|
|
544
|
-
} catch (o) {
|
|
545
|
-
h.error(
|
|
546
|
-
`performVerify - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/verify/${t}`,
|
|
547
|
-
o
|
|
548
|
-
);
|
|
549
|
-
const a = {
|
|
550
|
-
id: r || "",
|
|
551
|
-
endState: U.Fail,
|
|
552
|
-
tracker: r,
|
|
553
|
-
reason: "Failed to resolve trouble"
|
|
554
|
-
};
|
|
555
|
-
return y.initiateFuture(a), a;
|
|
556
|
-
}
|
|
557
|
-
}, nr = (e) => e ? e.data === "success" || !e.data ? "success" : e.data : "error", lr = async (e, t, r) => {
|
|
558
|
-
h.debug(
|
|
559
|
-
`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`
|
|
560
|
-
);
|
|
561
|
-
try {
|
|
562
|
-
const o = await K({
|
|
563
|
-
model: {},
|
|
564
|
-
urlOverride: `${j}/api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`
|
|
565
|
-
});
|
|
566
|
-
return h.debug("performPreCalibrate - response:", o), nr(o == null ? void 0 : o.data);
|
|
567
|
-
} catch (o) {
|
|
568
|
-
h.error(
|
|
569
|
-
`performPreCalibrate - sending POST request to /api/ext/freestyle/fcm/calibration/${e}/complete/${t}/${r}`,
|
|
570
|
-
o
|
|
571
|
-
);
|
|
572
|
-
return;
|
|
573
|
-
}
|
|
574
|
-
};
|
|
575
|
-
var ur = Object.defineProperty, cr = Object.getOwnPropertyDescriptor, ne = (e, t, r, o) => {
|
|
576
|
-
for (var a = o > 1 ? void 0 : o ? cr(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
577
|
-
(i = e[n]) && (a = (o ? i(t, r, a) : i(a)) || a);
|
|
578
|
-
return o && a && ur(t, r, a), a;
|
|
579
|
-
};
|
|
580
|
-
const Je = "fcm-pump-model", dr = C.createLogger({ name: "fcm-pump-model" });
|
|
581
|
-
let L = class {
|
|
582
|
-
constructor(e, t, r) {
|
|
583
|
-
s(this, "id");
|
|
584
|
-
s(this, "logger");
|
|
585
|
-
s(this, "pumpModel");
|
|
586
|
-
s(this, "futureHandler");
|
|
587
|
-
this.id = e, this.logger = r.logger, this.pumpModel = t.companionParent, this.futureHandler = new Ue(this);
|
|
588
|
-
}
|
|
589
|
-
get future() {
|
|
590
|
-
return this.futureHandler.future;
|
|
591
|
-
}
|
|
592
|
-
get name() {
|
|
593
|
-
return this.pumpModel.name;
|
|
594
|
-
}
|
|
595
|
-
get canPour() {
|
|
596
|
-
return this.pumpModel.canPour;
|
|
597
|
-
}
|
|
598
|
-
get isPouring() {
|
|
599
|
-
return this.pumpModel.isPouring;
|
|
600
|
-
}
|
|
601
|
-
async cancelPour() {
|
|
602
|
-
return this.pumpModel.cancelPour();
|
|
603
|
-
}
|
|
604
|
-
performIntent(e) {
|
|
605
|
-
return this.pumpModel.performIntent(e);
|
|
606
|
-
}
|
|
607
|
-
async performElectricalTest() {
|
|
608
|
-
const [e, t] = await ar(this.pumpModel.path);
|
|
609
|
-
return e && dr.error(`Failed to perform electrical test on pump ${this.id}`, e), t;
|
|
610
|
-
}
|
|
611
|
-
getChildren() {
|
|
612
|
-
return [...this.futureHandler.allFutures];
|
|
613
|
-
}
|
|
614
|
-
async performPreCalibrate(e) {
|
|
615
|
-
return or(this.pumpModel.path, e);
|
|
616
|
-
}
|
|
617
|
-
async performCalibrate(e) {
|
|
618
|
-
return ir(this.pumpModel.path, e);
|
|
619
|
-
}
|
|
620
|
-
async performVerify(e, t) {
|
|
621
|
-
return sr(this.pumpModel.path, e, t);
|
|
622
|
-
}
|
|
623
|
-
async performComplete(e, t) {
|
|
624
|
-
return lr(this.pumpModel.path, e, t);
|
|
625
|
-
}
|
|
626
|
-
// -------------------LIFECYCLE----------------------------
|
|
627
|
-
async init() {
|
|
628
|
-
this.logger.debug(`initializing fcm-pump ${this.id}`);
|
|
629
|
-
}
|
|
630
|
-
async load() {
|
|
631
|
-
this.logger.debug(`loading fcm-pump ${this.id}`);
|
|
632
|
-
}
|
|
633
|
-
};
|
|
634
|
-
ne([
|
|
635
|
-
I()
|
|
636
|
-
], L.prototype, "performPreCalibrate", 1);
|
|
637
|
-
ne([
|
|
638
|
-
I()
|
|
639
|
-
], L.prototype, "performCalibrate", 1);
|
|
640
|
-
ne([
|
|
641
|
-
I()
|
|
642
|
-
], L.prototype, "performVerify", 1);
|
|
643
|
-
L = ne([
|
|
644
|
-
f(Je)
|
|
645
|
-
], L);
|
|
646
|
-
const pr = new F({
|
|
647
|
-
class: L,
|
|
648
|
-
type: Je
|
|
649
|
-
});
|
|
650
|
-
var gr = Object.defineProperty, hr = Object.getOwnPropertyDescriptor, et = (e, t, r, o) => {
|
|
651
|
-
for (var a = o > 1 ? void 0 : o ? hr(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
652
|
-
(i = e[n]) && (a = (o ? i(t, r, a) : i(a)) || a);
|
|
653
|
-
return o && a && gr(t, r, a), a;
|
|
654
|
-
};
|
|
655
|
-
const tt = "freestyle-assembly-model", fr = "iceAgitator", mr = "carbTank", yr = "remoteTrays";
|
|
656
|
-
let J = class {
|
|
657
|
-
constructor(e, t, r) {
|
|
658
|
-
s(this, "id");
|
|
659
|
-
s(this, "_carbTankModel");
|
|
660
|
-
s(this, "logger");
|
|
661
|
-
s(this, "assembly");
|
|
662
|
-
s(this, "_remoteTrays");
|
|
663
|
-
this.id = e, this.logger = r.logger, this.assembly = t.companionParent;
|
|
664
|
-
}
|
|
665
|
-
get holderGroups() {
|
|
666
|
-
return this.assembly.holderGroups;
|
|
667
|
-
}
|
|
668
|
-
get nozzlePaths() {
|
|
669
|
-
return this.assembly.nozzlePaths;
|
|
670
|
-
}
|
|
671
|
-
get allHolders() {
|
|
672
|
-
return this.assembly.allHolders;
|
|
673
|
-
}
|
|
674
|
-
getHoldersByGroup(e) {
|
|
675
|
-
return this.assembly.getHoldersByGroup(e);
|
|
676
|
-
}
|
|
677
|
-
getHoldersByNozzle(e) {
|
|
678
|
-
return this.assembly.getHoldersByNozzle(e);
|
|
679
|
-
}
|
|
680
|
-
get pumpsByNozzle() {
|
|
681
|
-
return this.assembly.pumpsByNozzle;
|
|
682
|
-
}
|
|
683
|
-
get pumpPaths() {
|
|
684
|
-
return this.assembly.pumpPaths;
|
|
685
|
-
}
|
|
686
|
-
get boards() {
|
|
687
|
-
return this.assembly.boards;
|
|
688
|
-
}
|
|
689
|
-
updateModel(e) {
|
|
690
|
-
return this.assembly.updateModel(e);
|
|
691
|
-
}
|
|
692
|
-
get iceAgitator() {
|
|
693
|
-
return this.assembly.iceAgitator;
|
|
694
|
-
}
|
|
695
|
-
get carbTank() {
|
|
696
|
-
return this._carbTankModel;
|
|
697
|
-
}
|
|
698
|
-
get cartridgeAgitators() {
|
|
699
|
-
return this.assembly.cartridgeAgitators;
|
|
700
|
-
}
|
|
701
|
-
get defaultCartridgeAgitator() {
|
|
702
|
-
return this.assembly.cartridgeAgitators.data[0];
|
|
703
|
-
}
|
|
704
|
-
get cartridgeAgitatorModels() {
|
|
705
|
-
return this.assembly.cartridgeAgitators.data;
|
|
706
|
-
}
|
|
707
|
-
get hasCartridgeAgitators() {
|
|
708
|
-
return this.assembly.cartridgeAgitators.data.length > 0;
|
|
709
|
-
}
|
|
710
|
-
get remoteTrays() {
|
|
711
|
-
return this.assembly.remoteTrays;
|
|
712
|
-
}
|
|
713
|
-
get hasRemoteTrays() {
|
|
714
|
-
return this.assembly.remoteTrays ? this.assembly.remoteTrays.data.length > 0 : !1;
|
|
715
|
-
}
|
|
716
|
-
// -------------------LIFECYCLE----------------------------
|
|
717
|
-
get supportsRemoteTrays() {
|
|
718
|
-
return de.isFeatureEnabled(yr);
|
|
719
|
-
}
|
|
720
|
-
get supportsIce() {
|
|
721
|
-
return de.isFeatureEnabled(fr);
|
|
722
|
-
}
|
|
723
|
-
get supportsCarb() {
|
|
724
|
-
return de.isFeatureEnabled(mr);
|
|
725
|
-
}
|
|
726
|
-
async init() {
|
|
727
|
-
this.logger.debug(`initializing freestyle-assembly ${this.id}`);
|
|
728
|
-
}
|
|
729
|
-
async ready() {
|
|
730
|
-
const e = $t(
|
|
731
|
-
this.assembly,
|
|
732
|
-
Ke.type
|
|
733
|
-
);
|
|
734
|
-
this._carbTankModel = e;
|
|
735
|
-
}
|
|
736
|
-
};
|
|
737
|
-
et([
|
|
738
|
-
Ge
|
|
739
|
-
], J.prototype, "_remoteTrays", 2);
|
|
740
|
-
J = et([
|
|
741
|
-
je(),
|
|
742
|
-
f(tt)
|
|
743
|
-
], J);
|
|
744
|
-
const fe = new Te({
|
|
745
|
-
class: J,
|
|
746
|
-
type: tt
|
|
747
|
-
});
|
|
748
|
-
var br = Object.defineProperty, Pr = Object.getOwnPropertyDescriptor, rt = (e, t, r, o) => {
|
|
749
|
-
for (var a = o > 1 ? void 0 : o ? Pr(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
750
|
-
(i = e[n]) && (a = (o ? i(t, r, a) : i(a)) || a);
|
|
751
|
-
return o && a && br(t, r, a), a;
|
|
752
|
-
};
|
|
753
|
-
const at = "remote-tray-model";
|
|
754
|
-
G("holderPath");
|
|
755
|
-
const vr = G("configPath");
|
|
756
|
-
let ee = class {
|
|
757
|
-
constructor(e, t, r) {
|
|
758
|
-
/** Unique identifier for the remote tray instance */
|
|
759
|
-
s(this, "id");
|
|
760
|
-
s(this, "logger");
|
|
761
|
-
/** Path reference to the associated holder model */
|
|
762
|
-
s(this, "holderPath");
|
|
763
|
-
/** Configuration path for tray-specific settings */
|
|
764
|
-
s(this, "configPath");
|
|
765
|
-
/** Display name of the remote tray */
|
|
766
|
-
s(this, "name");
|
|
767
|
-
s(this, "remoteTrayEnabled");
|
|
768
|
-
this.id = e, this.logger = r.logger, this.holderPath = t.holderPath, this.configPath = t.configPath, this.name = t.name;
|
|
769
|
-
}
|
|
770
|
-
/**
|
|
771
|
-
* Gets the troubles from the associated holder model.
|
|
772
|
-
* Propagates trouble states from the holder to this remote tray.
|
|
773
|
-
*
|
|
774
|
-
* @returns Array of trouble models from the holder, or empty array if no holder
|
|
775
|
-
*/
|
|
776
|
-
get troubles() {
|
|
777
|
-
var e;
|
|
778
|
-
return ((e = this.holder) == null ? void 0 : e.troubles) ?? [];
|
|
779
|
-
}
|
|
780
|
-
/**
|
|
781
|
-
* Gets the highest priority trouble status.
|
|
782
|
-
* Currently returns empty string as troubles are managed by the holder.
|
|
783
|
-
*
|
|
784
|
-
* @returns Empty string (trouble status handled by holder)
|
|
785
|
-
*/
|
|
786
|
-
get troubleStatus() {
|
|
787
|
-
return "";
|
|
788
|
-
}
|
|
789
|
-
/**
|
|
790
|
-
* Gets troubles grouped by type from the associated holder.
|
|
791
|
-
*
|
|
792
|
-
* @returns Record of troubles grouped by type from the holder, or empty object if no holder
|
|
793
|
-
*/
|
|
794
|
-
get troublesByType() {
|
|
795
|
-
var e;
|
|
796
|
-
return ((e = this.holder) == null ? void 0 : e.troublesByType) ?? {};
|
|
797
|
-
}
|
|
798
|
-
/**
|
|
799
|
-
* Updates the model with new configuration options.
|
|
800
|
-
* Can be used to modify the holder path, config path, or name after initialization.
|
|
801
|
-
*
|
|
802
|
-
* @param _options - New configuration options for the remote tray
|
|
803
|
-
*/
|
|
804
|
-
updateModel(e) {
|
|
805
|
-
}
|
|
806
|
-
/**
|
|
807
|
-
* Gets the associated holder model for this remote tray.
|
|
808
|
-
* Uses synchronous model lookup to retrieve the holder by path.
|
|
809
|
-
*
|
|
810
|
-
* @returns The HolderModel instance referenced by holderPath, or undefined if not found
|
|
811
|
-
*/
|
|
812
|
-
get holder() {
|
|
813
|
-
return A(this.holderPath).model;
|
|
814
|
-
}
|
|
815
|
-
/**
|
|
816
|
-
* Determines if the remote tray is currently active.
|
|
817
|
-
* Active state is based on the remoteTrayEnabled configuration property.
|
|
818
|
-
*
|
|
819
|
-
* @returns true if the tray is enabled, false otherwise
|
|
820
|
-
*/
|
|
821
|
-
get active() {
|
|
822
|
-
return !!this.remoteTrayEnabled.value;
|
|
823
|
-
}
|
|
824
|
-
// -------------------LIFECYCLE----------------------------
|
|
825
|
-
/**
|
|
826
|
-
* Initializes the remote tray model.
|
|
827
|
-
* Called during the model lifecycle initialization phase.
|
|
828
|
-
* Sets up initial state and prepares the model for use.
|
|
829
|
-
*
|
|
830
|
-
* @returns Promise that resolves when initialization is complete
|
|
831
|
-
*/
|
|
832
|
-
async init() {
|
|
833
|
-
this.logger.debug(`initializing remote-tray ${this.id}`);
|
|
834
|
-
}
|
|
835
|
-
/**
|
|
836
|
-
* Loads the remote tray configuration and associated data.
|
|
837
|
-
* Called during the model lifecycle load phase.
|
|
838
|
-
* Typically loads configuration settings and establishes holder references.
|
|
839
|
-
*
|
|
840
|
-
* @returns Promise that resolves when loading is complete
|
|
841
|
-
*/
|
|
842
|
-
async load() {
|
|
843
|
-
this.logger.debug(`loading remote-tray ${this.id}`);
|
|
844
|
-
}
|
|
845
|
-
};
|
|
846
|
-
rt([
|
|
847
|
-
b({
|
|
848
|
-
path: vr,
|
|
849
|
-
attribute: "enabled"
|
|
850
|
-
})
|
|
851
|
-
], ee.prototype, "remoteTrayEnabled", 2);
|
|
852
|
-
ee = rt([
|
|
853
|
-
f(at)
|
|
854
|
-
], ee);
|
|
855
|
-
const V = new F({
|
|
856
|
-
class: ee,
|
|
857
|
-
type: at
|
|
858
|
-
});
|
|
859
|
-
var _r = Object.getOwnPropertyDescriptor, Tr = (e, t, r, o) => {
|
|
860
|
-
for (var a = o > 1 ? void 0 : o ? _r(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
861
|
-
(i = e[n]) && (a = i(a) || a);
|
|
862
|
-
return a;
|
|
863
|
-
};
|
|
864
|
-
const ot = "remote-tray-container-model";
|
|
865
|
-
let me = class {
|
|
866
|
-
constructor(e) {
|
|
867
|
-
s(this, "id");
|
|
868
|
-
this.id = e;
|
|
869
|
-
}
|
|
870
|
-
};
|
|
871
|
-
me = Tr([
|
|
872
|
-
f(ot),
|
|
873
|
-
D(),
|
|
874
|
-
Ct()
|
|
875
|
-
], me);
|
|
876
|
-
const Ee = new Te({
|
|
877
|
-
class: me,
|
|
878
|
-
type: ot
|
|
879
|
-
});
|
|
880
|
-
Ee.addRelatedModel(V);
|
|
881
|
-
var Ir = Object.getOwnPropertyDescriptor, $r = (e, t, r, o) => {
|
|
882
|
-
for (var a = o > 1 ? void 0 : o ? Ir(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
883
|
-
(i = e[n]) && (a = i(a) || a);
|
|
884
|
-
return a;
|
|
885
|
-
};
|
|
886
|
-
const it = "freestyle-holder-model";
|
|
887
|
-
function Cr(e) {
|
|
888
|
-
const t = Ot.getContext(e), r = t == null ? void 0 : t.get(
|
|
889
|
-
fe.type
|
|
890
|
-
);
|
|
891
|
-
if (!r) {
|
|
892
|
-
C.error("Freestyle assembly not found");
|
|
893
|
-
return;
|
|
894
|
-
}
|
|
895
|
-
return r;
|
|
896
|
-
}
|
|
897
|
-
async function Or(e, t) {
|
|
898
|
-
if (!e || !t)
|
|
899
|
-
return;
|
|
900
|
-
const r = await e[t]();
|
|
901
|
-
if (r != null && r.tracker)
|
|
902
|
-
return y.getFuture(r.tracker);
|
|
903
|
-
}
|
|
904
|
-
let ye = class {
|
|
905
|
-
constructor(e, t, r) {
|
|
906
|
-
s(this, "id");
|
|
907
|
-
s(this, "logger");
|
|
908
|
-
s(this, "holder");
|
|
909
|
-
s(this, "context");
|
|
910
|
-
s(this, "future");
|
|
911
|
-
this.id = e, this.logger = r.logger, this.context = r.kosContext, this.holder = t.companionParent;
|
|
912
|
-
}
|
|
913
|
-
get altName() {
|
|
914
|
-
return this.holder.attributes.ncui_altName;
|
|
915
|
-
}
|
|
916
|
-
get agitated() {
|
|
917
|
-
return this.holder.data.agitated;
|
|
918
|
-
}
|
|
919
|
-
async agitate() {
|
|
920
|
-
if (!this.holder.data.agitated)
|
|
921
|
-
return;
|
|
922
|
-
this.future = void 0;
|
|
923
|
-
const e = Cr(this.id);
|
|
924
|
-
if (!e)
|
|
925
|
-
return;
|
|
926
|
-
if (!e.defaultCartridgeAgitator) {
|
|
927
|
-
this.logger.error("Agitator not found");
|
|
928
|
-
return;
|
|
929
|
-
}
|
|
930
|
-
return this.future = await Or(
|
|
931
|
-
e.defaultCartridgeAgitator,
|
|
932
|
-
"testAgitate"
|
|
933
|
-
), this.future;
|
|
934
|
-
}
|
|
935
|
-
get isRemote() {
|
|
936
|
-
const e = `${V.type}-${this.holder.path}`, t = A(e);
|
|
937
|
-
return t != null && t.model ? !!t.model.remoteTrayEnabled.value : !1;
|
|
938
|
-
}
|
|
939
|
-
// -------------------LIFECYCLE----------------------------
|
|
940
|
-
async init() {
|
|
941
|
-
this.logger.debug(`initializing freestyle-holder ${this.id}`);
|
|
942
|
-
}
|
|
943
|
-
async load() {
|
|
944
|
-
this.logger.debug(`loading freestyle-holder ${this.id}`);
|
|
945
|
-
}
|
|
946
|
-
};
|
|
947
|
-
ye = $r([
|
|
948
|
-
f(it)
|
|
949
|
-
], ye);
|
|
950
|
-
const Ae = new F({
|
|
951
|
-
class: ye,
|
|
952
|
-
type: it
|
|
953
|
-
}), { URL: Er } = M("FREESTYLE-NOZZLE_SERVICE"), { getOne: Sr } = R.build({
|
|
954
|
-
basePath: `${Er}/api/freestyle-nozzle`
|
|
955
|
-
}), W = C.createLogger({
|
|
956
|
-
name: "freestyle-nozzle-service",
|
|
957
|
-
group: "Services"
|
|
958
|
-
});
|
|
959
|
-
class Ar extends Error {
|
|
960
|
-
constructor(t) {
|
|
961
|
-
super(t), this.name = "NutritionInfoError";
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
class we extends Error {
|
|
965
|
-
constructor(t) {
|
|
966
|
-
super(t), this.name = "InvalidRequestError";
|
|
967
|
-
}
|
|
968
|
-
}
|
|
969
|
-
const wr = async (e, t, r, o = "http://localhost:8081") => {
|
|
970
|
-
if (W.debug("sending GET for freestyle-nozzle"), !t)
|
|
971
|
-
throw W.error("Invalid freestyle-nozzle request: beverageId is required"), new we("No beverageId provided");
|
|
972
|
-
if (!r || r.length === 0)
|
|
973
|
-
throw W.error("Invalid freestyle-nozzle request: volumes are required"), new we("No volumes provided");
|
|
974
|
-
const a = await Sr({
|
|
975
|
-
urlOverride: `${o}${e}/pipeline/beverage/engine/nutrition/${t}?volumes=${r.join(
|
|
976
|
-
","
|
|
977
|
-
)}`
|
|
978
|
-
});
|
|
979
|
-
if (!(a != null && a.data))
|
|
980
|
-
throw W.error("Failed to retrieve freestyle-nozzle data"), new Error("Failed to retrieve freestyle-nozzle data");
|
|
981
|
-
if (a.data.error)
|
|
982
|
-
throw new Ar(a.data.error);
|
|
983
|
-
return a.data;
|
|
984
|
-
};
|
|
985
|
-
var Mr = Object.defineProperty, Rr = Object.getOwnPropertyDescriptor, st = (e, t, r, o) => {
|
|
986
|
-
for (var a = o > 1 ? void 0 : o ? Rr(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
987
|
-
(i = e[n]) && (a = (o ? i(t, r, a) : i(a)) || a);
|
|
988
|
-
return o && a && Mr(t, r, a), a;
|
|
989
|
-
};
|
|
990
|
-
const nt = "freestyle-nozzle-model";
|
|
991
|
-
let te = class {
|
|
992
|
-
constructor(e, t, r) {
|
|
993
|
-
s(this, "id");
|
|
994
|
-
s(this, "logger");
|
|
995
|
-
s(this, "nozzleModel");
|
|
996
|
-
s(this, "_cupSizes");
|
|
997
|
-
s(this, "_nutritionInfo");
|
|
998
|
-
this.id = e, this.logger = r.logger, this.nozzleModel = t.companionParent, this._cupSizes = [100];
|
|
999
|
-
}
|
|
1000
|
-
set cupSizes(e) {
|
|
1001
|
-
this._cupSizes = e;
|
|
1002
|
-
}
|
|
1003
|
-
get nutritionInfo() {
|
|
1004
|
-
return this._nutritionInfo;
|
|
1005
|
-
}
|
|
1006
|
-
get selectedPourable() {
|
|
1007
|
-
return this.nozzleModel.selectedPourable;
|
|
1008
|
-
}
|
|
1009
|
-
async handleBeverageSelection() {
|
|
1010
|
-
if (this.nozzleModel.selectedPourable.beverage && this._cupSizes.length) {
|
|
1011
|
-
this.logger.debug(
|
|
1012
|
-
`selected beverage: ${this.nozzleModel.selectedPourable.beverage.rawId}. Volume: ${this._cupSizes.join(", ")}`
|
|
1013
|
-
);
|
|
1014
|
-
const e = this.nozzleModel.selectedPourable.beverage.rawId, t = this.nozzleModel.urlPrefix;
|
|
1015
|
-
try {
|
|
1016
|
-
const r = await wr(
|
|
1017
|
-
t,
|
|
1018
|
-
e,
|
|
1019
|
-
this._cupSizes
|
|
1020
|
-
);
|
|
1021
|
-
Z(() => {
|
|
1022
|
-
this._nutritionInfo = r;
|
|
1023
|
-
});
|
|
1024
|
-
} catch (r) {
|
|
1025
|
-
this.logger.error(`Error fetching nutrition info: ${r}`);
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
// -------------------LIFECYCLE----------------------------
|
|
1030
|
-
async init() {
|
|
1031
|
-
this.logger.debug(`initializing freestyle-nozzle ${this.id}`);
|
|
1032
|
-
}
|
|
1033
|
-
unload() {
|
|
1034
|
-
this.logger.debug(`unloading freestyle-nozzle ${this.id}`);
|
|
1035
|
-
}
|
|
1036
|
-
async load() {
|
|
1037
|
-
this.logger.debug(`loading freestyle-nozzle ${this.id}`);
|
|
1038
|
-
}
|
|
1039
|
-
};
|
|
1040
|
-
st([
|
|
1041
|
-
_e({
|
|
1042
|
-
dependencies: (e) => [
|
|
1043
|
-
e.selectedPourable.beverage
|
|
1044
|
-
]
|
|
1045
|
-
})
|
|
1046
|
-
], te.prototype, "handleBeverageSelection", 1);
|
|
1047
|
-
te = st([
|
|
1048
|
-
je(),
|
|
1049
|
-
f(nt)
|
|
1050
|
-
], te);
|
|
1051
|
-
const Me = new F({
|
|
1052
|
-
class: te,
|
|
1053
|
-
type: nt
|
|
1054
|
-
}), { URL: lt } = M("PUMP_SERVICE"), { postModel: Dr } = R.build({
|
|
1055
|
-
basePath: `${lt}/api/ext/freestyle/microCalibration`
|
|
1056
|
-
}), he = C.createLogger({
|
|
1057
|
-
name: "freestyle-pump-service",
|
|
1058
|
-
group: "Services"
|
|
1059
|
-
}), Fr = async (e, t) => {
|
|
1060
|
-
var r, o, a, n, i;
|
|
1061
|
-
he.debug(
|
|
1062
|
-
`replacePump - sending POST request to /api/ext/freestyle/microCalibration/cal/${e}/code/${t}`
|
|
1063
|
-
);
|
|
1064
|
-
try {
|
|
1065
|
-
const u = await Dr({
|
|
1066
|
-
model: {},
|
|
1067
|
-
urlOverride: `${lt}/api/ext/freestyle/microCalibration/cal/${e}/code/${t}`
|
|
1068
|
-
});
|
|
1069
|
-
return he.debug("replacePump - response:", u), ((u == null ? void 0 : u.status) === 200 || (u == null ? void 0 : u.status) === 499) && ((r = u.data) != null && r.error) ? [u.data.error || "unknownError", u.data] : [void 0, u == null ? void 0 : u.data];
|
|
1070
|
-
} catch (u) {
|
|
1071
|
-
if (he.error(
|
|
1072
|
-
`replacePump - sending POST request to /api/cal/${e}/code/${t}`,
|
|
1073
|
-
u
|
|
1074
|
-
), u instanceof Ie) {
|
|
1075
|
-
const E = ((a = (o = u.payload) == null ? void 0 : o.data) == null ? void 0 : a.error) || ((n = u.payload) == null ? void 0 : n.error) || "unknownError";
|
|
1076
|
-
return [E, ((i = u.payload) == null ? void 0 : i.data) || { error: E }];
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
return ["unknownError", { error: "unknownError" }];
|
|
1080
|
-
};
|
|
1081
|
-
var Nr = Object.getOwnPropertyDescriptor, zr = (e, t, r, o) => {
|
|
1082
|
-
for (var a = o > 1 ? void 0 : o ? Nr(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
1083
|
-
(i = e[n]) && (a = i(a) || a);
|
|
1084
|
-
return a;
|
|
1085
|
-
};
|
|
1086
|
-
const ut = "freestyle-pump-model";
|
|
1087
|
-
let be = class {
|
|
1088
|
-
constructor(e, t, r) {
|
|
1089
|
-
s(this, "id");
|
|
1090
|
-
s(this, "logger");
|
|
1091
|
-
s(this, "pump");
|
|
1092
|
-
this.id = e, this.logger = r.logger, this.pump = t.companionParent;
|
|
1093
|
-
}
|
|
1094
|
-
// -------------------LIFECYCLE----------------------------
|
|
1095
|
-
async replacePump(e) {
|
|
1096
|
-
const [t, r] = await Fr(this.pump.path, e);
|
|
1097
|
-
return t && this.logger.error(`Failed to replace the pump, ${this.pump.id}`, t), [t, r];
|
|
1098
|
-
}
|
|
1099
|
-
};
|
|
1100
|
-
be = zr([
|
|
1101
|
-
f(ut)
|
|
1102
|
-
], be);
|
|
1103
|
-
const Re = new F({
|
|
1104
|
-
class: be,
|
|
1105
|
-
type: ut
|
|
1106
|
-
}), { URL: N } = M("ICE_AGITATOR_SERVICE"), { getAll: ct, postModel: le } = R.build({
|
|
1107
|
-
basePath: `${N}/api/ext/freestyle/ice`
|
|
1108
|
-
}), dt = C.createLogger({
|
|
1109
|
-
name: "ice-agitator-service",
|
|
1110
|
-
group: "Services"
|
|
1111
|
-
}), Lr = async (e) => (dt.debug("sending GET for ice types"), await ct({
|
|
1112
|
-
urlOverride: `${N}/api/handle/${e}/types`
|
|
1113
|
-
})), xr = async (e, t) => (dt.debug("sending POST for ice types"), await le({
|
|
1114
|
-
urlOverride: `${N}/api/handle/${e}/type/${t}`,
|
|
1115
|
-
model: {}
|
|
1116
|
-
})), qr = async (e) => await ct({
|
|
1117
|
-
urlOverride: `${N}/api/kos/config/details/${e}/4`
|
|
1118
|
-
}), Gr = async (e, t) => {
|
|
1119
|
-
const r = await le({
|
|
1120
|
-
model: {},
|
|
1121
|
-
tracker: t,
|
|
1122
|
-
urlOverride: `${N}/api/handle/${e}/pour`
|
|
1123
|
-
});
|
|
1124
|
-
if (!(r != null && r.data))
|
|
1125
|
-
throw new Error("No response from server");
|
|
1126
|
-
return r == null ? void 0 : r.data;
|
|
1127
|
-
}, Ur = async (e, t) => {
|
|
1128
|
-
const r = await le({
|
|
1129
|
-
model: {},
|
|
1130
|
-
tracker: t,
|
|
1131
|
-
urlOverride: `${N}/api/handle/${e}/test/agitation`
|
|
1132
|
-
});
|
|
1133
|
-
if (!(r != null && r.data))
|
|
1134
|
-
throw new Error("No response from server");
|
|
1135
|
-
return r == null ? void 0 : r.data;
|
|
1136
|
-
}, jr = async (e, t) => {
|
|
1137
|
-
const r = await le({
|
|
1138
|
-
model: {},
|
|
1139
|
-
tracker: t,
|
|
1140
|
-
urlOverride: `${N}/api/handle/${e}/test/gate`
|
|
1141
|
-
});
|
|
1142
|
-
if (!(r != null && r.data))
|
|
1143
|
-
throw new Error("No response from server");
|
|
1144
|
-
return r == null ? void 0 : r.data;
|
|
1145
|
-
};
|
|
1146
|
-
var pt = Object.defineProperty, Vr = Object.getOwnPropertyDescriptor, Hr = (e, t, r) => t in e ? pt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, p = (e, t, r, o) => {
|
|
1147
|
-
for (var a = o > 1 ? void 0 : o ? Vr(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
1148
|
-
(i = e[n]) && (a = (o ? i(t, r, a) : i(a)) || a);
|
|
1149
|
-
return o && a && pt(t, r, a), a;
|
|
1150
|
-
}, Br = (e, t, r) => (Hr(e, t + "", r), r);
|
|
1151
|
-
class re {
|
|
1152
|
-
}
|
|
1153
|
-
s(re, "TOPIC_AGITATION_STARTED", "/kos/events/ddk/ice-agitation-started"), s(re, "TOPIC_AGITATION_ENDED", "/kos/events/ddk/ice-agitation-ended");
|
|
1154
|
-
const Kr = "ice-agitator-model", gt = G("statePath");
|
|
1155
|
-
let c = class {
|
|
1156
|
-
constructor(e, t) {
|
|
1157
|
-
s(this, "id");
|
|
1158
|
-
s(this, "name");
|
|
1159
|
-
s(this, "path");
|
|
1160
|
-
s(this, "volWithoutIceMl");
|
|
1161
|
-
s(this, "durationSec");
|
|
1162
|
-
s(this, "enableIceChuteClear");
|
|
1163
|
-
s(this, "iceChuteClearDurationMs");
|
|
1164
|
-
s(this, "iceChuteClearIntervalSec");
|
|
1165
|
-
s(this, "iceChuteClearRetryIntervalSec");
|
|
1166
|
-
s(this, "maxDispenseSec");
|
|
1167
|
-
s(this, "type");
|
|
1168
|
-
s(this, "dilutionOffset");
|
|
1169
|
-
s(this, "inactivitySec");
|
|
1170
|
-
s(this, "agitating");
|
|
1171
|
-
s(this, "iceChuteOpen");
|
|
1172
|
-
s(this, "statePath");
|
|
1173
|
-
s(this, "_allIceTypes");
|
|
1174
|
-
s(this, "currentState", d.IDLE);
|
|
1175
|
-
s(this, "resetDefaultValues", async () => await qr(this.path));
|
|
1176
|
-
this.id = e, this.name = t.name, this.path = t.path, this.statePath = t.statePath, this._allIceTypes = [];
|
|
1177
|
-
}
|
|
1178
|
-
get iceTypes() {
|
|
1179
|
-
return this._allIceTypes;
|
|
1180
|
-
}
|
|
1181
|
-
get isAgitating() {
|
|
1182
|
-
return !!this.agitating.value;
|
|
1183
|
-
}
|
|
1184
|
-
get isIceChuteOpen() {
|
|
1185
|
-
return !!this.iceChuteOpen.value;
|
|
1186
|
-
}
|
|
1187
|
-
// future, pourFuture, agitateFuture, gateFuture getters are now provided by @kosMultipleFutureAware decorator
|
|
1188
|
-
/**
|
|
1189
|
-
* A derived value that indicates if the nozzle is currently pouring a beverage.
|
|
1190
|
-
* @readonly
|
|
1191
|
-
*/
|
|
1192
|
-
get isPouring() {
|
|
1193
|
-
var e;
|
|
1194
|
-
return !!(this.pourFuture && !((e = this.pourFuture) != null && e.endState)) || this.currentState === d.POUR_STARTING || this.currentState === d.POURING || this.currentState === d.POUR_CANCELING;
|
|
1195
|
-
}
|
|
1196
|
-
/**
|
|
1197
|
-
* A derived value that indicates if it is possible to dispense ice.
|
|
1198
|
-
*
|
|
1199
|
-
* The value is observable and will change as the current dispense state changes
|
|
1200
|
-
* @readonly
|
|
1201
|
-
* */
|
|
1202
|
-
get canPour() {
|
|
1203
|
-
return this.currentState === d.IDLE;
|
|
1204
|
-
}
|
|
1205
|
-
updateIfCurrent(e, t) {
|
|
1206
|
-
this.currentState === e && Z(() => {
|
|
1207
|
-
this.currentState = t;
|
|
1208
|
-
});
|
|
1209
|
-
}
|
|
1210
|
-
async pourIce(e) {
|
|
1211
|
-
try {
|
|
1212
|
-
if (this.currentState === d.IDLE) {
|
|
1213
|
-
if (this.updateIfCurrent(d.IDLE, d.POUR_STARTING), !e)
|
|
1214
|
-
throw new Error("No tracker provided");
|
|
1215
|
-
const t = await Gr(this.path, e);
|
|
1216
|
-
return this.updateIfCurrent(d.POUR_STARTING, d.POURING), t != null && t.endState && this.updateIfCurrent(d.POURING, d.IDLE), t;
|
|
1217
|
-
} else
|
|
1218
|
-
throw new Error(`Cannot pour in state ${this.currentState}`);
|
|
1219
|
-
} catch (t) {
|
|
1220
|
-
throw this.logger.error(t), this.currentState = d.IDLE, t;
|
|
1221
|
-
}
|
|
1222
|
-
}
|
|
1223
|
-
/**
|
|
1224
|
-
* An action that will cancel the ice dispense if it is currently in progress.
|
|
1225
|
-
* */
|
|
1226
|
-
async cancelIceDispense() {
|
|
1227
|
-
var e;
|
|
1228
|
-
this.currentState === d.POURING || this.currentState === d.POUR_STARTING ? (this.currentState = d.POUR_CANCELING, await ((e = this.pourFuture) == null ? void 0 : e.cancelFuture()), Z(() => {
|
|
1229
|
-
this.currentState = d.IDLE;
|
|
1230
|
-
})) : this.logger.warn(
|
|
1231
|
-
`Cannot cancel ice dispense in state ${this.currentState}`
|
|
1232
|
-
);
|
|
1233
|
-
}
|
|
1234
|
-
async testAgitate(e) {
|
|
1235
|
-
if (!e)
|
|
1236
|
-
throw new Error("No tracker provided");
|
|
1237
|
-
return this.logger.info(`agitating ice-agitator ${this.id}`), Ur(this.path, e);
|
|
1238
|
-
}
|
|
1239
|
-
async testGate(e) {
|
|
1240
|
-
if (!e)
|
|
1241
|
-
throw new Error("No tracker provided");
|
|
1242
|
-
return this.logger.info(`testing ice gate: ${this.id}`), jr(this.path, e);
|
|
1243
|
-
}
|
|
1244
|
-
handleAgitationChange() {
|
|
1245
|
-
var e;
|
|
1246
|
-
this.isAgitating ? (this.logger.info(`agitating ice-agitator ${this.id}`), k.publish(re.TOPIC_AGITATION_STARTED, {
|
|
1247
|
-
path: this.path,
|
|
1248
|
-
futureId: (e = this.futureHandler.future) == null ? void 0 : e.futureId
|
|
1249
|
-
})) : k.publish(re.TOPIC_AGITATION_ENDED, {
|
|
1250
|
-
path: this.path
|
|
1251
|
-
});
|
|
1252
|
-
}
|
|
1253
|
-
async updateIceType(e) {
|
|
1254
|
-
await xr(this.path, e);
|
|
1255
|
-
}
|
|
1256
|
-
async init() {
|
|
1257
|
-
this.logger.debug(`initializing ice-agitator ${this.id}`);
|
|
1258
|
-
}
|
|
1259
|
-
async load() {
|
|
1260
|
-
try {
|
|
1261
|
-
this.logger.debug(`loading ice-agitator ${this.id}`);
|
|
1262
|
-
const e = await Lr(this.path);
|
|
1263
|
-
(e == null ? void 0 : e.status) === 200 && Z(() => {
|
|
1264
|
-
this._allIceTypes = e.data || [];
|
|
1265
|
-
});
|
|
1266
|
-
} catch (e) {
|
|
1267
|
-
this.logger.error(e);
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
};
|
|
1271
|
-
Br(c, "Registration");
|
|
1272
|
-
p([
|
|
1273
|
-
b({
|
|
1274
|
-
path: $,
|
|
1275
|
-
attribute: "settings.volWithoutIceMl"
|
|
1276
|
-
})
|
|
1277
|
-
], c.prototype, "volWithoutIceMl", 2);
|
|
1278
|
-
p([
|
|
1279
|
-
b({
|
|
1280
|
-
path: $,
|
|
1281
|
-
attribute: "settings.durationSec",
|
|
1282
|
-
converter: {
|
|
1283
|
-
to: "second"
|
|
1284
|
-
}
|
|
1285
|
-
})
|
|
1286
|
-
], c.prototype, "durationSec", 2);
|
|
1287
|
-
p([
|
|
1288
|
-
b({
|
|
1289
|
-
path: $,
|
|
1290
|
-
attribute: "enableIceChuteClear"
|
|
1291
|
-
})
|
|
1292
|
-
], c.prototype, "enableIceChuteClear", 2);
|
|
1293
|
-
p([
|
|
1294
|
-
b({
|
|
1295
|
-
path: $,
|
|
1296
|
-
attribute: "iceChuteClearDurationMs"
|
|
1297
|
-
})
|
|
1298
|
-
], c.prototype, "iceChuteClearDurationMs", 2);
|
|
1299
|
-
p([
|
|
1300
|
-
b({
|
|
1301
|
-
path: $,
|
|
1302
|
-
attribute: "iceChuteClearIntervalSec"
|
|
1303
|
-
})
|
|
1304
|
-
], c.prototype, "iceChuteClearIntervalSec", 2);
|
|
1305
|
-
p([
|
|
1306
|
-
b({
|
|
1307
|
-
path: $,
|
|
1308
|
-
attribute: "iceChuteClearRetryIntervalSec"
|
|
1309
|
-
})
|
|
1310
|
-
], c.prototype, "iceChuteClearRetryIntervalSec", 2);
|
|
1311
|
-
p([
|
|
1312
|
-
b({
|
|
1313
|
-
path: $,
|
|
1314
|
-
attribute: "maxDispenseSec"
|
|
1315
|
-
})
|
|
1316
|
-
], c.prototype, "maxDispenseSec", 2);
|
|
1317
|
-
p([
|
|
1318
|
-
b({
|
|
1319
|
-
path: $,
|
|
1320
|
-
attribute: "type"
|
|
1321
|
-
})
|
|
1322
|
-
], c.prototype, "type", 2);
|
|
1323
|
-
p([
|
|
1324
|
-
b({
|
|
1325
|
-
path: $,
|
|
1326
|
-
attribute: "settings.dilutionOffset"
|
|
1327
|
-
})
|
|
1328
|
-
], c.prototype, "dilutionOffset", 2);
|
|
1329
|
-
p([
|
|
1330
|
-
b({
|
|
1331
|
-
path: $,
|
|
1332
|
-
attribute: "settings.inactivitySec",
|
|
1333
|
-
converter: {
|
|
1334
|
-
to: "minute"
|
|
1335
|
-
}
|
|
1336
|
-
})
|
|
1337
|
-
], c.prototype, "inactivitySec", 2);
|
|
1338
|
-
p([
|
|
1339
|
-
O({ path: gt, attribute: "agitating" })
|
|
1340
|
-
], c.prototype, "agitating", 2);
|
|
1341
|
-
p([
|
|
1342
|
-
O({ path: gt, attribute: "iceChuteOpen" })
|
|
1343
|
-
], c.prototype, "iceChuteOpen", 2);
|
|
1344
|
-
p([
|
|
1345
|
-
I({ alias: "pour" })
|
|
1346
|
-
], c.prototype, "pourIce", 1);
|
|
1347
|
-
p([
|
|
1348
|
-
I({ alias: "agitate" })
|
|
1349
|
-
], c.prototype, "testAgitate", 1);
|
|
1350
|
-
p([
|
|
1351
|
-
I({
|
|
1352
|
-
alias: "gate"
|
|
1353
|
-
})
|
|
1354
|
-
], c.prototype, "testGate", 1);
|
|
1355
|
-
p([
|
|
1356
|
-
_e({
|
|
1357
|
-
dependencies: (e) => [e.isAgitating]
|
|
1358
|
-
})
|
|
1359
|
-
], c.prototype, "handleAgitationChange", 1);
|
|
1360
|
-
c = p([
|
|
1361
|
-
f({ modelTypeId: Kr, singleton: !1 }),
|
|
1362
|
-
D(),
|
|
1363
|
-
Et()
|
|
1364
|
-
], c);
|
|
1365
|
-
const ht = c.Registration;
|
|
1366
|
-
var Yr = Object.defineProperty, Wr = Object.getOwnPropertyDescriptor, Zr = (e, t, r) => t in e ? Yr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, kr = (e, t, r, o) => {
|
|
1367
|
-
for (var a = o > 1 ? void 0 : o ? Wr(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
1368
|
-
(i = e[n]) && (a = i(a) || a);
|
|
1369
|
-
return a;
|
|
1370
|
-
}, Qr = (e, t, r) => (Zr(e, t + "", r), r);
|
|
1371
|
-
const Xr = "lfcv-pump-model";
|
|
1372
|
-
let ae = class {
|
|
1373
|
-
constructor(e, t) {
|
|
1374
|
-
s(this, "id");
|
|
1375
|
-
this.id = e;
|
|
1376
|
-
}
|
|
1377
|
-
get name() {
|
|
1378
|
-
return this.pumpModel.name;
|
|
1379
|
-
}
|
|
1380
|
-
get canPour() {
|
|
1381
|
-
return this.pumpModel.canPour;
|
|
1382
|
-
}
|
|
1383
|
-
get isPouring() {
|
|
1384
|
-
return this.pumpModel.isPouring;
|
|
1385
|
-
}
|
|
1386
|
-
async cancelPour() {
|
|
1387
|
-
return this.pumpModel.cancelPour();
|
|
1388
|
-
}
|
|
1389
|
-
performIntent(e) {
|
|
1390
|
-
return this.pumpModel.performIntent(e);
|
|
1391
|
-
}
|
|
1392
|
-
};
|
|
1393
|
-
Qr(ae, "Registration");
|
|
1394
|
-
ae = kr([
|
|
1395
|
-
f({ modelTypeId: Xr, singleton: !1 }),
|
|
1396
|
-
D(),
|
|
1397
|
-
oe({
|
|
1398
|
-
mode: "composition",
|
|
1399
|
-
parentProperty: "pumpModel"
|
|
1400
|
-
})
|
|
1401
|
-
], ae);
|
|
1402
|
-
const Jr = ae.Registration, { URL: Y } = M("SPM-PUMP_SERVICE"), { postModel: ue } = R.build({
|
|
1403
|
-
basePath: `${Y}/api/spm-pump`
|
|
1404
|
-
}), _ = C.createLogger({
|
|
1405
|
-
name: "spm-pump-service",
|
|
1406
|
-
group: "Services"
|
|
1407
|
-
}), ea = async (e, t) => {
|
|
1408
|
-
_.debug(
|
|
1409
|
-
`performPreCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/preCalibrate`
|
|
1410
|
-
);
|
|
1411
|
-
try {
|
|
1412
|
-
const r = await ue({
|
|
1413
|
-
model: {},
|
|
1414
|
-
urlOverride: `${Y}/api/ext/freestyle/microCalibration/pour/${e}/preCalibrate`,
|
|
1415
|
-
tracker: t
|
|
1416
|
-
});
|
|
1417
|
-
return _.debug("performPreCalibrate - response:", r), r != null && r.data && y.initiateFuture(r.data), r == null ? void 0 : r.data;
|
|
1418
|
-
} catch (r) {
|
|
1419
|
-
_.error(
|
|
1420
|
-
`performPreCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/preCalibrate`,
|
|
1421
|
-
r
|
|
1422
|
-
);
|
|
1423
|
-
const o = {
|
|
1424
|
-
id: t || "",
|
|
1425
|
-
endState: U.Fail,
|
|
1426
|
-
tracker: t,
|
|
1427
|
-
reason: "Failed to resolve trouble"
|
|
1428
|
-
};
|
|
1429
|
-
return y.initiateFuture(o), o;
|
|
1430
|
-
}
|
|
1431
|
-
}, ta = async (e, t) => {
|
|
1432
|
-
_.debug(
|
|
1433
|
-
`performCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/calibrate`
|
|
1434
|
-
);
|
|
1435
|
-
try {
|
|
1436
|
-
const r = await ue({
|
|
1437
|
-
model: {},
|
|
1438
|
-
urlOverride: `${Y}/api/ext/freestyle/microCalibration/pour/${e}/calibrate`,
|
|
1439
|
-
tracker: t
|
|
1440
|
-
});
|
|
1441
|
-
return _.debug("performCalibrate - response:", r), r != null && r.data && y.initiateFuture(r.data), r == null ? void 0 : r.data;
|
|
1442
|
-
} catch (r) {
|
|
1443
|
-
_.error(
|
|
1444
|
-
`performCalibrate - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/calibrate`,
|
|
1445
|
-
r
|
|
1446
|
-
);
|
|
1447
|
-
const o = {
|
|
1448
|
-
id: t || "",
|
|
1449
|
-
endState: U.Fail,
|
|
1450
|
-
tracker: t,
|
|
1451
|
-
reason: "Failed to resolve trouble"
|
|
1452
|
-
};
|
|
1453
|
-
return y.initiateFuture(o), o;
|
|
1454
|
-
}
|
|
1455
|
-
}, ra = async (e, t, r, o) => {
|
|
1456
|
-
_.debug(
|
|
1457
|
-
`performVerify - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/verify`
|
|
1458
|
-
);
|
|
1459
|
-
try {
|
|
1460
|
-
const a = await ue({
|
|
1461
|
-
model: {
|
|
1462
|
-
...r,
|
|
1463
|
-
// commandedCalibrationVolume: 0,
|
|
1464
|
-
measuredCalibrationVolume: t
|
|
1465
|
-
// measuredVerificationVolume: 0,
|
|
1466
|
-
// newCalibrationValue: 0,
|
|
1467
|
-
// pouredCalibrationVolume: 0,
|
|
1468
|
-
},
|
|
1469
|
-
urlOverride: `${Y}/api/ext/freestyle/microCalibration/pour/${e}/verify`,
|
|
1470
|
-
tracker: o
|
|
1471
|
-
});
|
|
1472
|
-
return _.debug("performVerify - response:", a), a != null && a.data && y.initiateFuture(a.data), a == null ? void 0 : a.data;
|
|
1473
|
-
} catch (a) {
|
|
1474
|
-
_.error(
|
|
1475
|
-
`performVerify - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/verify`,
|
|
1476
|
-
a
|
|
1477
|
-
);
|
|
1478
|
-
const n = {
|
|
1479
|
-
id: o || "",
|
|
1480
|
-
endState: U.Fail,
|
|
1481
|
-
tracker: o,
|
|
1482
|
-
reason: "Failed to resolve trouble"
|
|
1483
|
-
};
|
|
1484
|
-
return y.initiateFuture(n), n;
|
|
1485
|
-
}
|
|
1486
|
-
}, aa = async (e, t, r, o) => {
|
|
1487
|
-
var a, n, i, u, E;
|
|
1488
|
-
_.debug(
|
|
1489
|
-
`performComplete - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/complete`
|
|
1490
|
-
);
|
|
1491
|
-
try {
|
|
1492
|
-
const l = await ue({
|
|
1493
|
-
model: {
|
|
1494
|
-
...o,
|
|
1495
|
-
// commandedCalibrationVolume: 0,
|
|
1496
|
-
measuredCalibrationVolume: t,
|
|
1497
|
-
measuredVerificationVolume: r
|
|
1498
|
-
// newCalibrationValue: 0,
|
|
1499
|
-
// pouredCalibrationVolume: 0,
|
|
1500
|
-
},
|
|
1501
|
-
urlOverride: `${Y}/api/ext/freestyle/microCalibration/pour/${e}/complete`
|
|
1502
|
-
});
|
|
1503
|
-
return _.debug("performComplete - response:", l), ((l == null ? void 0 : l.status) === 200 || (l == null ? void 0 : l.status) === 499) && ((a = l.data) != null && a.error) ? [l.data.error || "unknownError", l.data] : [void 0, l == null ? void 0 : l.data];
|
|
1504
|
-
} catch (l) {
|
|
1505
|
-
if (_.error(
|
|
1506
|
-
`performComplete - sending POST request to /api/ext/freestyle/microCalibration/pour/${e}/complete`,
|
|
1507
|
-
l
|
|
1508
|
-
), l instanceof Ie) {
|
|
1509
|
-
const v = ((i = (n = l.payload) == null ? void 0 : n.data) == null ? void 0 : i.error) || ((u = l.payload) == null ? void 0 : u.error) || "unknownError";
|
|
1510
|
-
return [v, ((E = l.payload) == null ? void 0 : E.data) || { error: v }];
|
|
1511
|
-
}
|
|
1512
|
-
}
|
|
1513
|
-
return ["unknownError", { error: "unknownError" }];
|
|
1514
|
-
};
|
|
1515
|
-
var oa = Object.defineProperty, ia = Object.getOwnPropertyDescriptor, ce = (e, t, r, o) => {
|
|
1516
|
-
for (var a = o > 1 ? void 0 : o ? ia(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
1517
|
-
(i = e[n]) && (a = (o ? i(t, r, a) : i(a)) || a);
|
|
1518
|
-
return o && a && oa(t, r, a), a;
|
|
1519
|
-
};
|
|
1520
|
-
const ft = "spm-pump-model";
|
|
1521
|
-
let x = class {
|
|
1522
|
-
constructor(e, t, r) {
|
|
1523
|
-
s(this, "id");
|
|
1524
|
-
s(this, "logger");
|
|
1525
|
-
s(this, "pump");
|
|
1526
|
-
s(this, "futureHandler");
|
|
1527
|
-
this.id = e, this.logger = r.logger, this.pump = t.companionParent, this.futureHandler = new Ue(this);
|
|
1528
|
-
}
|
|
1529
|
-
get name() {
|
|
1530
|
-
return this.pump.name;
|
|
1531
|
-
}
|
|
1532
|
-
get canPour() {
|
|
1533
|
-
return this.pump.canPour;
|
|
1534
|
-
}
|
|
1535
|
-
get isPouring() {
|
|
1536
|
-
return this.pump.isPouring;
|
|
1537
|
-
}
|
|
1538
|
-
async cancelPour() {
|
|
1539
|
-
return this.pump.cancelPour();
|
|
1540
|
-
}
|
|
1541
|
-
performIntent(e) {
|
|
1542
|
-
return this.pump.performIntent(e);
|
|
1543
|
-
}
|
|
1544
|
-
get future() {
|
|
1545
|
-
return this.futureHandler.future;
|
|
1546
|
-
}
|
|
1547
|
-
async performPreCalibrate(e) {
|
|
1548
|
-
return ea(this.pump.path, e);
|
|
1549
|
-
}
|
|
1550
|
-
async performCalibrate(e) {
|
|
1551
|
-
return ta(this.pump.path, e);
|
|
1552
|
-
}
|
|
1553
|
-
async performVerify(e, t, r) {
|
|
1554
|
-
return ra(this.pump.path, e, t, r);
|
|
1555
|
-
}
|
|
1556
|
-
async performComplete(e, t, r) {
|
|
1557
|
-
return aa(this.pump.path, e, t, r);
|
|
1558
|
-
}
|
|
1559
|
-
// -------------------LIFECYCLE----------------------------
|
|
1560
|
-
async init() {
|
|
1561
|
-
this.logger.debug(`initializing spm-pump ${this.id}`);
|
|
1562
|
-
}
|
|
1563
|
-
async load() {
|
|
1564
|
-
this.logger.debug(`loading spm-pump ${this.id}`);
|
|
1565
|
-
}
|
|
1566
|
-
};
|
|
1567
|
-
ce([
|
|
1568
|
-
I()
|
|
1569
|
-
], x.prototype, "performPreCalibrate", 1);
|
|
1570
|
-
ce([
|
|
1571
|
-
I()
|
|
1572
|
-
], x.prototype, "performCalibrate", 1);
|
|
1573
|
-
ce([
|
|
1574
|
-
I()
|
|
1575
|
-
], x.prototype, "performVerify", 1);
|
|
1576
|
-
x = ce([
|
|
1577
|
-
f(ft)
|
|
1578
|
-
], x);
|
|
1579
|
-
const sa = new F({
|
|
1580
|
-
class: x,
|
|
1581
|
-
type: ft
|
|
1582
|
-
});
|
|
1583
|
-
var mt = Object.defineProperty, na = Object.getOwnPropertyDescriptor, la = (e, t, r) => t in e ? mt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Se = (e, t, r, o) => {
|
|
1584
|
-
for (var a = o > 1 ? void 0 : o ? na(t, r) : t, n = e.length - 1, i; n >= 0; n--)
|
|
1585
|
-
(i = e[n]) && (a = (o ? i(t, r, a) : i(a)) || a);
|
|
1586
|
-
return o && a && mt(t, r, a), a;
|
|
1587
|
-
}, ua = (e, t, r) => (la(e, t + "", r), r);
|
|
1588
|
-
const yt = "agitation-required-trouble-model", ca = (e) => {
|
|
1589
|
-
if (e.data.agitationRequired)
|
|
1590
|
-
return yt;
|
|
1591
|
-
}, da = "InsufficientAgitationTrouble";
|
|
1592
|
-
let q = class {
|
|
1593
|
-
/**
|
|
1594
|
-
* Creates a new AgitationRequiredTrouble model instance.
|
|
1595
|
-
*
|
|
1596
|
-
* @param modelId - Unique identifier for this model instance (typically matches parent trouble ID)
|
|
1597
|
-
*/
|
|
1598
|
-
constructor(e) {
|
|
1599
|
-
/**
|
|
1600
|
-
* Unique identifier for this model instance.
|
|
1601
|
-
*/
|
|
1602
|
-
s(this, "id");
|
|
1603
|
-
s(this, "_deferred");
|
|
1604
|
-
s(this, "_holdersLoaded", !1);
|
|
1605
|
-
s(this, "agitateBeforePour");
|
|
1606
|
-
this.id = e, this._deferred = !1;
|
|
1607
|
-
}
|
|
1608
|
-
/**
|
|
1609
|
-
* Resolves the agitation trouble by delegating to the parent trouble model.
|
|
1610
|
-
*
|
|
1611
|
-
* Resolution typically involves completing the agitation process and clearing
|
|
1612
|
-
* the trouble state once carbonation or mixing levels are acceptable.
|
|
1613
|
-
*
|
|
1614
|
-
* @returns Promise resolving to the future response from the parent trouble's resolution
|
|
1615
|
-
*/
|
|
1616
|
-
async resolve() {
|
|
1617
|
-
return this.trouble.resolve();
|
|
1618
|
-
}
|
|
1619
|
-
/**
|
|
1620
|
-
* Gets the holder model associated with this agitation trouble.
|
|
1621
|
-
*
|
|
1622
|
-
* The holder is the physical container (cartridge holder, ingredient holder, etc.)
|
|
1623
|
-
* that requires agitation. Returns undefined if the holder model hasn't been
|
|
1624
|
-
* loaded yet through the Assembly model initialization.
|
|
1625
|
-
*
|
|
1626
|
-
* @returns The holder model or undefined if not yet loaded
|
|
1627
|
-
*/
|
|
1628
|
-
get holder() {
|
|
1629
|
-
if (!this.trouble)
|
|
1630
|
-
return;
|
|
1631
|
-
const e = this.trouble.data.holderPaths[0], t = A(e);
|
|
1632
|
-
if (!(!this._holdersLoaded && !t.model))
|
|
1633
|
-
return t == null ? void 0 : t.model;
|
|
1634
|
-
}
|
|
1635
|
-
updateHolder() {
|
|
1636
|
-
if (!this._holdersLoaded && this.trouble) {
|
|
1637
|
-
const e = this.trouble.data.holderPaths[0];
|
|
1638
|
-
A(e).model && (this._holdersLoaded = !0);
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1641
|
-
/**
|
|
1642
|
-
* Determines if trouble resolution should be deferred until agitation completes.
|
|
1643
|
-
*
|
|
1644
|
-
* Trouble resolution is deferred when:
|
|
1645
|
-
* 1. The holder has active insufficient agitation troubles
|
|
1646
|
-
* 2. The `agitateBeforePour` configuration is enabled
|
|
1647
|
-
*
|
|
1648
|
-
* This ensures that operations requiring agitation (prime, purge, or other
|
|
1649
|
-
* holder-related troubles) wait for proper carbonation or mixing before
|
|
1650
|
-
* being marked as resolved.
|
|
1651
|
-
*
|
|
1652
|
-
* @returns true if trouble resolution should wait for agitation to complete
|
|
1653
|
-
*/
|
|
1654
|
-
get shouldDefer() {
|
|
1655
|
-
var o, a;
|
|
1656
|
-
if (!this.holder)
|
|
1657
|
-
return !0;
|
|
1658
|
-
const t = (((o = this.holder) == null ? void 0 : o.troublesByType[da]) || []).length > 0;
|
|
1659
|
-
return !!((a = this.agitateBeforePour) != null && a.value) && t;
|
|
1660
|
-
}
|
|
1661
|
-
/**
|
|
1662
|
-
* Gets the current deferral state of this trouble.
|
|
1663
|
-
*
|
|
1664
|
-
* @returns true if this trouble resolution is currently deferred
|
|
1665
|
-
*/
|
|
1666
|
-
get deferred() {
|
|
1667
|
-
return this._deferred;
|
|
1668
|
-
}
|
|
1669
|
-
/**
|
|
1670
|
-
* Marks this trouble as deferred, preventing immediate resolution.
|
|
1671
|
-
*
|
|
1672
|
-
* Called by the trouble system to indicate that trouble resolution
|
|
1673
|
-
* should wait for agitation to complete before being marked as resolved.
|
|
1674
|
-
*/
|
|
1675
|
-
defer() {
|
|
1676
|
-
this._deferred = !0;
|
|
1677
|
-
}
|
|
1678
|
-
/**
|
|
1679
|
-
* Clears the deferral state, allowing trouble resolution to proceed.
|
|
1680
|
-
*
|
|
1681
|
-
* Typically called after agitation has completed and the trouble can
|
|
1682
|
-
* now be safely resolved.
|
|
1683
|
-
*/
|
|
1684
|
-
clearDefer() {
|
|
1685
|
-
this._deferred = !1;
|
|
1686
|
-
}
|
|
1687
|
-
};
|
|
1688
|
-
ua(q, "Registration");
|
|
1689
|
-
Se([
|
|
1690
|
-
b({
|
|
1691
|
-
path: "app:kosdev.ddk:app",
|
|
1692
|
-
attribute: "ncui.agitateBeforePour"
|
|
1693
|
-
})
|
|
1694
|
-
], q.prototype, "agitateBeforePour", 2);
|
|
1695
|
-
Se([
|
|
1696
|
-
St({
|
|
1697
|
-
topic: At(Ve.type),
|
|
1698
|
-
lifecycle: qe.INIT
|
|
1699
|
-
})
|
|
1700
|
-
], q.prototype, "updateHolder", 1);
|
|
1701
|
-
q = Se([
|
|
1702
|
-
f({ modelTypeId: yt, singleton: !1 }),
|
|
1703
|
-
D(),
|
|
1704
|
-
oe({ mode: "composition", parentProperty: "trouble" })
|
|
1705
|
-
], q);
|
|
1706
|
-
const pa = q.Registration, ga = ["iceAgitator"], ha = {
|
|
1707
|
-
iceAgitator: ht
|
|
1708
|
-
}, fa = C.createLogger({ name: "freestyle-assembly-data-mapper" }), Ca = async (e) => {
|
|
1709
|
-
const t = Ce.instance().options({}).build(), r = Ee.instance().options({}).build(), o = e.assemblies.reduce((i, u) => {
|
|
1710
|
-
var E;
|
|
1711
|
-
return ga.forEach((l) => {
|
|
1712
|
-
var S;
|
|
1713
|
-
const v = u[l];
|
|
1714
|
-
if (v) {
|
|
1715
|
-
const bt = ha[l];
|
|
1716
|
-
i[l] = bt.instance(v.path).options({
|
|
1717
|
-
name: v.name,
|
|
1718
|
-
path: v.path,
|
|
1719
|
-
statePath: ((S = v.state) == null ? void 0 : S.path) || ""
|
|
1720
|
-
}).build();
|
|
1721
|
-
}
|
|
1722
|
-
}), (E = u.cartridgeAgitators) == null || E.forEach((l) => {
|
|
1723
|
-
var S;
|
|
1724
|
-
const v = Qe.instance(
|
|
1725
|
-
l.path
|
|
1726
|
-
).options({
|
|
1727
|
-
name: l.name,
|
|
1728
|
-
path: l.path,
|
|
1729
|
-
statePath: ((S = l.state) == null ? void 0 : S.path) || ""
|
|
1730
|
-
}).build();
|
|
1731
|
-
t.addModel(v);
|
|
1732
|
-
}), u.remoteTrays && u.remoteTrays.forEach((l) => {
|
|
1733
|
-
fa.info(`Found remote tray ${l.name} with path ${l.path}`);
|
|
1734
|
-
const v = `${V.type}-${l.holderPath}`, S = V.instance(v).options({
|
|
1735
|
-
holderPath: l.holderPath,
|
|
1736
|
-
configPath: l.path,
|
|
1737
|
-
name: l.name
|
|
1738
|
-
}).build();
|
|
1739
|
-
r.addModel(S);
|
|
1740
|
-
}), i;
|
|
1741
|
-
}, {}), a = !!o.iceAgitator, n = !!o.carbTank;
|
|
1742
|
-
return {
|
|
1743
|
-
...o,
|
|
1744
|
-
cartridgeAgitators: t,
|
|
1745
|
-
remoteTrays: r,
|
|
1746
|
-
supportsCarb: n,
|
|
1747
|
-
supportsIce: a
|
|
1748
|
-
};
|
|
1749
|
-
}, ma = (e) => () => (wt(e)(), Dt(e)(), Me.register(), fe.register(), ht.register(), Ke.register(), Ce.register(), sa.register(), pr.register(), Jr.register(), rr.register(), Re.register(), Ae.register(), V.register(), Ee.register(), m.companion.register(e)(
|
|
1750
|
-
Ft.type,
|
|
1751
|
-
Me.type
|
|
1752
|
-
), m.companion.register(e)(
|
|
1753
|
-
Ve.type,
|
|
1754
|
-
fe.type
|
|
1755
|
-
), pa.register(), m.companion.register(e)(
|
|
1756
|
-
Mt.type,
|
|
1757
|
-
ca
|
|
1758
|
-
), m.companion.register(e)(Nt.type, Re.type), m.companion.register(e)(
|
|
1759
|
-
zt.type,
|
|
1760
|
-
Ae.type
|
|
1761
|
-
), pe[ge].register(
|
|
1762
|
-
"EnjoyByTrouble",
|
|
1763
|
-
async (t) => {
|
|
1764
|
-
if (t.data.enjoyByDate) {
|
|
1765
|
-
const r = new Date(t.data.enjoyByDate);
|
|
1766
|
-
return {
|
|
1767
|
-
enjoyByDays: Math.floor(
|
|
1768
|
-
((/* @__PURE__ */ new Date()).getTime() - r.getTime()) / (1e3 * 60 * 60 * 24)
|
|
1769
|
-
) || ""
|
|
1770
|
-
};
|
|
1771
|
-
}
|
|
1772
|
-
return {};
|
|
1773
|
-
}
|
|
1774
|
-
), pe[ge].register(
|
|
1775
|
-
"SuperPumpRequiredTrouble",
|
|
1776
|
-
// This is the trouble type
|
|
1777
|
-
async (t) => {
|
|
1778
|
-
const { model: r } = A(
|
|
1779
|
-
Lt.type
|
|
1780
|
-
);
|
|
1781
|
-
return r ? {
|
|
1782
|
-
superPumps: r.models.getIndexByKey(
|
|
1783
|
-
xt.byType,
|
|
1784
|
-
"microSuper"
|
|
1785
|
-
).map((n) => n.name).join(", ")
|
|
1786
|
-
} : {};
|
|
1787
|
-
}
|
|
1788
|
-
), pe[ge].register(
|
|
1789
|
-
"MicroPumpAirDetectTrouble",
|
|
1790
|
-
async (t) => {
|
|
1791
|
-
if (t.ifaces.includes("container"))
|
|
1792
|
-
return {};
|
|
1793
|
-
if (t.data.pumpPath) {
|
|
1794
|
-
const { model: r } = A(
|
|
1795
|
-
t.data.pumpPath
|
|
1796
|
-
);
|
|
1797
|
-
if (r) {
|
|
1798
|
-
const o = r.ingredientId ? A(r.ingredientId).model : void 0;
|
|
1799
|
-
return {
|
|
1800
|
-
ingredientId: r.ingredientId,
|
|
1801
|
-
ingredientName: (o == null ? void 0 : o.name) || ""
|
|
1802
|
-
};
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
return {};
|
|
1806
|
-
}
|
|
1807
|
-
), {
|
|
1808
|
-
preload: m.model.preloadModel(e),
|
|
1809
|
-
model: m.model.register(e),
|
|
1810
|
-
companion: m.companion.register(e),
|
|
1811
|
-
legacy: m.model.registerLegacyModel(e)
|
|
1812
|
-
}), T = {
|
|
1813
|
-
...Rt
|
|
1814
|
-
};
|
|
1815
|
-
T.freestyle = {
|
|
1816
|
-
models: ma(T)
|
|
1817
|
-
};
|
|
1818
|
-
T.preload = m.model.preloadModel(T);
|
|
1819
|
-
T.model = m.model.register(T);
|
|
1820
|
-
T.companion = m.companion.register(T);
|
|
1821
|
-
T.legacy = m.model.registerLegacyModel(T);
|
|
1822
|
-
const Oa = T;
|
|
1823
|
-
function ya(e) {
|
|
1824
|
-
return B(e);
|
|
1825
|
-
}
|
|
1826
|
-
const De = H(), Ea = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1827
|
-
__proto__: null,
|
|
1828
|
-
api: De,
|
|
1829
|
-
default: De,
|
|
1830
|
-
kosServiceRequest: ya
|
|
1831
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1832
|
-
function ba(e) {
|
|
1833
|
-
return B(e);
|
|
1834
|
-
}
|
|
1835
|
-
const Fe = H(), Sa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1836
|
-
__proto__: null,
|
|
1837
|
-
api: Fe,
|
|
1838
|
-
default: Fe,
|
|
1839
|
-
kosServiceRequest: ba
|
|
1840
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1841
|
-
function Pa(e) {
|
|
1842
|
-
return B(e);
|
|
1843
|
-
}
|
|
1844
|
-
const Ne = H(), Aa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1845
|
-
__proto__: null,
|
|
1846
|
-
api: Ne,
|
|
1847
|
-
default: Ne,
|
|
1848
|
-
kosServiceRequest: Pa
|
|
1849
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1850
|
-
function va(e) {
|
|
1851
|
-
return B(e);
|
|
1852
|
-
}
|
|
1853
|
-
const ze = H(), wa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1854
|
-
__proto__: null,
|
|
1855
|
-
api: ze,
|
|
1856
|
-
default: ze,
|
|
1857
|
-
kosServiceRequest: va
|
|
1858
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1859
|
-
function _a(e) {
|
|
1860
|
-
return B(e);
|
|
1861
|
-
}
|
|
1862
|
-
const Le = H(), Ma = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1863
|
-
__proto__: null,
|
|
1864
|
-
api: Le,
|
|
1865
|
-
default: Le,
|
|
1866
|
-
kosServiceRequest: _a
|
|
1867
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
1868
|
-
export {
|
|
1869
|
-
da as A,
|
|
1870
|
-
aa as B,
|
|
1871
|
-
Ke as C,
|
|
1872
|
-
ea as D,
|
|
1873
|
-
ra as E,
|
|
1874
|
-
pr as F,
|
|
1875
|
-
Ca as G,
|
|
1876
|
-
fr as H,
|
|
1877
|
-
ht as I,
|
|
1878
|
-
Oa as K,
|
|
1879
|
-
Jr as L,
|
|
1880
|
-
Ar as N,
|
|
1881
|
-
Ee as R,
|
|
1882
|
-
sa as S,
|
|
1883
|
-
Ce as a,
|
|
1884
|
-
X as b,
|
|
1885
|
-
Qe as c,
|
|
1886
|
-
rr as d,
|
|
1887
|
-
fe as e,
|
|
1888
|
-
Ae as f,
|
|
1889
|
-
Me as g,
|
|
1890
|
-
Re as h,
|
|
1891
|
-
re as i,
|
|
1892
|
-
pa as j,
|
|
1893
|
-
Sa as k,
|
|
1894
|
-
Aa as l,
|
|
1895
|
-
wa as m,
|
|
1896
|
-
Ma as n,
|
|
1897
|
-
V as o,
|
|
1898
|
-
ir as p,
|
|
1899
|
-
lr as q,
|
|
1900
|
-
ma as r,
|
|
1901
|
-
Ea as s,
|
|
1902
|
-
ar as t,
|
|
1903
|
-
or as u,
|
|
1904
|
-
sr as v,
|
|
1905
|
-
we as w,
|
|
1906
|
-
wr as x,
|
|
1907
|
-
Fr as y,
|
|
1908
|
-
ta as z
|
|
1909
|
-
};
|
|
1910
|
-
//# sourceMappingURL=service-DildzPxj.js.map
|