@kosdev-code/kos-dispense-sdk 0.1.0-dev.5077 → 0.1.0-dev.5092
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/dispense-registration-manager-DDyKjPWB.cjs +2 -0
- package/dispense-registration-manager-DDyKjPWB.cjs.map +1 -0
- package/{dispense-registration-manager-kSiG2s8S.js → dispense-registration-manager-DgMTZL-g.js} +601 -590
- package/dispense-registration-manager-DgMTZL-g.js.map +1 -0
- package/{extension-utils-CdPC7X-L.cjs → extension-utils-BceaRPqX.cjs} +2 -2
- package/{extension-utils-CdPC7X-L.cjs.map → extension-utils-BceaRPqX.cjs.map} +1 -1
- package/{extension-utils-CuSBRs_n.js → extension-utils-mvxA4D4h.js} +2 -2
- package/{extension-utils-CuSBRs_n.js.map → extension-utils-mvxA4D4h.js.map} +1 -1
- package/index.cjs +1 -1
- package/index.js +3 -3
- package/models/models/assembly/assembly-model.d.ts.map +1 -1
- package/models/models/assembly/pump-utils.d.ts.map +1 -1
- package/models/models/pump/pump-model.d.ts.map +1 -1
- package/models/models/pump/types/index.d.ts +4 -0
- package/models/models/types/assembly.d.ts +4 -0
- package/models/models/types/assembly.d.ts.map +1 -1
- package/models/utils/service.d.ts +8 -8
- package/models.cjs +1 -1
- package/models.js +2 -2
- package/package.json +3 -3
- package/{pump-provider-BmaHEGSM.cjs → pump-provider-BSdtHuOD.cjs} +2 -2
- package/{pump-provider-BmaHEGSM.cjs.map → pump-provider-BSdtHuOD.cjs.map} +1 -1
- package/{pump-provider-C1wagpbM.js → pump-provider-C-Zclv9X.js} +2 -2
- package/{pump-provider-C1wagpbM.js.map → pump-provider-C-Zclv9X.js.map} +1 -1
- package/ui.cjs +1 -1
- package/ui.js +2 -2
- package/dispense-registration-manager-D2xgLGGi.cjs +0 -2
- package/dispense-registration-manager-D2xgLGGi.cjs.map +0 -1
- package/dispense-registration-manager-kSiG2s8S.js.map +0 -1
package/{dispense-registration-manager-kSiG2s8S.js → dispense-registration-manager-DgMTZL-g.js}
RENAMED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var o = (e, t, r) => (
|
|
4
|
-
import { kosModel as
|
|
1
|
+
var ut = Object.defineProperty;
|
|
2
|
+
var Pt = (e, t, r) => t in e ? ut(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var o = (e, t, r) => (Pt(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import { kosModel as y, Kos as v, isKosModel as b, resolveServiceUrl as D, ServiceFactory as S, KosLog as m, KosModelContainer as T, KosExtensionUtils as U, kosChild as _, FetchError as yt, ExtensionManager as P, EXTENSION_TROUBLE_MAPPER as Me, EXTENSION_TROUBLE_DATA_MAPPER as te, getKosModelSync as x, kosDependency as Be, kosTroubleAware as It, kosAction as O, kosTopicHandler as re, DependencyLifecycle as pe, getKosModel as Ge, FutureManager as he, kosFuture as ge, FutureHandler as je, EXTENSION_FEATURE_FLAG_RESOLVER as mt, isKosDataModel as ft, ChildModels as vt, KosFeatureFlags as bt, kosParentAware as Ot, createPropKey as _t, kosStateEntry as ue, kosStateExit as Pe, kosStateGuard as ae, kosLoggerAware as Fe, kosStateMachine as He, MultipleFutureHandler as Et, arraysEqual as Mt, getAllKosCompanionModels as z, EventBus as $, KosContextManager as wt, destroyKosModel as Rt, SingletonKosModelRegistrationFactory as Ct, kosFutureAware as $t, ObservableData as Te, KosModelRegistrationFactory as Nt, KosModelRegistry as Dt, RegistrationManager as R, registerCoreModels as St, registerLegacyModel as Tt } from "@kosdev-code/kos-ui-sdk";
|
|
5
5
|
import "react";
|
|
6
|
-
var
|
|
7
|
-
for (var
|
|
8
|
-
(n = e[s]) && (
|
|
9
|
-
return
|
|
6
|
+
var g = /* @__PURE__ */ ((e) => (e.IngredientLoader = "kos.ingredient.loader", e.IngredientMapper = "kos.ingredient.mapper", e.IngredientIndex = "kos.ingredient.index", e.IngredientTypeMapper = "kos.ingredient.type.mapper", e.HolderTypeMapper = "kos.holder.type.mapper", e.HolderMapper = "kos.holder.mapper", e.HolderIndex = "kos.holder.index", e.HolderIngredientMapper = "kos.holder.ingredient.mapper", e.AvailabilityMapper = "kos.availability.mapper", e.AvailabilityLoader = "kos.availability.loader", e.SelectedPourableMapper = "kos.selected.pourable.mapper", e.AssemblyMapper = "kos.assembly.mapper", e.BoardMapper = "kos.board.mapper", e.BoardIndex = "kos.board.index", e.PumpIndex = "kos.pump.index", e.AssemblyFeatureFlags = "kos.assembly.feature.flags", e))(g || {}), L = /* @__PURE__ */ ((e) => (e.Nozzle = "nozzle-model", e.Availability = "availability-model", e.Holder = "holder-model", e.HolderContainer = "holder-container-model", e.IngredientContainer = "ingredient-container-model", e.Ingredient = "ingredient-model", e.Pump = "pump-model", e.PumpContainer = "pump-container-model", e))(L || {}), Lt = Object.getOwnPropertyDescriptor, At = (e, t, r, a) => {
|
|
7
|
+
for (var i = a > 1 ? void 0 : a ? Lt(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
8
|
+
(n = e[s]) && (i = n(i) || i);
|
|
9
|
+
return i;
|
|
10
10
|
};
|
|
11
|
-
const
|
|
11
|
+
const H = "ingredient-model";
|
|
12
12
|
let be = class {
|
|
13
13
|
constructor(e, {
|
|
14
14
|
name: t,
|
|
15
15
|
type: r,
|
|
16
|
-
data:
|
|
17
|
-
ingredientId:
|
|
16
|
+
data: a,
|
|
17
|
+
ingredientId: i,
|
|
18
18
|
...s
|
|
19
19
|
}) {
|
|
20
20
|
o(this, "id");
|
|
@@ -22,53 +22,53 @@ let be = class {
|
|
|
22
22
|
o(this, "name");
|
|
23
23
|
o(this, "type");
|
|
24
24
|
o(this, "data");
|
|
25
|
-
this.id = e, this.ingredientId =
|
|
25
|
+
this.id = e, this.ingredientId = i, this.name = t, this.type = r, this.data = a, Object.assign(this, s);
|
|
26
26
|
}
|
|
27
27
|
updateModel({
|
|
28
28
|
name: e,
|
|
29
29
|
type: t,
|
|
30
30
|
data: r,
|
|
31
|
-
ingredientId:
|
|
32
|
-
...
|
|
31
|
+
ingredientId: a,
|
|
32
|
+
...i
|
|
33
33
|
}) {
|
|
34
|
-
this.name = e, this.type = t, this.ingredientId =
|
|
34
|
+
this.name = e, this.type = t, this.ingredientId = a, this.data = r, Object.assign(this, i);
|
|
35
35
|
}
|
|
36
36
|
// -------------------LIFECYCLE----------------------------
|
|
37
37
|
// -------------------ENTITY----------------------------
|
|
38
38
|
};
|
|
39
|
-
be =
|
|
40
|
-
|
|
39
|
+
be = At([
|
|
40
|
+
y(H)
|
|
41
41
|
], be);
|
|
42
|
-
const
|
|
42
|
+
const Ve = {
|
|
43
43
|
registration: {
|
|
44
|
-
[
|
|
44
|
+
[H]: {
|
|
45
45
|
class: be,
|
|
46
46
|
singleton: !1
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
-
type:
|
|
50
|
-
predicate: b(
|
|
51
|
-
factory: v.Factory.create(
|
|
52
|
-
}, { URL:
|
|
53
|
-
basePath: `${
|
|
54
|
-
}),
|
|
55
|
-
urlOverride: `${
|
|
49
|
+
type: H,
|
|
50
|
+
predicate: b(H),
|
|
51
|
+
factory: v.Factory.create(H)
|
|
52
|
+
}, { URL: Ke } = D("INGREDIENT_SERVICE"), { getOne: Ut } = S.build({
|
|
53
|
+
basePath: `${Ke}/api/ext/dispense/ingredients`
|
|
54
|
+
}), zt = async () => await Ut({
|
|
55
|
+
urlOverride: `${Ke}/api/ext/dispense/ingredients`
|
|
56
56
|
});
|
|
57
|
-
var
|
|
58
|
-
for (var
|
|
59
|
-
(n = e[s]) && (
|
|
60
|
-
return
|
|
57
|
+
var xt = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, ke = (e, t, r, a) => {
|
|
58
|
+
for (var i = a > 1 ? void 0 : a ? Bt(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
59
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
60
|
+
return a && i && xt(t, r, i), i;
|
|
61
61
|
};
|
|
62
|
-
const
|
|
62
|
+
const V = "ingredient-container-model", Gt = m.createLogger({ name: "ingredient-container-model" });
|
|
63
63
|
let se = class {
|
|
64
64
|
constructor(e, t) {
|
|
65
65
|
o(this, "id");
|
|
66
66
|
o(this, "ingredients");
|
|
67
|
-
this.id = e, this.ingredients = new
|
|
67
|
+
this.id = e, this.ingredients = new T({
|
|
68
68
|
indexMap: {
|
|
69
69
|
ingredientType: "type"
|
|
70
70
|
},
|
|
71
|
-
extensionId:
|
|
71
|
+
extensionId: g.IngredientIndex,
|
|
72
72
|
parentId: e
|
|
73
73
|
});
|
|
74
74
|
}
|
|
@@ -79,31 +79,31 @@ let se = class {
|
|
|
79
79
|
return this.ingredients.getIndexByKey("ingredientType", e);
|
|
80
80
|
}
|
|
81
81
|
async load(e) {
|
|
82
|
-
var
|
|
83
|
-
|
|
84
|
-
const t = await
|
|
82
|
+
var i;
|
|
83
|
+
Gt.debug(`loading ingredient container ${this.id}`);
|
|
84
|
+
const t = await zt();
|
|
85
85
|
if ((t == null ? void 0 : t.status) !== 200)
|
|
86
86
|
throw new Error("Failed to load ingredients");
|
|
87
|
-
const r = await
|
|
87
|
+
const r = await U.executeLoaderExtension({
|
|
88
88
|
context: e,
|
|
89
|
-
extension:
|
|
90
|
-
}),
|
|
91
|
-
for (const s of Object.keys(
|
|
92
|
-
for (const n of ((
|
|
93
|
-
const
|
|
94
|
-
extension:
|
|
89
|
+
extension: g.IngredientLoader
|
|
90
|
+
}), a = (t == null ? void 0 : t.data) ?? {};
|
|
91
|
+
for (const s of Object.keys(a))
|
|
92
|
+
for (const n of ((i = t == null ? void 0 : t.data) == null ? void 0 : i[s]) || []) {
|
|
93
|
+
const l = await U.executeDataMapperExtension({
|
|
94
|
+
extension: g.IngredientMapper,
|
|
95
95
|
data: n,
|
|
96
96
|
contextData: r
|
|
97
|
-
}),
|
|
98
|
-
extension:
|
|
97
|
+
}), c = await U.executePropertyMapperExtension({
|
|
98
|
+
extension: g.IngredientTypeMapper,
|
|
99
99
|
data: n,
|
|
100
100
|
contextData: r
|
|
101
101
|
}), p = {
|
|
102
102
|
...n,
|
|
103
|
-
type:
|
|
104
|
-
...
|
|
105
|
-
data:
|
|
106
|
-
}, u =
|
|
103
|
+
type: c || n.type,
|
|
104
|
+
...l,
|
|
105
|
+
data: l
|
|
106
|
+
}, u = Ve.factory(n.id)(
|
|
107
107
|
p
|
|
108
108
|
);
|
|
109
109
|
this.ingredients.addModel(u);
|
|
@@ -111,100 +111,100 @@ let se = class {
|
|
|
111
111
|
}
|
|
112
112
|
// -------------------ENTITY----------------------------
|
|
113
113
|
};
|
|
114
|
-
|
|
114
|
+
ke([
|
|
115
115
|
_
|
|
116
116
|
], se.prototype, "ingredients", 2);
|
|
117
|
-
se =
|
|
118
|
-
|
|
117
|
+
se = ke([
|
|
118
|
+
y(V)
|
|
119
119
|
], se);
|
|
120
|
-
const
|
|
120
|
+
const Ye = {
|
|
121
121
|
registration: {
|
|
122
|
-
[
|
|
122
|
+
[V]: {
|
|
123
123
|
class: se,
|
|
124
124
|
singleton: !0
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
|
-
type:
|
|
128
|
-
predicate: b(
|
|
129
|
-
factory: v.Singleton.create(
|
|
130
|
-
}, { URL: ye } =
|
|
127
|
+
type: V,
|
|
128
|
+
predicate: b(V),
|
|
129
|
+
factory: v.Singleton.create(V)
|
|
130
|
+
}, { URL: ye } = D("HOLDER_SERVICE"), { getAll: jt, postModel: Ze, deleteModel: Ft } = S.build({
|
|
131
131
|
basePath: `${ye}/api/kos/holders`
|
|
132
|
-
}),
|
|
132
|
+
}), Ht = m.createLogger({
|
|
133
133
|
name: "holder-service",
|
|
134
134
|
group: "Services"
|
|
135
|
-
}),
|
|
135
|
+
}), da = async () => await jt({}), Vt = async (e, t) => {
|
|
136
136
|
if (!e || !t)
|
|
137
137
|
throw new Error("Missing holderPath or ingredientId");
|
|
138
|
-
return await
|
|
138
|
+
return await Ze({
|
|
139
139
|
model: { holderPath: e, ingredientId: t },
|
|
140
140
|
urlOverride: `${ye}/api/ext/dispense/assignments`
|
|
141
141
|
});
|
|
142
|
-
},
|
|
142
|
+
}, Kt = async (e) => {
|
|
143
143
|
if (!e)
|
|
144
144
|
throw new Error("Missing holderPath");
|
|
145
|
-
return await
|
|
145
|
+
return await Ft({
|
|
146
146
|
id: e,
|
|
147
147
|
urlOverride: `${ye}/api/ext/dispense/assignments/${e}`
|
|
148
148
|
});
|
|
149
|
-
},
|
|
149
|
+
}, kt = async (e) => {
|
|
150
150
|
if (!e)
|
|
151
151
|
throw new Error("Missing holderPath");
|
|
152
|
-
return
|
|
152
|
+
return Ht.debug(
|
|
153
153
|
`sending POST request to /api/ext/dispense/pumpEvents/replaceLine/${e}`
|
|
154
|
-
), await
|
|
154
|
+
), await Ze({
|
|
155
155
|
model: {},
|
|
156
156
|
urlOverride: `${ye}/api/ext/dispense/pumpEvents/replaceLine/${e}`
|
|
157
157
|
});
|
|
158
|
-
}, { URL: ne } =
|
|
158
|
+
}, { URL: ne } = D("ASSIGNMENT_SERVICE"), { getAll: Yt, postModel: Xe, deleteModel: Zt } = S.build({
|
|
159
159
|
destinationAddress: "",
|
|
160
160
|
basePath: `${ne}/api/ext/dispense/assignments`
|
|
161
|
-
}), oe = window.kosUseFos,
|
|
162
|
-
var
|
|
163
|
-
const r = JSON.stringify(t),
|
|
161
|
+
}), oe = window.kosUseFos, la = async () => await Yt({ fos: oe }), Xt = async (e, t) => {
|
|
162
|
+
var i, s, n, l;
|
|
163
|
+
const r = JSON.stringify(t), a = `${ne}/api/ext/dispense/assignments`;
|
|
164
164
|
try {
|
|
165
|
-
const
|
|
165
|
+
const c = await Xe({
|
|
166
166
|
model: { holderPath: e, factoryJson: r },
|
|
167
|
-
urlOverride:
|
|
167
|
+
urlOverride: a
|
|
168
168
|
});
|
|
169
|
-
return (
|
|
170
|
-
} catch (
|
|
171
|
-
if (
|
|
169
|
+
return (c == null ? void 0 : c.status) === 200 && ((i = c == null ? void 0 : c.data) != null && i.error) ? [c.data.error || "unknownError", c.data] : [void 0, c == null ? void 0 : c.data];
|
|
170
|
+
} catch (c) {
|
|
171
|
+
if (c instanceof yt)
|
|
172
172
|
return [
|
|
173
|
-
((n = (s =
|
|
174
|
-
(
|
|
173
|
+
((n = (s = c.payload) == null ? void 0 : s.data) == null ? void 0 : n.error) || "unknownError",
|
|
174
|
+
(l = c.payload) == null ? void 0 : l.data
|
|
175
175
|
];
|
|
176
176
|
}
|
|
177
177
|
return ["unknownError", void 0];
|
|
178
|
-
},
|
|
178
|
+
}, ca = async (e) => {
|
|
179
179
|
const t = oe ? `${ne}/api/ingredients/assignments/${e.holderPath}` : `${ne}/api/ext/dispense/assignments`;
|
|
180
|
-
return await
|
|
180
|
+
return await Xe({
|
|
181
181
|
model: { ...e, fuelGauge: 680 },
|
|
182
182
|
fos: oe,
|
|
183
183
|
urlOverride: t
|
|
184
184
|
});
|
|
185
|
-
},
|
|
186
|
-
var
|
|
187
|
-
for (var
|
|
188
|
-
(n = e[s]) && (
|
|
189
|
-
return
|
|
185
|
+
}, pa = async (e) => await Zt({ id: e, fos: oe });
|
|
186
|
+
var Jt = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, we = (e, t, r, a) => {
|
|
187
|
+
for (var i = a > 1 ? void 0 : a ? qt(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
188
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
189
|
+
return a && i && Jt(t, r, i), i;
|
|
190
190
|
};
|
|
191
|
-
const
|
|
192
|
-
|
|
191
|
+
const K = L.Holder, Le = m.createLogger({ name: "holder-model" });
|
|
192
|
+
P[Me].register(
|
|
193
193
|
"holder",
|
|
194
194
|
async (e) => {
|
|
195
195
|
const t = [];
|
|
196
196
|
return t.push(...e.data.holderPaths), t;
|
|
197
197
|
}
|
|
198
198
|
);
|
|
199
|
-
|
|
199
|
+
P[te].register(
|
|
200
200
|
"pump",
|
|
201
201
|
async (e) => {
|
|
202
202
|
if (e.data.pumpPath) {
|
|
203
|
-
const { model: t } =
|
|
203
|
+
const { model: t } = x(
|
|
204
204
|
e.data.pumpPath
|
|
205
205
|
);
|
|
206
206
|
if (t) {
|
|
207
|
-
const r = t.ingredientId ?
|
|
207
|
+
const r = t.ingredientId ? x(t.ingredientId).model : void 0;
|
|
208
208
|
return {
|
|
209
209
|
ingredientId: t.ingredientId,
|
|
210
210
|
ingredientName: (r == null ? void 0 : r.displayName) ?? ((r == null ? void 0 : r.name) || ""),
|
|
@@ -215,17 +215,17 @@ g[ee].register(
|
|
|
215
215
|
return {};
|
|
216
216
|
}
|
|
217
217
|
);
|
|
218
|
-
|
|
218
|
+
P[te].register(
|
|
219
219
|
"holder",
|
|
220
220
|
async (e) => e.data.holderNames.length > 0 ? {
|
|
221
221
|
holderName: e.data.holderNames[0] || ""
|
|
222
222
|
} : {}
|
|
223
223
|
);
|
|
224
|
-
|
|
224
|
+
P[te].register(
|
|
225
225
|
"container",
|
|
226
226
|
async (e) => {
|
|
227
227
|
if (e.data.ingredients.length > 0) {
|
|
228
|
-
const t = e.data.ingredients[0], { model: r } =
|
|
228
|
+
const t = e.data.ingredients[0], { model: r } = x(t);
|
|
229
229
|
return {
|
|
230
230
|
ingredientName: (r == null ? void 0 : r.displayName) ?? ((r == null ? void 0 : r.name) || ""),
|
|
231
231
|
ingredients: e.data.ingredients ? e.data.ingredients : [],
|
|
@@ -235,23 +235,23 @@ g[ee].register(
|
|
|
235
235
|
return {};
|
|
236
236
|
}
|
|
237
237
|
);
|
|
238
|
-
class
|
|
239
|
-
constructor(r,
|
|
240
|
-
super(
|
|
238
|
+
class Wt extends Error {
|
|
239
|
+
constructor(r, a) {
|
|
240
|
+
super(a);
|
|
241
241
|
o(this, "type");
|
|
242
242
|
this.name = "AssignmentError", this.type = r;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
let
|
|
245
|
+
let ee = class {
|
|
246
246
|
constructor(e, {
|
|
247
247
|
path: t,
|
|
248
248
|
name: r,
|
|
249
|
-
ingredientSource:
|
|
250
|
-
ingredientId:
|
|
249
|
+
ingredientSource: a,
|
|
250
|
+
ingredientId: i,
|
|
251
251
|
ingredientType: s,
|
|
252
252
|
slice: n,
|
|
253
|
-
group:
|
|
254
|
-
data:
|
|
253
|
+
group: l,
|
|
254
|
+
data: c,
|
|
255
255
|
enjoyByDate: p
|
|
256
256
|
}, u) {
|
|
257
257
|
o(this, "id");
|
|
@@ -267,7 +267,7 @@ let Q = class {
|
|
|
267
267
|
o(this, "enjoyByDate");
|
|
268
268
|
o(this, "pumps");
|
|
269
269
|
o(this, "ingredientContainer");
|
|
270
|
-
this.id = e, this.path = t, this.name = r, this.ingredientType = s, this.ingredientSource =
|
|
270
|
+
this.id = e, this.path = t, this.name = r, this.ingredientType = s, this.ingredientSource = a, this.ingredientId = i, this.group = l, this.slice = n, this.enjoyByDate = p, this.data = c, this.pumps = new T({
|
|
271
271
|
parentId: e,
|
|
272
272
|
sortKey: "path"
|
|
273
273
|
}), this.logger = u.logger;
|
|
@@ -276,14 +276,14 @@ let Q = class {
|
|
|
276
276
|
path: e,
|
|
277
277
|
name: t,
|
|
278
278
|
ingredientSource: r,
|
|
279
|
-
ingredientId:
|
|
280
|
-
ingredientType:
|
|
279
|
+
ingredientId: a,
|
|
280
|
+
ingredientType: i,
|
|
281
281
|
group: s,
|
|
282
282
|
slice: n,
|
|
283
|
-
enjoyByDate:
|
|
284
|
-
data:
|
|
283
|
+
enjoyByDate: l,
|
|
284
|
+
data: c
|
|
285
285
|
}) {
|
|
286
|
-
this.path = e, this.name = t, this.ingredientId =
|
|
286
|
+
this.path = e, this.name = t, this.ingredientId = a, this.ingredientType = i, this.ingredientSource = r, this.enjoyByDate = l, this.slice = n, this.group = s, this.data = c;
|
|
287
287
|
}
|
|
288
288
|
get hasEnjoyByDate() {
|
|
289
289
|
return !!this.enjoyByDate && !this.unassigned;
|
|
@@ -308,8 +308,8 @@ let Q = class {
|
|
|
308
308
|
return this.logger.debug(`isPouring: ${!!e}`), e;
|
|
309
309
|
}
|
|
310
310
|
async performIntent(e) {
|
|
311
|
-
const t = typeof e == "string" ? e : e.intent, r = typeof e == "string" ? void 0 : e.pumpPath,
|
|
312
|
-
return
|
|
311
|
+
const t = typeof e == "string" ? e : e.intent, r = typeof e == "string" ? void 0 : e.pumpPath, a = r ? this.pumps.getModel(r) : this.pumps.data[0];
|
|
312
|
+
return a == null ? void 0 : a.performIntent({ intent: t });
|
|
313
313
|
}
|
|
314
314
|
get pourState() {
|
|
315
315
|
return this.pumps.data.reduce((t, r) => r.pouringState ? r.pouringState : t, "");
|
|
@@ -383,9 +383,9 @@ let Q = class {
|
|
|
383
383
|
if (!e)
|
|
384
384
|
throw new Error("Invalid override");
|
|
385
385
|
try {
|
|
386
|
-
const [t, r] = await
|
|
386
|
+
const [t, r] = await Xt(this.path, e);
|
|
387
387
|
if (t)
|
|
388
|
-
throw new
|
|
388
|
+
throw new Wt(
|
|
389
389
|
t,
|
|
390
390
|
`Failed to perform rfid override on holder ${this.id}`
|
|
391
391
|
);
|
|
@@ -398,7 +398,7 @@ let Q = class {
|
|
|
398
398
|
}
|
|
399
399
|
async assignIngredient(e) {
|
|
400
400
|
try {
|
|
401
|
-
e ? await
|
|
401
|
+
e ? await Vt(this.path, e) : await Kt(this.path), O(() => {
|
|
402
402
|
this.ingredientId = e;
|
|
403
403
|
});
|
|
404
404
|
} catch (t) {
|
|
@@ -409,7 +409,7 @@ let Q = class {
|
|
|
409
409
|
return this.troubles.some((e) => e.shouldDefer);
|
|
410
410
|
}
|
|
411
411
|
async replaceLine() {
|
|
412
|
-
await
|
|
412
|
+
await kt(this.path);
|
|
413
413
|
}
|
|
414
414
|
// -------------------LIFECYCLE----------------------------
|
|
415
415
|
// ----------------------------------
|
|
@@ -433,68 +433,68 @@ let Q = class {
|
|
|
433
433
|
};
|
|
434
434
|
we([
|
|
435
435
|
_
|
|
436
|
-
],
|
|
436
|
+
], ee.prototype, "pumps", 2);
|
|
437
437
|
we([
|
|
438
|
-
|
|
439
|
-
],
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
],
|
|
444
|
-
const
|
|
438
|
+
Be({ modelType: Ye.type })
|
|
439
|
+
], ee.prototype, "ingredientContainer", 2);
|
|
440
|
+
ee = we([
|
|
441
|
+
y(K),
|
|
442
|
+
It()
|
|
443
|
+
], ee);
|
|
444
|
+
const Je = {
|
|
445
445
|
registration: {
|
|
446
|
-
[
|
|
447
|
-
class:
|
|
446
|
+
[K]: {
|
|
447
|
+
class: ee,
|
|
448
448
|
singleton: !1
|
|
449
449
|
}
|
|
450
450
|
},
|
|
451
|
-
type:
|
|
452
|
-
predicate: b(
|
|
453
|
-
factory: v.Factory.create(
|
|
454
|
-
},
|
|
451
|
+
type: K,
|
|
452
|
+
predicate: b(K),
|
|
453
|
+
factory: v.Factory.create(K)
|
|
454
|
+
}, Qt = async (e, t) => {
|
|
455
455
|
var Se;
|
|
456
|
-
const r =
|
|
457
|
-
|
|
456
|
+
const r = P.propertyMapper.executeMapper(
|
|
457
|
+
g.HolderIngredientMapper,
|
|
458
458
|
t
|
|
459
|
-
),
|
|
460
|
-
|
|
459
|
+
), a = P.propertyMapper.executeMapper(
|
|
460
|
+
g.HolderTypeMapper,
|
|
461
461
|
t
|
|
462
|
-
) || t.ingType,
|
|
463
|
-
extension:
|
|
462
|
+
) || t.ingType, i = await U.executeDataMapperExtension({
|
|
463
|
+
extension: g.HolderMapper,
|
|
464
464
|
data: t,
|
|
465
465
|
contextData: {}
|
|
466
|
-
}), { name: s, path: n, ingredientId:
|
|
466
|
+
}), { name: s, path: n, ingredientId: l, ingType: c, ingSource: p, slice: u, ...F } = t, h = { ...F, ...i }, M = u || { pos: 0 }, C = {
|
|
467
467
|
name: s,
|
|
468
468
|
path: n,
|
|
469
|
-
ingredientId: r ||
|
|
470
|
-
ingredientType:
|
|
469
|
+
ingredientId: r || l,
|
|
470
|
+
ingredientType: a || c,
|
|
471
471
|
ingredientSource: p,
|
|
472
472
|
enjoyByDate: (Se = t.container) != null && Se.enjoyByDate ? new Date(t.container.enjoyByDate) : void 0,
|
|
473
|
-
slice:
|
|
473
|
+
slice: M,
|
|
474
474
|
group: e,
|
|
475
|
-
data:
|
|
475
|
+
data: h
|
|
476
476
|
};
|
|
477
|
-
return
|
|
478
|
-
}, { URL:
|
|
479
|
-
basePath: `${
|
|
480
|
-
}),
|
|
477
|
+
return Je.factory(t.path)(C);
|
|
478
|
+
}, { URL: er } = D("ASSEMBLY_SERVICE"), { getOne: tr } = S.build({
|
|
479
|
+
basePath: `${er}/api/kos/device/assemblies`
|
|
480
|
+
}), rr = m.createLogger({
|
|
481
481
|
name: "assembly-service",
|
|
482
482
|
group: "Services"
|
|
483
|
-
}),
|
|
484
|
-
var
|
|
485
|
-
for (var
|
|
486
|
-
(n = e[s]) && (
|
|
487
|
-
return
|
|
483
|
+
}), qe = async () => (rr.debug("sending GET for assembly"), await tr({}));
|
|
484
|
+
var ar = Object.defineProperty, ir = Object.getOwnPropertyDescriptor, Ie = (e, t, r, a) => {
|
|
485
|
+
for (var i = a > 1 ? void 0 : a ? ir(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
486
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
487
|
+
return a && i && ar(t, r, i), i;
|
|
488
488
|
};
|
|
489
|
-
const
|
|
490
|
-
let
|
|
489
|
+
const k = "board-container-model", We = "/kos/hardware/board/linked", Qe = "/kos/hardware/board/unlinked";
|
|
490
|
+
let B = class {
|
|
491
491
|
constructor(e, t, r) {
|
|
492
492
|
o(this, "id");
|
|
493
493
|
o(this, "logger");
|
|
494
494
|
o(this, "models");
|
|
495
|
-
this.id = e, this.logger = r.logger, this.models = new
|
|
495
|
+
this.id = e, this.logger = r.logger, this.models = new T({
|
|
496
496
|
parentId: e,
|
|
497
|
-
extensionId:
|
|
497
|
+
extensionId: g.BoardIndex
|
|
498
498
|
});
|
|
499
499
|
}
|
|
500
500
|
get boardList() {
|
|
@@ -517,59 +517,59 @@ let x = class {
|
|
|
517
517
|
r.updateModel(e);
|
|
518
518
|
}
|
|
519
519
|
handleBoardLinkEvent(e) {
|
|
520
|
-
this.logger.debug(`handling ${
|
|
520
|
+
this.logger.debug(`handling ${We} event ${e}`), e ? this.updateBoard(e) : this.logger.debug("- boardLinkEvent is undefined");
|
|
521
521
|
}
|
|
522
522
|
handleBoardUnlinkEvent(e) {
|
|
523
523
|
this.logger.debug(
|
|
524
|
-
`handling ${
|
|
524
|
+
`handling ${Qe} event ${e}`
|
|
525
525
|
), e ? this.updateBoard(e) : this.logger.debug("- boardLinkEvent is undefined");
|
|
526
526
|
}
|
|
527
527
|
};
|
|
528
528
|
Ie([
|
|
529
529
|
_
|
|
530
|
-
],
|
|
530
|
+
], B.prototype, "models", 2);
|
|
531
531
|
Ie([
|
|
532
|
-
|
|
532
|
+
re({
|
|
533
533
|
lifecycle: pe.INIT,
|
|
534
|
-
topic:
|
|
534
|
+
topic: We,
|
|
535
535
|
websocket: !0
|
|
536
536
|
})
|
|
537
|
-
],
|
|
537
|
+
], B.prototype, "handleBoardLinkEvent", 1);
|
|
538
538
|
Ie([
|
|
539
|
-
|
|
539
|
+
re({
|
|
540
540
|
lifecycle: pe.INIT,
|
|
541
|
-
topic:
|
|
541
|
+
topic: Qe,
|
|
542
542
|
websocket: !0
|
|
543
543
|
})
|
|
544
|
-
],
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
],
|
|
548
|
-
const
|
|
549
|
-
const t = e.data.boardPath, { model: r } =
|
|
544
|
+
], B.prototype, "handleBoardUnlinkEvent", 1);
|
|
545
|
+
B = Ie([
|
|
546
|
+
y(k)
|
|
547
|
+
], B);
|
|
548
|
+
const sr = async (e) => {
|
|
549
|
+
const t = e.data.boardPath, { model: r } = x(t);
|
|
550
550
|
return {
|
|
551
551
|
boardName: (r == null ? void 0 : r.name) || ""
|
|
552
552
|
};
|
|
553
553
|
};
|
|
554
|
-
var
|
|
555
|
-
for (var
|
|
556
|
-
(n = e[s]) && (
|
|
557
|
-
return
|
|
554
|
+
var nr = Object.defineProperty, or = Object.getOwnPropertyDescriptor, et = (e, t, r, a) => {
|
|
555
|
+
for (var i = a > 1 ? void 0 : a ? or(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
556
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
557
|
+
return a && i && nr(t, r, i), i;
|
|
558
558
|
};
|
|
559
|
-
const
|
|
560
|
-
var
|
|
559
|
+
const Y = L.PumpContainer;
|
|
560
|
+
var tt = /* @__PURE__ */ ((e) => (e.byBoard = "byBoard", e.byType = "byType", e.byNozzle = "byNozzle", e))(tt || {});
|
|
561
561
|
let de = class {
|
|
562
562
|
constructor(e, t) {
|
|
563
563
|
o(this, "id");
|
|
564
564
|
o(this, "pumps");
|
|
565
|
-
this.id = e, this.pumps = new
|
|
565
|
+
this.id = e, this.pumps = new T({
|
|
566
566
|
indexMap: {
|
|
567
567
|
byNozzle: (r) => r.nozzlePaths,
|
|
568
568
|
byBoard: (r) => r.boardPath,
|
|
569
569
|
byType: "type"
|
|
570
570
|
},
|
|
571
571
|
parentId: e,
|
|
572
|
-
extensionId:
|
|
572
|
+
extensionId: g.PumpIndex
|
|
573
573
|
});
|
|
574
574
|
}
|
|
575
575
|
/**
|
|
@@ -606,67 +606,67 @@ let de = class {
|
|
|
606
606
|
}
|
|
607
607
|
// -------------------ENTITY----------------------------
|
|
608
608
|
};
|
|
609
|
-
|
|
609
|
+
et([
|
|
610
610
|
_
|
|
611
611
|
], de.prototype, "pumps", 2);
|
|
612
|
-
de =
|
|
613
|
-
|
|
612
|
+
de = et([
|
|
613
|
+
y(Y)
|
|
614
614
|
], de);
|
|
615
615
|
const Re = {
|
|
616
616
|
registration: {
|
|
617
|
-
[
|
|
617
|
+
[Y]: {
|
|
618
618
|
class: de,
|
|
619
619
|
singleton: !0
|
|
620
620
|
}
|
|
621
621
|
},
|
|
622
|
-
type:
|
|
623
|
-
predicate: b(
|
|
622
|
+
type: Y,
|
|
623
|
+
predicate: b(Y),
|
|
624
624
|
factory: v.Singleton.create(
|
|
625
|
-
|
|
625
|
+
Y
|
|
626
626
|
)
|
|
627
|
-
},
|
|
628
|
-
const t = [], { model: r } = await
|
|
627
|
+
}, rt = async (e) => {
|
|
628
|
+
const t = [], { model: r } = await Ge(e);
|
|
629
629
|
return r && (t.push(r.boardPath), t.push(r.nozzlePath), t.push(r.holderPath)), t;
|
|
630
|
-
},
|
|
630
|
+
}, dr = async (e) => {
|
|
631
631
|
const t = [], r = e.data.pumpPath;
|
|
632
632
|
t.push(r);
|
|
633
|
-
const
|
|
634
|
-
return [...t, ...
|
|
635
|
-
},
|
|
633
|
+
const a = await rt(r);
|
|
634
|
+
return [...t, ...a];
|
|
635
|
+
}, lr = async (e) => {
|
|
636
636
|
const t = [], r = e.data.boardPath;
|
|
637
637
|
t.push(e.data.boardPath);
|
|
638
|
-
const
|
|
638
|
+
const a = await Ge(
|
|
639
639
|
Re.type
|
|
640
640
|
);
|
|
641
|
-
if (
|
|
642
|
-
const s =
|
|
643
|
-
|
|
641
|
+
if (a != null && a.model) {
|
|
642
|
+
const s = a.model.models.getIndexByKey(
|
|
643
|
+
tt.byBoard,
|
|
644
644
|
r
|
|
645
645
|
).map(
|
|
646
|
-
(
|
|
646
|
+
(l) => rt(l.path)
|
|
647
647
|
);
|
|
648
|
-
(await Promise.allSettled(s)).forEach((
|
|
649
|
-
|
|
648
|
+
(await Promise.allSettled(s)).forEach((l) => {
|
|
649
|
+
l.status === "fulfilled" && l.value.forEach((c) => t.push(c));
|
|
650
650
|
});
|
|
651
651
|
}
|
|
652
652
|
return Array.from(new Set(t));
|
|
653
653
|
};
|
|
654
|
-
var
|
|
655
|
-
for (var
|
|
656
|
-
(n = e[s]) && (
|
|
657
|
-
return
|
|
654
|
+
var cr = Object.getOwnPropertyDescriptor, pr = (e, t, r, a) => {
|
|
655
|
+
for (var i = a > 1 ? void 0 : a ? cr(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
656
|
+
(n = e[s]) && (i = n(i) || i);
|
|
657
|
+
return i;
|
|
658
658
|
};
|
|
659
|
-
const
|
|
660
|
-
const { type: r, name:
|
|
661
|
-
t.type = r, t.name =
|
|
659
|
+
const Z = "board-model", Ae = (e, t) => {
|
|
660
|
+
const { type: r, name: a, path: i, linked: s, instanceId: n, link: l, ...c } = e;
|
|
661
|
+
t.type = r, t.name = a, t.path = i, t.linked = s, t.link = Object.freeze(l), t.instanceId = n, Object.assign(t, c);
|
|
662
662
|
};
|
|
663
|
-
|
|
663
|
+
P[Me].register(
|
|
664
664
|
"board",
|
|
665
|
-
|
|
665
|
+
lr
|
|
666
666
|
);
|
|
667
|
-
|
|
667
|
+
P[te].register(
|
|
668
668
|
"board",
|
|
669
|
-
|
|
669
|
+
sr
|
|
670
670
|
);
|
|
671
671
|
let Oe = class {
|
|
672
672
|
constructor(e, t, r) {
|
|
@@ -690,78 +690,78 @@ let Oe = class {
|
|
|
690
690
|
this.logger.debug(`loading board ${this.id}`);
|
|
691
691
|
}
|
|
692
692
|
};
|
|
693
|
-
Oe =
|
|
694
|
-
|
|
693
|
+
Oe = pr([
|
|
694
|
+
y(Z)
|
|
695
695
|
], Oe);
|
|
696
|
-
const
|
|
696
|
+
const at = {
|
|
697
697
|
registration: {
|
|
698
|
-
[
|
|
698
|
+
[Z]: {
|
|
699
699
|
class: Oe,
|
|
700
700
|
singleton: !1
|
|
701
701
|
}
|
|
702
702
|
},
|
|
703
|
-
type:
|
|
704
|
-
predicate: b(
|
|
705
|
-
factory: v.Factory.create(
|
|
703
|
+
type: Z,
|
|
704
|
+
predicate: b(Z),
|
|
705
|
+
factory: v.Factory.create(Z)
|
|
706
706
|
}, it = {
|
|
707
707
|
registration: {
|
|
708
|
-
[
|
|
709
|
-
class:
|
|
708
|
+
[k]: {
|
|
709
|
+
class: B,
|
|
710
710
|
singleton: !0
|
|
711
711
|
},
|
|
712
|
-
...
|
|
712
|
+
...at.registration
|
|
713
713
|
},
|
|
714
|
-
type:
|
|
715
|
-
predicate: b(
|
|
714
|
+
type: k,
|
|
715
|
+
predicate: b(k),
|
|
716
716
|
factory: v.Singleton.create(
|
|
717
|
-
|
|
717
|
+
k
|
|
718
718
|
)
|
|
719
719
|
};
|
|
720
|
-
var
|
|
721
|
-
for (var
|
|
722
|
-
(n = e[s]) && (
|
|
723
|
-
return
|
|
720
|
+
var hr = Object.defineProperty, gr = Object.getOwnPropertyDescriptor, me = (e, t, r, a) => {
|
|
721
|
+
for (var i = a > 1 ? void 0 : a ? gr(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
722
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
723
|
+
return a && i && hr(t, r, i), i;
|
|
724
724
|
};
|
|
725
|
-
const
|
|
726
|
-
let
|
|
725
|
+
const X = L.HolderContainer, ur = "/kos/insertion/insert/start", Pr = "/kos/insertion/insert/complete", yr = "/kos/insertion/insert/update", Ir = "/kos/insertion/remove", mr = "/kos/pumpEvent/replaceLine", fr = "/kos/handle/*";
|
|
726
|
+
let G = class {
|
|
727
727
|
constructor(e, t, r) {
|
|
728
728
|
o(this, "id");
|
|
729
729
|
o(this, "holders");
|
|
730
730
|
o(this, "logger");
|
|
731
|
-
this.id = e, this.holders = new
|
|
731
|
+
this.id = e, this.holders = new T({
|
|
732
732
|
indexMap: {
|
|
733
|
-
nozzle: (
|
|
733
|
+
nozzle: (a) => a.nozzlePaths,
|
|
734
734
|
group: "group"
|
|
735
735
|
},
|
|
736
736
|
parentId: e,
|
|
737
|
-
extensionId:
|
|
737
|
+
extensionId: g.HolderIndex
|
|
738
738
|
}), this.logger = r.logger;
|
|
739
739
|
}
|
|
740
740
|
updateModel() {
|
|
741
741
|
}
|
|
742
742
|
handleHolderEvents(e) {
|
|
743
|
-
var r,
|
|
743
|
+
var r, a, i;
|
|
744
744
|
m.ifDebug(
|
|
745
745
|
() => this.logger.debug("Received holder change event", JSON.stringify(e))
|
|
746
746
|
);
|
|
747
747
|
const t = this.holders.getModel(e.path);
|
|
748
748
|
t && (this.logger.info(
|
|
749
749
|
`Received change event for holder ${t.path}. Updating fuel gauge data.`
|
|
750
|
-
), t.slice.currentVolMl = (r = e.slice) == null ? void 0 : r.currentVolMl, t.slice.maxVolMl = (
|
|
750
|
+
), t.slice.currentVolMl = (r = e.slice) == null ? void 0 : r.currentVolMl, t.slice.maxVolMl = (a = e.slice) == null ? void 0 : a.maxVolMl, (i = e == null ? void 0 : e.container) != null && i.enjoyByDate ? t.enjoyByDate = new Date(e.container.enjoyByDate) : t.enjoyByDate = void 0);
|
|
751
751
|
}
|
|
752
752
|
handleInsertion(e) {
|
|
753
753
|
m.ifDebug(
|
|
754
754
|
() => this.logger.debug("Received insertion event", JSON.stringify(e))
|
|
755
755
|
), (Array.isArray(e) ? e : [e]).forEach((r) => {
|
|
756
756
|
O(() => {
|
|
757
|
-
var s, n,
|
|
758
|
-
const
|
|
759
|
-
|
|
760
|
-
`Received insertion event for holder ${
|
|
761
|
-
),
|
|
757
|
+
var s, n, l;
|
|
758
|
+
const a = r.ingredientId, i = this.holders.getModel(r.path);
|
|
759
|
+
i && (this.logger.info(
|
|
760
|
+
`Received insertion event for holder ${i.path}`
|
|
761
|
+
), i.updateIngredient(a), i.slice.currentVolMl = (s = r.slice) == null ? void 0 : s.currentVolMl, i.slice.maxVolMl = (n = r.slice) == null ? void 0 : n.maxVolMl, (l = r == null ? void 0 : r.container) != null && l.enjoyByDate ? i.enjoyByDate = new Date(r.container.enjoyByDate) : i.enjoyByDate = void 0, r.pumps.forEach((c) => {
|
|
762
762
|
O(() => {
|
|
763
|
-
const p =
|
|
764
|
-
p && (p.ingredientId =
|
|
763
|
+
const p = i.pumps.getModel(c.path);
|
|
764
|
+
p && (p.ingredientId = c.ingredientId, p.inserted = c.inserted, p.prevIngredientId = c.prevIngredientId);
|
|
765
765
|
});
|
|
766
766
|
}));
|
|
767
767
|
});
|
|
@@ -771,88 +771,88 @@ let B = class {
|
|
|
771
771
|
};
|
|
772
772
|
me([
|
|
773
773
|
_
|
|
774
|
-
],
|
|
774
|
+
], G.prototype, "holders", 2);
|
|
775
775
|
me([
|
|
776
|
-
|
|
777
|
-
topic:
|
|
776
|
+
re({
|
|
777
|
+
topic: fr,
|
|
778
778
|
websocket: !0,
|
|
779
779
|
condition: (e, t) => t.holders.getModel(e.path) !== void 0
|
|
780
780
|
})
|
|
781
|
-
],
|
|
781
|
+
], G.prototype, "handleHolderEvents", 1);
|
|
782
782
|
me([
|
|
783
|
-
|
|
783
|
+
re({
|
|
784
784
|
topic: [
|
|
785
|
-
gr,
|
|
786
785
|
ur,
|
|
787
786
|
Pr,
|
|
788
787
|
yr,
|
|
789
|
-
Ir
|
|
788
|
+
Ir,
|
|
789
|
+
mr
|
|
790
790
|
],
|
|
791
791
|
websocket: !0
|
|
792
792
|
})
|
|
793
|
-
],
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
],
|
|
797
|
-
const
|
|
793
|
+
], G.prototype, "handleInsertion", 1);
|
|
794
|
+
G = me([
|
|
795
|
+
y(X)
|
|
796
|
+
], G);
|
|
797
|
+
const st = {
|
|
798
798
|
registration: {
|
|
799
|
-
[
|
|
800
|
-
class:
|
|
799
|
+
[X]: {
|
|
800
|
+
class: G,
|
|
801
801
|
singleton: !0
|
|
802
802
|
}
|
|
803
803
|
},
|
|
804
|
-
type:
|
|
805
|
-
predicate: b(
|
|
804
|
+
type: X,
|
|
805
|
+
predicate: b(X),
|
|
806
806
|
factory: v.Singleton.create(
|
|
807
|
-
|
|
807
|
+
X
|
|
808
808
|
)
|
|
809
|
-
},
|
|
810
|
-
const t = await
|
|
811
|
-
extension:
|
|
809
|
+
}, vr = m.createLogger({ name: "board-utils" }), br = async (e) => {
|
|
810
|
+
const t = await U.executeDataMapperExtension({
|
|
811
|
+
extension: g.BoardMapper,
|
|
812
812
|
data: e,
|
|
813
813
|
contextData: {}
|
|
814
|
-
}), { type: r, name:
|
|
814
|
+
}), { type: r, name: a, path: i, linked: s, instanceId: n, ...l } = e, c = { ...l, ...t }, p = {
|
|
815
815
|
type: r,
|
|
816
|
-
name:
|
|
817
|
-
path:
|
|
816
|
+
name: a,
|
|
817
|
+
path: i,
|
|
818
818
|
linked: s,
|
|
819
819
|
instanceId: n,
|
|
820
|
-
...
|
|
821
|
-
}, u =
|
|
820
|
+
...c
|
|
821
|
+
}, u = at.factory(e.path)(p);
|
|
822
822
|
return u.updateModel(p), u;
|
|
823
|
-
},
|
|
824
|
-
|
|
825
|
-
const r = await
|
|
823
|
+
}, Or = (e) => async (t) => {
|
|
824
|
+
vr.debug(`adding board ${t.name}`);
|
|
825
|
+
const r = await br(t);
|
|
826
826
|
e.addModel(r);
|
|
827
827
|
};
|
|
828
828
|
var d = /* @__PURE__ */ ((e) => (e.IDLE = "IDLE", e.POURING = "POURING", e.POUR_STARTING = "POUR_STARTING", e.POUR_CANCELING = "POUR_CANCELING", e))(d || {});
|
|
829
|
-
const { URL: Ce } =
|
|
829
|
+
const { URL: Ce } = D("PUMP_SERVICE"), { postModel: _r, getOne: Er } = S.build({
|
|
830
830
|
basePath: `${Ce}/api/kos/holders`
|
|
831
831
|
});
|
|
832
832
|
m.createLogger({
|
|
833
833
|
name: "pump-service",
|
|
834
834
|
group: "Services"
|
|
835
835
|
});
|
|
836
|
-
const
|
|
836
|
+
const Mr = async ({
|
|
837
837
|
intent: e,
|
|
838
838
|
pumpId: t,
|
|
839
839
|
tracker: r
|
|
840
840
|
}) => {
|
|
841
|
-
const
|
|
842
|
-
return
|
|
843
|
-
},
|
|
844
|
-
const r = `${Ce}/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/intent/${e}/${t}/volume`,
|
|
845
|
-
return
|
|
841
|
+
const a = `${Ce}/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/pour/${t}/${e}`, i = await _r({ model: {}, urlOverride: a, tracker: r });
|
|
842
|
+
return i != null && i.data && he.initiateFuture(i.data), i;
|
|
843
|
+
}, wr = async (e, t) => {
|
|
844
|
+
const r = `${Ce}/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/intent/${e}/${t}/volume`, a = await Er({ urlOverride: r });
|
|
845
|
+
return a != null && a.data ? a.data : { volume: -1 };
|
|
846
846
|
};
|
|
847
|
-
var
|
|
848
|
-
for (var
|
|
849
|
-
(n = e[s]) && (
|
|
850
|
-
return
|
|
847
|
+
var Rr = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, nt = (e, t, r, a) => {
|
|
848
|
+
for (var i = a > 1 ? void 0 : a ? Cr(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
849
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
850
|
+
return a && i && Rr(t, r, i), i;
|
|
851
851
|
};
|
|
852
|
-
const
|
|
853
|
-
|
|
852
|
+
const J = L.Pump;
|
|
853
|
+
P[Me].register(
|
|
854
854
|
"pump",
|
|
855
|
-
|
|
855
|
+
dr
|
|
856
856
|
);
|
|
857
857
|
let le = class {
|
|
858
858
|
constructor(e, t) {
|
|
@@ -868,35 +868,37 @@ let le = class {
|
|
|
868
868
|
o(this, "name");
|
|
869
869
|
o(this, "path");
|
|
870
870
|
o(this, "prevIngredientId");
|
|
871
|
+
o(this, "state");
|
|
871
872
|
o(this, "futureHandler");
|
|
872
873
|
o(this, "currentState", d.IDLE);
|
|
873
874
|
this.id = e;
|
|
874
875
|
const {
|
|
875
876
|
inserted: r,
|
|
876
|
-
holderPath:
|
|
877
|
-
boardPath:
|
|
877
|
+
holderPath: a,
|
|
878
|
+
boardPath: i,
|
|
878
879
|
nozzlePath: s,
|
|
879
880
|
name: n,
|
|
880
|
-
path:
|
|
881
|
-
childPump:
|
|
881
|
+
path: l,
|
|
882
|
+
childPump: c,
|
|
882
883
|
virtual: p,
|
|
883
884
|
prevIngredientId: u,
|
|
884
|
-
|
|
885
|
+
state: F,
|
|
886
|
+
...h
|
|
885
887
|
} = t;
|
|
886
|
-
this.inserted = r, this.type = t.type, this.ingredientId = t.ingredientId, this.holderPath =
|
|
888
|
+
this.inserted = r, this.type = t.type, this.ingredientId = t.ingredientId, this.holderPath = a, this.boardPath = i, this.nozzlePath = s, this.name = n, this.path = l, this.childPump = !!c, this.virtual = !!p, this.prevIngredientId = u, this.state = F, Object.assign(this, h), this.futureHandler = new je(this);
|
|
887
889
|
}
|
|
888
890
|
updateModel(e) {
|
|
889
891
|
const {
|
|
890
892
|
inserted: t,
|
|
891
893
|
holderPath: r,
|
|
892
|
-
boardPath:
|
|
893
|
-
nozzlePath:
|
|
894
|
+
boardPath: a,
|
|
895
|
+
nozzlePath: i,
|
|
894
896
|
childPump: s,
|
|
895
897
|
name: n,
|
|
896
|
-
path:
|
|
897
|
-
...
|
|
898
|
+
path: l,
|
|
899
|
+
...c
|
|
898
900
|
} = e;
|
|
899
|
-
this.inserted = t, this.type = e.type, this.ingredientId = e.ingredientId, this.holderPath = r, this.boardPath =
|
|
901
|
+
this.inserted = t, this.type = e.type, this.ingredientId = e.ingredientId, this.holderPath = r, this.boardPath = a, this.nozzlePath = i, this.childPump = this.childPump ? this.childPump : !!s, this.name = n, this.path = l, this.prevIngredientId = e.prevIngredientId, Object.assign(this, c);
|
|
900
902
|
}
|
|
901
903
|
// -------------------LIFECYCLE----------------------------
|
|
902
904
|
get pouringState() {
|
|
@@ -925,7 +927,7 @@ let le = class {
|
|
|
925
927
|
return this.futureHandler.future;
|
|
926
928
|
}
|
|
927
929
|
async resolveIntentVolume(e) {
|
|
928
|
-
return await
|
|
930
|
+
return await wr(this.path, e);
|
|
929
931
|
}
|
|
930
932
|
async performIntent(e, t) {
|
|
931
933
|
const r = typeof e == "string" ? e : e.intent;
|
|
@@ -935,40 +937,40 @@ let le = class {
|
|
|
935
937
|
if (this.currentState === d.IDLE) {
|
|
936
938
|
if (this.currentState = d.POUR_STARTING, !t)
|
|
937
939
|
throw new Error("No tracker provided");
|
|
938
|
-
const
|
|
940
|
+
const a = await Mr({
|
|
939
941
|
tracker: t,
|
|
940
942
|
intent: r,
|
|
941
943
|
pumpId: this.path
|
|
942
944
|
});
|
|
943
945
|
return this.currentState === d.POUR_STARTING && O(() => {
|
|
944
946
|
this.currentState = d.POURING;
|
|
945
|
-
}),
|
|
947
|
+
}), a == null ? void 0 : a.data;
|
|
946
948
|
} else
|
|
947
949
|
throw new Error(`Cannot pour in state ${this.currentState}`);
|
|
948
|
-
} catch (
|
|
949
|
-
throw m.error(
|
|
950
|
+
} catch (a) {
|
|
951
|
+
throw m.error(a), this.currentState = d.IDLE, a;
|
|
950
952
|
}
|
|
951
953
|
}
|
|
952
954
|
// -------------------ENTITY----------------------------
|
|
953
955
|
};
|
|
954
|
-
|
|
956
|
+
nt([
|
|
955
957
|
ge()
|
|
956
958
|
], le.prototype, "performIntent", 1);
|
|
957
|
-
le =
|
|
958
|
-
|
|
959
|
+
le = nt([
|
|
960
|
+
y(J)
|
|
959
961
|
], le);
|
|
960
|
-
const
|
|
962
|
+
const ot = {
|
|
961
963
|
registration: {
|
|
962
|
-
[
|
|
964
|
+
[J]: {
|
|
963
965
|
class: le,
|
|
964
966
|
singleton: !1
|
|
965
967
|
}
|
|
966
968
|
},
|
|
967
|
-
type:
|
|
968
|
-
predicate: b(
|
|
969
|
-
factory: v.Factory.create(
|
|
970
|
-
},
|
|
971
|
-
const r = (t.pumps ?? []).length > 1,
|
|
969
|
+
type: J,
|
|
970
|
+
predicate: b(J),
|
|
971
|
+
factory: v.Factory.create(J)
|
|
972
|
+
}, Ue = m.createLogger({ name: "pump-utils" }), $r = (e, t) => {
|
|
973
|
+
const r = (t.pumps ?? []).length > 1, a = {
|
|
972
974
|
boardPath: t.boardPath,
|
|
973
975
|
holderPath: t.holderPath,
|
|
974
976
|
ingredientId: t.ingredientId,
|
|
@@ -979,32 +981,37 @@ const nt = {
|
|
|
979
981
|
path: t.path,
|
|
980
982
|
type: t.type,
|
|
981
983
|
nozzlePath: e,
|
|
982
|
-
prevIngredientId: t.prevIngredientId
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
const
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
984
|
+
prevIngredientId: t.prevIngredientId,
|
|
985
|
+
state: t.state
|
|
986
|
+
}, i = ot.factory(t.path)(a);
|
|
987
|
+
return i.updateModel(a), i;
|
|
988
|
+
}, dt = (e) => (t) => (r) => (a) => {
|
|
989
|
+
var i;
|
|
990
|
+
try {
|
|
991
|
+
Ue.debug(`adding pump ${a.name}`);
|
|
992
|
+
const s = $r(r.path, a);
|
|
993
|
+
e.addModel(s);
|
|
994
|
+
const n = s.holderPath, l = t.holders.getModel(n);
|
|
995
|
+
l == null || l.pumps.addModel(s), l != null && l.nozzlePaths.includes(r.path) || l == null || l.nozzlePaths.push(r.path), (i = a == null ? void 0 : a.pumps) == null || i.forEach((c) => {
|
|
996
|
+
const p = s.holderPath, u = {
|
|
997
|
+
...c,
|
|
998
|
+
childPump: !0,
|
|
999
|
+
holderPath: p,
|
|
1000
|
+
ingredientId: s.ingredientId
|
|
1001
|
+
};
|
|
1002
|
+
dt(e)(t)(r)(u);
|
|
1003
|
+
});
|
|
1004
|
+
} catch (s) {
|
|
1005
|
+
throw Ue.error(`Error mapping assembly pump: ${s}`), s;
|
|
1006
|
+
}
|
|
1000
1007
|
};
|
|
1001
|
-
var
|
|
1002
|
-
for (var
|
|
1003
|
-
(n = e[s]) && (
|
|
1004
|
-
return
|
|
1008
|
+
var Nr = Object.defineProperty, Dr = Object.getOwnPropertyDescriptor, ie = (e, t, r, a) => {
|
|
1009
|
+
for (var i = a > 1 ? void 0 : a ? Dr(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1010
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
1011
|
+
return a && i && Nr(t, r, i), i;
|
|
1005
1012
|
};
|
|
1006
|
-
const
|
|
1007
|
-
let
|
|
1013
|
+
const q = "assembly-model", Sr = "assembly-data", Tr = "assembly-raw-data";
|
|
1014
|
+
let N = class {
|
|
1008
1015
|
constructor(e, t, r) {
|
|
1009
1016
|
o(this, "id");
|
|
1010
1017
|
o(this, "_nozzlePaths", /* @__PURE__ */ new Set());
|
|
@@ -1013,7 +1020,7 @@ let C = class {
|
|
|
1013
1020
|
o(this, "boardContainer");
|
|
1014
1021
|
o(this, "pumpContainer");
|
|
1015
1022
|
o(this, "logger");
|
|
1016
|
-
this.id = e, this.holderContainer =
|
|
1023
|
+
this.id = e, this.holderContainer = st.factory({}), this.boardContainer = it.factory({}), this.pumpContainer = Re.factory({}), this.logger = r.logger;
|
|
1017
1024
|
}
|
|
1018
1025
|
updateModel(e) {
|
|
1019
1026
|
}
|
|
@@ -1056,92 +1063,96 @@ let C = class {
|
|
|
1056
1063
|
}
|
|
1057
1064
|
async ready() {
|
|
1058
1065
|
var e;
|
|
1059
|
-
(e = this.troubleContainer) == null || e.troubles.increment(),
|
|
1060
|
-
|
|
1066
|
+
(e = this.troubleContainer) == null || e.troubles.increment(), P[mt].execute(
|
|
1067
|
+
g.AssemblyFeatureFlags,
|
|
1061
1068
|
this
|
|
1062
1069
|
);
|
|
1063
1070
|
}
|
|
1064
1071
|
async load(e) {
|
|
1065
1072
|
this.logger.debug(`loading assembly ${this.id}`);
|
|
1066
|
-
const t = await
|
|
1073
|
+
const t = await qe();
|
|
1067
1074
|
if ((t == null ? void 0 : t.status) === 200) {
|
|
1068
|
-
const r = await
|
|
1069
|
-
extension:
|
|
1075
|
+
const r = await U.executeDataMapperExtension({
|
|
1076
|
+
extension: g.AssemblyMapper,
|
|
1070
1077
|
data: t.data,
|
|
1071
1078
|
contextData: {}
|
|
1072
1079
|
});
|
|
1073
|
-
e.set(Sr, r), Object.assign(this, r), Object.entries(r).forEach(([
|
|
1074
|
-
|
|
1080
|
+
e.set(Sr, r), Object.assign(this, r), Object.entries(r).forEach(([a, i]) => {
|
|
1081
|
+
ft(i) && (this.logger.debug(`adding child model ${a} from extension data`), this[vt][a] = !0);
|
|
1075
1082
|
}), e.set(Tr, t.data);
|
|
1076
|
-
for await (const
|
|
1083
|
+
for await (const a of t.data.assemblies) {
|
|
1077
1084
|
const {
|
|
1078
|
-
boards:
|
|
1085
|
+
boards: i = [],
|
|
1079
1086
|
holders: s = {},
|
|
1080
1087
|
nozzles: n = [],
|
|
1081
|
-
core:
|
|
1082
|
-
name:
|
|
1088
|
+
core: l,
|
|
1089
|
+
name: c,
|
|
1083
1090
|
path: p,
|
|
1084
1091
|
...u
|
|
1085
|
-
} =
|
|
1086
|
-
this.logger.debug(`adding assembly ${
|
|
1087
|
-
|
|
1092
|
+
} = a;
|
|
1093
|
+
this.logger.debug(`adding assembly ${c}`), this.logger.warn(`Assembly rest keys: ${Object.keys(u).join(", ")}`), Object.keys(u).forEach((h) => {
|
|
1094
|
+
var M;
|
|
1095
|
+
if (this.logger.warn(`Enabling feature flag: ${h}`), bt.enableFeature(h), e.set(`assembly-feature-${h}`, u[h]), ((M = u[h].state) == null ? void 0 : M.path) !== void 0) {
|
|
1096
|
+
const C = u[h].state.path;
|
|
1097
|
+
this.logger.warn(`Feature flag ${h} state path: ${C}`), e.set(`assembly-state-path-${h}`, C);
|
|
1098
|
+
}
|
|
1088
1099
|
});
|
|
1089
|
-
for await (const
|
|
1090
|
-
this.logger.debug(`adding board ${
|
|
1091
|
-
for await (const [
|
|
1100
|
+
for await (const h of i)
|
|
1101
|
+
this.logger.debug(`adding board ${h.name}`), await Or(this.boardContainer)(h);
|
|
1102
|
+
for await (const [h, M] of Object.entries(
|
|
1092
1103
|
s ?? {}
|
|
1093
1104
|
))
|
|
1094
|
-
for await (const
|
|
1095
|
-
this.logger.debug(`adding holder ${
|
|
1096
|
-
const De = await
|
|
1105
|
+
for await (const C of M) {
|
|
1106
|
+
this.logger.debug(`adding holder ${C.name}`);
|
|
1107
|
+
const De = await Qt(h, C);
|
|
1097
1108
|
this.holderContainer.holders.addModel(De);
|
|
1098
1109
|
}
|
|
1099
|
-
const
|
|
1110
|
+
const F = dt(this.pumpContainer)(
|
|
1100
1111
|
this.holderContainer
|
|
1101
1112
|
);
|
|
1102
|
-
n.forEach((
|
|
1103
|
-
this._nozzlePaths.add(
|
|
1104
|
-
const
|
|
1105
|
-
|
|
1113
|
+
n.forEach((h) => {
|
|
1114
|
+
this._nozzlePaths.add(h.path);
|
|
1115
|
+
const M = F(h);
|
|
1116
|
+
h.pumps.forEach(M);
|
|
1106
1117
|
});
|
|
1107
1118
|
}
|
|
1108
1119
|
}
|
|
1109
1120
|
}
|
|
1110
1121
|
};
|
|
1111
1122
|
ie([
|
|
1112
|
-
|
|
1123
|
+
Be({
|
|
1113
1124
|
modelType: "trouble-container-model"
|
|
1114
1125
|
})
|
|
1115
|
-
],
|
|
1126
|
+
], N.prototype, "troubleContainer", 2);
|
|
1116
1127
|
ie([
|
|
1117
1128
|
_
|
|
1118
|
-
],
|
|
1129
|
+
], N.prototype, "holderContainer", 2);
|
|
1119
1130
|
ie([
|
|
1120
1131
|
_
|
|
1121
|
-
],
|
|
1132
|
+
], N.prototype, "boardContainer", 2);
|
|
1122
1133
|
ie([
|
|
1123
1134
|
_
|
|
1124
|
-
],
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
],
|
|
1128
|
-
const
|
|
1135
|
+
], N.prototype, "pumpContainer", 2);
|
|
1136
|
+
N = ie([
|
|
1137
|
+
y(q)
|
|
1138
|
+
], N);
|
|
1139
|
+
const lt = {
|
|
1129
1140
|
registration: {
|
|
1130
|
-
[
|
|
1131
|
-
class:
|
|
1141
|
+
[q]: {
|
|
1142
|
+
class: N,
|
|
1132
1143
|
singleton: !0
|
|
1133
1144
|
}
|
|
1134
1145
|
},
|
|
1135
|
-
type:
|
|
1136
|
-
predicate: b(
|
|
1137
|
-
factory: v.Singleton.create(
|
|
1146
|
+
type: q,
|
|
1147
|
+
predicate: b(q),
|
|
1148
|
+
factory: v.Singleton.create(q)
|
|
1138
1149
|
};
|
|
1139
|
-
var Lr = Object.getOwnPropertyDescriptor, Ar = (e, t, r,
|
|
1140
|
-
for (var
|
|
1141
|
-
(n = e[s]) && (
|
|
1142
|
-
return
|
|
1150
|
+
var Lr = Object.getOwnPropertyDescriptor, Ar = (e, t, r, a) => {
|
|
1151
|
+
for (var i = a > 1 ? void 0 : a ? Lr(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1152
|
+
(n = e[s]) && (i = n(i) || i);
|
|
1153
|
+
return i;
|
|
1143
1154
|
};
|
|
1144
|
-
const
|
|
1155
|
+
const W = L.Availability;
|
|
1145
1156
|
let _e = class {
|
|
1146
1157
|
constructor(e, t, r) {
|
|
1147
1158
|
o(this, "id");
|
|
@@ -1169,56 +1180,56 @@ let _e = class {
|
|
|
1169
1180
|
// -------------------ENTITY----------------------------
|
|
1170
1181
|
};
|
|
1171
1182
|
_e = Ar([
|
|
1172
|
-
|
|
1173
|
-
|
|
1183
|
+
Ot(),
|
|
1184
|
+
y(W)
|
|
1174
1185
|
], _e);
|
|
1175
1186
|
const Ee = {
|
|
1176
1187
|
registration: {
|
|
1177
|
-
[
|
|
1188
|
+
[W]: {
|
|
1178
1189
|
class: _e,
|
|
1179
1190
|
singleton: !1
|
|
1180
1191
|
}
|
|
1181
1192
|
},
|
|
1182
|
-
type:
|
|
1183
|
-
predicate: b(
|
|
1193
|
+
type: W,
|
|
1194
|
+
predicate: b(W),
|
|
1184
1195
|
factory: v.Factory.create(
|
|
1185
|
-
|
|
1196
|
+
W
|
|
1186
1197
|
)
|
|
1187
|
-
}, { URL:
|
|
1188
|
-
basePath: `${
|
|
1198
|
+
}, { URL: j } = D("NOZZLE_SERVICE"), { postModel: $e, deleteModel: Ur, getOne: zr } = S.build({
|
|
1199
|
+
basePath: `${j}/api/nozzle`
|
|
1189
1200
|
}), xr = async (e, t) => {
|
|
1190
|
-
const r = await
|
|
1201
|
+
const r = await $e({
|
|
1191
1202
|
model: {},
|
|
1192
|
-
urlOverride: `${
|
|
1203
|
+
urlOverride: `${j}/api/ext/dispense/nozzle/${e}/pipeline/beverage/pour`,
|
|
1193
1204
|
ordered: !0,
|
|
1194
1205
|
tracker: t
|
|
1195
1206
|
});
|
|
1196
1207
|
return r != null && r.data && he.initiateFuture(r.data), r;
|
|
1197
1208
|
}, Br = async (e, t, r) => {
|
|
1198
|
-
const
|
|
1209
|
+
const a = await $e({
|
|
1199
1210
|
model: {},
|
|
1200
|
-
urlOverride: `${
|
|
1211
|
+
urlOverride: `${j}/api/ext/dispense/nozzle/${t}/pipeline/beverage/fixed/${e}`,
|
|
1201
1212
|
ordered: !0,
|
|
1202
1213
|
tracker: r
|
|
1203
1214
|
});
|
|
1204
|
-
return
|
|
1215
|
+
return a != null && a.data && he.initiateFuture(a.data), a;
|
|
1205
1216
|
}, Gr = async (e) => await zr({
|
|
1206
|
-
urlOverride: `${
|
|
1207
|
-
}), jr = async (e, t) => await
|
|
1217
|
+
urlOverride: `${j}${e}/pipeline/beverage/availability`
|
|
1218
|
+
}), jr = async (e, t) => await $e({
|
|
1208
1219
|
model: t,
|
|
1209
|
-
urlOverride: `${
|
|
1220
|
+
urlOverride: `${j}/api/ext/dispense/nozzle/${e}/pipeline/beverage/select`
|
|
1210
1221
|
}), Fr = async (e) => await Ur({
|
|
1211
1222
|
id: e,
|
|
1212
|
-
urlOverride: `${
|
|
1223
|
+
urlOverride: `${j}/api/ext/dispense/nozzle/${e}/pipeline/beverage/select`
|
|
1213
1224
|
});
|
|
1214
|
-
var Hr = Object.defineProperty, Vr = Object.getOwnPropertyDescriptor, E = (e, t, r,
|
|
1215
|
-
for (var
|
|
1216
|
-
(n = e[s]) && (
|
|
1217
|
-
return
|
|
1225
|
+
var Hr = Object.defineProperty, Vr = Object.getOwnPropertyDescriptor, E = (e, t, r, a) => {
|
|
1226
|
+
for (var i = a > 1 ? void 0 : a ? Vr(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1227
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
1228
|
+
return a && i && Hr(t, r, i), i;
|
|
1218
1229
|
};
|
|
1219
|
-
const
|
|
1230
|
+
const Q = L.Nozzle, Kr = _t(
|
|
1220
1231
|
"beverageTopicPrefix"
|
|
1221
|
-
), fe = (e) => e.onPourStart !== void 0 && e.onPourCancel !== void 0 && e.onPourProgress !== void 0,
|
|
1232
|
+
), fe = (e) => e.onPourStart !== void 0 && e.onPourCancel !== void 0 && e.onPourProgress !== void 0, ze = "/kos/nozzle/pour/started", kr = "/kos/nozzle/pour/progress", Yr = "/kos/nozzle/pour/cancel";
|
|
1222
1233
|
let I = class {
|
|
1223
1234
|
constructor(e, t) {
|
|
1224
1235
|
/** the unique identifier for this nozzle.*/
|
|
@@ -1233,7 +1244,7 @@ let I = class {
|
|
|
1233
1244
|
o(this, "beverageTopicPrefix");
|
|
1234
1245
|
o(this, "topicPrefix");
|
|
1235
1246
|
o(this, "urlPrefix");
|
|
1236
|
-
this.id = e, this.path = t.path, this.name = t.name, this.beverageTopicPrefix = t.beverageTopicPrefix, this.topicPrefix = t.topicPrefix, this.urlPrefix = t.urlPrefix, this._selectedBeverage = void 0, this._selectedBrand = void 0, this._additionalItems = [], this.futureHandler = new
|
|
1247
|
+
this.id = e, this.path = t.path, this.name = t.name, this.beverageTopicPrefix = t.beverageTopicPrefix, this.topicPrefix = t.topicPrefix, this.urlPrefix = t.urlPrefix, this._selectedBeverage = void 0, this._selectedBrand = void 0, this._additionalItems = [], this.futureHandler = new Et(this), this._availabilityItems = new T({
|
|
1237
1248
|
indexMap: {
|
|
1238
1249
|
byGroup: "groupId",
|
|
1239
1250
|
byParent: "parentId"
|
|
@@ -1325,32 +1336,32 @@ let I = class {
|
|
|
1325
1336
|
context: r
|
|
1326
1337
|
}) {
|
|
1327
1338
|
if (!e) {
|
|
1328
|
-
const
|
|
1329
|
-
if ((
|
|
1339
|
+
const l = await Fr(this.name);
|
|
1340
|
+
if ((l == null ? void 0 : l.status) !== 200)
|
|
1330
1341
|
throw new Error("Failed to clear pourable");
|
|
1331
1342
|
this._selectedBeverage = void 0;
|
|
1332
1343
|
return;
|
|
1333
1344
|
}
|
|
1334
|
-
if (e === this._selectedBeverage &&
|
|
1345
|
+
if (e === this._selectedBeverage && Mt(this._additionalItems, t)) {
|
|
1335
1346
|
this.logger.info("No change in selected pourable");
|
|
1336
1347
|
return;
|
|
1337
1348
|
}
|
|
1338
1349
|
this._selectedBeverage = e, this._additionalItems = t;
|
|
1339
|
-
let
|
|
1340
|
-
|
|
1350
|
+
let a = await P.dataMapper.executeMapper(
|
|
1351
|
+
g.SelectedPourableMapper,
|
|
1341
1352
|
{
|
|
1342
1353
|
beverage: e,
|
|
1343
1354
|
additional: t,
|
|
1344
1355
|
context: r
|
|
1345
1356
|
}
|
|
1346
1357
|
);
|
|
1347
|
-
const
|
|
1358
|
+
const i = {
|
|
1348
1359
|
bevId: e.rawId
|
|
1349
1360
|
};
|
|
1350
|
-
(!
|
|
1351
|
-
`No selected pourable mapper defined, using the default payload ${
|
|
1352
|
-
),
|
|
1353
|
-
const s =
|
|
1361
|
+
(!a || Object.keys(a).length === 0) && (this.logger.info(
|
|
1362
|
+
`No selected pourable mapper defined, using the default payload ${i}`
|
|
1363
|
+
), a = i);
|
|
1364
|
+
const s = a ?? i, n = await jr(this.name, s);
|
|
1354
1365
|
if ((n == null ? void 0 : n.status) !== 200)
|
|
1355
1366
|
throw new Error("Failed to select pourable");
|
|
1356
1367
|
}
|
|
@@ -1385,7 +1396,7 @@ let I = class {
|
|
|
1385
1396
|
);
|
|
1386
1397
|
}
|
|
1387
1398
|
handlePouringStart() {
|
|
1388
|
-
this.logger.info("Pour started"),
|
|
1399
|
+
this.logger.info("Pour started"), z(this).forEach((e) => {
|
|
1389
1400
|
var t;
|
|
1390
1401
|
fe(e) && ((t = e.onPourStart) == null || t.call(e));
|
|
1391
1402
|
});
|
|
@@ -1397,21 +1408,21 @@ let I = class {
|
|
|
1397
1408
|
this.logger.info("Pour canceling");
|
|
1398
1409
|
}
|
|
1399
1410
|
handleCanceled() {
|
|
1400
|
-
this.logger.info("Pour canceled"),
|
|
1411
|
+
this.logger.info("Pour canceled"), z(this).forEach((t) => {
|
|
1401
1412
|
var r;
|
|
1402
1413
|
fe(t) && ((r = t.onPourCancel) == null || r.call(t));
|
|
1403
1414
|
});
|
|
1404
1415
|
const e = {
|
|
1405
1416
|
nozzleId: this.id
|
|
1406
1417
|
};
|
|
1407
|
-
|
|
1418
|
+
$.publish(Yr, e);
|
|
1408
1419
|
}
|
|
1409
1420
|
// ============================================================================
|
|
1410
1421
|
// Future Lifecycle Handler
|
|
1411
1422
|
// ============================================================================
|
|
1412
1423
|
onFutureUpdate(e) {
|
|
1413
|
-
|
|
1414
|
-
fe(
|
|
1424
|
+
z(this).forEach((a) => {
|
|
1425
|
+
fe(a) && a.onPourProgress(e);
|
|
1415
1426
|
});
|
|
1416
1427
|
const r = {
|
|
1417
1428
|
nozzleId: this.id,
|
|
@@ -1424,7 +1435,7 @@ let I = class {
|
|
|
1424
1435
|
reason: e.reason,
|
|
1425
1436
|
timeRemaining: e.timeRemaining
|
|
1426
1437
|
};
|
|
1427
|
-
|
|
1438
|
+
$.publish(kr, r), e.endState && O(() => {
|
|
1428
1439
|
this.currentState === d.POURING && this.transition("POUR_COMPLETED");
|
|
1429
1440
|
});
|
|
1430
1441
|
}
|
|
@@ -1436,11 +1447,11 @@ let I = class {
|
|
|
1436
1447
|
throw new Error("No tracker provided");
|
|
1437
1448
|
const r = await xr(this.name, e);
|
|
1438
1449
|
this.transition("POUR_ACTIVE");
|
|
1439
|
-
const
|
|
1450
|
+
const a = {
|
|
1440
1451
|
nozzleId: this.id,
|
|
1441
1452
|
type: "free"
|
|
1442
1453
|
};
|
|
1443
|
-
return
|
|
1454
|
+
return $.publish(ze, a), (t = r == null ? void 0 : r.data) != null && t.endState && this.transition("POUR_COMPLETED"), r;
|
|
1444
1455
|
} catch (r) {
|
|
1445
1456
|
throw this.logger.error(r), this.currentState !== d.IDLE && this.transition("POUR_COMPLETED"), r;
|
|
1446
1457
|
}
|
|
@@ -1451,15 +1462,15 @@ let I = class {
|
|
|
1451
1462
|
try {
|
|
1452
1463
|
if (this.transition("START_POUR"), !t)
|
|
1453
1464
|
throw new Error("No tracker provided");
|
|
1454
|
-
const
|
|
1465
|
+
const a = await Br(e, this.name, t);
|
|
1455
1466
|
this.transition("POUR_ACTIVE");
|
|
1456
|
-
const
|
|
1467
|
+
const i = {
|
|
1457
1468
|
nozzleId: this.id,
|
|
1458
1469
|
type: "fixed"
|
|
1459
1470
|
};
|
|
1460
|
-
return
|
|
1461
|
-
} catch (
|
|
1462
|
-
throw this.logger.error(
|
|
1471
|
+
return $.publish(ze, i), (r = a == null ? void 0 : a.data) != null && r.endState && this.transition("POUR_COMPLETED"), a;
|
|
1472
|
+
} catch (a) {
|
|
1473
|
+
throw this.logger.error(a), this.currentState !== d.IDLE && this.transition("POUR_COMPLETED"), a;
|
|
1463
1474
|
}
|
|
1464
1475
|
}
|
|
1465
1476
|
// Inherits throwOnInvalid: false - silently ignore if already idle
|
|
@@ -1470,105 +1481,105 @@ let I = class {
|
|
|
1470
1481
|
updateGroupMembers() {
|
|
1471
1482
|
this._availabilityItems.data.forEach((e) => {
|
|
1472
1483
|
(e.taggedIds || []).forEach((r) => {
|
|
1473
|
-
const
|
|
1474
|
-
(
|
|
1484
|
+
const a = this._availabilityItems.data.find(
|
|
1485
|
+
(i) => i.rawId === r
|
|
1475
1486
|
);
|
|
1476
|
-
|
|
1487
|
+
a && a.parentId !== e.id && (a.parentId = e.id, this._availabilityItems.updateModel(a));
|
|
1477
1488
|
});
|
|
1478
1489
|
});
|
|
1479
1490
|
}
|
|
1480
1491
|
/** @internal */
|
|
1481
1492
|
async load(e) {
|
|
1482
|
-
var
|
|
1493
|
+
var a, i;
|
|
1483
1494
|
this.logger.debug(`loading nozzle ${this.id}`);
|
|
1484
1495
|
const t = await Gr(this.urlPrefix);
|
|
1485
1496
|
if ((t == null ? void 0 : t.status) !== 200)
|
|
1486
1497
|
throw new Error("Failed to load nozzle availability");
|
|
1487
|
-
const r = await
|
|
1488
|
-
|
|
1498
|
+
const r = await P.loader.executeLoader(
|
|
1499
|
+
g.AvailabilityLoader,
|
|
1489
1500
|
{}
|
|
1490
1501
|
);
|
|
1491
|
-
e == null || e.set(
|
|
1492
|
-
for (const s of Object.keys((
|
|
1493
|
-
for (const n of ((
|
|
1494
|
-
const
|
|
1495
|
-
|
|
1502
|
+
e == null || e.set(g.AvailabilityLoader, r), e == null || e.set(Ne.type, this);
|
|
1503
|
+
for (const s of Object.keys((a = t.data) == null ? void 0 : a.groups) || [])
|
|
1504
|
+
for (const n of ((i = t.data) == null ? void 0 : i.groups[s]) || []) {
|
|
1505
|
+
const l = await P.dataMapper.executeMapper(
|
|
1506
|
+
g.AvailabilityMapper,
|
|
1496
1507
|
{ ...n, groupId: s },
|
|
1497
1508
|
r
|
|
1498
|
-
),
|
|
1509
|
+
), c = {
|
|
1499
1510
|
...n,
|
|
1500
1511
|
note: n.note ?? void 0,
|
|
1501
1512
|
kosParentId: this.id,
|
|
1502
1513
|
rawId: n.id,
|
|
1503
1514
|
groupId: s,
|
|
1504
|
-
data:
|
|
1515
|
+
data: l,
|
|
1505
1516
|
properties: n.properties || {}
|
|
1506
1517
|
}, p = Ee.factory(
|
|
1507
1518
|
`${this.id}-${s}-${n.id}`
|
|
1508
|
-
)(
|
|
1519
|
+
)(c);
|
|
1509
1520
|
this._availabilityItems.addModel(p);
|
|
1510
1521
|
}
|
|
1511
1522
|
this.updateGroupMembers();
|
|
1512
1523
|
}
|
|
1513
1524
|
async updateAvailability(e) {
|
|
1514
|
-
const t =
|
|
1525
|
+
const t = wt.getContext(this.id), r = (t == null ? void 0 : t.get(g.AvailabilityLoader)) || {};
|
|
1515
1526
|
if (e.rebuild)
|
|
1516
|
-
for (const
|
|
1517
|
-
this._availabilityItems.getIndexByKey("group",
|
|
1518
|
-
(s) => !e.groups[
|
|
1519
|
-
(n) => `${this.id}-${
|
|
1527
|
+
for (const a of Object.keys(e == null ? void 0 : e.groups) || []) {
|
|
1528
|
+
this._availabilityItems.getIndexByKey("group", a).filter(
|
|
1529
|
+
(s) => !e.groups[a].find(
|
|
1530
|
+
(n) => `${this.id}-${a}-${n.id}` === s.id
|
|
1520
1531
|
)
|
|
1521
1532
|
).forEach((s) => {
|
|
1522
|
-
this._availabilityItems.removeModel(s.id),
|
|
1533
|
+
this._availabilityItems.removeModel(s.id), Rt(s);
|
|
1523
1534
|
});
|
|
1524
|
-
for (const s of (e == null ? void 0 : e.groups[
|
|
1525
|
-
const n = await
|
|
1526
|
-
|
|
1527
|
-
{ ...s, groupId:
|
|
1535
|
+
for (const s of (e == null ? void 0 : e.groups[a]) || []) {
|
|
1536
|
+
const n = await P.dataMapper.executeMapper(
|
|
1537
|
+
g.AvailabilityMapper,
|
|
1538
|
+
{ ...s, groupId: a },
|
|
1528
1539
|
r
|
|
1529
|
-
),
|
|
1540
|
+
), l = {
|
|
1530
1541
|
...s,
|
|
1531
1542
|
note: s.note ?? void 0,
|
|
1532
1543
|
kosParentId: this.id,
|
|
1533
|
-
groupId:
|
|
1544
|
+
groupId: a,
|
|
1534
1545
|
rawId: s.id,
|
|
1535
1546
|
data: n,
|
|
1536
1547
|
taggedIds: s.taggedIds,
|
|
1537
1548
|
properties: s.properties || {}
|
|
1538
|
-
},
|
|
1539
|
-
`${this.id}-${
|
|
1549
|
+
}, c = this._availabilityItems.getModel(
|
|
1550
|
+
`${this.id}-${a}-${s.id}`
|
|
1540
1551
|
);
|
|
1541
|
-
if (
|
|
1542
|
-
|
|
1552
|
+
if (c)
|
|
1553
|
+
c.updateModel(l);
|
|
1543
1554
|
else {
|
|
1544
1555
|
const p = Ee.factory(
|
|
1545
|
-
`${this.id}-${
|
|
1546
|
-
)(
|
|
1556
|
+
`${this.id}-${a}-${s.id}`
|
|
1557
|
+
)(l);
|
|
1547
1558
|
this._availabilityItems.addModel(p);
|
|
1548
1559
|
}
|
|
1549
1560
|
}
|
|
1550
1561
|
}
|
|
1551
1562
|
else
|
|
1552
|
-
for (const
|
|
1553
|
-
for (const
|
|
1554
|
-
const s = await
|
|
1555
|
-
|
|
1556
|
-
{ ...
|
|
1563
|
+
for (const a of Object.keys(e == null ? void 0 : e.groups) || [])
|
|
1564
|
+
for (const i of (e == null ? void 0 : e.groups[a]) || []) {
|
|
1565
|
+
const s = await P.dataMapper.executeMapper(
|
|
1566
|
+
g.AvailabilityMapper,
|
|
1567
|
+
{ ...i, groupId: a },
|
|
1557
1568
|
r
|
|
1558
1569
|
), n = {
|
|
1559
|
-
...
|
|
1560
|
-
note:
|
|
1570
|
+
...i,
|
|
1571
|
+
note: i.note ?? void 0,
|
|
1561
1572
|
kosParentId: this.id,
|
|
1562
|
-
groupId:
|
|
1563
|
-
rawId:
|
|
1573
|
+
groupId: a,
|
|
1574
|
+
rawId: i.id,
|
|
1564
1575
|
data: s,
|
|
1565
|
-
type:
|
|
1566
|
-
taggedIds:
|
|
1567
|
-
properties:
|
|
1568
|
-
},
|
|
1569
|
-
`${this.id}-${
|
|
1576
|
+
type: i.type,
|
|
1577
|
+
taggedIds: i.taggedIds,
|
|
1578
|
+
properties: i.properties || {}
|
|
1579
|
+
}, l = this._availabilityItems.getModel(
|
|
1580
|
+
`${this.id}-${a}-${i.id}`
|
|
1570
1581
|
);
|
|
1571
|
-
|
|
1582
|
+
l && l.updateModel(n);
|
|
1572
1583
|
}
|
|
1573
1584
|
this.updateGroupMembers();
|
|
1574
1585
|
}
|
|
@@ -1591,27 +1602,27 @@ E([
|
|
|
1591
1602
|
], I.prototype, "handleCanceled", 1);
|
|
1592
1603
|
E([
|
|
1593
1604
|
ge(),
|
|
1594
|
-
|
|
1605
|
+
ae({ allowedStates: [d.IDLE] })
|
|
1595
1606
|
], I.prototype, "pour", 1);
|
|
1596
1607
|
E([
|
|
1597
1608
|
ge(),
|
|
1598
|
-
|
|
1609
|
+
ae({ allowedStates: [d.IDLE] })
|
|
1599
1610
|
], I.prototype, "fixedPour", 1);
|
|
1600
1611
|
E([
|
|
1601
|
-
|
|
1612
|
+
ae({
|
|
1602
1613
|
allowedStates: [d.POUR_STARTING, d.POURING]
|
|
1603
1614
|
})
|
|
1604
1615
|
], I.prototype, "cancelPour", 1);
|
|
1605
1616
|
E([
|
|
1606
|
-
|
|
1617
|
+
re({
|
|
1607
1618
|
topic: `${Kr}/availability`,
|
|
1608
1619
|
websocket: !0
|
|
1609
1620
|
})
|
|
1610
1621
|
], I.prototype, "updateAvailability", 1);
|
|
1611
1622
|
I = E([
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1623
|
+
y(Q),
|
|
1624
|
+
Fe(),
|
|
1625
|
+
He(
|
|
1615
1626
|
{
|
|
1616
1627
|
initial: d.IDLE,
|
|
1617
1628
|
initializeAt: pe.READY,
|
|
@@ -1648,29 +1659,29 @@ I = E([
|
|
|
1648
1659
|
}
|
|
1649
1660
|
)
|
|
1650
1661
|
], I);
|
|
1651
|
-
const
|
|
1662
|
+
const Ne = {
|
|
1652
1663
|
registration: {
|
|
1653
|
-
[
|
|
1664
|
+
[Q]: {
|
|
1654
1665
|
class: I,
|
|
1655
1666
|
singleton: !1
|
|
1656
1667
|
}
|
|
1657
1668
|
},
|
|
1658
|
-
type:
|
|
1659
|
-
predicate: b(
|
|
1660
|
-
factory: v.Factory.create(
|
|
1669
|
+
type: Q,
|
|
1670
|
+
predicate: b(Q),
|
|
1671
|
+
factory: v.Factory.create(Q)
|
|
1661
1672
|
};
|
|
1662
|
-
var Zr = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor,
|
|
1663
|
-
for (var
|
|
1664
|
-
(n = e[s]) && (
|
|
1665
|
-
return
|
|
1673
|
+
var Zr = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor, ct = (e, t, r, a) => {
|
|
1674
|
+
for (var i = a > 1 ? void 0 : a ? Xr(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1675
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
1676
|
+
return a && i && Zr(t, r, i), i;
|
|
1666
1677
|
};
|
|
1667
|
-
const
|
|
1678
|
+
const pt = "device-assembly-model";
|
|
1668
1679
|
let ce = class {
|
|
1669
1680
|
constructor(e, t, r) {
|
|
1670
1681
|
o(this, "id");
|
|
1671
1682
|
o(this, "deviceNozzles");
|
|
1672
1683
|
o(this, "logger");
|
|
1673
|
-
this.id = e, this.logger = r.logger, this.deviceNozzles = new
|
|
1684
|
+
this.id = e, this.logger = r.logger, this.deviceNozzles = new T();
|
|
1674
1685
|
}
|
|
1675
1686
|
// -------------------LIFECYCLE----------------------------
|
|
1676
1687
|
async init() {
|
|
@@ -1684,54 +1695,54 @@ let ce = class {
|
|
|
1684
1695
|
}
|
|
1685
1696
|
async load() {
|
|
1686
1697
|
this.logger.debug(`loading device-assembly ${this.id}`);
|
|
1687
|
-
const e = await
|
|
1698
|
+
const e = await qe();
|
|
1688
1699
|
(e == null ? void 0 : e.status) === 200 && e.data.assemblies.map((r) => r.nozzles ?? []).flat().forEach((r) => {
|
|
1689
1700
|
var n;
|
|
1690
|
-
const
|
|
1701
|
+
const a = r.path, i = ((n = r.pipelines.find((l) => l.name === "beverage")) == null ? void 0 : n.topicPrefix) || "", s = Ne.factory(a)({
|
|
1691
1702
|
path: r.path,
|
|
1692
1703
|
name: r.name,
|
|
1693
1704
|
urlPrefix: r.urlPrefix,
|
|
1694
1705
|
topicPrefix: r.topicPrefix,
|
|
1695
|
-
beverageTopicPrefix:
|
|
1706
|
+
beverageTopicPrefix: i
|
|
1696
1707
|
});
|
|
1697
1708
|
this.deviceNozzles.addModel(s);
|
|
1698
1709
|
});
|
|
1699
1710
|
}
|
|
1700
1711
|
};
|
|
1701
|
-
|
|
1712
|
+
ct([
|
|
1702
1713
|
_
|
|
1703
1714
|
], ce.prototype, "deviceNozzles", 2);
|
|
1704
|
-
ce =
|
|
1705
|
-
|
|
1715
|
+
ce = ct([
|
|
1716
|
+
y(pt)
|
|
1706
1717
|
], ce);
|
|
1707
|
-
const Jr = new
|
|
1718
|
+
const Jr = new Ct({
|
|
1708
1719
|
class: ce,
|
|
1709
|
-
type:
|
|
1710
|
-
}), { URL:
|
|
1711
|
-
basePath: `${
|
|
1720
|
+
type: pt
|
|
1721
|
+
}), { URL: ht } = D("GENERIC_POUR_SERVICE"), { postModel: qr } = S.build({
|
|
1722
|
+
basePath: `${ht}/api/nozzle`
|
|
1712
1723
|
}), Wr = async (e, t) => {
|
|
1713
1724
|
const r = await qr({
|
|
1714
1725
|
model: {},
|
|
1715
|
-
urlOverride: `${
|
|
1726
|
+
urlOverride: `${ht}${e}`,
|
|
1716
1727
|
ordered: !0,
|
|
1717
1728
|
tracker: t
|
|
1718
1729
|
});
|
|
1719
1730
|
return r != null && r.data && he.initiateFuture(r.data), r;
|
|
1720
1731
|
};
|
|
1721
|
-
var Qr = Object.defineProperty,
|
|
1722
|
-
for (var
|
|
1723
|
-
(n = e[s]) && (
|
|
1724
|
-
return
|
|
1732
|
+
var Qr = Object.defineProperty, ea = Object.getOwnPropertyDescriptor, A = (e, t, r, a) => {
|
|
1733
|
+
for (var i = a > 1 ? void 0 : a ? ea(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1734
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
1735
|
+
return a && i && Qr(t, r, i), i;
|
|
1725
1736
|
};
|
|
1726
|
-
const
|
|
1727
|
-
let
|
|
1737
|
+
const gt = "generic-pour-model", ta = "/kos/generic/pour/started", ra = "/kos/generic/pour/progress", aa = "/kos/generic/pour/cancel", ve = (e) => e.onPourStart !== void 0 && e.onPourCancel !== void 0 && e.onPourProgress !== void 0;
|
|
1738
|
+
let w = class {
|
|
1728
1739
|
constructor(e, t) {
|
|
1729
1740
|
o(this, "id");
|
|
1730
1741
|
o(this, "servicePathFactory");
|
|
1731
1742
|
o(this, "pourType");
|
|
1732
1743
|
o(this, "selectedId");
|
|
1733
1744
|
o(this, "state");
|
|
1734
|
-
this.id = e, this.futureHandler = new
|
|
1745
|
+
this.id = e, this.futureHandler = new je(this), this.servicePathFactory = t.servicePathFactory, this.pourType = t.pourType || "free", this.selectedId = t.selectedId, this.state = Te();
|
|
1735
1746
|
}
|
|
1736
1747
|
get servicePath() {
|
|
1737
1748
|
return this.selectedId ? this.servicePathFactory(this.selectedId, this.state) : "";
|
|
@@ -1746,7 +1757,7 @@ let M = class {
|
|
|
1746
1757
|
this.state = Te();
|
|
1747
1758
|
}
|
|
1748
1759
|
handlePouringStart() {
|
|
1749
|
-
this.logger.info("Pour started"),
|
|
1760
|
+
this.logger.info("Pour started"), z(this).forEach((t) => {
|
|
1750
1761
|
var r;
|
|
1751
1762
|
ve(t) && ((r = t.onPourStart) == null || r.call(t));
|
|
1752
1763
|
});
|
|
@@ -1754,7 +1765,7 @@ let M = class {
|
|
|
1754
1765
|
pourTarget: this.id,
|
|
1755
1766
|
type: this.pourType
|
|
1756
1767
|
};
|
|
1757
|
-
|
|
1768
|
+
$.publish(ta, e);
|
|
1758
1769
|
}
|
|
1759
1770
|
handlePouringEnd() {
|
|
1760
1771
|
this.logger.info("Pour ended");
|
|
@@ -1763,14 +1774,14 @@ let M = class {
|
|
|
1763
1774
|
this.logger.info("Pour canceling");
|
|
1764
1775
|
}
|
|
1765
1776
|
handleCanceled() {
|
|
1766
|
-
this.logger.info("Pour canceled"),
|
|
1777
|
+
this.logger.info("Pour canceled"), z(this).forEach((t) => {
|
|
1767
1778
|
var r;
|
|
1768
1779
|
ve(t) && ((r = t.onPourCancel) == null || r.call(t));
|
|
1769
1780
|
});
|
|
1770
1781
|
const e = {
|
|
1771
1782
|
pourTarget: this.id
|
|
1772
1783
|
};
|
|
1773
|
-
|
|
1784
|
+
$.publish(aa, e);
|
|
1774
1785
|
}
|
|
1775
1786
|
// Inherits throwOnInvalid: false from class
|
|
1776
1787
|
async pour(e) {
|
|
@@ -1819,7 +1830,7 @@ let M = class {
|
|
|
1819
1830
|
// Future Lifecycle Handler
|
|
1820
1831
|
// ============================================================================
|
|
1821
1832
|
onFutureUpdate(e) {
|
|
1822
|
-
|
|
1833
|
+
z(this).forEach((r) => {
|
|
1823
1834
|
ve(r) && r.onPourProgress(e);
|
|
1824
1835
|
});
|
|
1825
1836
|
const t = {
|
|
@@ -1833,37 +1844,37 @@ let M = class {
|
|
|
1833
1844
|
reason: e.reason,
|
|
1834
1845
|
timeRemaining: e.timeRemaining
|
|
1835
1846
|
};
|
|
1836
|
-
|
|
1847
|
+
$.publish(ra, t), e.endState && O(() => {
|
|
1837
1848
|
this.currentState === d.POURING && this.transition("POUR_COMPLETED");
|
|
1838
1849
|
});
|
|
1839
1850
|
}
|
|
1840
1851
|
};
|
|
1841
|
-
|
|
1852
|
+
A([
|
|
1842
1853
|
ue(d.POURING)
|
|
1843
|
-
],
|
|
1844
|
-
|
|
1854
|
+
], w.prototype, "handlePouringStart", 1);
|
|
1855
|
+
A([
|
|
1845
1856
|
Pe(d.POURING)
|
|
1846
|
-
],
|
|
1847
|
-
|
|
1857
|
+
], w.prototype, "handlePouringEnd", 1);
|
|
1858
|
+
A([
|
|
1848
1859
|
ue(d.POUR_CANCELING)
|
|
1849
|
-
],
|
|
1850
|
-
|
|
1860
|
+
], w.prototype, "handleCancelStart", 1);
|
|
1861
|
+
A([
|
|
1851
1862
|
Pe(d.POUR_CANCELING)
|
|
1852
|
-
],
|
|
1853
|
-
|
|
1863
|
+
], w.prototype, "handleCanceled", 1);
|
|
1864
|
+
A([
|
|
1854
1865
|
ge(),
|
|
1855
|
-
|
|
1856
|
-
],
|
|
1857
|
-
|
|
1858
|
-
|
|
1866
|
+
ae({ allowedStates: [d.IDLE] })
|
|
1867
|
+
], w.prototype, "pour", 1);
|
|
1868
|
+
A([
|
|
1869
|
+
ae({
|
|
1859
1870
|
allowedStates: [d.POUR_STARTING, d.POURING]
|
|
1860
1871
|
})
|
|
1861
|
-
],
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1872
|
+
], w.prototype, "cancelPour", 1);
|
|
1873
|
+
w = A([
|
|
1874
|
+
y(gt),
|
|
1875
|
+
Fe(),
|
|
1876
|
+
$t(),
|
|
1877
|
+
He(
|
|
1867
1878
|
{
|
|
1868
1879
|
initial: d.IDLE,
|
|
1869
1880
|
initializeAt: pe.READY,
|
|
@@ -1899,102 +1910,102 @@ M = T([
|
|
|
1899
1910
|
// Gracefully ignore invalid state calls (expected runtime scenarios)
|
|
1900
1911
|
}
|
|
1901
1912
|
)
|
|
1902
|
-
],
|
|
1903
|
-
const
|
|
1904
|
-
class:
|
|
1905
|
-
type:
|
|
1906
|
-
}),
|
|
1907
|
-
...
|
|
1908
|
-
...
|
|
1909
|
-
...
|
|
1910
|
-
...
|
|
1911
|
-
|
|
1912
|
-
...
|
|
1913
|
+
], w);
|
|
1914
|
+
const ha = new Nt({
|
|
1915
|
+
class: w,
|
|
1916
|
+
type: gt
|
|
1917
|
+
}), xe = {
|
|
1918
|
+
...Ye.registration,
|
|
1919
|
+
...Ve.registration,
|
|
1920
|
+
...st.registration,
|
|
1921
|
+
...Je.registration,
|
|
1922
|
+
...Ne.registration,
|
|
1923
|
+
...ot.registration,
|
|
1913
1924
|
...Re.registration,
|
|
1914
1925
|
...Ee.registration,
|
|
1915
|
-
...
|
|
1926
|
+
...lt.registration,
|
|
1916
1927
|
...it.registration
|
|
1917
|
-
},
|
|
1918
|
-
const r =
|
|
1919
|
-
|
|
1920
|
-
}),
|
|
1928
|
+
}, ia = (e) => () => (St(e)(), Jr.register(), Object.keys(xe).forEach((t) => {
|
|
1929
|
+
const r = xe[t];
|
|
1930
|
+
Tt(e)(t, r);
|
|
1931
|
+
}), P[te].register(
|
|
1921
1932
|
"FirmwareUpdateInProgressTrouble",
|
|
1922
1933
|
async (t) => {
|
|
1923
1934
|
var r;
|
|
1924
1935
|
if ((r = t.data) != null && r.deviceId) {
|
|
1925
|
-
const { model:
|
|
1926
|
-
|
|
1936
|
+
const { model: a } = x(
|
|
1937
|
+
lt.type
|
|
1927
1938
|
);
|
|
1928
|
-
if (
|
|
1929
|
-
const
|
|
1939
|
+
if (a) {
|
|
1940
|
+
const i = a.boards.find(
|
|
1930
1941
|
(s) => s.id === t.data.deviceId
|
|
1931
|
-
) ?
|
|
1942
|
+
) ? x(t.data.deviceId).model : void 0;
|
|
1932
1943
|
return {
|
|
1933
|
-
devices:
|
|
1944
|
+
devices: i ? i.name : ""
|
|
1934
1945
|
};
|
|
1935
1946
|
}
|
|
1936
1947
|
}
|
|
1937
1948
|
return {};
|
|
1938
1949
|
}
|
|
1939
1950
|
), {
|
|
1940
|
-
preload:
|
|
1941
|
-
model:
|
|
1942
|
-
companion:
|
|
1943
|
-
legacy:
|
|
1951
|
+
preload: R.model.preloadModel(e),
|
|
1952
|
+
model: R.model.register(e),
|
|
1953
|
+
companion: R.companion.register(e),
|
|
1954
|
+
legacy: R.model.registerLegacyModel(e)
|
|
1944
1955
|
}), f = {
|
|
1945
|
-
|
|
1956
|
+
...Dt
|
|
1946
1957
|
};
|
|
1947
1958
|
f.dispense = {
|
|
1948
|
-
models:
|
|
1959
|
+
models: ia(f)
|
|
1949
1960
|
};
|
|
1950
|
-
f.preload =
|
|
1951
|
-
f.model =
|
|
1952
|
-
f.companion =
|
|
1953
|
-
f.legacy =
|
|
1954
|
-
const
|
|
1961
|
+
f.preload = R.model.preloadModel(f);
|
|
1962
|
+
f.model = R.model.register(f);
|
|
1963
|
+
f.companion = R.companion.register(f);
|
|
1964
|
+
f.legacy = R.model.registerLegacyModel(f);
|
|
1965
|
+
const ga = f;
|
|
1955
1966
|
export {
|
|
1956
|
-
|
|
1957
|
-
|
|
1967
|
+
lt as A,
|
|
1968
|
+
B,
|
|
1958
1969
|
Sr as C,
|
|
1959
|
-
|
|
1960
|
-
|
|
1970
|
+
L as D,
|
|
1971
|
+
g as E,
|
|
1961
1972
|
Gr as F,
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1973
|
+
ha as G,
|
|
1974
|
+
Je as H,
|
|
1975
|
+
Ve as I,
|
|
1965
1976
|
Br as J,
|
|
1966
|
-
|
|
1977
|
+
ga as K,
|
|
1967
1978
|
xr as L,
|
|
1968
1979
|
jr as M,
|
|
1969
|
-
|
|
1980
|
+
Ne as N,
|
|
1970
1981
|
Wr as O,
|
|
1971
|
-
|
|
1972
|
-
|
|
1982
|
+
ot as P,
|
|
1983
|
+
We as T,
|
|
1973
1984
|
Tr as a,
|
|
1974
1985
|
Ee as b,
|
|
1975
|
-
|
|
1986
|
+
Qe as c,
|
|
1976
1987
|
it as d,
|
|
1977
|
-
|
|
1988
|
+
at as e,
|
|
1978
1989
|
Jr as f,
|
|
1979
|
-
|
|
1980
|
-
|
|
1990
|
+
st as g,
|
|
1991
|
+
Ye as h,
|
|
1981
1992
|
Re as i,
|
|
1982
|
-
|
|
1993
|
+
tt as j,
|
|
1983
1994
|
d as k,
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1995
|
+
xe as l,
|
|
1996
|
+
zt as m,
|
|
1997
|
+
ca as n,
|
|
1998
|
+
Vt as o,
|
|
1999
|
+
pa as p,
|
|
2000
|
+
la as q,
|
|
2001
|
+
ia as r,
|
|
2002
|
+
da as s,
|
|
2003
|
+
kt as t,
|
|
2004
|
+
Xt as u,
|
|
2005
|
+
Kt as v,
|
|
2006
|
+
qe as w,
|
|
2007
|
+
wr as x,
|
|
2008
|
+
Mr as y,
|
|
1998
2009
|
Fr as z
|
|
1999
2010
|
};
|
|
2000
|
-
//# sourceMappingURL=dispense-registration-manager-
|
|
2011
|
+
//# sourceMappingURL=dispense-registration-manager-DgMTZL-g.js.map
|