@kosdev-code/kos-dispense-sdk 2.0.16 → 2.0.18
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-UjShRcvq.js → dispense-registration-manager-BX9C7jzd.js} +243 -239
- package/dispense-registration-manager-BX9C7jzd.js.map +1 -0
- package/dispense-registration-manager-DRFXN5Fe.cjs +2 -0
- package/dispense-registration-manager-DRFXN5Fe.cjs.map +1 -0
- package/{extension-utils-DrKHgDXC.js → extension-utils-CaPxvvPM.js} +2 -2
- package/{extension-utils-DrKHgDXC.js.map → extension-utils-CaPxvvPM.js.map} +1 -1
- package/{extension-utils-lo_uDdh9.cjs → extension-utils-DiqbAS68.cjs} +2 -2
- package/{extension-utils-lo_uDdh9.cjs.map → extension-utils-DiqbAS68.cjs.map} +1 -1
- package/index.cjs +1 -1
- package/index.js +3 -3
- package/models/models/availability/availability-model.d.ts.map +1 -1
- package/models/models/availability/types/index.d.ts +12 -4
- package/models/models/nozzle/nozzle-model.d.ts +9 -9
- package/models/models/nozzle/nozzle-model.d.ts.map +1 -1
- package/models/models/nozzle/services/nozzle-services.d.ts +2 -1
- package/models/models/nozzle/services/nozzle-services.d.ts.map +1 -1
- package/models.cjs +1 -1
- package/models.js +2 -2
- package/package.json +3 -3
- package/{pump-provider-DMGN5lvz.cjs → pump-provider-Csj2RXYB.cjs} +2 -2
- package/{pump-provider-DMGN5lvz.cjs.map → pump-provider-Csj2RXYB.cjs.map} +1 -1
- package/{pump-provider-DpNSFHld.js → pump-provider-UGrGomQa.js} +2 -2
- package/{pump-provider-DpNSFHld.js.map → pump-provider-UGrGomQa.js.map} +1 -1
- package/ui/hooks/availability/use-availability.d.ts +2 -2
- package/ui/hooks/cui-kit/use-beverages.d.ts +2 -2
- package/ui/hooks/cui-kit/use-brands.d.ts +2 -2
- package/ui/hooks/cui-kit/use-flavors.d.ts +2 -2
- package/ui/hooks/nozzle/use-dispense-kit.d.ts +2 -2
- package/ui.cjs +1 -1
- package/ui.js +2 -2
- package/dispense-registration-manager-BXNJ1hUZ.cjs +0 -2
- package/dispense-registration-manager-BXNJ1hUZ.cjs.map +0 -1
- package/dispense-registration-manager-UjShRcvq.js.map +0 -1
package/{dispense-registration-manager-UjShRcvq.js → dispense-registration-manager-BX9C7jzd.js}
RENAMED
|
@@ -3,35 +3,35 @@ var ut = (e, t, r) => t in e ? pt(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var o = (e, t, r) => (ut(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
4
|
import { kosModel as I, isKosModel as v, Kos as b, resolveServiceUrl as C, ServiceFactory as S, KosLog as m, KosModelContainer as R, KosExtensionUtils as T, kosChild as M, FetchError as ht, ExtensionManager as h, EXTENSION_TROUBLE_MAPPER as Me, EXTENSION_TROUBLE_DATA_MAPPER as W, getKosModelSync as z, kosDependency as ce, TroubleContainer as xe, troubleByTypeReducer as Ae, kosAction as g, kosTopicHandler as Q, DependencyLifecycle as Be, getKosModel as Ue, FutureManager as pe, kosFuture as ue, FutureHandler as Ge, isKosDataModel as gt, ChildModels as yt, KosFeatureFlags as It, kosParentAware as ft, createPropKey as mt, MultipleFutureHandler as Pt, arraysEqual as vt, getAllKosCompanionModels as E, EventBus as _, KosContextManager as bt, destroyKosModel as _t, SingletonKosModelRegistrationFactory as Mt, KosModelRegistrationFactory as Ot, KosModelRegistry as Et, RegistrationManager as O, registerCoreModels as wt, registerLegacyModel as $t } from "@kosdev-code/kos-ui-sdk";
|
|
5
5
|
import "react";
|
|
6
|
-
var u = /* @__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))(u || {}), D = /* @__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))(D || {}), Ct = Object.defineProperty, St = Object.getOwnPropertyDescriptor, Rt = (e, t, r,
|
|
7
|
-
for (var i =
|
|
8
|
-
(
|
|
9
|
-
return
|
|
6
|
+
var u = /* @__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))(u || {}), D = /* @__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))(D || {}), Ct = Object.defineProperty, St = Object.getOwnPropertyDescriptor, Rt = (e, t, r, s) => {
|
|
7
|
+
for (var i = s > 1 ? void 0 : s ? St(t, r) : t, n = e.length - 1, a; n >= 0; n--)
|
|
8
|
+
(a = e[n]) && (i = (s ? a(t, r, i) : a(i)) || i);
|
|
9
|
+
return s && i && Ct(t, r, i), i;
|
|
10
10
|
};
|
|
11
11
|
const G = "ingredient-model";
|
|
12
12
|
let Pe = class {
|
|
13
13
|
constructor(e, {
|
|
14
14
|
name: t,
|
|
15
15
|
type: r,
|
|
16
|
-
data:
|
|
16
|
+
data: s,
|
|
17
17
|
ingredientId: i,
|
|
18
|
-
...
|
|
18
|
+
...n
|
|
19
19
|
}) {
|
|
20
20
|
o(this, "id");
|
|
21
21
|
o(this, "ingredientId");
|
|
22
22
|
o(this, "name");
|
|
23
23
|
o(this, "type");
|
|
24
24
|
o(this, "data");
|
|
25
|
-
this.id = e, this.ingredientId = i, this.name = t, this.type = r, this.data =
|
|
25
|
+
this.id = e, this.ingredientId = i, this.name = t, this.type = r, this.data = s, Object.assign(this, n);
|
|
26
26
|
}
|
|
27
27
|
updateModel({
|
|
28
28
|
name: e,
|
|
29
29
|
type: t,
|
|
30
30
|
data: r,
|
|
31
|
-
ingredientId:
|
|
31
|
+
ingredientId: s,
|
|
32
32
|
...i
|
|
33
33
|
}) {
|
|
34
|
-
this.name = e, this.type = t, this.ingredientId =
|
|
34
|
+
this.name = e, this.type = t, this.ingredientId = s, this.data = r, Object.assign(this, i);
|
|
35
35
|
}
|
|
36
36
|
// -------------------LIFECYCLE----------------------------
|
|
37
37
|
// -------------------ENTITY----------------------------
|
|
@@ -54,13 +54,13 @@ const je = {
|
|
|
54
54
|
}), Nt = async () => await Dt({
|
|
55
55
|
urlOverride: `${Fe}/api/ext/dispense/ingredients`
|
|
56
56
|
});
|
|
57
|
-
var Tt = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, He = (e, t, r,
|
|
58
|
-
for (var i =
|
|
59
|
-
(
|
|
60
|
-
return
|
|
57
|
+
var Tt = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, He = (e, t, r, s) => {
|
|
58
|
+
for (var i = s > 1 ? void 0 : s ? zt(t, r) : t, n = e.length - 1, a; n >= 0; n--)
|
|
59
|
+
(a = e[n]) && (i = (s ? a(t, r, i) : a(i)) || i);
|
|
60
|
+
return s && i && Tt(t, r, i), i;
|
|
61
61
|
};
|
|
62
62
|
const j = "ingredient-container-model", Lt = m.createLogger({ name: "ingredient-container-model" });
|
|
63
|
-
let
|
|
63
|
+
let se = class {
|
|
64
64
|
constructor(e, t) {
|
|
65
65
|
o(this, "id");
|
|
66
66
|
o(this, "ingredients");
|
|
@@ -87,23 +87,23 @@ let ne = class {
|
|
|
87
87
|
const r = await T.executeLoaderExtension({
|
|
88
88
|
context: e,
|
|
89
89
|
extension: u.IngredientLoader
|
|
90
|
-
}),
|
|
91
|
-
for (const
|
|
92
|
-
for (const
|
|
90
|
+
}), s = (t == null ? void 0 : t.data) ?? {};
|
|
91
|
+
for (const n of Object.keys(s))
|
|
92
|
+
for (const a of ((i = t == null ? void 0 : t.data) == null ? void 0 : i[n]) || []) {
|
|
93
93
|
const c = await T.executeDataMapperExtension({
|
|
94
94
|
extension: u.IngredientMapper,
|
|
95
|
-
data:
|
|
95
|
+
data: a,
|
|
96
96
|
contextData: r
|
|
97
97
|
}), l = await T.executePropertyMapperExtension({
|
|
98
98
|
extension: u.IngredientTypeMapper,
|
|
99
|
-
data:
|
|
99
|
+
data: a,
|
|
100
100
|
contextData: r
|
|
101
101
|
}), p = {
|
|
102
|
-
...
|
|
103
|
-
type: l ||
|
|
102
|
+
...a,
|
|
103
|
+
type: l || a.type,
|
|
104
104
|
...c,
|
|
105
105
|
data: c
|
|
106
|
-
}, y = je.factory(
|
|
106
|
+
}, y = je.factory(a.id)(
|
|
107
107
|
p
|
|
108
108
|
);
|
|
109
109
|
this.ingredients.addModel(y);
|
|
@@ -113,14 +113,14 @@ let ne = class {
|
|
|
113
113
|
};
|
|
114
114
|
He([
|
|
115
115
|
M
|
|
116
|
-
],
|
|
117
|
-
|
|
116
|
+
], se.prototype, "ingredients", 2);
|
|
117
|
+
se = He([
|
|
118
118
|
I(j)
|
|
119
|
-
],
|
|
119
|
+
], se);
|
|
120
120
|
const Ke = {
|
|
121
121
|
registration: {
|
|
122
122
|
[j]: {
|
|
123
|
-
class:
|
|
123
|
+
class: se,
|
|
124
124
|
singleton: !0
|
|
125
125
|
}
|
|
126
126
|
},
|
|
@@ -155,38 +155,38 @@ const Ke = {
|
|
|
155
155
|
model: {},
|
|
156
156
|
urlOverride: `${he}/api/ext/dispense/pumpEvents/replaceLine/${e}`
|
|
157
157
|
});
|
|
158
|
-
}, { URL:
|
|
158
|
+
}, { URL: ne } = C("ASSIGNMENT_SERVICE"), { getAll: Ft, postModel: Ye, deleteModel: Ht } = S.build({
|
|
159
159
|
destinationAddress: "",
|
|
160
|
-
basePath: `${
|
|
161
|
-
}),
|
|
162
|
-
var i,
|
|
163
|
-
const r = JSON.stringify(t),
|
|
160
|
+
basePath: `${ne}/api/ext/dispense/assignments`
|
|
161
|
+
}), ae = window.kosUseFos, si = async () => await Ft({ fos: ae }), Kt = async (e, t) => {
|
|
162
|
+
var i, n, a, c;
|
|
163
|
+
const r = JSON.stringify(t), s = `${ne}/api/ext/dispense/assignments`;
|
|
164
164
|
try {
|
|
165
165
|
const l = await Ye({
|
|
166
166
|
model: { holderPath: e, factoryJson: r },
|
|
167
|
-
urlOverride:
|
|
167
|
+
urlOverride: s
|
|
168
168
|
});
|
|
169
169
|
return (l == null ? void 0 : l.status) === 200 && ((i = l == null ? void 0 : l.data) != null && i.error) ? [l.data.error || "unknownError", l.data] : [void 0, l == null ? void 0 : l.data];
|
|
170
170
|
} catch (l) {
|
|
171
171
|
if (l instanceof ht)
|
|
172
172
|
return [
|
|
173
|
-
((
|
|
173
|
+
((a = (n = l.payload) == null ? void 0 : n.data) == null ? void 0 : a.error) || "unknownError",
|
|
174
174
|
(c = l.payload) == null ? void 0 : c.data
|
|
175
175
|
];
|
|
176
176
|
}
|
|
177
177
|
return ["unknownError", void 0];
|
|
178
|
-
},
|
|
179
|
-
const t =
|
|
178
|
+
}, ni = async (e) => {
|
|
179
|
+
const t = ae ? `${ne}/api/ingredients/assignments/${e.holderPath}` : `${ne}/api/ext/dispense/assignments`;
|
|
180
180
|
return await Ye({
|
|
181
181
|
model: { ...e, fuelGauge: 680 },
|
|
182
|
-
fos:
|
|
182
|
+
fos: ae,
|
|
183
183
|
urlOverride: t
|
|
184
184
|
});
|
|
185
|
-
},
|
|
186
|
-
var Vt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, ge = (e, t, r,
|
|
187
|
-
for (var i =
|
|
188
|
-
(
|
|
189
|
-
return
|
|
185
|
+
}, ai = async (e) => await Ht({ id: e, fos: ae });
|
|
186
|
+
var Vt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, ge = (e, t, r, s) => {
|
|
187
|
+
for (var i = s > 1 ? void 0 : s ? Yt(t, r) : t, n = e.length - 1, a; n >= 0; n--)
|
|
188
|
+
(a = e[n]) && (i = (s ? a(t, r, i) : a(i)) || i);
|
|
189
|
+
return s && i && Vt(t, r, i), i;
|
|
190
190
|
};
|
|
191
191
|
const F = D.Holder, De = m.createLogger({ name: "holder-model" });
|
|
192
192
|
h[Me].register(
|
|
@@ -236,8 +236,8 @@ h[W].register(
|
|
|
236
236
|
}
|
|
237
237
|
);
|
|
238
238
|
class kt extends Error {
|
|
239
|
-
constructor(r,
|
|
240
|
-
super(
|
|
239
|
+
constructor(r, s) {
|
|
240
|
+
super(s);
|
|
241
241
|
o(this, "type");
|
|
242
242
|
this.name = "AssignmentError", this.type = r;
|
|
243
243
|
}
|
|
@@ -246,10 +246,10 @@ let L = class {
|
|
|
246
246
|
constructor(e, {
|
|
247
247
|
path: t,
|
|
248
248
|
name: r,
|
|
249
|
-
ingredientSource:
|
|
249
|
+
ingredientSource: s,
|
|
250
250
|
ingredientId: i,
|
|
251
|
-
ingredientType:
|
|
252
|
-
slice:
|
|
251
|
+
ingredientType: n,
|
|
252
|
+
slice: a,
|
|
253
253
|
group: c,
|
|
254
254
|
data: l,
|
|
255
255
|
enjoyByDate: p
|
|
@@ -268,7 +268,7 @@ let L = class {
|
|
|
268
268
|
o(this, "pumps");
|
|
269
269
|
o(this, "ingredientContainer");
|
|
270
270
|
o(this, "troubleContainer");
|
|
271
|
-
this.id = e, this.path = t, this.name = r, this.ingredientType =
|
|
271
|
+
this.id = e, this.path = t, this.name = r, this.ingredientType = n, this.ingredientSource = s, this.ingredientId = i, this.group = c, this.slice = a, this.enjoyByDate = p, this.data = l, this.pumps = new R({
|
|
272
272
|
parentId: e,
|
|
273
273
|
sortKey: "path"
|
|
274
274
|
}), this.logger = y.logger;
|
|
@@ -277,14 +277,14 @@ let L = class {
|
|
|
277
277
|
path: e,
|
|
278
278
|
name: t,
|
|
279
279
|
ingredientSource: r,
|
|
280
|
-
ingredientId:
|
|
280
|
+
ingredientId: s,
|
|
281
281
|
ingredientType: i,
|
|
282
|
-
group:
|
|
283
|
-
slice:
|
|
282
|
+
group: n,
|
|
283
|
+
slice: a,
|
|
284
284
|
enjoyByDate: c,
|
|
285
285
|
data: l
|
|
286
286
|
}) {
|
|
287
|
-
this.path = e, this.name = t, this.ingredientId =
|
|
287
|
+
this.path = e, this.name = t, this.ingredientId = s, this.ingredientType = i, this.ingredientSource = r, this.enjoyByDate = c, this.slice = a, this.group = n, this.data = l;
|
|
288
288
|
}
|
|
289
289
|
get hasEnjoyByDate() {
|
|
290
290
|
return !!this.enjoyByDate && !this.unassigned;
|
|
@@ -309,8 +309,8 @@ let L = class {
|
|
|
309
309
|
return this.logger.debug(`isPouring: ${!!e}`), e;
|
|
310
310
|
}
|
|
311
311
|
async performIntent(e) {
|
|
312
|
-
const t = typeof e == "string" ? e : e.intent, r = typeof e == "string" ? void 0 : e.pumpPath,
|
|
313
|
-
return
|
|
312
|
+
const t = typeof e == "string" ? e : e.intent, r = typeof e == "string" ? void 0 : e.pumpPath, s = r ? this.pumps.getModel(r) : this.pumps.data[0];
|
|
313
|
+
return s == null ? void 0 : s.performIntent({ intent: t });
|
|
314
314
|
}
|
|
315
315
|
get pourState() {
|
|
316
316
|
return this.pumps.data.reduce((t, r) => r.pouringState ? r.pouringState : t, "");
|
|
@@ -471,18 +471,18 @@ const ke = {
|
|
|
471
471
|
const r = h.propertyMapper.executeMapper(
|
|
472
472
|
u.HolderIngredientMapper,
|
|
473
473
|
t
|
|
474
|
-
),
|
|
474
|
+
), s = h.propertyMapper.executeMapper(
|
|
475
475
|
u.HolderTypeMapper,
|
|
476
476
|
t
|
|
477
477
|
) || t.ingType, i = await T.executeDataMapperExtension({
|
|
478
478
|
extension: u.HolderMapper,
|
|
479
479
|
data: t,
|
|
480
480
|
contextData: {}
|
|
481
|
-
}), { name:
|
|
482
|
-
name:
|
|
483
|
-
path:
|
|
481
|
+
}), { name: n, path: a, ingredientId: c, ingType: l, ingSource: p, slice: y, ...U } = t, f = { ...U, ...i }, N = y || { pos: 0 }, re = {
|
|
482
|
+
name: n,
|
|
483
|
+
path: a,
|
|
484
484
|
ingredientId: r || c,
|
|
485
|
-
ingredientType:
|
|
485
|
+
ingredientType: s || l,
|
|
486
486
|
ingredientSource: p,
|
|
487
487
|
enjoyByDate: (Re = t.container) != null && Re.enjoyByDate ? new Date(t.container.enjoyByDate) : void 0,
|
|
488
488
|
slice: N,
|
|
@@ -496,10 +496,10 @@ const ke = {
|
|
|
496
496
|
name: "assembly-service",
|
|
497
497
|
group: "Services"
|
|
498
498
|
}), Ze = async () => (qt.debug("sending GET for assembly"), await Xt({}));
|
|
499
|
-
var Wt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, ye = (e, t, r,
|
|
500
|
-
for (var i =
|
|
501
|
-
(
|
|
502
|
-
return
|
|
499
|
+
var Wt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, ye = (e, t, r, s) => {
|
|
500
|
+
for (var i = s > 1 ? void 0 : s ? Qt(t, r) : t, n = e.length - 1, a; n >= 0; n--)
|
|
501
|
+
(a = e[n]) && (i = (s ? a(t, r, i) : a(i)) || i);
|
|
502
|
+
return s && i && Wt(t, r, i), i;
|
|
503
503
|
};
|
|
504
504
|
const H = "board-container-model", Je = "/kos/hardware/board/linked", Xe = "/kos/hardware/board/unlinked";
|
|
505
505
|
let x = class {
|
|
@@ -566,10 +566,10 @@ const er = async (e) => {
|
|
|
566
566
|
boardName: (r == null ? void 0 : r.name) || ""
|
|
567
567
|
};
|
|
568
568
|
};
|
|
569
|
-
var tr = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, qe = (e, t, r,
|
|
570
|
-
for (var i =
|
|
571
|
-
(
|
|
572
|
-
return
|
|
569
|
+
var tr = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, qe = (e, t, r, s) => {
|
|
570
|
+
for (var i = s > 1 ? void 0 : s ? rr(t, r) : t, n = e.length - 1, a; n >= 0; n--)
|
|
571
|
+
(a = e[n]) && (i = (s ? a(t, r, i) : a(i)) || i);
|
|
572
|
+
return s && i && tr(t, r, i), i;
|
|
573
573
|
};
|
|
574
574
|
const K = D.PumpContainer;
|
|
575
575
|
var We = /* @__PURE__ */ ((e) => (e.byBoard = "byBoard", e.byType = "byType", e.byNozzle = "byNozzle", e))(We || {});
|
|
@@ -645,39 +645,39 @@ const Oe = {
|
|
|
645
645
|
}, ir = async (e) => {
|
|
646
646
|
const t = [], r = e.data.pumpPath;
|
|
647
647
|
t.push(r);
|
|
648
|
-
const
|
|
649
|
-
return [...t, ...
|
|
650
|
-
},
|
|
648
|
+
const s = await Qe(r);
|
|
649
|
+
return [...t, ...s];
|
|
650
|
+
}, sr = async (e) => {
|
|
651
651
|
const t = [], r = e.data.boardPath;
|
|
652
652
|
t.push(e.data.boardPath);
|
|
653
|
-
const
|
|
653
|
+
const s = await Ue(
|
|
654
654
|
Oe.type
|
|
655
655
|
);
|
|
656
|
-
if (
|
|
657
|
-
const
|
|
656
|
+
if (s != null && s.model) {
|
|
657
|
+
const n = s.model.models.getIndexByKey(
|
|
658
658
|
We.byBoard,
|
|
659
659
|
r
|
|
660
660
|
).map(
|
|
661
661
|
(c) => Qe(c.path)
|
|
662
662
|
);
|
|
663
|
-
(await Promise.allSettled(
|
|
663
|
+
(await Promise.allSettled(n)).forEach((c) => {
|
|
664
664
|
c.status === "fulfilled" && c.value.forEach((l) => t.push(l));
|
|
665
665
|
});
|
|
666
666
|
}
|
|
667
667
|
return Array.from(new Set(t));
|
|
668
668
|
};
|
|
669
|
-
var
|
|
670
|
-
for (var i =
|
|
671
|
-
(
|
|
672
|
-
return
|
|
669
|
+
var nr = Object.defineProperty, ar = Object.getOwnPropertyDescriptor, or = (e, t, r, s) => {
|
|
670
|
+
for (var i = s > 1 ? void 0 : s ? ar(t, r) : t, n = e.length - 1, a; n >= 0; n--)
|
|
671
|
+
(a = e[n]) && (i = (s ? a(t, r, i) : a(i)) || i);
|
|
672
|
+
return s && i && nr(t, r, i), i;
|
|
673
673
|
};
|
|
674
674
|
const V = "board-model", Ne = (e, t) => {
|
|
675
|
-
const { type: r, name:
|
|
676
|
-
t.type = r, t.name =
|
|
675
|
+
const { type: r, name: s, path: i, linked: n, instanceId: a, link: c, ...l } = e;
|
|
676
|
+
t.type = r, t.name = s, t.path = i, t.linked = n, t.link = Object.freeze(c), t.instanceId = a, Object.assign(t, l);
|
|
677
677
|
};
|
|
678
678
|
h[Me].register(
|
|
679
679
|
"board",
|
|
680
|
-
|
|
680
|
+
sr
|
|
681
681
|
);
|
|
682
682
|
h[W].register(
|
|
683
683
|
"board",
|
|
@@ -732,10 +732,10 @@ const et = {
|
|
|
732
732
|
H
|
|
733
733
|
)
|
|
734
734
|
};
|
|
735
|
-
var dr = Object.defineProperty, lr = Object.getOwnPropertyDescriptor, Ie = (e, t, r,
|
|
736
|
-
for (var i =
|
|
737
|
-
(
|
|
738
|
-
return
|
|
735
|
+
var dr = Object.defineProperty, lr = Object.getOwnPropertyDescriptor, Ie = (e, t, r, s) => {
|
|
736
|
+
for (var i = s > 1 ? void 0 : s ? lr(t, r) : t, n = e.length - 1, a; n >= 0; n--)
|
|
737
|
+
(a = e[n]) && (i = (s ? a(t, r, i) : a(i)) || i);
|
|
738
|
+
return s && i && dr(t, r, i), i;
|
|
739
739
|
};
|
|
740
740
|
const Y = D.HolderContainer, cr = "/kos/insertion/insert/start", pr = "/kos/insertion/insert/complete", ur = "/kos/insertion/insert/update", hr = "/kos/insertion/remove", gr = "/kos/pumpEvent/replaceLine", yr = "/kos/handle/*";
|
|
741
741
|
let A = class {
|
|
@@ -745,7 +745,7 @@ let A = class {
|
|
|
745
745
|
o(this, "logger");
|
|
746
746
|
this.id = e, this.holders = new R({
|
|
747
747
|
indexMap: {
|
|
748
|
-
nozzle: (
|
|
748
|
+
nozzle: (s) => s.nozzlePaths,
|
|
749
749
|
group: "group"
|
|
750
750
|
},
|
|
751
751
|
parentId: e,
|
|
@@ -755,25 +755,25 @@ let A = class {
|
|
|
755
755
|
updateModel() {
|
|
756
756
|
}
|
|
757
757
|
handleHolderEvents(e) {
|
|
758
|
-
var r,
|
|
758
|
+
var r, s, i;
|
|
759
759
|
m.ifDebug(
|
|
760
760
|
() => this.logger.debug("Received holder change event", JSON.stringify(e))
|
|
761
761
|
);
|
|
762
762
|
const t = this.holders.getModel(e.path);
|
|
763
763
|
t && (this.logger.info(
|
|
764
764
|
`Received change event for holder ${t.path}. Updating fuel gauge data.`
|
|
765
|
-
), t.slice.currentVolMl = (r = e.slice) == null ? void 0 : r.currentVolMl, t.slice.maxVolMl = (
|
|
765
|
+
), t.slice.currentVolMl = (r = e.slice) == null ? void 0 : r.currentVolMl, t.slice.maxVolMl = (s = e.slice) == null ? void 0 : s.maxVolMl, (i = e == null ? void 0 : e.container) != null && i.enjoyByDate ? t.enjoyByDate = new Date(e.container.enjoyByDate) : t.enjoyByDate = void 0);
|
|
766
766
|
}
|
|
767
767
|
handleInsertion(e) {
|
|
768
768
|
m.ifDebug(
|
|
769
769
|
() => this.logger.debug("Received insertion event", JSON.stringify(e))
|
|
770
770
|
), (Array.isArray(e) ? e : [e]).forEach((r) => {
|
|
771
771
|
g(() => {
|
|
772
|
-
var
|
|
773
|
-
const
|
|
772
|
+
var n, a, c;
|
|
773
|
+
const s = r.ingredientId, i = this.holders.getModel(r.path);
|
|
774
774
|
i && (this.logger.info(
|
|
775
775
|
`Received insertion event for holder ${i.path}`
|
|
776
|
-
), i.updateIngredient(
|
|
776
|
+
), i.updateIngredient(s), i.slice.currentVolMl = (n = r.slice) == null ? void 0 : n.currentVolMl, i.slice.maxVolMl = (a = r.slice) == null ? void 0 : a.maxVolMl, (c = r == null ? void 0 : r.container) != null && c.enjoyByDate ? i.enjoyByDate = new Date(r.container.enjoyByDate) : i.enjoyByDate = void 0, r.pumps.forEach((l) => {
|
|
777
777
|
g(() => {
|
|
778
778
|
const p = i.pumps.getModel(l.path);
|
|
779
779
|
p && (p.ingredientId = l.ingredientId, p.inserted = l.inserted, p.prevIngredientId = l.prevIngredientId);
|
|
@@ -826,12 +826,12 @@ const rt = {
|
|
|
826
826
|
extension: u.BoardMapper,
|
|
827
827
|
data: e,
|
|
828
828
|
contextData: {}
|
|
829
|
-
}), { type: r, name:
|
|
829
|
+
}), { type: r, name: s, path: i, linked: n, instanceId: a, ...c } = e, l = { ...c, ...t }, p = {
|
|
830
830
|
type: r,
|
|
831
|
-
name:
|
|
831
|
+
name: s,
|
|
832
832
|
path: i,
|
|
833
|
-
linked:
|
|
834
|
-
instanceId:
|
|
833
|
+
linked: n,
|
|
834
|
+
instanceId: a,
|
|
835
835
|
...l
|
|
836
836
|
}, y = et.factory(e.path)(p);
|
|
837
837
|
return y.updateModel(p), y;
|
|
@@ -853,16 +853,16 @@ const br = async ({
|
|
|
853
853
|
pumpId: t,
|
|
854
854
|
tracker: r
|
|
855
855
|
}) => {
|
|
856
|
-
const
|
|
856
|
+
const s = `${Ee}/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/pour/${t}/${e}`, i = await Pr({ model: {}, urlOverride: s, tracker: r });
|
|
857
857
|
return i != null && i.data && pe.initiateFuture(i.data), i;
|
|
858
858
|
}, _r = async (e, t) => {
|
|
859
|
-
const r = `${Ee}/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/intent/${e}/${t}/volume`,
|
|
860
|
-
return
|
|
859
|
+
const r = `${Ee}/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/intent/${e}/${t}/volume`, s = await vr({ urlOverride: r });
|
|
860
|
+
return s != null && s.data ? s.data : { volume: -1 };
|
|
861
861
|
};
|
|
862
|
-
var Mr = Object.defineProperty, Or = Object.getOwnPropertyDescriptor, we = (e, t, r,
|
|
863
|
-
for (var i =
|
|
864
|
-
(
|
|
865
|
-
return
|
|
862
|
+
var Mr = Object.defineProperty, Or = Object.getOwnPropertyDescriptor, we = (e, t, r, s) => {
|
|
863
|
+
for (var i = s > 1 ? void 0 : s ? Or(t, r) : t, n = e.length - 1, a; n >= 0; n--)
|
|
864
|
+
(a = e[n]) && (i = (s ? a(t, r, i) : a(i)) || i);
|
|
865
|
+
return s && i && Mr(t, r, i), i;
|
|
866
866
|
};
|
|
867
867
|
const k = D.Pump;
|
|
868
868
|
h[Me].register(
|
|
@@ -889,30 +889,30 @@ let q = class {
|
|
|
889
889
|
this.id = e;
|
|
890
890
|
const {
|
|
891
891
|
inserted: r,
|
|
892
|
-
holderPath:
|
|
892
|
+
holderPath: s,
|
|
893
893
|
boardPath: i,
|
|
894
|
-
nozzlePath:
|
|
895
|
-
name:
|
|
894
|
+
nozzlePath: n,
|
|
895
|
+
name: a,
|
|
896
896
|
path: c,
|
|
897
897
|
childPump: l,
|
|
898
898
|
virtual: p,
|
|
899
899
|
prevIngredientId: y,
|
|
900
900
|
...U
|
|
901
901
|
} = t;
|
|
902
|
-
this.inserted = r, this.type = t.type, this.ingredientId = t.ingredientId, this.holderPath =
|
|
902
|
+
this.inserted = r, this.type = t.type, this.ingredientId = t.ingredientId, this.holderPath = s, this.boardPath = i, this.nozzlePath = n, this.name = a, this.path = c, this.childPump = !!l, this.virtual = !!p, this.prevIngredientId = y, Object.assign(this, U), this.futureHandler = new Ge(this);
|
|
903
903
|
}
|
|
904
904
|
updateModel(e) {
|
|
905
905
|
const {
|
|
906
906
|
inserted: t,
|
|
907
907
|
holderPath: r,
|
|
908
|
-
boardPath:
|
|
908
|
+
boardPath: s,
|
|
909
909
|
nozzlePath: i,
|
|
910
|
-
childPump:
|
|
911
|
-
name:
|
|
910
|
+
childPump: n,
|
|
911
|
+
name: a,
|
|
912
912
|
path: c,
|
|
913
913
|
...l
|
|
914
914
|
} = e;
|
|
915
|
-
this.inserted = t, this.type = e.type, this.ingredientId = e.ingredientId, this.holderPath = r, this.boardPath =
|
|
915
|
+
this.inserted = t, this.type = e.type, this.ingredientId = e.ingredientId, this.holderPath = r, this.boardPath = s, this.nozzlePath = i, this.childPump = this.childPump ? this.childPump : !!n, this.name = a, this.path = c, this.prevIngredientId = e.prevIngredientId, Object.assign(this, l);
|
|
916
916
|
}
|
|
917
917
|
// -------------------LIFECYCLE----------------------------
|
|
918
918
|
get troubles() {
|
|
@@ -963,18 +963,18 @@ let q = class {
|
|
|
963
963
|
if (this.currentState === d.IDLE) {
|
|
964
964
|
if (this.currentState = d.POUR_STARTING, !t)
|
|
965
965
|
throw new Error("No tracker provided");
|
|
966
|
-
const
|
|
966
|
+
const s = await br({
|
|
967
967
|
tracker: t,
|
|
968
968
|
intent: r,
|
|
969
969
|
pumpId: this.path
|
|
970
970
|
});
|
|
971
971
|
return this.currentState === d.POUR_STARTING && g(() => {
|
|
972
972
|
this.currentState = d.POURING;
|
|
973
|
-
}),
|
|
973
|
+
}), s == null ? void 0 : s.data;
|
|
974
974
|
} else
|
|
975
975
|
throw new Error(`Cannot pour in state ${this.currentState}`);
|
|
976
|
-
} catch (
|
|
977
|
-
throw m.error(
|
|
976
|
+
} catch (s) {
|
|
977
|
+
throw m.error(s), this.currentState = d.IDLE, s;
|
|
978
978
|
}
|
|
979
979
|
}
|
|
980
980
|
// -------------------ENTITY----------------------------
|
|
@@ -999,7 +999,7 @@ const it = {
|
|
|
999
999
|
predicate: v(k),
|
|
1000
1000
|
factory: b.Factory.create(k)
|
|
1001
1001
|
}, Er = m.createLogger({ name: "pump-utils" }), wr = (e, t) => {
|
|
1002
|
-
const r = (t.pumps ?? []).length > 1,
|
|
1002
|
+
const r = (t.pumps ?? []).length > 1, s = {
|
|
1003
1003
|
boardPath: t.boardPath,
|
|
1004
1004
|
holderPath: t.holderPath,
|
|
1005
1005
|
ingredientId: t.ingredientId,
|
|
@@ -1011,28 +1011,28 @@ const it = {
|
|
|
1011
1011
|
type: t.type,
|
|
1012
1012
|
nozzlePath: e,
|
|
1013
1013
|
prevIngredientId: t.prevIngredientId
|
|
1014
|
-
}, i = it.factory(t.path)(
|
|
1015
|
-
return i.updateModel(
|
|
1016
|
-
},
|
|
1014
|
+
}, i = it.factory(t.path)(s);
|
|
1015
|
+
return i.updateModel(s), i;
|
|
1016
|
+
}, st = (e) => (t) => (r) => (s) => {
|
|
1017
1017
|
var c;
|
|
1018
|
-
Er.debug(`adding pump ${
|
|
1019
|
-
const i = wr(r.path,
|
|
1018
|
+
Er.debug(`adding pump ${s.name}`);
|
|
1019
|
+
const i = wr(r.path, s);
|
|
1020
1020
|
e.addModel(i);
|
|
1021
|
-
const
|
|
1022
|
-
|
|
1021
|
+
const n = i.holderPath, a = t.holders.getModel(n);
|
|
1022
|
+
a == null || a.pumps.addModel(i), a != null && a.nozzlePaths.includes(r.path) || a == null || a.nozzlePaths.push(r.path), (c = s == null ? void 0 : s.pumps) == null || c.forEach((l) => {
|
|
1023
1023
|
const p = i.holderPath, y = {
|
|
1024
1024
|
...l,
|
|
1025
1025
|
childPump: !0,
|
|
1026
1026
|
holderPath: p,
|
|
1027
1027
|
ingredientId: i.ingredientId
|
|
1028
1028
|
};
|
|
1029
|
-
|
|
1029
|
+
st(e)(t)(r)(y);
|
|
1030
1030
|
});
|
|
1031
1031
|
};
|
|
1032
|
-
var $r = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, ee = (e, t, r,
|
|
1033
|
-
for (var i =
|
|
1034
|
-
(
|
|
1035
|
-
return
|
|
1032
|
+
var $r = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, ee = (e, t, r, s) => {
|
|
1033
|
+
for (var i = s > 1 ? void 0 : s ? Cr(t, r) : t, n = e.length - 1, a; n >= 0; n--)
|
|
1034
|
+
(a = e[n]) && (i = (s ? a(t, r, i) : a(i)) || i);
|
|
1035
|
+
return s && i && $r(t, r, i), i;
|
|
1036
1036
|
};
|
|
1037
1037
|
const Z = "assembly-model", Sr = "assembly-data";
|
|
1038
1038
|
let w = class {
|
|
@@ -1098,34 +1098,34 @@ let w = class {
|
|
|
1098
1098
|
data: t.data,
|
|
1099
1099
|
contextData: {}
|
|
1100
1100
|
});
|
|
1101
|
-
e.set(Sr, r), Object.assign(this, r), Object.entries(r).forEach(([
|
|
1102
|
-
gt(i) && (this.logger.debug(`adding child model ${
|
|
1101
|
+
e.set(Sr, r), Object.assign(this, r), Object.entries(r).forEach(([s, i]) => {
|
|
1102
|
+
gt(i) && (this.logger.debug(`adding child model ${s} from extension data`), this[yt][s] = !0);
|
|
1103
1103
|
});
|
|
1104
|
-
for await (const
|
|
1104
|
+
for await (const s of t.data.assemblies) {
|
|
1105
1105
|
const {
|
|
1106
1106
|
boards: i,
|
|
1107
|
-
holders:
|
|
1108
|
-
nozzles:
|
|
1107
|
+
holders: n,
|
|
1108
|
+
nozzles: a,
|
|
1109
1109
|
core: c,
|
|
1110
1110
|
name: l,
|
|
1111
1111
|
path: p,
|
|
1112
1112
|
...y
|
|
1113
|
-
} =
|
|
1113
|
+
} = s;
|
|
1114
1114
|
this.logger.debug(`adding assembly ${l}`), Object.keys(y).forEach((f) => {
|
|
1115
1115
|
It.enableFeature(f);
|
|
1116
1116
|
});
|
|
1117
1117
|
for await (const f of i)
|
|
1118
1118
|
this.logger.debug(`adding board ${f.name}`), await mr(this.boardContainer)(f);
|
|
1119
|
-
for await (const [f, N] of Object.entries(
|
|
1119
|
+
for await (const [f, N] of Object.entries(n))
|
|
1120
1120
|
for await (const re of N) {
|
|
1121
1121
|
this.logger.debug(`adding holder ${re.name}`);
|
|
1122
1122
|
const Se = await Zt(f, re);
|
|
1123
1123
|
this.holderContainer.holders.addModel(Se);
|
|
1124
1124
|
}
|
|
1125
|
-
const U =
|
|
1125
|
+
const U = st(this.pumpContainer)(
|
|
1126
1126
|
this.holderContainer
|
|
1127
1127
|
);
|
|
1128
|
-
|
|
1128
|
+
a.forEach((f) => {
|
|
1129
1129
|
this._nozzlePaths.add(f.path);
|
|
1130
1130
|
const N = U(f);
|
|
1131
1131
|
f.pumps.forEach(N);
|
|
@@ -1151,7 +1151,7 @@ ee([
|
|
|
1151
1151
|
w = ee([
|
|
1152
1152
|
I(Z)
|
|
1153
1153
|
], w);
|
|
1154
|
-
const
|
|
1154
|
+
const nt = {
|
|
1155
1155
|
registration: {
|
|
1156
1156
|
[Z]: {
|
|
1157
1157
|
class: w,
|
|
@@ -1162,16 +1162,17 @@ const at = {
|
|
|
1162
1162
|
predicate: v(Z),
|
|
1163
1163
|
factory: b.Singleton.create(Z)
|
|
1164
1164
|
};
|
|
1165
|
-
var Rr = Object.defineProperty, Dr = Object.getOwnPropertyDescriptor, Nr = (e, t, r,
|
|
1166
|
-
for (var i =
|
|
1167
|
-
(
|
|
1168
|
-
return
|
|
1165
|
+
var Rr = Object.defineProperty, Dr = Object.getOwnPropertyDescriptor, Nr = (e, t, r, s) => {
|
|
1166
|
+
for (var i = s > 1 ? void 0 : s ? Dr(t, r) : t, n = e.length - 1, a; n >= 0; n--)
|
|
1167
|
+
(a = e[n]) && (i = (s ? a(t, r, i) : a(i)) || i);
|
|
1168
|
+
return s && i && Rr(t, r, i), i;
|
|
1169
1169
|
};
|
|
1170
1170
|
const J = D.Availability;
|
|
1171
1171
|
let be = class {
|
|
1172
1172
|
constructor(e, t, r) {
|
|
1173
1173
|
o(this, "id");
|
|
1174
1174
|
o(this, "data");
|
|
1175
|
+
o(this, "properties");
|
|
1175
1176
|
o(this, "available");
|
|
1176
1177
|
o(this, "visible");
|
|
1177
1178
|
o(this, "groupId");
|
|
@@ -1182,7 +1183,7 @@ let be = class {
|
|
|
1182
1183
|
o(this, "taggedIds");
|
|
1183
1184
|
o(this, "parentId");
|
|
1184
1185
|
o(this, "logger");
|
|
1185
|
-
this.id = e, this.taggedIds = t.taggedIds || [], this.logger = r.logger, this.available = t.available, this.visible = t.visible, this.groupId = t.groupId, this.rawId = t.rawId, this.altId = t.altId, this.type = t.type, this.parentId = t.kosParentId, this.data = t.data, this.note = t.note;
|
|
1186
|
+
this.id = e, this.taggedIds = t.taggedIds || [], this.logger = r.logger, this.available = t.available, this.visible = t.visible, this.groupId = t.groupId, this.rawId = t.rawId, this.altId = t.altId, this.type = t.type, this.parentId = t.kosParentId, this.data = t.data, this.note = t.note, this.properties = t.properties || {};
|
|
1186
1187
|
}
|
|
1187
1188
|
updateModel(e) {
|
|
1188
1189
|
this.taggedIds = e.taggedIds || [], this.available = e.available, this.visible = e.visible, this.groupId = e.groupId, this.rawId = e.rawId, this.altId = e.altId, this.type = e.type, this.data = e.data;
|
|
@@ -1220,13 +1221,13 @@ const _e = {
|
|
|
1220
1221
|
});
|
|
1221
1222
|
return r != null && r.data && pe.initiateFuture(r.data), r;
|
|
1222
1223
|
}, xr = async (e, t, r) => {
|
|
1223
|
-
const
|
|
1224
|
+
const s = await $e({
|
|
1224
1225
|
model: {},
|
|
1225
1226
|
urlOverride: `${B}/api/ext/dispense/nozzle/${t}/pipeline/beverage/fixed/${e}`,
|
|
1226
1227
|
ordered: !0,
|
|
1227
1228
|
tracker: r
|
|
1228
1229
|
});
|
|
1229
|
-
return
|
|
1230
|
+
return s != null && s.data && pe.initiateFuture(s.data), s;
|
|
1230
1231
|
}, Ar = async (e) => await zr({
|
|
1231
1232
|
urlOverride: `${B}${e}/pipeline/beverage/availability`
|
|
1232
1233
|
}), Br = async (e, t) => await $e({
|
|
@@ -1236,10 +1237,10 @@ const _e = {
|
|
|
1236
1237
|
id: e,
|
|
1237
1238
|
urlOverride: `${B}/api/ext/dispense/nozzle/${e}/pipeline/beverage/select`
|
|
1238
1239
|
});
|
|
1239
|
-
var Gr = Object.defineProperty, jr = Object.getOwnPropertyDescriptor, te = (e, t, r,
|
|
1240
|
-
for (var i =
|
|
1241
|
-
(
|
|
1242
|
-
return
|
|
1240
|
+
var Gr = Object.defineProperty, jr = Object.getOwnPropertyDescriptor, te = (e, t, r, s) => {
|
|
1241
|
+
for (var i = s > 1 ? void 0 : s ? jr(t, r) : t, n = e.length - 1, a; n >= 0; n--)
|
|
1242
|
+
(a = e[n]) && (i = (s ? a(t, r, i) : a(i)) || i);
|
|
1243
|
+
return s && i && Gr(t, r, i), i;
|
|
1243
1244
|
};
|
|
1244
1245
|
const X = D.Nozzle, Fr = mt(
|
|
1245
1246
|
"beverageTopicPrefix"
|
|
@@ -1363,7 +1364,7 @@ let $ = class {
|
|
|
1363
1364
|
return;
|
|
1364
1365
|
}
|
|
1365
1366
|
this._selectedBeverage = e, this._additionalItems = t;
|
|
1366
|
-
let
|
|
1367
|
+
let s = await h.dataMapper.executeMapper(
|
|
1367
1368
|
u.SelectedPourableMapper,
|
|
1368
1369
|
{
|
|
1369
1370
|
beverage: e,
|
|
@@ -1374,11 +1375,11 @@ let $ = class {
|
|
|
1374
1375
|
const i = {
|
|
1375
1376
|
bevId: e.rawId
|
|
1376
1377
|
};
|
|
1377
|
-
(!
|
|
1378
|
+
(!s || Object.keys(s).length === 0) && (this.logger.info(
|
|
1378
1379
|
`No selected pourable mapper defined, using the default payload ${i}`
|
|
1379
|
-
),
|
|
1380
|
-
const
|
|
1381
|
-
if ((
|
|
1380
|
+
), s = i);
|
|
1381
|
+
const n = s ?? i, a = await Br(this.name, n);
|
|
1382
|
+
if ((a == null ? void 0 : a.status) !== 200)
|
|
1382
1383
|
throw new Error("Failed to select pourable");
|
|
1383
1384
|
}
|
|
1384
1385
|
/**
|
|
@@ -1417,8 +1418,8 @@ let $ = class {
|
|
|
1417
1418
|
});
|
|
1418
1419
|
}
|
|
1419
1420
|
onFutureUpdate(e) {
|
|
1420
|
-
E(this).forEach((
|
|
1421
|
-
ie(
|
|
1421
|
+
E(this).forEach((s) => {
|
|
1422
|
+
ie(s) && s.onPourProgress(e);
|
|
1422
1423
|
});
|
|
1423
1424
|
const r = {
|
|
1424
1425
|
nozzleId: this.id,
|
|
@@ -1443,14 +1444,14 @@ let $ = class {
|
|
|
1443
1444
|
throw new Error("No tracker provided");
|
|
1444
1445
|
const r = await Lr(this.name, e);
|
|
1445
1446
|
this.updateIfCurrent(d.POUR_STARTING, d.POURING), E(this).forEach((i) => {
|
|
1446
|
-
var
|
|
1447
|
-
ie(i) && ((
|
|
1447
|
+
var n;
|
|
1448
|
+
ie(i) && ((n = i.onPourStart) == null || n.call(i));
|
|
1448
1449
|
});
|
|
1449
|
-
const
|
|
1450
|
+
const s = {
|
|
1450
1451
|
nozzleId: this.id,
|
|
1451
1452
|
type: "free"
|
|
1452
1453
|
};
|
|
1453
|
-
if (_.publish(Te,
|
|
1454
|
+
if (_.publish(Te, s), (t = r == null ? void 0 : r.data) != null && t.endState) {
|
|
1454
1455
|
this.updateIfCurrent(d.POURING, d.IDLE);
|
|
1455
1456
|
const i = {
|
|
1456
1457
|
nozzleId: this.id
|
|
@@ -1470,29 +1471,29 @@ let $ = class {
|
|
|
1470
1471
|
if (this.currentState === d.IDLE) {
|
|
1471
1472
|
if (this.currentState = d.POUR_STARTING, !t)
|
|
1472
1473
|
throw new Error("No tracker provided");
|
|
1473
|
-
const
|
|
1474
|
+
const s = await xr(e, this.name, t);
|
|
1474
1475
|
this.currentState === d.POUR_STARTING && g(() => {
|
|
1475
1476
|
this.currentState = d.POURING;
|
|
1476
|
-
}), E(this).forEach((
|
|
1477
|
-
var
|
|
1478
|
-
ie(
|
|
1477
|
+
}), E(this).forEach((n) => {
|
|
1478
|
+
var a;
|
|
1479
|
+
ie(n) && ((a = n.onPourStart) == null || a.call(n));
|
|
1479
1480
|
});
|
|
1480
1481
|
const i = {
|
|
1481
1482
|
nozzleId: this.id,
|
|
1482
1483
|
type: "fixed"
|
|
1483
1484
|
};
|
|
1484
|
-
if (_.publish(Te, i), (r =
|
|
1485
|
+
if (_.publish(Te, i), (r = s == null ? void 0 : s.data) != null && r.endState) {
|
|
1485
1486
|
this.updateIfCurrent(d.POURING, d.IDLE);
|
|
1486
|
-
const
|
|
1487
|
+
const n = {
|
|
1487
1488
|
nozzleId: this.id
|
|
1488
1489
|
};
|
|
1489
|
-
_.publish(fe,
|
|
1490
|
+
_.publish(fe, n);
|
|
1490
1491
|
}
|
|
1491
|
-
return
|
|
1492
|
+
return s;
|
|
1492
1493
|
} else
|
|
1493
1494
|
throw new Error(`Cannot pour in state ${this.currentState}`);
|
|
1494
|
-
} catch (
|
|
1495
|
-
throw this.logger.error(
|
|
1495
|
+
} catch (s) {
|
|
1496
|
+
throw this.logger.error(s), this.currentState = d.IDLE, s;
|
|
1496
1497
|
}
|
|
1497
1498
|
}
|
|
1498
1499
|
/**
|
|
@@ -1504,8 +1505,8 @@ let $ = class {
|
|
|
1504
1505
|
this.currentState = d.POUR_CANCELING, await ((e = this.futureHandler.getFuture()) == null ? void 0 : e.cancelFuture()), g(() => {
|
|
1505
1506
|
this.currentState = d.IDLE;
|
|
1506
1507
|
}), E(this).forEach((r) => {
|
|
1507
|
-
var
|
|
1508
|
-
ie(r) && ((
|
|
1508
|
+
var s;
|
|
1509
|
+
ie(r) && ((s = r.onPourCancel) == null || s.call(r));
|
|
1509
1510
|
});
|
|
1510
1511
|
const t = {
|
|
1511
1512
|
nozzleId: this.id
|
|
@@ -1517,16 +1518,16 @@ let $ = class {
|
|
|
1517
1518
|
updateGroupMembers() {
|
|
1518
1519
|
this._availabilityItems.data.forEach((e) => {
|
|
1519
1520
|
(e.taggedIds || []).forEach((r) => {
|
|
1520
|
-
const
|
|
1521
|
+
const s = this._availabilityItems.data.find(
|
|
1521
1522
|
(i) => i.rawId === r
|
|
1522
1523
|
);
|
|
1523
|
-
|
|
1524
|
+
s && s.parentId !== e.id && (s.parentId = e.id, this._availabilityItems.updateModel(s));
|
|
1524
1525
|
});
|
|
1525
1526
|
});
|
|
1526
1527
|
}
|
|
1527
1528
|
/** @internal */
|
|
1528
1529
|
async load(e) {
|
|
1529
|
-
var
|
|
1530
|
+
var s, i;
|
|
1530
1531
|
this.logger.debug(`loading nozzle ${this.id}`);
|
|
1531
1532
|
const t = await Ar(this.urlPrefix);
|
|
1532
1533
|
if ((t == null ? void 0 : t.status) !== 200)
|
|
@@ -1536,21 +1537,22 @@ let $ = class {
|
|
|
1536
1537
|
{}
|
|
1537
1538
|
);
|
|
1538
1539
|
e == null || e.set(u.AvailabilityLoader, r), e == null || e.set(Ce.type, this);
|
|
1539
|
-
for (const
|
|
1540
|
-
for (const
|
|
1540
|
+
for (const n of Object.keys((s = t.data) == null ? void 0 : s.groups) || [])
|
|
1541
|
+
for (const a of ((i = t.data) == null ? void 0 : i.groups[n]) || []) {
|
|
1541
1542
|
const c = await h.dataMapper.executeMapper(
|
|
1542
1543
|
u.AvailabilityMapper,
|
|
1543
|
-
{ ...
|
|
1544
|
+
{ ...a, groupId: n },
|
|
1544
1545
|
r
|
|
1545
1546
|
), l = {
|
|
1546
|
-
...
|
|
1547
|
-
note:
|
|
1547
|
+
...a,
|
|
1548
|
+
note: a.note ?? void 0,
|
|
1548
1549
|
kosParentId: this.id,
|
|
1549
|
-
rawId:
|
|
1550
|
-
groupId:
|
|
1551
|
-
data: c
|
|
1550
|
+
rawId: a.id,
|
|
1551
|
+
groupId: n,
|
|
1552
|
+
data: c,
|
|
1553
|
+
properties: a.properties || {}
|
|
1552
1554
|
}, p = _e.factory(
|
|
1553
|
-
`${this.id}-${
|
|
1555
|
+
`${this.id}-${n}-${a.id}`
|
|
1554
1556
|
)(l);
|
|
1555
1557
|
this._availabilityItems.addModel(p);
|
|
1556
1558
|
}
|
|
@@ -1559,60 +1561,62 @@ let $ = class {
|
|
|
1559
1561
|
async updateAvailability(e) {
|
|
1560
1562
|
const t = bt.getContext(this.id), r = (t == null ? void 0 : t.get(u.AvailabilityLoader)) || {};
|
|
1561
1563
|
if (e.rebuild)
|
|
1562
|
-
for (const
|
|
1563
|
-
this._availabilityItems.getIndexByKey("group",
|
|
1564
|
-
(
|
|
1565
|
-
(
|
|
1564
|
+
for (const s of Object.keys(e == null ? void 0 : e.groups) || []) {
|
|
1565
|
+
this._availabilityItems.getIndexByKey("group", s).filter(
|
|
1566
|
+
(n) => !e.groups[s].find(
|
|
1567
|
+
(a) => `${this.id}-${s}-${a.id}` === n.id
|
|
1566
1568
|
)
|
|
1567
|
-
).forEach((
|
|
1568
|
-
this._availabilityItems.removeModel(
|
|
1569
|
+
).forEach((n) => {
|
|
1570
|
+
this._availabilityItems.removeModel(n.id), _t(n);
|
|
1569
1571
|
});
|
|
1570
|
-
for (const
|
|
1571
|
-
const
|
|
1572
|
+
for (const n of (e == null ? void 0 : e.groups[s]) || []) {
|
|
1573
|
+
const a = await h.dataMapper.executeMapper(
|
|
1572
1574
|
u.AvailabilityMapper,
|
|
1573
|
-
{ ...
|
|
1575
|
+
{ ...n, groupId: s },
|
|
1574
1576
|
r
|
|
1575
1577
|
), c = {
|
|
1576
|
-
...
|
|
1577
|
-
note:
|
|
1578
|
+
...n,
|
|
1579
|
+
note: n.note ?? void 0,
|
|
1578
1580
|
kosParentId: this.id,
|
|
1579
|
-
groupId:
|
|
1580
|
-
rawId:
|
|
1581
|
-
data:
|
|
1582
|
-
taggedIds:
|
|
1581
|
+
groupId: s,
|
|
1582
|
+
rawId: n.id,
|
|
1583
|
+
data: a,
|
|
1584
|
+
taggedIds: n.taggedIds,
|
|
1585
|
+
properties: n.properties || {}
|
|
1583
1586
|
}, l = this._availabilityItems.getModel(
|
|
1584
|
-
`${this.id}-${
|
|
1587
|
+
`${this.id}-${s}-${n.id}`
|
|
1585
1588
|
);
|
|
1586
1589
|
if (l)
|
|
1587
1590
|
l.updateModel(c);
|
|
1588
1591
|
else {
|
|
1589
1592
|
const p = _e.factory(
|
|
1590
|
-
`${this.id}-${
|
|
1593
|
+
`${this.id}-${s}-${n.id}`
|
|
1591
1594
|
)(c);
|
|
1592
1595
|
this._availabilityItems.addModel(p);
|
|
1593
1596
|
}
|
|
1594
1597
|
}
|
|
1595
1598
|
}
|
|
1596
1599
|
else
|
|
1597
|
-
for (const
|
|
1598
|
-
for (const i of (e == null ? void 0 : e.groups[
|
|
1599
|
-
const
|
|
1600
|
+
for (const s of Object.keys(e == null ? void 0 : e.groups) || [])
|
|
1601
|
+
for (const i of (e == null ? void 0 : e.groups[s]) || []) {
|
|
1602
|
+
const n = await h.dataMapper.executeMapper(
|
|
1600
1603
|
u.AvailabilityMapper,
|
|
1601
|
-
{ ...i, groupId:
|
|
1604
|
+
{ ...i, groupId: s },
|
|
1602
1605
|
r
|
|
1603
|
-
),
|
|
1606
|
+
), a = {
|
|
1604
1607
|
...i,
|
|
1605
1608
|
note: i.note ?? void 0,
|
|
1606
1609
|
kosParentId: this.id,
|
|
1607
|
-
groupId:
|
|
1610
|
+
groupId: s,
|
|
1608
1611
|
rawId: i.id,
|
|
1609
|
-
data:
|
|
1612
|
+
data: n,
|
|
1610
1613
|
type: i.type,
|
|
1611
|
-
taggedIds: i.taggedIds
|
|
1614
|
+
taggedIds: i.taggedIds,
|
|
1615
|
+
properties: i.properties || {}
|
|
1612
1616
|
}, c = this._availabilityItems.getModel(
|
|
1613
|
-
`${this.id}-${
|
|
1617
|
+
`${this.id}-${s}-${i.id}`
|
|
1614
1618
|
);
|
|
1615
|
-
c && c.updateModel(
|
|
1619
|
+
c && c.updateModel(a);
|
|
1616
1620
|
}
|
|
1617
1621
|
this.updateGroupMembers();
|
|
1618
1622
|
}
|
|
@@ -1647,10 +1651,10 @@ const Ce = {
|
|
|
1647
1651
|
predicate: v(X),
|
|
1648
1652
|
factory: b.Factory.create(X)
|
|
1649
1653
|
};
|
|
1650
|
-
var Kr = Object.defineProperty, Vr = Object.getOwnPropertyDescriptor,
|
|
1651
|
-
for (var i =
|
|
1652
|
-
(
|
|
1653
|
-
return
|
|
1654
|
+
var Kr = Object.defineProperty, Vr = Object.getOwnPropertyDescriptor, at = (e, t, r, s) => {
|
|
1655
|
+
for (var i = s > 1 ? void 0 : s ? Vr(t, r) : t, n = e.length - 1, a; n >= 0; n--)
|
|
1656
|
+
(a = e[n]) && (i = (s ? a(t, r, i) : a(i)) || i);
|
|
1657
|
+
return s && i && Kr(t, r, i), i;
|
|
1654
1658
|
};
|
|
1655
1659
|
const ot = "device-assembly-model";
|
|
1656
1660
|
let de = class {
|
|
@@ -1674,22 +1678,22 @@ let de = class {
|
|
|
1674
1678
|
this.logger.debug(`loading device-assembly ${this.id}`);
|
|
1675
1679
|
const e = await Ze();
|
|
1676
1680
|
(e == null ? void 0 : e.status) === 200 && e.data.assemblies.map((r) => r.nozzles).flat().forEach((r) => {
|
|
1677
|
-
var
|
|
1678
|
-
const
|
|
1681
|
+
var a;
|
|
1682
|
+
const s = r.path, i = ((a = r.pipelines.find((c) => c.name === "beverage")) == null ? void 0 : a.topicPrefix) || "", n = Ce.factory(s)({
|
|
1679
1683
|
path: r.path,
|
|
1680
1684
|
name: r.name,
|
|
1681
1685
|
urlPrefix: r.urlPrefix,
|
|
1682
1686
|
topicPrefix: r.topicPrefix,
|
|
1683
1687
|
beverageTopicPrefix: i
|
|
1684
1688
|
});
|
|
1685
|
-
this.deviceNozzles.addModel(
|
|
1689
|
+
this.deviceNozzles.addModel(n);
|
|
1686
1690
|
});
|
|
1687
1691
|
}
|
|
1688
1692
|
};
|
|
1689
|
-
|
|
1693
|
+
at([
|
|
1690
1694
|
M
|
|
1691
1695
|
], de.prototype, "deviceNozzles", 2);
|
|
1692
|
-
de =
|
|
1696
|
+
de = at([
|
|
1693
1697
|
I(ot)
|
|
1694
1698
|
], de);
|
|
1695
1699
|
const Yr = new Mt({
|
|
@@ -1706,10 +1710,10 @@ const Yr = new Mt({
|
|
|
1706
1710
|
});
|
|
1707
1711
|
return r != null && r.data && pe.initiateFuture(r.data), r;
|
|
1708
1712
|
};
|
|
1709
|
-
var Jr = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor, lt = (e, t, r,
|
|
1710
|
-
for (var i =
|
|
1711
|
-
(
|
|
1712
|
-
return
|
|
1713
|
+
var Jr = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor, lt = (e, t, r, s) => {
|
|
1714
|
+
for (var i = s > 1 ? void 0 : s ? Xr(t, r) : t, n = e.length - 1, a; n >= 0; n--)
|
|
1715
|
+
(a = e[n]) && (i = (s ? a(t, r, i) : a(i)) || i);
|
|
1716
|
+
return s && i && Jr(t, r, i), i;
|
|
1713
1717
|
};
|
|
1714
1718
|
const ct = "generic-pour-model", qr = "/kos/generic/pour/started", Wr = "/kos/generic/pour/progress", ze = "/kos/generic/pour/cancel", me = (e) => e.onPourStart !== void 0 && e.onPourCancel !== void 0 && e.onPourProgress !== void 0;
|
|
1715
1719
|
let le = class {
|
|
@@ -1734,14 +1738,14 @@ let le = class {
|
|
|
1734
1738
|
throw new Error("No tracker provided");
|
|
1735
1739
|
const r = await Zr(this.servicePath, e);
|
|
1736
1740
|
this.updateIfCurrent(d.POUR_STARTING, d.POURING), E(this).forEach((i) => {
|
|
1737
|
-
var
|
|
1738
|
-
me(i) && ((
|
|
1741
|
+
var n;
|
|
1742
|
+
me(i) && ((n = i.onPourStart) == null || n.call(i));
|
|
1739
1743
|
});
|
|
1740
|
-
const
|
|
1744
|
+
const s = {
|
|
1741
1745
|
pourTarget: this.id,
|
|
1742
1746
|
type: this.pourType
|
|
1743
1747
|
};
|
|
1744
|
-
if (_.publish(qr,
|
|
1748
|
+
if (_.publish(qr, s), (t = r == null ? void 0 : r.data) != null && t.endState) {
|
|
1745
1749
|
this.updateIfCurrent(d.POURING, d.IDLE);
|
|
1746
1750
|
const i = {
|
|
1747
1751
|
pourTarget: this.id
|
|
@@ -1761,8 +1765,8 @@ let le = class {
|
|
|
1761
1765
|
this.currentState = d.POUR_CANCELING, await ((e = this.futureHandler.getFuture()) == null ? void 0 : e.cancelFuture()), g(() => {
|
|
1762
1766
|
this.currentState = d.IDLE;
|
|
1763
1767
|
}), E(this).forEach((r) => {
|
|
1764
|
-
var
|
|
1765
|
-
me(r) && ((
|
|
1768
|
+
var s;
|
|
1769
|
+
me(r) && ((s = r.onPourCancel) == null || s.call(r));
|
|
1766
1770
|
});
|
|
1767
1771
|
const t = {
|
|
1768
1772
|
pourTarget: this.id
|
|
@@ -1847,7 +1851,7 @@ const oi = new Ot({
|
|
|
1847
1851
|
...it.registration,
|
|
1848
1852
|
...Oe.registration,
|
|
1849
1853
|
..._e.registration,
|
|
1850
|
-
...
|
|
1854
|
+
...nt.registration,
|
|
1851
1855
|
...tt.registration
|
|
1852
1856
|
}, Qr = (e) => () => (wt(e)(), Yr.register(), Object.keys(Le).forEach((t) => {
|
|
1853
1857
|
const r = Le[t];
|
|
@@ -1857,12 +1861,12 @@ const oi = new Ot({
|
|
|
1857
1861
|
async (t) => {
|
|
1858
1862
|
var r;
|
|
1859
1863
|
if ((r = t.data) != null && r.deviceId) {
|
|
1860
|
-
const { model:
|
|
1861
|
-
|
|
1864
|
+
const { model: s } = z(
|
|
1865
|
+
nt.type
|
|
1862
1866
|
);
|
|
1863
|
-
if (
|
|
1864
|
-
const i =
|
|
1865
|
-
(
|
|
1867
|
+
if (s) {
|
|
1868
|
+
const i = s.boards.find(
|
|
1869
|
+
(n) => n.id === t.data.deviceId
|
|
1866
1870
|
) ? z(t.data.deviceId).model : void 0;
|
|
1867
1871
|
return {
|
|
1868
1872
|
devices: i ? i.name : ""
|
|
@@ -1888,7 +1892,7 @@ P.companion = O.companion.register(P);
|
|
|
1888
1892
|
P.legacy = O.model.registerLegacyModel(P);
|
|
1889
1893
|
const di = P;
|
|
1890
1894
|
export {
|
|
1891
|
-
|
|
1895
|
+
nt as A,
|
|
1892
1896
|
x as B,
|
|
1893
1897
|
xr as C,
|
|
1894
1898
|
D,
|
|
@@ -1915,10 +1919,10 @@ export {
|
|
|
1915
1919
|
d as j,
|
|
1916
1920
|
Le as k,
|
|
1917
1921
|
Nt as l,
|
|
1918
|
-
|
|
1922
|
+
ni as m,
|
|
1919
1923
|
Ut as n,
|
|
1920
|
-
|
|
1921
|
-
|
|
1924
|
+
ai as o,
|
|
1925
|
+
si as p,
|
|
1922
1926
|
ii as q,
|
|
1923
1927
|
Qr as r,
|
|
1924
1928
|
jt as s,
|
|
@@ -1930,4 +1934,4 @@ export {
|
|
|
1930
1934
|
Ur as y,
|
|
1931
1935
|
Ar as z
|
|
1932
1936
|
};
|
|
1933
|
-
//# sourceMappingURL=dispense-registration-manager-
|
|
1937
|
+
//# sourceMappingURL=dispense-registration-manager-BX9C7jzd.js.map
|