@kosdev-code/kos-dispense-sdk 2.0.15 → 2.0.16
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-BXNJ1hUZ.cjs +2 -0
- package/{dispense-registration-manager-6NDXduUb.cjs.map → dispense-registration-manager-BXNJ1hUZ.cjs.map} +1 -1
- package/{dispense-registration-manager-CSjwKonf.js → dispense-registration-manager-UjShRcvq.js} +516 -487
- package/{dispense-registration-manager-CSjwKonf.js.map → dispense-registration-manager-UjShRcvq.js.map} +1 -1
- package/{extension-utils-BBJG9cnM.js → extension-utils-DrKHgDXC.js} +2 -2
- package/{extension-utils-BBJG9cnM.js.map → extension-utils-DrKHgDXC.js.map} +1 -1
- package/{extension-utils-DYqo5NBO.cjs → extension-utils-lo_uDdh9.cjs} +2 -2
- package/{extension-utils-DYqo5NBO.cjs.map → extension-utils-lo_uDdh9.cjs.map} +1 -1
- package/index.cjs +1 -1
- package/index.js +3 -3
- package/models/models/generic-pour/generic-pour-model.d.ts +3 -2
- package/models/models/generic-pour/generic-pour-model.d.ts.map +1 -1
- package/models/models/generic-pour/types/index.d.ts +2 -1
- package/models/models/nozzle/nozzle-model.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 +2 -0
- package/pump-provider-DMGN5lvz.cjs.map +1 -0
- package/pump-provider-DpNSFHld.js +1065 -0
- package/pump-provider-DpNSFHld.js.map +1 -0
- package/ui/hooks/generic-pour/use-generic-pour.d.ts +1 -1
- package/ui/hooks/generic-pour/use-generic-pour.d.ts.map +1 -1
- package/ui/hooks/generic-pour/with-generic-pour.d.ts +2 -1
- package/ui/hooks/generic-pour/with-generic-pour.d.ts.map +1 -1
- package/ui/hooks/pour/use-pour.d.ts +2 -1
- package/ui/hooks/pour/use-pour.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts +2 -2
- package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts.map +1 -1
- package/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.d.ts +2 -2
- package/ui/hooks/utils/pour-strategy/tap-or-hold-to-pour-intent-strategy.d.ts.map +1 -1
- package/ui.cjs +1 -1
- package/ui.js +2 -2
- package/dispense-registration-manager-6NDXduUb.cjs +0 -2
- package/pump-provider-B2FPLQDA.cjs +0 -2
- package/pump-provider-B2FPLQDA.cjs.map +0 -1
- package/pump-provider-BN6_xdlt.js +0 -1073
- package/pump-provider-BN6_xdlt.js.map +0 -1
package/{dispense-registration-manager-CSjwKonf.js → dispense-registration-manager-UjShRcvq.js}
RENAMED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var o = (e, t, r) => (
|
|
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
|
|
1
|
+
var pt = Object.defineProperty;
|
|
2
|
+
var ut = (e, t, r) => t in e ? pt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var o = (e, t, r) => (ut(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
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 || {}),
|
|
7
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
8
|
-
(
|
|
9
|
-
return n && i &&
|
|
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, n) => {
|
|
7
|
+
for (var i = n > 1 ? void 0 : n ? St(t, r) : t, a = e.length - 1, s; a >= 0; a--)
|
|
8
|
+
(s = e[a]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
9
|
+
return n && i && Ct(t, r, i), i;
|
|
10
10
|
};
|
|
11
|
-
const
|
|
12
|
-
let
|
|
11
|
+
const G = "ingredient-model";
|
|
12
|
+
let Pe = class {
|
|
13
13
|
constructor(e, {
|
|
14
14
|
name: t,
|
|
15
15
|
type: r,
|
|
16
16
|
data: n,
|
|
17
17
|
ingredientId: i,
|
|
18
|
-
...
|
|
18
|
+
...a
|
|
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 = n, Object.assign(this,
|
|
25
|
+
this.id = e, this.ingredientId = i, this.name = t, this.type = r, this.data = n, Object.assign(this, a);
|
|
26
26
|
}
|
|
27
27
|
updateModel({
|
|
28
28
|
name: e,
|
|
@@ -36,30 +36,30 @@ let me = class {
|
|
|
36
36
|
// -------------------LIFECYCLE----------------------------
|
|
37
37
|
// -------------------ENTITY----------------------------
|
|
38
38
|
};
|
|
39
|
-
|
|
40
|
-
I(
|
|
41
|
-
],
|
|
42
|
-
const
|
|
39
|
+
Pe = Rt([
|
|
40
|
+
I(G)
|
|
41
|
+
], Pe);
|
|
42
|
+
const je = {
|
|
43
43
|
registration: {
|
|
44
|
-
[
|
|
45
|
-
class:
|
|
44
|
+
[G]: {
|
|
45
|
+
class: Pe,
|
|
46
46
|
singleton: !1
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
-
type:
|
|
50
|
-
predicate: v(
|
|
51
|
-
factory: b.Factory.create(
|
|
52
|
-
}, { URL:
|
|
53
|
-
basePath: `${
|
|
54
|
-
}),
|
|
55
|
-
urlOverride: `${
|
|
49
|
+
type: G,
|
|
50
|
+
predicate: v(G),
|
|
51
|
+
factory: b.Factory.create(G)
|
|
52
|
+
}, { URL: Fe } = C("INGREDIENT_SERVICE"), { getOne: Dt } = S.build({
|
|
53
|
+
basePath: `${Fe}/api/ext/dispense/ingredients`
|
|
54
|
+
}), Nt = async () => await Dt({
|
|
55
|
+
urlOverride: `${Fe}/api/ext/dispense/ingredients`
|
|
56
56
|
});
|
|
57
|
-
var Tt = Object.defineProperty,
|
|
58
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
59
|
-
(
|
|
57
|
+
var Tt = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, He = (e, t, r, n) => {
|
|
58
|
+
for (var i = n > 1 ? void 0 : n ? zt(t, r) : t, a = e.length - 1, s; a >= 0; a--)
|
|
59
|
+
(s = e[a]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
60
60
|
return n && i && Tt(t, r, i), i;
|
|
61
61
|
};
|
|
62
|
-
const
|
|
62
|
+
const j = "ingredient-container-model", Lt = m.createLogger({ name: "ingredient-container-model" });
|
|
63
63
|
let ne = class {
|
|
64
64
|
constructor(e, t) {
|
|
65
65
|
o(this, "id");
|
|
@@ -80,123 +80,123 @@ let ne = class {
|
|
|
80
80
|
}
|
|
81
81
|
async load(e) {
|
|
82
82
|
var i;
|
|
83
|
-
|
|
84
|
-
const t = await
|
|
83
|
+
Lt.debug(`loading ingredient container ${this.id}`);
|
|
84
|
+
const t = await Nt();
|
|
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 T.executeLoaderExtension({
|
|
88
88
|
context: e,
|
|
89
89
|
extension: u.IngredientLoader
|
|
90
90
|
}), n = (t == null ? void 0 : t.data) ?? {};
|
|
91
|
-
for (const
|
|
92
|
-
for (const
|
|
93
|
-
const c = await
|
|
91
|
+
for (const a of Object.keys(n))
|
|
92
|
+
for (const s of ((i = t == null ? void 0 : t.data) == null ? void 0 : i[a]) || []) {
|
|
93
|
+
const c = await T.executeDataMapperExtension({
|
|
94
94
|
extension: u.IngredientMapper,
|
|
95
|
-
data:
|
|
95
|
+
data: s,
|
|
96
96
|
contextData: r
|
|
97
|
-
}), l = await
|
|
97
|
+
}), l = await T.executePropertyMapperExtension({
|
|
98
98
|
extension: u.IngredientTypeMapper,
|
|
99
|
-
data:
|
|
99
|
+
data: s,
|
|
100
100
|
contextData: r
|
|
101
101
|
}), p = {
|
|
102
|
-
...
|
|
103
|
-
type: l ||
|
|
102
|
+
...s,
|
|
103
|
+
type: l || s.type,
|
|
104
104
|
...c,
|
|
105
105
|
data: c
|
|
106
|
-
},
|
|
106
|
+
}, y = je.factory(s.id)(
|
|
107
107
|
p
|
|
108
108
|
);
|
|
109
|
-
this.ingredients.addModel(
|
|
109
|
+
this.ingredients.addModel(y);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
// -------------------ENTITY----------------------------
|
|
113
113
|
};
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
He([
|
|
115
|
+
M
|
|
116
116
|
], ne.prototype, "ingredients", 2);
|
|
117
|
-
ne =
|
|
118
|
-
I(
|
|
117
|
+
ne = He([
|
|
118
|
+
I(j)
|
|
119
119
|
], ne);
|
|
120
|
-
const
|
|
120
|
+
const Ke = {
|
|
121
121
|
registration: {
|
|
122
|
-
[
|
|
122
|
+
[j]: {
|
|
123
123
|
class: ne,
|
|
124
124
|
singleton: !0
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
|
-
type:
|
|
128
|
-
predicate: v(
|
|
129
|
-
factory: b.Singleton.create(
|
|
130
|
-
}, { URL:
|
|
131
|
-
basePath: `${
|
|
132
|
-
}),
|
|
127
|
+
type: j,
|
|
128
|
+
predicate: v(j),
|
|
129
|
+
factory: b.Singleton.create(j)
|
|
130
|
+
}, { URL: he } = C("HOLDER_SERVICE"), { getAll: xt, postModel: Ve, deleteModel: At } = S.build({
|
|
131
|
+
basePath: `${he}/api/kos/holders`
|
|
132
|
+
}), Bt = m.createLogger({
|
|
133
133
|
name: "holder-service",
|
|
134
134
|
group: "Services"
|
|
135
|
-
}), ii = async () => await
|
|
135
|
+
}), ii = async () => await xt({}), Ut = async (e, t) => {
|
|
136
136
|
if (!e || !t)
|
|
137
137
|
throw new Error("Missing holderPath or ingredientId");
|
|
138
|
-
return await
|
|
138
|
+
return await Ve({
|
|
139
139
|
model: { holderPath: e, ingredientId: t },
|
|
140
|
-
urlOverride: `${
|
|
140
|
+
urlOverride: `${he}/api/ext/dispense/assignments`
|
|
141
141
|
});
|
|
142
|
-
},
|
|
142
|
+
}, Gt = async (e) => {
|
|
143
143
|
if (!e)
|
|
144
144
|
throw new Error("Missing holderPath");
|
|
145
|
-
return await
|
|
145
|
+
return await At({
|
|
146
146
|
id: e,
|
|
147
|
-
urlOverride: `${
|
|
147
|
+
urlOverride: `${he}/api/ext/dispense/assignments/${e}`
|
|
148
148
|
});
|
|
149
|
-
},
|
|
149
|
+
}, jt = async (e) => {
|
|
150
150
|
if (!e)
|
|
151
151
|
throw new Error("Missing holderPath");
|
|
152
|
-
return
|
|
152
|
+
return Bt.debug(
|
|
153
153
|
`sending POST request to /api/ext/dispense/pumpEvents/replaceLine/${e}`
|
|
154
|
-
), await
|
|
154
|
+
), await Ve({
|
|
155
155
|
model: {},
|
|
156
|
-
urlOverride: `${
|
|
156
|
+
urlOverride: `${he}/api/ext/dispense/pumpEvents/replaceLine/${e}`
|
|
157
157
|
});
|
|
158
|
-
}, { URL:
|
|
158
|
+
}, { URL: ae } = 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), n = `${
|
|
160
|
+
basePath: `${ae}/api/ext/dispense/assignments`
|
|
161
|
+
}), se = window.kosUseFos, ni = async () => await Ft({ fos: se }), Kt = async (e, t) => {
|
|
162
|
+
var i, a, s, c;
|
|
163
|
+
const r = JSON.stringify(t), n = `${ae}/api/ext/dispense/assignments`;
|
|
164
164
|
try {
|
|
165
|
-
const l = await
|
|
165
|
+
const l = await Ye({
|
|
166
166
|
model: { holderPath: e, factoryJson: r },
|
|
167
167
|
urlOverride: n
|
|
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
|
-
if (l instanceof
|
|
171
|
+
if (l instanceof ht)
|
|
172
172
|
return [
|
|
173
|
-
((
|
|
173
|
+
((s = (a = l.payload) == null ? void 0 : a.data) == null ? void 0 : s.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 =
|
|
180
|
-
return await
|
|
178
|
+
}, ai = async (e) => {
|
|
179
|
+
const t = se ? `${ae}/api/ingredients/assignments/${e.holderPath}` : `${ae}/api/ext/dispense/assignments`;
|
|
180
|
+
return await Ye({
|
|
181
181
|
model: { ...e, fuelGauge: 680 },
|
|
182
|
-
fos:
|
|
182
|
+
fos: se,
|
|
183
183
|
urlOverride: t
|
|
184
184
|
});
|
|
185
|
-
},
|
|
186
|
-
var
|
|
187
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
188
|
-
(
|
|
189
|
-
return n && i &&
|
|
185
|
+
}, si = async (e) => await Ht({ id: e, fos: se });
|
|
186
|
+
var Vt = Object.defineProperty, Yt = Object.getOwnPropertyDescriptor, ge = (e, t, r, n) => {
|
|
187
|
+
for (var i = n > 1 ? void 0 : n ? Yt(t, r) : t, a = e.length - 1, s; a >= 0; a--)
|
|
188
|
+
(s = e[a]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
189
|
+
return n && i && Vt(t, r, i), i;
|
|
190
190
|
};
|
|
191
|
-
const
|
|
192
|
-
|
|
191
|
+
const F = D.Holder, De = m.createLogger({ name: "holder-model" });
|
|
192
|
+
h[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
|
+
h[W].register(
|
|
200
200
|
"pump",
|
|
201
201
|
async (e) => {
|
|
202
202
|
if (e.data.pumpPath) {
|
|
@@ -215,13 +215,13 @@ g[W].register(
|
|
|
215
215
|
return {};
|
|
216
216
|
}
|
|
217
217
|
);
|
|
218
|
-
|
|
218
|
+
h[W].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
|
+
h[W].register(
|
|
225
225
|
"container",
|
|
226
226
|
async (e) => {
|
|
227
227
|
if (e.data.ingredients.length > 0) {
|
|
@@ -235,7 +235,7 @@ g[W].register(
|
|
|
235
235
|
return {};
|
|
236
236
|
}
|
|
237
237
|
);
|
|
238
|
-
class
|
|
238
|
+
class kt extends Error {
|
|
239
239
|
constructor(r, n) {
|
|
240
240
|
super(n);
|
|
241
241
|
o(this, "type");
|
|
@@ -248,12 +248,12 @@ let L = class {
|
|
|
248
248
|
name: r,
|
|
249
249
|
ingredientSource: n,
|
|
250
250
|
ingredientId: i,
|
|
251
|
-
ingredientType:
|
|
252
|
-
slice:
|
|
251
|
+
ingredientType: a,
|
|
252
|
+
slice: s,
|
|
253
253
|
group: c,
|
|
254
254
|
data: l,
|
|
255
255
|
enjoyByDate: p
|
|
256
|
-
},
|
|
256
|
+
}, y) {
|
|
257
257
|
o(this, "id");
|
|
258
258
|
o(this, "path");
|
|
259
259
|
o(this, "name");
|
|
@@ -268,10 +268,10 @@ 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 = a, this.ingredientSource = n, this.ingredientId = i, this.group = c, this.slice = s, this.enjoyByDate = p, this.data = l, this.pumps = new R({
|
|
272
272
|
parentId: e,
|
|
273
273
|
sortKey: "path"
|
|
274
|
-
}), this.logger =
|
|
274
|
+
}), this.logger = y.logger;
|
|
275
275
|
}
|
|
276
276
|
updateModel({
|
|
277
277
|
path: e,
|
|
@@ -279,12 +279,12 @@ let L = class {
|
|
|
279
279
|
ingredientSource: r,
|
|
280
280
|
ingredientId: n,
|
|
281
281
|
ingredientType: i,
|
|
282
|
-
group:
|
|
283
|
-
slice:
|
|
282
|
+
group: a,
|
|
283
|
+
slice: s,
|
|
284
284
|
enjoyByDate: c,
|
|
285
285
|
data: l
|
|
286
286
|
}) {
|
|
287
|
-
this.path = e, this.name = t, this.ingredientId = n, this.ingredientType = i, this.ingredientSource = r, this.enjoyByDate = c, this.slice =
|
|
287
|
+
this.path = e, this.name = t, this.ingredientId = n, this.ingredientType = i, this.ingredientSource = r, this.enjoyByDate = c, this.slice = s, this.group = a, this.data = l;
|
|
288
288
|
}
|
|
289
289
|
get hasEnjoyByDate() {
|
|
290
290
|
return !!this.enjoyByDate && !this.unassigned;
|
|
@@ -351,7 +351,7 @@ let L = class {
|
|
|
351
351
|
}
|
|
352
352
|
get troublesByType() {
|
|
353
353
|
return this.troubles.reduce(
|
|
354
|
-
|
|
354
|
+
Ae,
|
|
355
355
|
{}
|
|
356
356
|
);
|
|
357
357
|
}
|
|
@@ -384,7 +384,7 @@ let L = class {
|
|
|
384
384
|
return this.hasMaxVolume && this.hasRemainingVolume;
|
|
385
385
|
}
|
|
386
386
|
updateIngredient(e) {
|
|
387
|
-
this.ingredientId !== e &&
|
|
387
|
+
this.ingredientId !== e && g(() => {
|
|
388
388
|
this.ingredientId = e;
|
|
389
389
|
});
|
|
390
390
|
}
|
|
@@ -396,33 +396,33 @@ let L = class {
|
|
|
396
396
|
if (!e)
|
|
397
397
|
throw new Error("Invalid override");
|
|
398
398
|
try {
|
|
399
|
-
const [t, r] = await
|
|
399
|
+
const [t, r] = await Kt(this.path, e);
|
|
400
400
|
if (t)
|
|
401
|
-
throw new
|
|
401
|
+
throw new kt(
|
|
402
402
|
t,
|
|
403
403
|
`Failed to perform rfid override on holder ${this.id}`
|
|
404
404
|
);
|
|
405
|
-
return
|
|
405
|
+
return g(() => {
|
|
406
406
|
this.ingredientId = r == null ? void 0 : r.ingredientId;
|
|
407
407
|
}), r;
|
|
408
408
|
} catch (t) {
|
|
409
|
-
throw
|
|
409
|
+
throw De.error(`Failed to perform rfid override on holder ${this.id}`, t), t;
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
async assignIngredient(e) {
|
|
413
413
|
try {
|
|
414
|
-
e ? await
|
|
414
|
+
e ? await Ut(this.path, e) : await Gt(this.path), g(() => {
|
|
415
415
|
this.ingredientId = e;
|
|
416
416
|
});
|
|
417
417
|
} catch (t) {
|
|
418
|
-
throw
|
|
418
|
+
throw De.error(`Failed to perform assign ingredient to holder ${this.id}`, t), t;
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
get shouldDefer() {
|
|
422
422
|
return this.troubles.some((e) => e.shouldDefer);
|
|
423
423
|
}
|
|
424
424
|
async replaceLine() {
|
|
425
|
-
await
|
|
425
|
+
await jt(this.path);
|
|
426
426
|
}
|
|
427
427
|
// -------------------LIFECYCLE----------------------------
|
|
428
428
|
// ----------------------------------
|
|
@@ -444,64 +444,64 @@ let L = class {
|
|
|
444
444
|
// }
|
|
445
445
|
// -------------------ENTITY----------------------------
|
|
446
446
|
};
|
|
447
|
-
|
|
448
|
-
|
|
447
|
+
ge([
|
|
448
|
+
M
|
|
449
449
|
], L.prototype, "pumps", 2);
|
|
450
|
-
|
|
451
|
-
ce({ modelType:
|
|
450
|
+
ge([
|
|
451
|
+
ce({ modelType: Ke.type })
|
|
452
452
|
], L.prototype, "ingredientContainer", 2);
|
|
453
|
-
|
|
454
|
-
ce({ modelType:
|
|
453
|
+
ge([
|
|
454
|
+
ce({ modelType: xe.type })
|
|
455
455
|
], L.prototype, "troubleContainer", 2);
|
|
456
|
-
L =
|
|
457
|
-
I(
|
|
456
|
+
L = ge([
|
|
457
|
+
I(F)
|
|
458
458
|
], L);
|
|
459
|
-
const
|
|
459
|
+
const ke = {
|
|
460
460
|
registration: {
|
|
461
|
-
[
|
|
461
|
+
[F]: {
|
|
462
462
|
class: L,
|
|
463
463
|
singleton: !1
|
|
464
464
|
}
|
|
465
465
|
},
|
|
466
|
-
type:
|
|
467
|
-
predicate: v(
|
|
468
|
-
factory: b.Factory.create(
|
|
469
|
-
},
|
|
470
|
-
var
|
|
471
|
-
const r =
|
|
466
|
+
type: F,
|
|
467
|
+
predicate: v(F),
|
|
468
|
+
factory: b.Factory.create(F)
|
|
469
|
+
}, Zt = async (e, t) => {
|
|
470
|
+
var Re;
|
|
471
|
+
const r = h.propertyMapper.executeMapper(
|
|
472
472
|
u.HolderIngredientMapper,
|
|
473
473
|
t
|
|
474
|
-
), n =
|
|
474
|
+
), n = h.propertyMapper.executeMapper(
|
|
475
475
|
u.HolderTypeMapper,
|
|
476
476
|
t
|
|
477
|
-
) || t.ingType, i = await
|
|
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: a, path: s, ingredientId: c, ingType: l, ingSource: p, slice: y, ...U } = t, f = { ...U, ...i }, N = y || { pos: 0 }, re = {
|
|
482
|
+
name: a,
|
|
483
|
+
path: s,
|
|
484
484
|
ingredientId: r || c,
|
|
485
485
|
ingredientType: n || l,
|
|
486
486
|
ingredientSource: p,
|
|
487
|
-
enjoyByDate: (
|
|
488
|
-
slice:
|
|
487
|
+
enjoyByDate: (Re = t.container) != null && Re.enjoyByDate ? new Date(t.container.enjoyByDate) : void 0,
|
|
488
|
+
slice: N,
|
|
489
489
|
group: e,
|
|
490
490
|
data: f
|
|
491
491
|
};
|
|
492
|
-
return
|
|
493
|
-
}, { URL:
|
|
494
|
-
basePath: `${
|
|
495
|
-
}),
|
|
492
|
+
return ke.factory(t.path)(re);
|
|
493
|
+
}, { URL: Jt } = C("ASSEMBLY_SERVICE"), { getOne: Xt } = S.build({
|
|
494
|
+
basePath: `${Jt}/api/kos/device/assemblies`
|
|
495
|
+
}), qt = m.createLogger({
|
|
496
496
|
name: "assembly-service",
|
|
497
497
|
group: "Services"
|
|
498
|
-
}),
|
|
499
|
-
var
|
|
500
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
501
|
-
(
|
|
502
|
-
return n && i &&
|
|
498
|
+
}), Ze = async () => (qt.debug("sending GET for assembly"), await Xt({}));
|
|
499
|
+
var Wt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, ye = (e, t, r, n) => {
|
|
500
|
+
for (var i = n > 1 ? void 0 : n ? Qt(t, r) : t, a = e.length - 1, s; a >= 0; a--)
|
|
501
|
+
(s = e[a]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
502
|
+
return n && i && Wt(t, r, i), i;
|
|
503
503
|
};
|
|
504
|
-
const
|
|
504
|
+
const H = "board-container-model", Je = "/kos/hardware/board/linked", Xe = "/kos/hardware/board/unlinked";
|
|
505
505
|
let x = class {
|
|
506
506
|
constructor(e, t, r) {
|
|
507
507
|
o(this, "id");
|
|
@@ -532,47 +532,47 @@ let x = class {
|
|
|
532
532
|
r.updateModel(e);
|
|
533
533
|
}
|
|
534
534
|
handleBoardLinkEvent(e) {
|
|
535
|
-
this.logger.debug(`handling ${
|
|
535
|
+
this.logger.debug(`handling ${Je} event ${e}`), e ? this.updateBoard(e) : this.logger.debug("- boardLinkEvent is undefined");
|
|
536
536
|
}
|
|
537
537
|
handleBoardUnlinkEvent(e) {
|
|
538
538
|
this.logger.debug(
|
|
539
|
-
`handling ${
|
|
539
|
+
`handling ${Xe} event ${e}`
|
|
540
540
|
), e ? this.updateBoard(e) : this.logger.debug("- boardLinkEvent is undefined");
|
|
541
541
|
}
|
|
542
542
|
};
|
|
543
543
|
ye([
|
|
544
|
-
|
|
544
|
+
M
|
|
545
545
|
], x.prototype, "models", 2);
|
|
546
546
|
ye([
|
|
547
547
|
Q({
|
|
548
|
-
lifecycle:
|
|
549
|
-
topic:
|
|
548
|
+
lifecycle: Be.INIT,
|
|
549
|
+
topic: Je,
|
|
550
550
|
websocket: !0
|
|
551
551
|
})
|
|
552
552
|
], x.prototype, "handleBoardLinkEvent", 1);
|
|
553
553
|
ye([
|
|
554
554
|
Q({
|
|
555
|
-
lifecycle:
|
|
556
|
-
topic:
|
|
555
|
+
lifecycle: Be.INIT,
|
|
556
|
+
topic: Xe,
|
|
557
557
|
websocket: !0
|
|
558
558
|
})
|
|
559
559
|
], x.prototype, "handleBoardUnlinkEvent", 1);
|
|
560
560
|
x = ye([
|
|
561
|
-
I(
|
|
561
|
+
I(H)
|
|
562
562
|
], x);
|
|
563
|
-
const
|
|
563
|
+
const er = async (e) => {
|
|
564
564
|
const t = e.data.boardPath, { model: r } = z(t);
|
|
565
565
|
return {
|
|
566
566
|
boardName: (r == null ? void 0 : r.name) || ""
|
|
567
567
|
};
|
|
568
568
|
};
|
|
569
|
-
var
|
|
570
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
571
|
-
(
|
|
572
|
-
return n && i &&
|
|
569
|
+
var tr = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, qe = (e, t, r, n) => {
|
|
570
|
+
for (var i = n > 1 ? void 0 : n ? rr(t, r) : t, a = e.length - 1, s; a >= 0; a--)
|
|
571
|
+
(s = e[a]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
572
|
+
return n && i && tr(t, r, i), i;
|
|
573
573
|
};
|
|
574
|
-
const K =
|
|
575
|
-
var
|
|
574
|
+
const K = D.PumpContainer;
|
|
575
|
+
var We = /* @__PURE__ */ ((e) => (e.byBoard = "byBoard", e.byType = "byType", e.byNozzle = "byNozzle", e))(We || {});
|
|
576
576
|
let oe = class {
|
|
577
577
|
constructor(e, t) {
|
|
578
578
|
o(this, "id");
|
|
@@ -621,13 +621,13 @@ let oe = class {
|
|
|
621
621
|
}
|
|
622
622
|
// -------------------ENTITY----------------------------
|
|
623
623
|
};
|
|
624
|
-
|
|
625
|
-
|
|
624
|
+
qe([
|
|
625
|
+
M
|
|
626
626
|
], oe.prototype, "pumps", 2);
|
|
627
|
-
oe =
|
|
627
|
+
oe = qe([
|
|
628
628
|
I(K)
|
|
629
629
|
], oe);
|
|
630
|
-
const
|
|
630
|
+
const Oe = {
|
|
631
631
|
registration: {
|
|
632
632
|
[K]: {
|
|
633
633
|
class: oe,
|
|
@@ -639,51 +639,51 @@ const Me = {
|
|
|
639
639
|
factory: b.Singleton.create(
|
|
640
640
|
K
|
|
641
641
|
)
|
|
642
|
-
},
|
|
643
|
-
const t = [], { model: r } = await
|
|
642
|
+
}, Qe = async (e) => {
|
|
643
|
+
const t = [], { model: r } = await Ue(e);
|
|
644
644
|
return r && (t.push(r.boardPath), t.push(r.nozzlePath), t.push(r.holderPath)), t;
|
|
645
|
-
},
|
|
645
|
+
}, ir = async (e) => {
|
|
646
646
|
const t = [], r = e.data.pumpPath;
|
|
647
647
|
t.push(r);
|
|
648
|
-
const n = await
|
|
648
|
+
const n = await Qe(r);
|
|
649
649
|
return [...t, ...n];
|
|
650
|
-
},
|
|
650
|
+
}, nr = async (e) => {
|
|
651
651
|
const t = [], r = e.data.boardPath;
|
|
652
652
|
t.push(e.data.boardPath);
|
|
653
|
-
const n = await
|
|
654
|
-
|
|
653
|
+
const n = await Ue(
|
|
654
|
+
Oe.type
|
|
655
655
|
);
|
|
656
656
|
if (n != null && n.model) {
|
|
657
|
-
const
|
|
658
|
-
|
|
657
|
+
const a = n.model.models.getIndexByKey(
|
|
658
|
+
We.byBoard,
|
|
659
659
|
r
|
|
660
660
|
).map(
|
|
661
|
-
(c) =>
|
|
661
|
+
(c) => Qe(c.path)
|
|
662
662
|
);
|
|
663
|
-
(await Promise.allSettled(
|
|
663
|
+
(await Promise.allSettled(a)).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 = n > 1 ? void 0 : n ?
|
|
671
|
-
(
|
|
672
|
-
return n && i &&
|
|
669
|
+
var ar = Object.defineProperty, sr = Object.getOwnPropertyDescriptor, or = (e, t, r, n) => {
|
|
670
|
+
for (var i = n > 1 ? void 0 : n ? sr(t, r) : t, a = e.length - 1, s; a >= 0; a--)
|
|
671
|
+
(s = e[a]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
672
|
+
return n && i && ar(t, r, i), i;
|
|
673
673
|
};
|
|
674
|
-
const V = "board-model",
|
|
675
|
-
const { type: r, name: n, path: i, linked:
|
|
676
|
-
t.type = r, t.name = n, t.path = i, t.linked =
|
|
674
|
+
const V = "board-model", Ne = (e, t) => {
|
|
675
|
+
const { type: r, name: n, path: i, linked: a, instanceId: s, link: c, ...l } = e;
|
|
676
|
+
t.type = r, t.name = n, t.path = i, t.linked = a, t.link = Object.freeze(c), t.instanceId = s, Object.assign(t, l);
|
|
677
677
|
};
|
|
678
|
-
|
|
678
|
+
h[Me].register(
|
|
679
679
|
"board",
|
|
680
|
-
|
|
680
|
+
nr
|
|
681
681
|
);
|
|
682
|
-
|
|
682
|
+
h[W].register(
|
|
683
683
|
"board",
|
|
684
|
-
|
|
684
|
+
er
|
|
685
685
|
);
|
|
686
|
-
let
|
|
686
|
+
let ve = class {
|
|
687
687
|
constructor(e, t, r) {
|
|
688
688
|
o(this, "id");
|
|
689
689
|
o(this, "type");
|
|
@@ -692,10 +692,10 @@ let Pe = class {
|
|
|
692
692
|
o(this, "linked");
|
|
693
693
|
o(this, "instanceId");
|
|
694
694
|
o(this, "logger");
|
|
695
|
-
this.id = e, this.logger = r.logger,
|
|
695
|
+
this.id = e, this.logger = r.logger, Ne(t, this);
|
|
696
696
|
}
|
|
697
697
|
updateModel(e) {
|
|
698
|
-
|
|
698
|
+
Ne(e, this);
|
|
699
699
|
}
|
|
700
700
|
// -------------------LIFECYCLE----------------------------
|
|
701
701
|
async init() {
|
|
@@ -705,39 +705,39 @@ let Pe = class {
|
|
|
705
705
|
this.logger.debug(`loading board ${this.id}`);
|
|
706
706
|
}
|
|
707
707
|
};
|
|
708
|
-
|
|
708
|
+
ve = or([
|
|
709
709
|
I(V)
|
|
710
|
-
],
|
|
711
|
-
const
|
|
710
|
+
], ve);
|
|
711
|
+
const et = {
|
|
712
712
|
registration: {
|
|
713
713
|
[V]: {
|
|
714
|
-
class:
|
|
714
|
+
class: ve,
|
|
715
715
|
singleton: !1
|
|
716
716
|
}
|
|
717
717
|
},
|
|
718
718
|
type: V,
|
|
719
719
|
predicate: v(V),
|
|
720
720
|
factory: b.Factory.create(V)
|
|
721
|
-
},
|
|
721
|
+
}, tt = {
|
|
722
722
|
registration: {
|
|
723
|
-
[
|
|
723
|
+
[H]: {
|
|
724
724
|
class: x,
|
|
725
725
|
singleton: !0
|
|
726
726
|
},
|
|
727
|
-
...
|
|
727
|
+
...et.registration
|
|
728
728
|
},
|
|
729
|
-
type:
|
|
730
|
-
predicate: v(
|
|
729
|
+
type: H,
|
|
730
|
+
predicate: v(H),
|
|
731
731
|
factory: b.Singleton.create(
|
|
732
|
-
|
|
732
|
+
H
|
|
733
733
|
)
|
|
734
734
|
};
|
|
735
|
-
var
|
|
736
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
737
|
-
(
|
|
738
|
-
return n && i &&
|
|
735
|
+
var dr = Object.defineProperty, lr = Object.getOwnPropertyDescriptor, Ie = (e, t, r, n) => {
|
|
736
|
+
for (var i = n > 1 ? void 0 : n ? lr(t, r) : t, a = e.length - 1, s; a >= 0; a--)
|
|
737
|
+
(s = e[a]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
738
|
+
return n && i && dr(t, r, i), i;
|
|
739
739
|
};
|
|
740
|
-
const Y =
|
|
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 {
|
|
742
742
|
constructor(e, t, r) {
|
|
743
743
|
o(this, "id");
|
|
@@ -768,13 +768,13 @@ let A = class {
|
|
|
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
|
-
|
|
772
|
-
var
|
|
771
|
+
g(() => {
|
|
772
|
+
var a, s, c;
|
|
773
773
|
const n = 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(n), i.slice.currentVolMl = (
|
|
777
|
-
|
|
776
|
+
), i.updateIngredient(n), i.slice.currentVolMl = (a = r.slice) == null ? void 0 : a.currentVolMl, i.slice.maxVolMl = (s = r.slice) == null ? void 0 : s.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
|
+
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);
|
|
780
780
|
});
|
|
@@ -785,11 +785,11 @@ let A = class {
|
|
|
785
785
|
// -------------------ENTITY----------------------------
|
|
786
786
|
};
|
|
787
787
|
Ie([
|
|
788
|
-
|
|
788
|
+
M
|
|
789
789
|
], A.prototype, "holders", 2);
|
|
790
790
|
Ie([
|
|
791
791
|
Q({
|
|
792
|
-
topic:
|
|
792
|
+
topic: yr,
|
|
793
793
|
websocket: !0,
|
|
794
794
|
condition: (e, t) => t.holders.getModel(e.path) !== void 0
|
|
795
795
|
})
|
|
@@ -797,11 +797,11 @@ Ie([
|
|
|
797
797
|
Ie([
|
|
798
798
|
Q({
|
|
799
799
|
topic: [
|
|
800
|
-
dr,
|
|
801
|
-
lr,
|
|
802
800
|
cr,
|
|
803
801
|
pr,
|
|
804
|
-
ur
|
|
802
|
+
ur,
|
|
803
|
+
hr,
|
|
804
|
+
gr
|
|
805
805
|
],
|
|
806
806
|
websocket: !0
|
|
807
807
|
})
|
|
@@ -809,7 +809,7 @@ Ie([
|
|
|
809
809
|
A = Ie([
|
|
810
810
|
I(Y)
|
|
811
811
|
], A);
|
|
812
|
-
const
|
|
812
|
+
const rt = {
|
|
813
813
|
registration: {
|
|
814
814
|
[Y]: {
|
|
815
815
|
class: A,
|
|
@@ -821,53 +821,53 @@ const et = {
|
|
|
821
821
|
factory: b.Singleton.create(
|
|
822
822
|
Y
|
|
823
823
|
)
|
|
824
|
-
},
|
|
825
|
-
const t = await
|
|
824
|
+
}, Ir = m.createLogger({ name: "board-utils" }), fr = async (e) => {
|
|
825
|
+
const t = await T.executeDataMapperExtension({
|
|
826
826
|
extension: u.BoardMapper,
|
|
827
827
|
data: e,
|
|
828
828
|
contextData: {}
|
|
829
|
-
}), { type: r, name: n, path: i, linked:
|
|
829
|
+
}), { type: r, name: n, path: i, linked: a, instanceId: s, ...c } = e, l = { ...c, ...t }, p = {
|
|
830
830
|
type: r,
|
|
831
831
|
name: n,
|
|
832
832
|
path: i,
|
|
833
|
-
linked:
|
|
834
|
-
instanceId:
|
|
833
|
+
linked: a,
|
|
834
|
+
instanceId: s,
|
|
835
835
|
...l
|
|
836
|
-
},
|
|
837
|
-
return
|
|
838
|
-
},
|
|
839
|
-
|
|
840
|
-
const r = await
|
|
836
|
+
}, y = et.factory(e.path)(p);
|
|
837
|
+
return y.updateModel(p), y;
|
|
838
|
+
}, mr = (e) => async (t) => {
|
|
839
|
+
Ir.debug(`adding board ${t.name}`);
|
|
840
|
+
const r = await fr(t);
|
|
841
841
|
e.addModel(r);
|
|
842
842
|
};
|
|
843
843
|
var d = /* @__PURE__ */ ((e) => (e.IDLE = "IDLE", e.POURING = "POURING", e.POUR_STARTING = "POUR_STARTING", e.POUR_CANCELING = "POUR_CANCELING", e.POUR_CANCELED = "POUR_CANCELED", e.POUR_COMPLETE = "POUR_COMPLETE", e))(d || {});
|
|
844
|
-
const { URL:
|
|
845
|
-
basePath: `${
|
|
844
|
+
const { URL: Ee } = C("PUMP_SERVICE"), { postModel: Pr, getOne: vr } = S.build({
|
|
845
|
+
basePath: `${Ee}/api/kos/holders`
|
|
846
846
|
});
|
|
847
847
|
m.createLogger({
|
|
848
848
|
name: "pump-service",
|
|
849
849
|
group: "Services"
|
|
850
850
|
});
|
|
851
|
-
const
|
|
851
|
+
const br = async ({
|
|
852
852
|
intent: e,
|
|
853
853
|
pumpId: t,
|
|
854
854
|
tracker: r
|
|
855
855
|
}) => {
|
|
856
|
-
const n = `${
|
|
856
|
+
const n = `${Ee}/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/pour/${t}/${e}`, i = await Pr({ model: {}, urlOverride: n, tracker: r });
|
|
857
857
|
return i != null && i.data && pe.initiateFuture(i.data), i;
|
|
858
|
-
},
|
|
859
|
-
const r = `${
|
|
858
|
+
}, _r = async (e, t) => {
|
|
859
|
+
const r = `${Ee}/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/intent/${e}/${t}/volume`, n = await vr({ urlOverride: r });
|
|
860
860
|
return n != null && n.data ? n.data : { volume: -1 };
|
|
861
861
|
};
|
|
862
|
-
var
|
|
863
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
864
|
-
(
|
|
865
|
-
return n && i &&
|
|
862
|
+
var Mr = Object.defineProperty, Or = Object.getOwnPropertyDescriptor, we = (e, t, r, n) => {
|
|
863
|
+
for (var i = n > 1 ? void 0 : n ? Or(t, r) : t, a = e.length - 1, s; a >= 0; a--)
|
|
864
|
+
(s = e[a]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
865
|
+
return n && i && Mr(t, r, i), i;
|
|
866
866
|
};
|
|
867
|
-
const k =
|
|
868
|
-
|
|
867
|
+
const k = D.Pump;
|
|
868
|
+
h[Me].register(
|
|
869
869
|
"pump",
|
|
870
|
-
|
|
870
|
+
ir
|
|
871
871
|
);
|
|
872
872
|
let q = class {
|
|
873
873
|
constructor(e, t) {
|
|
@@ -891,15 +891,15 @@ let q = class {
|
|
|
891
891
|
inserted: r,
|
|
892
892
|
holderPath: n,
|
|
893
893
|
boardPath: i,
|
|
894
|
-
nozzlePath:
|
|
895
|
-
name:
|
|
894
|
+
nozzlePath: a,
|
|
895
|
+
name: s,
|
|
896
896
|
path: c,
|
|
897
897
|
childPump: l,
|
|
898
898
|
virtual: p,
|
|
899
|
-
prevIngredientId:
|
|
899
|
+
prevIngredientId: y,
|
|
900
900
|
...U
|
|
901
901
|
} = t;
|
|
902
|
-
this.inserted = r, this.type = t.type, this.ingredientId = t.ingredientId, this.holderPath = n, this.boardPath = i, this.nozzlePath =
|
|
902
|
+
this.inserted = r, this.type = t.type, this.ingredientId = t.ingredientId, this.holderPath = n, this.boardPath = i, this.nozzlePath = a, this.name = s, 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 {
|
|
@@ -907,12 +907,12 @@ let q = class {
|
|
|
907
907
|
holderPath: r,
|
|
908
908
|
boardPath: n,
|
|
909
909
|
nozzlePath: i,
|
|
910
|
-
childPump:
|
|
911
|
-
name:
|
|
910
|
+
childPump: a,
|
|
911
|
+
name: s,
|
|
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 = n, this.nozzlePath = i, this.childPump = this.childPump ? this.childPump : !!
|
|
915
|
+
this.inserted = t, this.type = e.type, this.ingredientId = e.ingredientId, this.holderPath = r, this.boardPath = n, this.nozzlePath = i, this.childPump = this.childPump ? this.childPump : !!a, this.name = s, this.path = c, this.prevIngredientId = e.prevIngredientId, Object.assign(this, l);
|
|
916
916
|
}
|
|
917
917
|
// -------------------LIFECYCLE----------------------------
|
|
918
918
|
get troubles() {
|
|
@@ -923,7 +923,7 @@ let q = class {
|
|
|
923
923
|
}
|
|
924
924
|
get troublesByType() {
|
|
925
925
|
return this.troubles.reduce(
|
|
926
|
-
|
|
926
|
+
Ae,
|
|
927
927
|
{}
|
|
928
928
|
);
|
|
929
929
|
}
|
|
@@ -939,13 +939,13 @@ let q = class {
|
|
|
939
939
|
return !!this.ingredientId && !this.isPouring;
|
|
940
940
|
}
|
|
941
941
|
onFutureUpdate(e) {
|
|
942
|
-
e.endState &&
|
|
942
|
+
e.endState && g(() => {
|
|
943
943
|
this.currentState = d.IDLE;
|
|
944
944
|
});
|
|
945
945
|
}
|
|
946
946
|
async cancelPour() {
|
|
947
947
|
var e;
|
|
948
|
-
this.currentState === d.POURING || this.currentState === d.POUR_STARTING ? (this.currentState = d.POUR_CANCELING, await ((e = this.future) == null ? void 0 : e.cancelFuture()),
|
|
948
|
+
this.currentState === d.POURING || this.currentState === d.POUR_STARTING ? (this.currentState = d.POUR_CANCELING, await ((e = this.future) == null ? void 0 : e.cancelFuture()), g(() => {
|
|
949
949
|
this.currentState = d.IDLE;
|
|
950
950
|
})) : m.warn(`Cannot cancel pour in state ${this.currentState}`);
|
|
951
951
|
}
|
|
@@ -953,7 +953,7 @@ let q = class {
|
|
|
953
953
|
return this.futureHandler.future;
|
|
954
954
|
}
|
|
955
955
|
async resolveIntentVolume(e) {
|
|
956
|
-
return await
|
|
956
|
+
return await _r(this.path, e);
|
|
957
957
|
}
|
|
958
958
|
async performIntent(e, t) {
|
|
959
959
|
const r = typeof e == "string" ? e : e.intent;
|
|
@@ -963,12 +963,12 @@ 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 n = await
|
|
966
|
+
const n = await br({
|
|
967
967
|
tracker: t,
|
|
968
968
|
intent: r,
|
|
969
969
|
pumpId: this.path
|
|
970
970
|
});
|
|
971
|
-
return this.currentState === d.POUR_STARTING &&
|
|
971
|
+
return this.currentState === d.POUR_STARTING && g(() => {
|
|
972
972
|
this.currentState = d.POURING;
|
|
973
973
|
}), n == null ? void 0 : n.data;
|
|
974
974
|
} else
|
|
@@ -979,16 +979,16 @@ let q = class {
|
|
|
979
979
|
}
|
|
980
980
|
// -------------------ENTITY----------------------------
|
|
981
981
|
};
|
|
982
|
-
|
|
983
|
-
ce({ modelType:
|
|
982
|
+
we([
|
|
983
|
+
ce({ modelType: xe.type })
|
|
984
984
|
], q.prototype, "troubleContainer", 2);
|
|
985
|
-
|
|
985
|
+
we([
|
|
986
986
|
ue()
|
|
987
987
|
], q.prototype, "performIntent", 1);
|
|
988
|
-
q =
|
|
988
|
+
q = we([
|
|
989
989
|
I(k)
|
|
990
990
|
], q);
|
|
991
|
-
const
|
|
991
|
+
const it = {
|
|
992
992
|
registration: {
|
|
993
993
|
[k]: {
|
|
994
994
|
class: q,
|
|
@@ -998,7 +998,7 @@ const tt = {
|
|
|
998
998
|
type: k,
|
|
999
999
|
predicate: v(k),
|
|
1000
1000
|
factory: b.Factory.create(k)
|
|
1001
|
-
},
|
|
1001
|
+
}, Er = m.createLogger({ name: "pump-utils" }), wr = (e, t) => {
|
|
1002
1002
|
const r = (t.pumps ?? []).length > 1, n = {
|
|
1003
1003
|
boardPath: t.boardPath,
|
|
1004
1004
|
holderPath: t.holderPath,
|
|
@@ -1011,30 +1011,30 @@ const tt = {
|
|
|
1011
1011
|
type: t.type,
|
|
1012
1012
|
nozzlePath: e,
|
|
1013
1013
|
prevIngredientId: t.prevIngredientId
|
|
1014
|
-
}, i =
|
|
1014
|
+
}, i = it.factory(t.path)(n);
|
|
1015
1015
|
return i.updateModel(n), i;
|
|
1016
|
-
},
|
|
1016
|
+
}, nt = (e) => (t) => (r) => (n) => {
|
|
1017
1017
|
var c;
|
|
1018
|
-
|
|
1019
|
-
const i =
|
|
1018
|
+
Er.debug(`adding pump ${n.name}`);
|
|
1019
|
+
const i = wr(r.path, n);
|
|
1020
1020
|
e.addModel(i);
|
|
1021
|
-
const
|
|
1022
|
-
|
|
1023
|
-
const p = i.holderPath,
|
|
1021
|
+
const a = i.holderPath, s = t.holders.getModel(a);
|
|
1022
|
+
s == null || s.pumps.addModel(i), s != null && s.nozzlePaths.includes(r.path) || s == null || s.nozzlePaths.push(r.path), (c = n == null ? void 0 : n.pumps) == null || c.forEach((l) => {
|
|
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
|
+
nt(e)(t)(r)(y);
|
|
1030
1030
|
});
|
|
1031
1031
|
};
|
|
1032
|
-
var
|
|
1033
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1034
|
-
(
|
|
1035
|
-
return n && i &&
|
|
1032
|
+
var $r = Object.defineProperty, Cr = Object.getOwnPropertyDescriptor, ee = (e, t, r, n) => {
|
|
1033
|
+
for (var i = n > 1 ? void 0 : n ? Cr(t, r) : t, a = e.length - 1, s; a >= 0; a--)
|
|
1034
|
+
(s = e[a]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
1035
|
+
return n && i && $r(t, r, i), i;
|
|
1036
1036
|
};
|
|
1037
|
-
const Z = "assembly-model",
|
|
1037
|
+
const Z = "assembly-model", Sr = "assembly-data";
|
|
1038
1038
|
let w = class {
|
|
1039
1039
|
constructor(e, t, r) {
|
|
1040
1040
|
o(this, "id");
|
|
@@ -1044,7 +1044,7 @@ let w = class {
|
|
|
1044
1044
|
o(this, "boardContainer");
|
|
1045
1045
|
o(this, "pumpContainer");
|
|
1046
1046
|
o(this, "logger");
|
|
1047
|
-
this.id = e, this.holderContainer =
|
|
1047
|
+
this.id = e, this.holderContainer = rt.factory({}), this.boardContainer = tt.factory({}), this.pumpContainer = Oe.factory({}), this.logger = r.logger;
|
|
1048
1048
|
}
|
|
1049
1049
|
updateModel(e) {
|
|
1050
1050
|
}
|
|
@@ -1091,44 +1091,44 @@ let w = class {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
async load(e) {
|
|
1093
1093
|
this.logger.debug(`loading assembly ${this.id}`);
|
|
1094
|
-
const t = await
|
|
1094
|
+
const t = await Ze();
|
|
1095
1095
|
if ((t == null ? void 0 : t.status) === 200) {
|
|
1096
|
-
const r = await
|
|
1096
|
+
const r = await T.executeDataMapperExtension({
|
|
1097
1097
|
extension: u.AssemblyMapper,
|
|
1098
1098
|
data: t.data,
|
|
1099
1099
|
contextData: {}
|
|
1100
1100
|
});
|
|
1101
|
-
e.set(
|
|
1102
|
-
|
|
1101
|
+
e.set(Sr, r), Object.assign(this, r), Object.entries(r).forEach(([n, i]) => {
|
|
1102
|
+
gt(i) && (this.logger.debug(`adding child model ${n} from extension data`), this[yt][n] = !0);
|
|
1103
1103
|
});
|
|
1104
1104
|
for await (const n of t.data.assemblies) {
|
|
1105
1105
|
const {
|
|
1106
1106
|
boards: i,
|
|
1107
|
-
holders:
|
|
1108
|
-
nozzles:
|
|
1107
|
+
holders: a,
|
|
1108
|
+
nozzles: s,
|
|
1109
1109
|
core: c,
|
|
1110
1110
|
name: l,
|
|
1111
1111
|
path: p,
|
|
1112
|
-
...
|
|
1112
|
+
...y
|
|
1113
1113
|
} = n;
|
|
1114
|
-
this.logger.debug(`adding assembly ${l}`), Object.keys(
|
|
1115
|
-
|
|
1114
|
+
this.logger.debug(`adding assembly ${l}`), Object.keys(y).forEach((f) => {
|
|
1115
|
+
It.enableFeature(f);
|
|
1116
1116
|
});
|
|
1117
1117
|
for await (const f of i)
|
|
1118
|
-
this.logger.debug(`adding board ${f.name}`), await
|
|
1119
|
-
for await (const [f,
|
|
1120
|
-
for await (const re of
|
|
1118
|
+
this.logger.debug(`adding board ${f.name}`), await mr(this.boardContainer)(f);
|
|
1119
|
+
for await (const [f, N] of Object.entries(a))
|
|
1120
|
+
for await (const re of N) {
|
|
1121
1121
|
this.logger.debug(`adding holder ${re.name}`);
|
|
1122
|
-
const
|
|
1123
|
-
this.holderContainer.holders.addModel(
|
|
1122
|
+
const Se = await Zt(f, re);
|
|
1123
|
+
this.holderContainer.holders.addModel(Se);
|
|
1124
1124
|
}
|
|
1125
|
-
const U =
|
|
1125
|
+
const U = nt(this.pumpContainer)(
|
|
1126
1126
|
this.holderContainer
|
|
1127
1127
|
);
|
|
1128
|
-
|
|
1128
|
+
s.forEach((f) => {
|
|
1129
1129
|
this._nozzlePaths.add(f.path);
|
|
1130
|
-
const
|
|
1131
|
-
f.pumps.forEach(
|
|
1130
|
+
const N = U(f);
|
|
1131
|
+
f.pumps.forEach(N);
|
|
1132
1132
|
});
|
|
1133
1133
|
}
|
|
1134
1134
|
}
|
|
@@ -1140,18 +1140,18 @@ ee([
|
|
|
1140
1140
|
})
|
|
1141
1141
|
], w.prototype, "troubleContainer", 2);
|
|
1142
1142
|
ee([
|
|
1143
|
-
|
|
1143
|
+
M
|
|
1144
1144
|
], w.prototype, "holderContainer", 2);
|
|
1145
1145
|
ee([
|
|
1146
|
-
|
|
1146
|
+
M
|
|
1147
1147
|
], w.prototype, "boardContainer", 2);
|
|
1148
1148
|
ee([
|
|
1149
|
-
|
|
1149
|
+
M
|
|
1150
1150
|
], w.prototype, "pumpContainer", 2);
|
|
1151
1151
|
w = ee([
|
|
1152
1152
|
I(Z)
|
|
1153
1153
|
], w);
|
|
1154
|
-
const
|
|
1154
|
+
const at = {
|
|
1155
1155
|
registration: {
|
|
1156
1156
|
[Z]: {
|
|
1157
1157
|
class: w,
|
|
@@ -1162,13 +1162,13 @@ const it = {
|
|
|
1162
1162
|
predicate: v(Z),
|
|
1163
1163
|
factory: b.Singleton.create(Z)
|
|
1164
1164
|
};
|
|
1165
|
-
var
|
|
1166
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1167
|
-
(
|
|
1168
|
-
return n && i &&
|
|
1165
|
+
var Rr = Object.defineProperty, Dr = Object.getOwnPropertyDescriptor, Nr = (e, t, r, n) => {
|
|
1166
|
+
for (var i = n > 1 ? void 0 : n ? Dr(t, r) : t, a = e.length - 1, s; a >= 0; a--)
|
|
1167
|
+
(s = e[a]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
1168
|
+
return n && i && Rr(t, r, i), i;
|
|
1169
1169
|
};
|
|
1170
|
-
const J =
|
|
1171
|
-
let
|
|
1170
|
+
const J = D.Availability;
|
|
1171
|
+
let be = class {
|
|
1172
1172
|
constructor(e, t, r) {
|
|
1173
1173
|
o(this, "id");
|
|
1174
1174
|
o(this, "data");
|
|
@@ -1193,14 +1193,14 @@ let ve = class {
|
|
|
1193
1193
|
// -------------------LIFECYCLE----------------------------
|
|
1194
1194
|
// -------------------ENTITY----------------------------
|
|
1195
1195
|
};
|
|
1196
|
-
|
|
1197
|
-
|
|
1196
|
+
be = Nr([
|
|
1197
|
+
ft(),
|
|
1198
1198
|
I(J)
|
|
1199
|
-
],
|
|
1200
|
-
const
|
|
1199
|
+
], be);
|
|
1200
|
+
const _e = {
|
|
1201
1201
|
registration: {
|
|
1202
1202
|
[J]: {
|
|
1203
|
-
class:
|
|
1203
|
+
class: be,
|
|
1204
1204
|
singleton: !1
|
|
1205
1205
|
}
|
|
1206
1206
|
},
|
|
@@ -1209,41 +1209,41 @@ const be = {
|
|
|
1209
1209
|
factory: b.Factory.create(
|
|
1210
1210
|
J
|
|
1211
1211
|
)
|
|
1212
|
-
}, { URL: B } = C("NOZZLE_SERVICE"), { postModel:
|
|
1212
|
+
}, { URL: B } = C("NOZZLE_SERVICE"), { postModel: $e, deleteModel: Tr, getOne: zr } = S.build({
|
|
1213
1213
|
basePath: `${B}/api/nozzle`
|
|
1214
|
-
}),
|
|
1215
|
-
const r = await
|
|
1214
|
+
}), Lr = async (e, t) => {
|
|
1215
|
+
const r = await $e({
|
|
1216
1216
|
model: {},
|
|
1217
1217
|
urlOverride: `${B}/api/ext/dispense/nozzle/${e}/pipeline/beverage/pour`,
|
|
1218
1218
|
ordered: !0,
|
|
1219
1219
|
tracker: t
|
|
1220
1220
|
});
|
|
1221
1221
|
return r != null && r.data && pe.initiateFuture(r.data), r;
|
|
1222
|
-
},
|
|
1223
|
-
const n = await
|
|
1222
|
+
}, xr = async (e, t, r) => {
|
|
1223
|
+
const n = await $e({
|
|
1224
1224
|
model: {},
|
|
1225
1225
|
urlOverride: `${B}/api/ext/dispense/nozzle/${t}/pipeline/beverage/fixed/${e}`,
|
|
1226
1226
|
ordered: !0,
|
|
1227
1227
|
tracker: r
|
|
1228
1228
|
});
|
|
1229
1229
|
return n != null && n.data && pe.initiateFuture(n.data), n;
|
|
1230
|
-
},
|
|
1230
|
+
}, Ar = async (e) => await zr({
|
|
1231
1231
|
urlOverride: `${B}${e}/pipeline/beverage/availability`
|
|
1232
|
-
}),
|
|
1232
|
+
}), Br = async (e, t) => await $e({
|
|
1233
1233
|
model: t,
|
|
1234
1234
|
urlOverride: `${B}/api/ext/dispense/nozzle/${e}/pipeline/beverage/select`
|
|
1235
|
-
}),
|
|
1235
|
+
}), Ur = async (e) => await Tr({
|
|
1236
1236
|
id: e,
|
|
1237
1237
|
urlOverride: `${B}/api/ext/dispense/nozzle/${e}/pipeline/beverage/select`
|
|
1238
1238
|
});
|
|
1239
|
-
var
|
|
1240
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1241
|
-
(
|
|
1242
|
-
return n && i &&
|
|
1239
|
+
var Gr = Object.defineProperty, jr = Object.getOwnPropertyDescriptor, te = (e, t, r, n) => {
|
|
1240
|
+
for (var i = n > 1 ? void 0 : n ? jr(t, r) : t, a = e.length - 1, s; a >= 0; a--)
|
|
1241
|
+
(s = e[a]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
1242
|
+
return n && i && Gr(t, r, i), i;
|
|
1243
1243
|
};
|
|
1244
|
-
const X =
|
|
1244
|
+
const X = D.Nozzle, Fr = mt(
|
|
1245
1245
|
"beverageTopicPrefix"
|
|
1246
|
-
), ie = (e) => e.onPourStart !== void 0 && e.onPourCancel !== void 0 && e.onPourProgress !== void 0,
|
|
1246
|
+
), ie = (e) => e.onPourStart !== void 0 && e.onPourCancel !== void 0 && e.onPourProgress !== void 0, Te = "/kos/nozzle/pour/started", Hr = "/kos/nozzle/pour/progress", fe = "/kos/nozzle/pour/cancel";
|
|
1247
1247
|
let $ = class {
|
|
1248
1248
|
constructor(e, t, r) {
|
|
1249
1249
|
/** the unique identifier for this nozzle.*/
|
|
@@ -1260,7 +1260,7 @@ let $ = class {
|
|
|
1260
1260
|
o(this, "beverageTopicPrefix");
|
|
1261
1261
|
o(this, "topicPrefix");
|
|
1262
1262
|
o(this, "urlPrefix");
|
|
1263
|
-
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
|
|
1263
|
+
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 Pt(this), this._availabilityItems = new R({
|
|
1264
1264
|
indexMap: {
|
|
1265
1265
|
byGroup: "groupId",
|
|
1266
1266
|
byParent: "parentId"
|
|
@@ -1352,18 +1352,18 @@ let $ = class {
|
|
|
1352
1352
|
context: r
|
|
1353
1353
|
}) {
|
|
1354
1354
|
if (!e) {
|
|
1355
|
-
const c = await
|
|
1355
|
+
const c = await Ur(this.name);
|
|
1356
1356
|
if ((c == null ? void 0 : c.status) !== 200)
|
|
1357
1357
|
throw new Error("Failed to clear pourable");
|
|
1358
1358
|
this._selectedBeverage = void 0;
|
|
1359
1359
|
return;
|
|
1360
1360
|
}
|
|
1361
|
-
if (e === this._selectedBeverage &&
|
|
1361
|
+
if (e === this._selectedBeverage && vt(this._additionalItems, t)) {
|
|
1362
1362
|
this.logger.info("No change in selected pourable");
|
|
1363
1363
|
return;
|
|
1364
1364
|
}
|
|
1365
1365
|
this._selectedBeverage = e, this._additionalItems = t;
|
|
1366
|
-
let n = await
|
|
1366
|
+
let n = await h.dataMapper.executeMapper(
|
|
1367
1367
|
u.SelectedPourableMapper,
|
|
1368
1368
|
{
|
|
1369
1369
|
beverage: e,
|
|
@@ -1377,8 +1377,8 @@ let $ = class {
|
|
|
1377
1377
|
(!n || Object.keys(n).length === 0) && (this.logger.info(
|
|
1378
1378
|
`No selected pourable mapper defined, using the default payload ${i}`
|
|
1379
1379
|
), n = i);
|
|
1380
|
-
const
|
|
1381
|
-
if ((
|
|
1380
|
+
const a = n ?? i, s = await Br(this.name, a);
|
|
1381
|
+
if ((s == null ? void 0 : s.status) !== 200)
|
|
1382
1382
|
throw new Error("Failed to select pourable");
|
|
1383
1383
|
}
|
|
1384
1384
|
/**
|
|
@@ -1412,15 +1412,15 @@ let $ = class {
|
|
|
1412
1412
|
);
|
|
1413
1413
|
}
|
|
1414
1414
|
updateIfCurrent(e, t) {
|
|
1415
|
-
this.currentState === e &&
|
|
1415
|
+
this.currentState === e && g(() => {
|
|
1416
1416
|
this.currentState = t;
|
|
1417
1417
|
});
|
|
1418
1418
|
}
|
|
1419
1419
|
onFutureUpdate(e) {
|
|
1420
|
-
|
|
1421
|
-
ie(
|
|
1420
|
+
E(this).forEach((n) => {
|
|
1421
|
+
ie(n) && n.onPourProgress(e);
|
|
1422
1422
|
});
|
|
1423
|
-
const
|
|
1423
|
+
const r = {
|
|
1424
1424
|
nozzleId: this.id,
|
|
1425
1425
|
progress: e.progress,
|
|
1426
1426
|
status: e.status,
|
|
@@ -1431,50 +1431,68 @@ let $ = class {
|
|
|
1431
1431
|
reason: e.reason,
|
|
1432
1432
|
timeRemaining: e.timeRemaining
|
|
1433
1433
|
};
|
|
1434
|
-
|
|
1434
|
+
_.publish(Hr, r), e.endState && g(() => {
|
|
1435
|
+
this.currentState = d.IDLE;
|
|
1436
|
+
});
|
|
1435
1437
|
}
|
|
1436
1438
|
async pour(e) {
|
|
1439
|
+
var t;
|
|
1437
1440
|
try {
|
|
1438
1441
|
if (this.currentState === d.IDLE) {
|
|
1439
1442
|
if (this.updateIfCurrent(d.IDLE, d.POUR_STARTING), !e)
|
|
1440
1443
|
throw new Error("No tracker provided");
|
|
1441
|
-
const
|
|
1442
|
-
this.updateIfCurrent(d.POUR_STARTING, d.POURING),
|
|
1443
|
-
var
|
|
1444
|
-
ie(
|
|
1444
|
+
const r = await Lr(this.name, e);
|
|
1445
|
+
this.updateIfCurrent(d.POUR_STARTING, d.POURING), E(this).forEach((i) => {
|
|
1446
|
+
var a;
|
|
1447
|
+
ie(i) && ((a = i.onPourStart) == null || a.call(i));
|
|
1445
1448
|
});
|
|
1446
|
-
const
|
|
1449
|
+
const n = {
|
|
1447
1450
|
nozzleId: this.id,
|
|
1448
1451
|
type: "free"
|
|
1449
1452
|
};
|
|
1450
|
-
|
|
1453
|
+
if (_.publish(Te, n), (t = r == null ? void 0 : r.data) != null && t.endState) {
|
|
1454
|
+
this.updateIfCurrent(d.POURING, d.IDLE);
|
|
1455
|
+
const i = {
|
|
1456
|
+
nozzleId: this.id
|
|
1457
|
+
};
|
|
1458
|
+
_.publish(fe, i);
|
|
1459
|
+
}
|
|
1460
|
+
return r;
|
|
1451
1461
|
} else
|
|
1452
1462
|
throw new Error(`Cannot pour in state ${this.currentState}`);
|
|
1453
|
-
} catch (
|
|
1454
|
-
throw this.logger.error(
|
|
1463
|
+
} catch (r) {
|
|
1464
|
+
throw this.logger.error(r), this.currentState = d.IDLE, r;
|
|
1455
1465
|
}
|
|
1456
1466
|
}
|
|
1457
1467
|
async fixedPour(e, t) {
|
|
1468
|
+
var r;
|
|
1458
1469
|
try {
|
|
1459
1470
|
if (this.currentState === d.IDLE) {
|
|
1460
1471
|
if (this.currentState = d.POUR_STARTING, !t)
|
|
1461
1472
|
throw new Error("No tracker provided");
|
|
1462
|
-
const
|
|
1463
|
-
this.currentState === d.POUR_STARTING &&
|
|
1473
|
+
const n = await xr(e, this.name, t);
|
|
1474
|
+
this.currentState === d.POUR_STARTING && g(() => {
|
|
1464
1475
|
this.currentState = d.POURING;
|
|
1465
|
-
}),
|
|
1476
|
+
}), E(this).forEach((a) => {
|
|
1466
1477
|
var s;
|
|
1467
|
-
ie(
|
|
1478
|
+
ie(a) && ((s = a.onPourStart) == null || s.call(a));
|
|
1468
1479
|
});
|
|
1469
|
-
const
|
|
1480
|
+
const i = {
|
|
1470
1481
|
nozzleId: this.id,
|
|
1471
1482
|
type: "fixed"
|
|
1472
1483
|
};
|
|
1473
|
-
|
|
1484
|
+
if (_.publish(Te, i), (r = n == null ? void 0 : n.data) != null && r.endState) {
|
|
1485
|
+
this.updateIfCurrent(d.POURING, d.IDLE);
|
|
1486
|
+
const a = {
|
|
1487
|
+
nozzleId: this.id
|
|
1488
|
+
};
|
|
1489
|
+
_.publish(fe, a);
|
|
1490
|
+
}
|
|
1491
|
+
return n;
|
|
1474
1492
|
} else
|
|
1475
1493
|
throw new Error(`Cannot pour in state ${this.currentState}`);
|
|
1476
|
-
} catch (
|
|
1477
|
-
throw this.logger.error(
|
|
1494
|
+
} catch (n) {
|
|
1495
|
+
throw this.logger.error(n), this.currentState = d.IDLE, n;
|
|
1478
1496
|
}
|
|
1479
1497
|
}
|
|
1480
1498
|
/**
|
|
@@ -1483,16 +1501,16 @@ let $ = class {
|
|
|
1483
1501
|
async cancelPour() {
|
|
1484
1502
|
var e;
|
|
1485
1503
|
if (this.currentState === d.POURING || this.currentState === d.POUR_STARTING) {
|
|
1486
|
-
this.currentState = d.POUR_CANCELING, await ((e = this.futureHandler.getFuture()) == null ? void 0 : e.cancelFuture()),
|
|
1504
|
+
this.currentState = d.POUR_CANCELING, await ((e = this.futureHandler.getFuture()) == null ? void 0 : e.cancelFuture()), g(() => {
|
|
1487
1505
|
this.currentState = d.IDLE;
|
|
1488
|
-
}),
|
|
1506
|
+
}), E(this).forEach((r) => {
|
|
1489
1507
|
var n;
|
|
1490
1508
|
ie(r) && ((n = r.onPourCancel) == null || n.call(r));
|
|
1491
1509
|
});
|
|
1492
1510
|
const t = {
|
|
1493
1511
|
nozzleId: this.id
|
|
1494
1512
|
};
|
|
1495
|
-
|
|
1513
|
+
_.publish(fe, t);
|
|
1496
1514
|
} else
|
|
1497
1515
|
this.logger.warn(`Cannot cancel pour in state ${this.currentState}`);
|
|
1498
1516
|
}
|
|
@@ -1510,66 +1528,66 @@ let $ = class {
|
|
|
1510
1528
|
async load(e) {
|
|
1511
1529
|
var n, i;
|
|
1512
1530
|
this.logger.debug(`loading nozzle ${this.id}`);
|
|
1513
|
-
const t = await
|
|
1531
|
+
const t = await Ar(this.urlPrefix);
|
|
1514
1532
|
if ((t == null ? void 0 : t.status) !== 200)
|
|
1515
1533
|
throw new Error("Failed to load nozzle availability");
|
|
1516
|
-
const r = await
|
|
1534
|
+
const r = await h.loader.executeLoader(
|
|
1517
1535
|
u.AvailabilityLoader,
|
|
1518
1536
|
{}
|
|
1519
1537
|
);
|
|
1520
|
-
e == null || e.set(u.AvailabilityLoader, r), e == null || e.set(
|
|
1521
|
-
for (const
|
|
1522
|
-
for (const
|
|
1523
|
-
const c = await
|
|
1538
|
+
e == null || e.set(u.AvailabilityLoader, r), e == null || e.set(Ce.type, this);
|
|
1539
|
+
for (const a of Object.keys((n = t.data) == null ? void 0 : n.groups) || [])
|
|
1540
|
+
for (const s of ((i = t.data) == null ? void 0 : i.groups[a]) || []) {
|
|
1541
|
+
const c = await h.dataMapper.executeMapper(
|
|
1524
1542
|
u.AvailabilityMapper,
|
|
1525
|
-
{ ...
|
|
1543
|
+
{ ...s, groupId: a },
|
|
1526
1544
|
r
|
|
1527
1545
|
), l = {
|
|
1528
|
-
...
|
|
1529
|
-
note:
|
|
1546
|
+
...s,
|
|
1547
|
+
note: s.note ?? void 0,
|
|
1530
1548
|
kosParentId: this.id,
|
|
1531
|
-
rawId:
|
|
1532
|
-
groupId:
|
|
1549
|
+
rawId: s.id,
|
|
1550
|
+
groupId: a,
|
|
1533
1551
|
data: c
|
|
1534
|
-
}, p =
|
|
1535
|
-
`${this.id}-${
|
|
1552
|
+
}, p = _e.factory(
|
|
1553
|
+
`${this.id}-${a}-${s.id}`
|
|
1536
1554
|
)(l);
|
|
1537
1555
|
this._availabilityItems.addModel(p);
|
|
1538
1556
|
}
|
|
1539
1557
|
this.updateGroupMembers();
|
|
1540
1558
|
}
|
|
1541
1559
|
async updateAvailability(e) {
|
|
1542
|
-
const t =
|
|
1560
|
+
const t = bt.getContext(this.id), r = (t == null ? void 0 : t.get(u.AvailabilityLoader)) || {};
|
|
1543
1561
|
if (e.rebuild)
|
|
1544
1562
|
for (const n of Object.keys(e == null ? void 0 : e.groups) || []) {
|
|
1545
1563
|
this._availabilityItems.getIndexByKey("group", n).filter(
|
|
1546
|
-
(
|
|
1547
|
-
(
|
|
1564
|
+
(a) => !e.groups[n].find(
|
|
1565
|
+
(s) => `${this.id}-${n}-${s.id}` === a.id
|
|
1548
1566
|
)
|
|
1549
|
-
).forEach((
|
|
1550
|
-
this._availabilityItems.removeModel(
|
|
1567
|
+
).forEach((a) => {
|
|
1568
|
+
this._availabilityItems.removeModel(a.id), _t(a);
|
|
1551
1569
|
});
|
|
1552
|
-
for (const
|
|
1553
|
-
const
|
|
1570
|
+
for (const a of (e == null ? void 0 : e.groups[n]) || []) {
|
|
1571
|
+
const s = await h.dataMapper.executeMapper(
|
|
1554
1572
|
u.AvailabilityMapper,
|
|
1555
|
-
{ ...
|
|
1573
|
+
{ ...a, groupId: n },
|
|
1556
1574
|
r
|
|
1557
1575
|
), c = {
|
|
1558
|
-
...
|
|
1559
|
-
note:
|
|
1576
|
+
...a,
|
|
1577
|
+
note: a.note ?? void 0,
|
|
1560
1578
|
kosParentId: this.id,
|
|
1561
1579
|
groupId: n,
|
|
1562
|
-
rawId:
|
|
1563
|
-
data:
|
|
1564
|
-
taggedIds:
|
|
1580
|
+
rawId: a.id,
|
|
1581
|
+
data: s,
|
|
1582
|
+
taggedIds: a.taggedIds
|
|
1565
1583
|
}, l = this._availabilityItems.getModel(
|
|
1566
|
-
`${this.id}-${n}-${
|
|
1584
|
+
`${this.id}-${n}-${a.id}`
|
|
1567
1585
|
);
|
|
1568
1586
|
if (l)
|
|
1569
1587
|
l.updateModel(c);
|
|
1570
1588
|
else {
|
|
1571
|
-
const p =
|
|
1572
|
-
`${this.id}-${n}-${
|
|
1589
|
+
const p = _e.factory(
|
|
1590
|
+
`${this.id}-${n}-${a.id}`
|
|
1573
1591
|
)(c);
|
|
1574
1592
|
this._availabilityItems.addModel(p);
|
|
1575
1593
|
}
|
|
@@ -1578,30 +1596,30 @@ let $ = class {
|
|
|
1578
1596
|
else
|
|
1579
1597
|
for (const n of Object.keys(e == null ? void 0 : e.groups) || [])
|
|
1580
1598
|
for (const i of (e == null ? void 0 : e.groups[n]) || []) {
|
|
1581
|
-
const
|
|
1599
|
+
const a = await h.dataMapper.executeMapper(
|
|
1582
1600
|
u.AvailabilityMapper,
|
|
1583
1601
|
{ ...i, groupId: n },
|
|
1584
1602
|
r
|
|
1585
|
-
),
|
|
1603
|
+
), s = {
|
|
1586
1604
|
...i,
|
|
1587
1605
|
note: i.note ?? void 0,
|
|
1588
1606
|
kosParentId: this.id,
|
|
1589
1607
|
groupId: n,
|
|
1590
1608
|
rawId: i.id,
|
|
1591
|
-
data:
|
|
1609
|
+
data: a,
|
|
1592
1610
|
type: i.type,
|
|
1593
1611
|
taggedIds: i.taggedIds
|
|
1594
1612
|
}, c = this._availabilityItems.getModel(
|
|
1595
1613
|
`${this.id}-${n}-${i.id}`
|
|
1596
1614
|
);
|
|
1597
|
-
c && c.updateModel(
|
|
1615
|
+
c && c.updateModel(s);
|
|
1598
1616
|
}
|
|
1599
1617
|
this.updateGroupMembers();
|
|
1600
1618
|
}
|
|
1601
1619
|
// -------------------ENTITY----------------------------
|
|
1602
1620
|
};
|
|
1603
1621
|
te([
|
|
1604
|
-
|
|
1622
|
+
M
|
|
1605
1623
|
], $.prototype, "_availabilityItems", 2);
|
|
1606
1624
|
te([
|
|
1607
1625
|
ue()
|
|
@@ -1611,14 +1629,14 @@ te([
|
|
|
1611
1629
|
], $.prototype, "fixedPour", 1);
|
|
1612
1630
|
te([
|
|
1613
1631
|
Q({
|
|
1614
|
-
topic: `${
|
|
1632
|
+
topic: `${Fr}/availability`,
|
|
1615
1633
|
websocket: !0
|
|
1616
1634
|
})
|
|
1617
1635
|
], $.prototype, "updateAvailability", 1);
|
|
1618
1636
|
$ = te([
|
|
1619
1637
|
I(X)
|
|
1620
1638
|
], $);
|
|
1621
|
-
const
|
|
1639
|
+
const Ce = {
|
|
1622
1640
|
registration: {
|
|
1623
1641
|
[X]: {
|
|
1624
1642
|
class: $,
|
|
@@ -1629,12 +1647,12 @@ const $e = {
|
|
|
1629
1647
|
predicate: v(X),
|
|
1630
1648
|
factory: b.Factory.create(X)
|
|
1631
1649
|
};
|
|
1632
|
-
var
|
|
1633
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1634
|
-
(
|
|
1635
|
-
return n && i &&
|
|
1650
|
+
var Kr = Object.defineProperty, Vr = Object.getOwnPropertyDescriptor, st = (e, t, r, n) => {
|
|
1651
|
+
for (var i = n > 1 ? void 0 : n ? Vr(t, r) : t, a = e.length - 1, s; a >= 0; a--)
|
|
1652
|
+
(s = e[a]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
1653
|
+
return n && i && Kr(t, r, i), i;
|
|
1636
1654
|
};
|
|
1637
|
-
const
|
|
1655
|
+
const ot = "device-assembly-model";
|
|
1638
1656
|
let de = class {
|
|
1639
1657
|
constructor(e, t, r) {
|
|
1640
1658
|
o(this, "id");
|
|
@@ -1654,95 +1672,107 @@ let de = class {
|
|
|
1654
1672
|
}
|
|
1655
1673
|
async load() {
|
|
1656
1674
|
this.logger.debug(`loading device-assembly ${this.id}`);
|
|
1657
|
-
const e = await
|
|
1675
|
+
const e = await Ze();
|
|
1658
1676
|
(e == null ? void 0 : e.status) === 200 && e.data.assemblies.map((r) => r.nozzles).flat().forEach((r) => {
|
|
1659
|
-
var
|
|
1660
|
-
const n = r.path, i = ((
|
|
1677
|
+
var s;
|
|
1678
|
+
const n = r.path, i = ((s = r.pipelines.find((c) => c.name === "beverage")) == null ? void 0 : s.topicPrefix) || "", a = Ce.factory(n)({
|
|
1661
1679
|
path: r.path,
|
|
1662
1680
|
name: r.name,
|
|
1663
1681
|
urlPrefix: r.urlPrefix,
|
|
1664
1682
|
topicPrefix: r.topicPrefix,
|
|
1665
1683
|
beverageTopicPrefix: i
|
|
1666
1684
|
});
|
|
1667
|
-
this.deviceNozzles.addModel(
|
|
1685
|
+
this.deviceNozzles.addModel(a);
|
|
1668
1686
|
});
|
|
1669
1687
|
}
|
|
1670
1688
|
};
|
|
1671
|
-
|
|
1672
|
-
|
|
1689
|
+
st([
|
|
1690
|
+
M
|
|
1673
1691
|
], de.prototype, "deviceNozzles", 2);
|
|
1674
|
-
de =
|
|
1675
|
-
I(
|
|
1692
|
+
de = st([
|
|
1693
|
+
I(ot)
|
|
1676
1694
|
], de);
|
|
1677
|
-
const
|
|
1695
|
+
const Yr = new Mt({
|
|
1678
1696
|
class: de,
|
|
1679
|
-
type:
|
|
1680
|
-
}), { URL:
|
|
1681
|
-
basePath: `${
|
|
1682
|
-
}),
|
|
1683
|
-
const r = await
|
|
1697
|
+
type: ot
|
|
1698
|
+
}), { URL: dt } = C("GENERIC_POUR_SERVICE"), { postModel: kr } = S.build({
|
|
1699
|
+
basePath: `${dt}/api/nozzle`
|
|
1700
|
+
}), Zr = async (e, t) => {
|
|
1701
|
+
const r = await kr({
|
|
1684
1702
|
model: {},
|
|
1685
|
-
urlOverride: `${
|
|
1703
|
+
urlOverride: `${dt}${e}`,
|
|
1686
1704
|
ordered: !0,
|
|
1687
1705
|
tracker: t
|
|
1688
1706
|
});
|
|
1689
1707
|
return r != null && r.data && pe.initiateFuture(r.data), r;
|
|
1690
1708
|
};
|
|
1691
|
-
var
|
|
1692
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
1693
|
-
(
|
|
1694
|
-
return n && i &&
|
|
1709
|
+
var Jr = Object.defineProperty, Xr = Object.getOwnPropertyDescriptor, lt = (e, t, r, n) => {
|
|
1710
|
+
for (var i = n > 1 ? void 0 : n ? Xr(t, r) : t, a = e.length - 1, s; a >= 0; a--)
|
|
1711
|
+
(s = e[a]) && (i = (n ? s(t, r, i) : s(i)) || i);
|
|
1712
|
+
return n && i && Jr(t, r, i), i;
|
|
1695
1713
|
};
|
|
1696
|
-
const
|
|
1714
|
+
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;
|
|
1697
1715
|
let le = class {
|
|
1698
1716
|
constructor(e, t, r) {
|
|
1699
1717
|
o(this, "id");
|
|
1700
1718
|
o(this, "currentState", d.IDLE);
|
|
1701
|
-
o(this, "
|
|
1719
|
+
o(this, "servicePathFactory");
|
|
1702
1720
|
o(this, "pourType");
|
|
1703
1721
|
o(this, "logger");
|
|
1704
1722
|
o(this, "futureHandler");
|
|
1705
|
-
|
|
1723
|
+
o(this, "selectedId");
|
|
1724
|
+
this.id = e, this.logger = r.logger, this.futureHandler = new Ge(this), this.servicePathFactory = t.servicePathFactory, this.pourType = t.pourType || "free", this.selectedId = t.selectedId;
|
|
1725
|
+
}
|
|
1726
|
+
get servicePath() {
|
|
1727
|
+
return this.selectedId ? this.servicePathFactory(this.selectedId) : "";
|
|
1706
1728
|
}
|
|
1707
1729
|
async pour(e) {
|
|
1730
|
+
var t;
|
|
1708
1731
|
try {
|
|
1709
1732
|
if (this.currentState === d.IDLE) {
|
|
1710
1733
|
if (this.updateIfCurrent(d.IDLE, d.POUR_STARTING), !e)
|
|
1711
1734
|
throw new Error("No tracker provided");
|
|
1712
|
-
const
|
|
1713
|
-
this.updateIfCurrent(d.POUR_STARTING, d.POURING),
|
|
1714
|
-
var
|
|
1715
|
-
|
|
1735
|
+
const r = await Zr(this.servicePath, e);
|
|
1736
|
+
this.updateIfCurrent(d.POUR_STARTING, d.POURING), E(this).forEach((i) => {
|
|
1737
|
+
var a;
|
|
1738
|
+
me(i) && ((a = i.onPourStart) == null || a.call(i));
|
|
1716
1739
|
});
|
|
1717
|
-
const
|
|
1740
|
+
const n = {
|
|
1718
1741
|
pourTarget: this.id,
|
|
1719
1742
|
type: this.pourType
|
|
1720
1743
|
};
|
|
1721
|
-
|
|
1744
|
+
if (_.publish(qr, n), (t = r == null ? void 0 : r.data) != null && t.endState) {
|
|
1745
|
+
this.updateIfCurrent(d.POURING, d.IDLE);
|
|
1746
|
+
const i = {
|
|
1747
|
+
pourTarget: this.id
|
|
1748
|
+
};
|
|
1749
|
+
_.publish(ze, i);
|
|
1750
|
+
}
|
|
1751
|
+
return r;
|
|
1722
1752
|
} else
|
|
1723
1753
|
throw new Error(`Cannot pour in state ${this.currentState}`);
|
|
1724
|
-
} catch (
|
|
1725
|
-
throw this.logger.error(
|
|
1754
|
+
} catch (r) {
|
|
1755
|
+
throw this.logger.error(r), this.currentState = d.IDLE, r;
|
|
1726
1756
|
}
|
|
1727
1757
|
}
|
|
1728
1758
|
async cancelPour() {
|
|
1729
1759
|
var e;
|
|
1730
1760
|
if (this.currentState === d.POURING || this.currentState === d.POUR_STARTING) {
|
|
1731
|
-
this.currentState = d.POUR_CANCELING, await ((e = this.futureHandler.getFuture()) == null ? void 0 : e.cancelFuture()),
|
|
1761
|
+
this.currentState = d.POUR_CANCELING, await ((e = this.futureHandler.getFuture()) == null ? void 0 : e.cancelFuture()), g(() => {
|
|
1732
1762
|
this.currentState = d.IDLE;
|
|
1733
|
-
}),
|
|
1763
|
+
}), E(this).forEach((r) => {
|
|
1734
1764
|
var n;
|
|
1735
|
-
|
|
1765
|
+
me(r) && ((n = r.onPourCancel) == null || n.call(r));
|
|
1736
1766
|
});
|
|
1737
1767
|
const t = {
|
|
1738
1768
|
pourTarget: this.id
|
|
1739
1769
|
};
|
|
1740
|
-
|
|
1741
|
-
}
|
|
1742
|
-
|
|
1770
|
+
_.publish(ze, t);
|
|
1771
|
+
}
|
|
1772
|
+
this.currentState === d.IDLE ? this.logger.info("Pour already idle, nothing to cancel.") : this.logger.warn(`Cannot cancel pour in state ${this.currentState}`);
|
|
1743
1773
|
}
|
|
1744
1774
|
updateIfCurrent(e, t) {
|
|
1745
|
-
this.currentState === e &&
|
|
1775
|
+
this.currentState === e && g(() => {
|
|
1746
1776
|
this.currentState = t;
|
|
1747
1777
|
});
|
|
1748
1778
|
}
|
|
@@ -1772,12 +1802,9 @@ let le = class {
|
|
|
1772
1802
|
var e;
|
|
1773
1803
|
return ((e = this.future) == null ? void 0 : e.progress) ?? 0;
|
|
1774
1804
|
}
|
|
1775
|
-
updateServicePath(e, t) {
|
|
1776
|
-
e !== this.servicePath && (this.isPouring && t && this.cancelPour(), this.servicePath = e);
|
|
1777
|
-
}
|
|
1778
1805
|
onFutureUpdate(e) {
|
|
1779
|
-
|
|
1780
|
-
|
|
1806
|
+
E(this).forEach((r) => {
|
|
1807
|
+
me(r) && r.onPourProgress(e);
|
|
1781
1808
|
});
|
|
1782
1809
|
const t = {
|
|
1783
1810
|
pourTarget: this.id,
|
|
@@ -1790,7 +1817,9 @@ let le = class {
|
|
|
1790
1817
|
reason: e.reason,
|
|
1791
1818
|
timeRemaining: e.timeRemaining
|
|
1792
1819
|
};
|
|
1793
|
-
|
|
1820
|
+
_.publish(Wr, t), e.endState && g(() => {
|
|
1821
|
+
this.currentState = d.IDLE;
|
|
1822
|
+
});
|
|
1794
1823
|
}
|
|
1795
1824
|
// -------------------LIFECYCLE----------------------------
|
|
1796
1825
|
async init() {
|
|
@@ -1800,40 +1829,40 @@ let le = class {
|
|
|
1800
1829
|
this.logger.debug(`loading generic-pour ${this.id}`);
|
|
1801
1830
|
}
|
|
1802
1831
|
};
|
|
1803
|
-
|
|
1832
|
+
lt([
|
|
1804
1833
|
ue()
|
|
1805
1834
|
], le.prototype, "pour", 1);
|
|
1806
|
-
le =
|
|
1807
|
-
I(
|
|
1835
|
+
le = lt([
|
|
1836
|
+
I(ct)
|
|
1808
1837
|
], le);
|
|
1809
|
-
const oi = new
|
|
1838
|
+
const oi = new Ot({
|
|
1810
1839
|
class: le,
|
|
1811
|
-
type:
|
|
1812
|
-
}),
|
|
1813
|
-
...
|
|
1814
|
-
...
|
|
1815
|
-
...
|
|
1816
|
-
...
|
|
1817
|
-
|
|
1818
|
-
...tt.registration,
|
|
1819
|
-
...Me.registration,
|
|
1820
|
-
...be.registration,
|
|
1840
|
+
type: ct
|
|
1841
|
+
}), Le = {
|
|
1842
|
+
...Ke.registration,
|
|
1843
|
+
...je.registration,
|
|
1844
|
+
...rt.registration,
|
|
1845
|
+
...ke.registration,
|
|
1846
|
+
...Ce.registration,
|
|
1821
1847
|
...it.registration,
|
|
1822
|
-
...
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
}),
|
|
1848
|
+
...Oe.registration,
|
|
1849
|
+
..._e.registration,
|
|
1850
|
+
...at.registration,
|
|
1851
|
+
...tt.registration
|
|
1852
|
+
}, Qr = (e) => () => (wt(e)(), Yr.register(), Object.keys(Le).forEach((t) => {
|
|
1853
|
+
const r = Le[t];
|
|
1854
|
+
$t(e)(t, r);
|
|
1855
|
+
}), h[W].register(
|
|
1827
1856
|
"FirmwareUpdateInProgressTrouble",
|
|
1828
1857
|
async (t) => {
|
|
1829
1858
|
var r;
|
|
1830
1859
|
if ((r = t.data) != null && r.deviceId) {
|
|
1831
1860
|
const { model: n } = z(
|
|
1832
|
-
|
|
1861
|
+
at.type
|
|
1833
1862
|
);
|
|
1834
1863
|
if (n) {
|
|
1835
1864
|
const i = n.boards.find(
|
|
1836
|
-
(
|
|
1865
|
+
(a) => a.id === t.data.deviceId
|
|
1837
1866
|
) ? z(t.data.deviceId).model : void 0;
|
|
1838
1867
|
return {
|
|
1839
1868
|
devices: i ? i.name : ""
|
|
@@ -1843,62 +1872,62 @@ const oi = new _t({
|
|
|
1843
1872
|
return {};
|
|
1844
1873
|
}
|
|
1845
1874
|
), {
|
|
1846
|
-
preload:
|
|
1847
|
-
model:
|
|
1848
|
-
companion:
|
|
1849
|
-
legacy:
|
|
1875
|
+
preload: O.model.preloadModel(e),
|
|
1876
|
+
model: O.model.register(e),
|
|
1877
|
+
companion: O.companion.register(e),
|
|
1878
|
+
legacy: O.model.registerLegacyModel(e)
|
|
1850
1879
|
}), P = {
|
|
1851
|
-
...
|
|
1880
|
+
...Et
|
|
1852
1881
|
};
|
|
1853
1882
|
P.dispense = {
|
|
1854
1883
|
models: Qr(P)
|
|
1855
1884
|
};
|
|
1856
|
-
P.preload =
|
|
1857
|
-
P.model =
|
|
1858
|
-
P.companion =
|
|
1859
|
-
P.legacy =
|
|
1885
|
+
P.preload = O.model.preloadModel(P);
|
|
1886
|
+
P.model = O.model.register(P);
|
|
1887
|
+
P.companion = O.companion.register(P);
|
|
1888
|
+
P.legacy = O.model.registerLegacyModel(P);
|
|
1860
1889
|
const di = P;
|
|
1861
1890
|
export {
|
|
1862
|
-
|
|
1891
|
+
at as A,
|
|
1863
1892
|
x as B,
|
|
1864
|
-
|
|
1865
|
-
|
|
1893
|
+
xr as C,
|
|
1894
|
+
D,
|
|
1866
1895
|
u as E,
|
|
1867
|
-
|
|
1896
|
+
Lr as F,
|
|
1868
1897
|
oi as G,
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1898
|
+
ke as H,
|
|
1899
|
+
je as I,
|
|
1900
|
+
Br as J,
|
|
1872
1901
|
di as K,
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1902
|
+
Zr as L,
|
|
1903
|
+
Ce as N,
|
|
1904
|
+
it as P,
|
|
1905
|
+
Je as T,
|
|
1906
|
+
_e as a,
|
|
1907
|
+
Xe as b,
|
|
1908
|
+
tt as c,
|
|
1909
|
+
et as d,
|
|
1910
|
+
Yr as e,
|
|
1911
|
+
rt as f,
|
|
1912
|
+
Ke as g,
|
|
1913
|
+
Oe as h,
|
|
1914
|
+
We as i,
|
|
1886
1915
|
d as j,
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1916
|
+
Le as k,
|
|
1917
|
+
Nt as l,
|
|
1918
|
+
ai as m,
|
|
1919
|
+
Ut as n,
|
|
1920
|
+
si as o,
|
|
1892
1921
|
ni as p,
|
|
1893
1922
|
ii as q,
|
|
1894
1923
|
Qr as r,
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1924
|
+
jt as s,
|
|
1925
|
+
Kt as t,
|
|
1926
|
+
Gt as u,
|
|
1927
|
+
Ze as v,
|
|
1928
|
+
_r as w,
|
|
1929
|
+
br as x,
|
|
1930
|
+
Ur as y,
|
|
1931
|
+
Ar as z
|
|
1903
1932
|
};
|
|
1904
|
-
//# sourceMappingURL=dispense-registration-manager-
|
|
1933
|
+
//# sourceMappingURL=dispense-registration-manager-UjShRcvq.js.map
|