@kosdev-code/kos-dispense-sdk 2.0.40 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/control-pour-extension-Byiwjyzw.js +1547 -0
- package/control-pour-extension-Byiwjyzw.js.map +1 -0
- package/control-pour-extension-DGztqLxi.cjs +2 -0
- package/control-pour-extension-DGztqLxi.cjs.map +1 -0
- package/dispense-registration-manager-DauhdXxX.cjs +2 -0
- package/dispense-registration-manager-DauhdXxX.cjs.map +1 -0
- package/{dispense-registration-manager-eOOE05xT.js → dispense-registration-manager-pB5e_YT1.js} +584 -615
- package/dispense-registration-manager-pB5e_YT1.js.map +1 -0
- package/{extension-utils-DcOOx69a.cjs → extension-utils-BcdtSKJM.cjs} +2 -2
- package/{extension-utils-DcOOx69a.cjs.map → extension-utils-BcdtSKJM.cjs.map} +1 -1
- package/{extension-utils-B9gziKDQ.js → extension-utils-siWT4ZuD.js} +2 -2
- package/{extension-utils-B9gziKDQ.js.map → extension-utils-siWT4ZuD.js.map} +1 -1
- package/extensions/control-pour-extension.d.ts +80 -0
- package/extensions/control-pour-extension.d.ts.map +1 -0
- package/extensions/index.d.ts +2 -0
- package/extensions/index.d.ts.map +1 -0
- package/index.cjs +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +97 -94
- package/index.js.map +1 -1
- package/models/models/holder/holder-model.d.ts.map +1 -1
- package/models/models/pump/pump-model.d.ts.map +1 -1
- package/models/models/pump/types/index.d.ts +3 -2
- package/models/utils/dispense-registration-manager.d.ts +2 -2
- package/models/utils/service.d.ts +8 -8
- package/models.cjs +1 -1
- package/models.js +2 -2
- package/package.json +3 -3
- package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts +1 -0
- package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts.map +1 -1
- package/ui.cjs +1 -1
- package/ui.js +67 -66
- package/ui.js.map +1 -1
- package/dispense-registration-manager-BZeOXyYn.cjs +0 -2
- package/dispense-registration-manager-BZeOXyYn.cjs.map +0 -1
- package/dispense-registration-manager-eOOE05xT.js.map +0 -1
- package/pump-provider--hQGuh_w.js +0 -1239
- package/pump-provider--hQGuh_w.js.map +0 -1
- package/pump-provider-5w04Zi8j.cjs +0 -2
- package/pump-provider-5w04Zi8j.cjs.map +0 -1
package/{dispense-registration-manager-eOOE05xT.js → dispense-registration-manager-pB5e_YT1.js}
RENAMED
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var o = (e, t, r) => (
|
|
4
|
-
import { kosModel as I,
|
|
1
|
+
var lt = Object.defineProperty;
|
|
2
|
+
var ct = (e, t, r) => t in e ? lt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var o = (e, t, r) => (ct(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import { kosModel as I, Kos as v, isKosModel as b, resolveServiceUrl as S, ServiceFactory as R, KosLog as f, KosModelContainer as C, KosExtensionUtils as T, kosChild as M, FetchError as pt, ExtensionManager as g, EXTENSION_TROUBLE_MAPPER as be, EXTENSION_TROUBLE_DATA_MAPPER as q, getKosModelSync as z, kosDependency as ze, kosTroubleAware as ut, kosAction as h, kosTopicHandler as W, DependencyLifecycle as Le, getKosModel as Ae, FutureManager as ce, kosFuture as pe, FutureHandler as xe, EXTENSION_FEATURE_FLAG_RESOLVER as gt, isKosDataModel as ht, ChildModels as yt, KosFeatureFlags as It, kosParentAware as mt, createPropKey as ft, 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.AssemblyFeatureFlags = "kos.assembly.feature.flags", 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 || {}),
|
|
7
|
-
for (var i =
|
|
8
|
-
(n = e[
|
|
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.AssemblyFeatureFlags = "kos.assembly.feature.flags", 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 || {}), St = Object.getOwnPropertyDescriptor, Rt = (e, t, r, a) => {
|
|
7
|
+
for (var i = a > 1 ? void 0 : a ? St(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
8
|
+
(n = e[s]) && (i = n(i) || i);
|
|
9
|
+
return i;
|
|
10
10
|
};
|
|
11
|
-
const
|
|
12
|
-
let
|
|
11
|
+
const U = "ingredient-model";
|
|
12
|
+
let me = class {
|
|
13
13
|
constructor(e, {
|
|
14
14
|
name: t,
|
|
15
15
|
type: r,
|
|
16
|
-
data:
|
|
16
|
+
data: a,
|
|
17
17
|
ingredientId: i,
|
|
18
|
-
...
|
|
18
|
+
...s
|
|
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 = a, Object.assign(this, s);
|
|
26
26
|
}
|
|
27
27
|
updateModel({
|
|
28
28
|
name: e,
|
|
29
29
|
type: t,
|
|
30
30
|
data: r,
|
|
31
|
-
ingredientId:
|
|
31
|
+
ingredientId: a,
|
|
32
32
|
...i
|
|
33
33
|
}) {
|
|
34
|
-
this.name = e, this.type = t, this.ingredientId =
|
|
34
|
+
this.name = e, this.type = t, this.ingredientId = a, this.data = r, Object.assign(this, i);
|
|
35
35
|
}
|
|
36
36
|
// -------------------LIFECYCLE----------------------------
|
|
37
37
|
// -------------------ENTITY----------------------------
|
|
38
38
|
};
|
|
39
|
-
|
|
40
|
-
I(
|
|
41
|
-
],
|
|
42
|
-
const
|
|
39
|
+
me = Rt([
|
|
40
|
+
I(U)
|
|
41
|
+
], me);
|
|
42
|
+
const Be = {
|
|
43
43
|
registration: {
|
|
44
|
-
[
|
|
45
|
-
class:
|
|
44
|
+
[U]: {
|
|
45
|
+
class: me,
|
|
46
46
|
singleton: !1
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
-
type:
|
|
50
|
-
predicate: b(
|
|
51
|
-
factory: v.Factory.create(
|
|
52
|
-
}, { URL:
|
|
53
|
-
basePath: `${
|
|
54
|
-
}),
|
|
55
|
-
urlOverride: `${
|
|
49
|
+
type: U,
|
|
50
|
+
predicate: b(U),
|
|
51
|
+
factory: v.Factory.create(U)
|
|
52
|
+
}, { URL: Ue } = S("INGREDIENT_SERVICE"), { getOne: Ct } = R.build({
|
|
53
|
+
basePath: `${Ue}/api/ext/dispense/ingredients`
|
|
54
|
+
}), Dt = async () => await Ct({
|
|
55
|
+
urlOverride: `${Ue}/api/ext/dispense/ingredients`
|
|
56
56
|
});
|
|
57
|
-
var
|
|
58
|
-
for (var i =
|
|
59
|
-
(n = e[
|
|
60
|
-
return
|
|
57
|
+
var Nt = Object.defineProperty, Tt = Object.getOwnPropertyDescriptor, Ge = (e, t, r, a) => {
|
|
58
|
+
for (var i = a > 1 ? void 0 : a ? Tt(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
59
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
60
|
+
return a && i && Nt(t, r, i), i;
|
|
61
61
|
};
|
|
62
|
-
const
|
|
63
|
-
let
|
|
62
|
+
const G = "ingredient-container-model", zt = f.createLogger({ name: "ingredient-container-model" });
|
|
63
|
+
let ie = class {
|
|
64
64
|
constructor(e, t) {
|
|
65
65
|
o(this, "id");
|
|
66
66
|
o(this, "ingredients");
|
|
67
|
-
this.id = e, this.ingredients = new
|
|
67
|
+
this.id = e, this.ingredients = new C({
|
|
68
68
|
indexMap: {
|
|
69
69
|
ingredientType: "type"
|
|
70
70
|
},
|
|
@@ -80,21 +80,21 @@ let se = class {
|
|
|
80
80
|
}
|
|
81
81
|
async load(e) {
|
|
82
82
|
var i;
|
|
83
|
-
|
|
84
|
-
const t = await
|
|
83
|
+
zt.debug(`loading ingredient container ${this.id}`);
|
|
84
|
+
const t = await Dt();
|
|
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
|
-
}),
|
|
91
|
-
for (const
|
|
92
|
-
for (const n of ((i = t == null ? void 0 : t.data) == null ? void 0 : i[
|
|
93
|
-
const c = await
|
|
90
|
+
}), a = (t == null ? void 0 : t.data) ?? {};
|
|
91
|
+
for (const s of Object.keys(a))
|
|
92
|
+
for (const n of ((i = t == null ? void 0 : t.data) == null ? void 0 : i[s]) || []) {
|
|
93
|
+
const c = await T.executeDataMapperExtension({
|
|
94
94
|
extension: u.IngredientMapper,
|
|
95
95
|
data: n,
|
|
96
96
|
contextData: r
|
|
97
|
-
}), l = await
|
|
97
|
+
}), l = await T.executePropertyMapperExtension({
|
|
98
98
|
extension: u.IngredientTypeMapper,
|
|
99
99
|
data: n,
|
|
100
100
|
contextData: r
|
|
@@ -103,7 +103,7 @@ let se = class {
|
|
|
103
103
|
type: l || n.type,
|
|
104
104
|
...c,
|
|
105
105
|
data: c
|
|
106
|
-
}, y =
|
|
106
|
+
}, y = Be.factory(n.id)(
|
|
107
107
|
p
|
|
108
108
|
);
|
|
109
109
|
this.ingredients.addModel(y);
|
|
@@ -111,92 +111,92 @@ let se = class {
|
|
|
111
111
|
}
|
|
112
112
|
// -------------------ENTITY----------------------------
|
|
113
113
|
};
|
|
114
|
-
|
|
114
|
+
Ge([
|
|
115
115
|
M
|
|
116
|
-
],
|
|
117
|
-
|
|
118
|
-
I(
|
|
119
|
-
],
|
|
120
|
-
const
|
|
116
|
+
], ie.prototype, "ingredients", 2);
|
|
117
|
+
ie = Ge([
|
|
118
|
+
I(G)
|
|
119
|
+
], ie);
|
|
120
|
+
const je = {
|
|
121
121
|
registration: {
|
|
122
|
-
[
|
|
123
|
-
class:
|
|
122
|
+
[G]: {
|
|
123
|
+
class: ie,
|
|
124
124
|
singleton: !0
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
|
-
type:
|
|
128
|
-
predicate: b(
|
|
129
|
-
factory: v.Singleton.create(
|
|
130
|
-
}, { URL:
|
|
131
|
-
basePath: `${
|
|
132
|
-
}),
|
|
127
|
+
type: G,
|
|
128
|
+
predicate: b(G),
|
|
129
|
+
factory: v.Singleton.create(G)
|
|
130
|
+
}, { URL: ue } = S("HOLDER_SERVICE"), { getAll: Lt, postModel: Fe, deleteModel: At } = R.build({
|
|
131
|
+
basePath: `${ue}/api/kos/holders`
|
|
132
|
+
}), xt = f.createLogger({
|
|
133
133
|
name: "holder-service",
|
|
134
134
|
group: "Services"
|
|
135
|
-
}),
|
|
135
|
+
}), ti = async () => await Lt({}), Bt = async (e, t) => {
|
|
136
136
|
if (!e || !t)
|
|
137
137
|
throw new Error("Missing holderPath or ingredientId");
|
|
138
|
-
return await
|
|
138
|
+
return await Fe({
|
|
139
139
|
model: { holderPath: e, ingredientId: t },
|
|
140
|
-
urlOverride: `${
|
|
140
|
+
urlOverride: `${ue}/api/ext/dispense/assignments`
|
|
141
141
|
});
|
|
142
|
-
},
|
|
142
|
+
}, Ut = 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: `${ue}/api/ext/dispense/assignments/${e}`
|
|
148
148
|
});
|
|
149
|
-
},
|
|
149
|
+
}, Gt = async (e) => {
|
|
150
150
|
if (!e)
|
|
151
151
|
throw new Error("Missing holderPath");
|
|
152
|
-
return
|
|
152
|
+
return xt.debug(
|
|
153
153
|
`sending POST request to /api/ext/dispense/pumpEvents/replaceLine/${e}`
|
|
154
|
-
), await
|
|
154
|
+
), await Fe({
|
|
155
155
|
model: {},
|
|
156
|
-
urlOverride: `${
|
|
156
|
+
urlOverride: `${ue}/api/ext/dispense/pumpEvents/replaceLine/${e}`
|
|
157
157
|
});
|
|
158
|
-
}, { URL: ae } = S("ASSIGNMENT_SERVICE"), { getAll:
|
|
158
|
+
}, { URL: ae } = S("ASSIGNMENT_SERVICE"), { getAll: jt, postModel: He, deleteModel: Ft } = R.build({
|
|
159
159
|
destinationAddress: "",
|
|
160
160
|
basePath: `${ae}/api/ext/dispense/assignments`
|
|
161
|
-
}),
|
|
162
|
-
var i,
|
|
163
|
-
const r = JSON.stringify(t),
|
|
161
|
+
}), se = window.kosUseFos, ri = async () => await jt({ fos: se }), Ht = async (e, t) => {
|
|
162
|
+
var i, s, n, c;
|
|
163
|
+
const r = JSON.stringify(t), a = `${ae}/api/ext/dispense/assignments`;
|
|
164
164
|
try {
|
|
165
|
-
const l = await
|
|
165
|
+
const l = await He({
|
|
166
166
|
model: { holderPath: e, factoryJson: r },
|
|
167
|
-
urlOverride:
|
|
167
|
+
urlOverride: a
|
|
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 pt)
|
|
172
172
|
return [
|
|
173
|
-
((n = (
|
|
173
|
+
((n = (s = l.payload) == null ? void 0 : s.data) == null ? void 0 : n.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
|
+
}, ii = async (e) => {
|
|
179
|
+
const t = se ? `${ae}/api/ingredients/assignments/${e.holderPath}` : `${ae}/api/ext/dispense/assignments`;
|
|
180
|
+
return await He({
|
|
181
181
|
model: { ...e, fuelGauge: 680 },
|
|
182
|
-
fos:
|
|
182
|
+
fos: se,
|
|
183
183
|
urlOverride: t
|
|
184
184
|
});
|
|
185
|
-
},
|
|
186
|
-
var
|
|
187
|
-
for (var i =
|
|
188
|
-
(n = e[
|
|
189
|
-
return
|
|
185
|
+
}, ai = async (e) => await Ft({ id: e, fos: se });
|
|
186
|
+
var Vt = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, _e = (e, t, r, a) => {
|
|
187
|
+
for (var i = a > 1 ? void 0 : a ? Kt(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
188
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
189
|
+
return a && i && Vt(t, r, i), i;
|
|
190
190
|
};
|
|
191
|
-
const
|
|
192
|
-
|
|
191
|
+
const j = D.Holder, Re = f.createLogger({ name: "holder-model" });
|
|
192
|
+
g[be].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
|
+
g[q].register(
|
|
200
200
|
"pump",
|
|
201
201
|
async (e) => {
|
|
202
202
|
if (e.data.pumpPath) {
|
|
@@ -215,13 +215,13 @@ h[W].register(
|
|
|
215
215
|
return {};
|
|
216
216
|
}
|
|
217
217
|
);
|
|
218
|
-
|
|
218
|
+
g[q].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
|
+
g[q].register(
|
|
225
225
|
"container",
|
|
226
226
|
async (e) => {
|
|
227
227
|
if (e.data.ingredients.length > 0) {
|
|
@@ -235,20 +235,20 @@ h[W].register(
|
|
|
235
235
|
return {};
|
|
236
236
|
}
|
|
237
237
|
);
|
|
238
|
-
class
|
|
239
|
-
constructor(r,
|
|
240
|
-
super(
|
|
238
|
+
class kt extends Error {
|
|
239
|
+
constructor(r, a) {
|
|
240
|
+
super(a);
|
|
241
241
|
o(this, "type");
|
|
242
242
|
this.name = "AssignmentError", this.type = r;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
let
|
|
245
|
+
let J = class {
|
|
246
246
|
constructor(e, {
|
|
247
247
|
path: t,
|
|
248
248
|
name: r,
|
|
249
|
-
ingredientSource:
|
|
249
|
+
ingredientSource: a,
|
|
250
250
|
ingredientId: i,
|
|
251
|
-
ingredientType:
|
|
251
|
+
ingredientType: s,
|
|
252
252
|
slice: n,
|
|
253
253
|
group: c,
|
|
254
254
|
data: l,
|
|
@@ -267,8 +267,7 @@ let L = class {
|
|
|
267
267
|
o(this, "enjoyByDate");
|
|
268
268
|
o(this, "pumps");
|
|
269
269
|
o(this, "ingredientContainer");
|
|
270
|
-
|
|
271
|
-
this.id = e, this.path = t, this.name = r, this.ingredientType = a, this.ingredientSource = s, this.ingredientId = i, this.group = c, this.slice = n, this.enjoyByDate = p, this.data = l, this.pumps = new R({
|
|
270
|
+
this.id = e, this.path = t, this.name = r, this.ingredientType = s, this.ingredientSource = a, this.ingredientId = i, this.group = c, this.slice = n, this.enjoyByDate = p, this.data = l, this.pumps = new C({
|
|
272
271
|
parentId: e,
|
|
273
272
|
sortKey: "path"
|
|
274
273
|
}), this.logger = y.logger;
|
|
@@ -277,14 +276,14 @@ let L = class {
|
|
|
277
276
|
path: e,
|
|
278
277
|
name: t,
|
|
279
278
|
ingredientSource: r,
|
|
280
|
-
ingredientId:
|
|
279
|
+
ingredientId: a,
|
|
281
280
|
ingredientType: i,
|
|
282
|
-
group:
|
|
281
|
+
group: s,
|
|
283
282
|
slice: n,
|
|
284
283
|
enjoyByDate: c,
|
|
285
284
|
data: l
|
|
286
285
|
}) {
|
|
287
|
-
this.path = e, this.name = t, this.ingredientId =
|
|
286
|
+
this.path = e, this.name = t, this.ingredientId = a, this.ingredientType = i, this.ingredientSource = r, this.enjoyByDate = c, this.slice = n, this.group = s, this.data = l;
|
|
288
287
|
}
|
|
289
288
|
get hasEnjoyByDate() {
|
|
290
289
|
return !!this.enjoyByDate && !this.unassigned;
|
|
@@ -309,8 +308,8 @@ let L = class {
|
|
|
309
308
|
return this.logger.debug(`isPouring: ${!!e}`), e;
|
|
310
309
|
}
|
|
311
310
|
async performIntent(e) {
|
|
312
|
-
const t = typeof e == "string" ? e : e.intent, r = typeof e == "string" ? void 0 : e.pumpPath,
|
|
313
|
-
return
|
|
311
|
+
const t = typeof e == "string" ? e : e.intent, r = typeof e == "string" ? void 0 : e.pumpPath, a = r ? this.pumps.getModel(r) : this.pumps.data[0];
|
|
312
|
+
return a == null ? void 0 : a.performIntent({ intent: t });
|
|
314
313
|
}
|
|
315
314
|
get pourState() {
|
|
316
315
|
return this.pumps.data.reduce((t, r) => r.pouringState ? r.pouringState : t, "");
|
|
@@ -343,18 +342,6 @@ let L = class {
|
|
|
343
342
|
get previousIngredientName() {
|
|
344
343
|
return this.previousIngredient ? this.previousIngredient.displayName ?? this.previousIngredient.name : this.prevIngredientId ? "unknown" : "";
|
|
345
344
|
}
|
|
346
|
-
get troubles() {
|
|
347
|
-
return this.troubleContainer.troubles.getIndexByKey("byIface", this.path).sort((e, t) => t.rank - e.rank);
|
|
348
|
-
}
|
|
349
|
-
get troubleStatus() {
|
|
350
|
-
return "";
|
|
351
|
-
}
|
|
352
|
-
get troublesByType() {
|
|
353
|
-
return this.troubles.reduce(
|
|
354
|
-
Ae,
|
|
355
|
-
{}
|
|
356
|
-
);
|
|
357
|
-
}
|
|
358
345
|
get prevIngredientId() {
|
|
359
346
|
var e, t;
|
|
360
347
|
return (t = (e = this.pumps.data) == null ? void 0 : e[0]) == null ? void 0 : t.prevIngredientId;
|
|
@@ -384,7 +371,7 @@ let L = class {
|
|
|
384
371
|
return this.hasMaxVolume && this.hasRemainingVolume;
|
|
385
372
|
}
|
|
386
373
|
updateIngredient(e) {
|
|
387
|
-
this.ingredientId !== e &&
|
|
374
|
+
this.ingredientId !== e && h(() => {
|
|
388
375
|
this.ingredientId = e;
|
|
389
376
|
});
|
|
390
377
|
}
|
|
@@ -396,33 +383,33 @@ let L = class {
|
|
|
396
383
|
if (!e)
|
|
397
384
|
throw new Error("Invalid override");
|
|
398
385
|
try {
|
|
399
|
-
const [t, r] = await
|
|
386
|
+
const [t, r] = await Ht(this.path, e);
|
|
400
387
|
if (t)
|
|
401
|
-
throw new
|
|
388
|
+
throw new kt(
|
|
402
389
|
t,
|
|
403
390
|
`Failed to perform rfid override on holder ${this.id}`
|
|
404
391
|
);
|
|
405
|
-
return
|
|
392
|
+
return h(() => {
|
|
406
393
|
this.ingredientId = r == null ? void 0 : r.ingredientId;
|
|
407
394
|
}), r;
|
|
408
395
|
} catch (t) {
|
|
409
|
-
throw
|
|
396
|
+
throw Re.error(`Failed to perform rfid override on holder ${this.id}`, t), t;
|
|
410
397
|
}
|
|
411
398
|
}
|
|
412
399
|
async assignIngredient(e) {
|
|
413
400
|
try {
|
|
414
|
-
e ? await
|
|
401
|
+
e ? await Bt(this.path, e) : await Ut(this.path), h(() => {
|
|
415
402
|
this.ingredientId = e;
|
|
416
403
|
});
|
|
417
404
|
} catch (t) {
|
|
418
|
-
throw
|
|
405
|
+
throw Re.error(`Failed to perform assign ingredient to holder ${this.id}`, t), t;
|
|
419
406
|
}
|
|
420
407
|
}
|
|
421
408
|
get shouldDefer() {
|
|
422
409
|
return this.troubles.some((e) => e.shouldDefer);
|
|
423
410
|
}
|
|
424
411
|
async replaceLine() {
|
|
425
|
-
await
|
|
412
|
+
await Gt(this.path);
|
|
426
413
|
}
|
|
427
414
|
// -------------------LIFECYCLE----------------------------
|
|
428
415
|
// ----------------------------------
|
|
@@ -444,70 +431,68 @@ let L = class {
|
|
|
444
431
|
// }
|
|
445
432
|
// -------------------ENTITY----------------------------
|
|
446
433
|
};
|
|
447
|
-
|
|
434
|
+
_e([
|
|
448
435
|
M
|
|
449
|
-
],
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
],
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
], L);
|
|
459
|
-
const ke = {
|
|
436
|
+
], J.prototype, "pumps", 2);
|
|
437
|
+
_e([
|
|
438
|
+
ze({ modelType: je.type })
|
|
439
|
+
], J.prototype, "ingredientContainer", 2);
|
|
440
|
+
J = _e([
|
|
441
|
+
I(j),
|
|
442
|
+
ut()
|
|
443
|
+
], J);
|
|
444
|
+
const Ve = {
|
|
460
445
|
registration: {
|
|
461
|
-
[
|
|
462
|
-
class:
|
|
446
|
+
[j]: {
|
|
447
|
+
class: J,
|
|
463
448
|
singleton: !1
|
|
464
449
|
}
|
|
465
450
|
},
|
|
466
|
-
type:
|
|
467
|
-
predicate: b(
|
|
468
|
-
factory: v.Factory.create(
|
|
469
|
-
},
|
|
470
|
-
var
|
|
471
|
-
const r =
|
|
451
|
+
type: j,
|
|
452
|
+
predicate: b(j),
|
|
453
|
+
factory: v.Factory.create(j)
|
|
454
|
+
}, Yt = async (e, t) => {
|
|
455
|
+
var Se;
|
|
456
|
+
const r = g.propertyMapper.executeMapper(
|
|
472
457
|
u.HolderIngredientMapper,
|
|
473
458
|
t
|
|
474
|
-
),
|
|
459
|
+
), a = g.propertyMapper.executeMapper(
|
|
475
460
|
u.HolderTypeMapper,
|
|
476
461
|
t
|
|
477
|
-
) || t.ingType, i = await
|
|
462
|
+
) || t.ingType, i = await T.executeDataMapperExtension({
|
|
478
463
|
extension: u.HolderMapper,
|
|
479
464
|
data: t,
|
|
480
465
|
contextData: {}
|
|
481
|
-
}), { name:
|
|
482
|
-
name:
|
|
466
|
+
}), { name: s, path: n, ingredientId: c, ingType: l, ingSource: p, slice: y, ...B } = t, m = { ...B, ...i }, N = y || { pos: 0 }, te = {
|
|
467
|
+
name: s,
|
|
483
468
|
path: n,
|
|
484
469
|
ingredientId: r || c,
|
|
485
|
-
ingredientType:
|
|
470
|
+
ingredientType: a || l,
|
|
486
471
|
ingredientSource: p,
|
|
487
|
-
enjoyByDate: (
|
|
488
|
-
slice:
|
|
472
|
+
enjoyByDate: (Se = t.container) != null && Se.enjoyByDate ? new Date(t.container.enjoyByDate) : void 0,
|
|
473
|
+
slice: N,
|
|
489
474
|
group: e,
|
|
490
|
-
data:
|
|
475
|
+
data: m
|
|
491
476
|
};
|
|
492
|
-
return
|
|
493
|
-
}, { URL:
|
|
494
|
-
basePath: `${
|
|
495
|
-
}),
|
|
477
|
+
return Ve.factory(t.path)(te);
|
|
478
|
+
}, { URL: Zt } = S("ASSEMBLY_SERVICE"), { getOne: Xt } = R.build({
|
|
479
|
+
basePath: `${Zt}/api/kos/device/assemblies`
|
|
480
|
+
}), Jt = f.createLogger({
|
|
496
481
|
name: "assembly-service",
|
|
497
482
|
group: "Services"
|
|
498
|
-
}),
|
|
499
|
-
var
|
|
500
|
-
for (var i =
|
|
501
|
-
(n = e[
|
|
502
|
-
return
|
|
483
|
+
}), Ke = async () => (Jt.debug("sending GET for assembly"), await Xt({}));
|
|
484
|
+
var qt = Object.defineProperty, Wt = Object.getOwnPropertyDescriptor, ge = (e, t, r, a) => {
|
|
485
|
+
for (var i = a > 1 ? void 0 : a ? Wt(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
486
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
487
|
+
return a && i && qt(t, r, i), i;
|
|
503
488
|
};
|
|
504
|
-
const
|
|
505
|
-
let
|
|
489
|
+
const F = "board-container-model", ke = "/kos/hardware/board/linked", Ye = "/kos/hardware/board/unlinked";
|
|
490
|
+
let L = class {
|
|
506
491
|
constructor(e, t, r) {
|
|
507
492
|
o(this, "id");
|
|
508
493
|
o(this, "logger");
|
|
509
494
|
o(this, "models");
|
|
510
|
-
this.id = e, this.logger = r.logger, this.models = new
|
|
495
|
+
this.id = e, this.logger = r.logger, this.models = new C({
|
|
511
496
|
parentId: e,
|
|
512
497
|
extensionId: u.BoardIndex
|
|
513
498
|
});
|
|
@@ -532,52 +517,52 @@ let x = class {
|
|
|
532
517
|
r.updateModel(e);
|
|
533
518
|
}
|
|
534
519
|
handleBoardLinkEvent(e) {
|
|
535
|
-
this.logger.debug(`handling ${
|
|
520
|
+
this.logger.debug(`handling ${ke} event ${e}`), e ? this.updateBoard(e) : this.logger.debug("- boardLinkEvent is undefined");
|
|
536
521
|
}
|
|
537
522
|
handleBoardUnlinkEvent(e) {
|
|
538
523
|
this.logger.debug(
|
|
539
|
-
`handling ${
|
|
524
|
+
`handling ${Ye} event ${e}`
|
|
540
525
|
), e ? this.updateBoard(e) : this.logger.debug("- boardLinkEvent is undefined");
|
|
541
526
|
}
|
|
542
527
|
};
|
|
543
|
-
|
|
528
|
+
ge([
|
|
544
529
|
M
|
|
545
|
-
],
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
lifecycle:
|
|
549
|
-
topic:
|
|
530
|
+
], L.prototype, "models", 2);
|
|
531
|
+
ge([
|
|
532
|
+
W({
|
|
533
|
+
lifecycle: Le.INIT,
|
|
534
|
+
topic: ke,
|
|
550
535
|
websocket: !0
|
|
551
536
|
})
|
|
552
|
-
],
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
lifecycle:
|
|
556
|
-
topic:
|
|
537
|
+
], L.prototype, "handleBoardLinkEvent", 1);
|
|
538
|
+
ge([
|
|
539
|
+
W({
|
|
540
|
+
lifecycle: Le.INIT,
|
|
541
|
+
topic: Ye,
|
|
557
542
|
websocket: !0
|
|
558
543
|
})
|
|
559
|
-
],
|
|
560
|
-
|
|
561
|
-
I(
|
|
562
|
-
],
|
|
563
|
-
const
|
|
544
|
+
], L.prototype, "handleBoardUnlinkEvent", 1);
|
|
545
|
+
L = ge([
|
|
546
|
+
I(F)
|
|
547
|
+
], L);
|
|
548
|
+
const Qt = async (e) => {
|
|
564
549
|
const t = e.data.boardPath, { model: r } = z(t);
|
|
565
550
|
return {
|
|
566
551
|
boardName: (r == null ? void 0 : r.name) || ""
|
|
567
552
|
};
|
|
568
553
|
};
|
|
569
|
-
var
|
|
570
|
-
for (var i =
|
|
571
|
-
(n = e[
|
|
572
|
-
return
|
|
554
|
+
var er = Object.defineProperty, tr = Object.getOwnPropertyDescriptor, Ze = (e, t, r, a) => {
|
|
555
|
+
for (var i = a > 1 ? void 0 : a ? tr(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
556
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
557
|
+
return a && i && er(t, r, i), i;
|
|
573
558
|
};
|
|
574
|
-
const
|
|
575
|
-
var
|
|
576
|
-
let
|
|
559
|
+
const H = D.PumpContainer;
|
|
560
|
+
var Xe = /* @__PURE__ */ ((e) => (e.byBoard = "byBoard", e.byType = "byType", e.byNozzle = "byNozzle", e))(Xe || {});
|
|
561
|
+
let ne = class {
|
|
577
562
|
constructor(e, t) {
|
|
578
563
|
o(this, "id");
|
|
579
564
|
o(this, "pumps");
|
|
580
|
-
this.id = e, this.pumps = new
|
|
565
|
+
this.id = e, this.pumps = new C({
|
|
581
566
|
indexMap: {
|
|
582
567
|
byNozzle: (r) => r.nozzlePaths,
|
|
583
568
|
byBoard: (r) => r.boardPath,
|
|
@@ -621,69 +606,69 @@ let oe = class {
|
|
|
621
606
|
}
|
|
622
607
|
// -------------------ENTITY----------------------------
|
|
623
608
|
};
|
|
624
|
-
|
|
609
|
+
Ze([
|
|
625
610
|
M
|
|
626
|
-
],
|
|
627
|
-
|
|
628
|
-
I(
|
|
629
|
-
],
|
|
630
|
-
const
|
|
611
|
+
], ne.prototype, "pumps", 2);
|
|
612
|
+
ne = Ze([
|
|
613
|
+
I(H)
|
|
614
|
+
], ne);
|
|
615
|
+
const Me = {
|
|
631
616
|
registration: {
|
|
632
|
-
[
|
|
633
|
-
class:
|
|
617
|
+
[H]: {
|
|
618
|
+
class: ne,
|
|
634
619
|
singleton: !0
|
|
635
620
|
}
|
|
636
621
|
},
|
|
637
|
-
type:
|
|
638
|
-
predicate: b(
|
|
622
|
+
type: H,
|
|
623
|
+
predicate: b(H),
|
|
639
624
|
factory: v.Singleton.create(
|
|
640
|
-
|
|
625
|
+
H
|
|
641
626
|
)
|
|
642
|
-
},
|
|
643
|
-
const t = [], { model: r } = await
|
|
627
|
+
}, Je = async (e) => {
|
|
628
|
+
const t = [], { model: r } = await Ae(e);
|
|
644
629
|
return r && (t.push(r.boardPath), t.push(r.nozzlePath), t.push(r.holderPath)), t;
|
|
645
|
-
},
|
|
630
|
+
}, rr = async (e) => {
|
|
646
631
|
const t = [], r = e.data.pumpPath;
|
|
647
632
|
t.push(r);
|
|
648
|
-
const
|
|
649
|
-
return [...t, ...
|
|
650
|
-
},
|
|
633
|
+
const a = await Je(r);
|
|
634
|
+
return [...t, ...a];
|
|
635
|
+
}, ir = async (e) => {
|
|
651
636
|
const t = [], r = e.data.boardPath;
|
|
652
637
|
t.push(e.data.boardPath);
|
|
653
|
-
const
|
|
654
|
-
|
|
638
|
+
const a = await Ae(
|
|
639
|
+
Me.type
|
|
655
640
|
);
|
|
656
|
-
if (
|
|
657
|
-
const
|
|
658
|
-
|
|
641
|
+
if (a != null && a.model) {
|
|
642
|
+
const s = a.model.models.getIndexByKey(
|
|
643
|
+
Xe.byBoard,
|
|
659
644
|
r
|
|
660
645
|
).map(
|
|
661
|
-
(c) =>
|
|
646
|
+
(c) => Je(c.path)
|
|
662
647
|
);
|
|
663
|
-
(await Promise.allSettled(
|
|
648
|
+
(await Promise.allSettled(s)).forEach((c) => {
|
|
664
649
|
c.status === "fulfilled" && c.value.forEach((l) => t.push(l));
|
|
665
650
|
});
|
|
666
651
|
}
|
|
667
652
|
return Array.from(new Set(t));
|
|
668
653
|
};
|
|
669
|
-
var
|
|
670
|
-
for (var i =
|
|
671
|
-
(n = e[
|
|
672
|
-
return
|
|
654
|
+
var ar = Object.getOwnPropertyDescriptor, sr = (e, t, r, a) => {
|
|
655
|
+
for (var i = a > 1 ? void 0 : a ? ar(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
656
|
+
(n = e[s]) && (i = n(i) || i);
|
|
657
|
+
return i;
|
|
673
658
|
};
|
|
674
|
-
const V = "board-model",
|
|
675
|
-
const { type: r, name:
|
|
676
|
-
t.type = r, t.name =
|
|
659
|
+
const V = "board-model", Ce = (e, t) => {
|
|
660
|
+
const { type: r, name: a, path: i, linked: s, instanceId: n, link: c, ...l } = e;
|
|
661
|
+
t.type = r, t.name = a, t.path = i, t.linked = s, t.link = Object.freeze(c), t.instanceId = n, Object.assign(t, l);
|
|
677
662
|
};
|
|
678
|
-
|
|
663
|
+
g[be].register(
|
|
679
664
|
"board",
|
|
680
|
-
|
|
665
|
+
ir
|
|
681
666
|
);
|
|
682
|
-
|
|
667
|
+
g[q].register(
|
|
683
668
|
"board",
|
|
684
|
-
|
|
669
|
+
Qt
|
|
685
670
|
);
|
|
686
|
-
let
|
|
671
|
+
let fe = class {
|
|
687
672
|
constructor(e, t, r) {
|
|
688
673
|
o(this, "id");
|
|
689
674
|
o(this, "type");
|
|
@@ -692,10 +677,10 @@ let be = class {
|
|
|
692
677
|
o(this, "linked");
|
|
693
678
|
o(this, "instanceId");
|
|
694
679
|
o(this, "logger");
|
|
695
|
-
this.id = e, this.logger = r.logger,
|
|
680
|
+
this.id = e, this.logger = r.logger, Ce(t, this);
|
|
696
681
|
}
|
|
697
682
|
updateModel(e) {
|
|
698
|
-
|
|
683
|
+
Ce(e, this);
|
|
699
684
|
}
|
|
700
685
|
// -------------------LIFECYCLE----------------------------
|
|
701
686
|
async init() {
|
|
@@ -705,47 +690,47 @@ let be = class {
|
|
|
705
690
|
this.logger.debug(`loading board ${this.id}`);
|
|
706
691
|
}
|
|
707
692
|
};
|
|
708
|
-
|
|
693
|
+
fe = sr([
|
|
709
694
|
I(V)
|
|
710
|
-
],
|
|
711
|
-
const
|
|
695
|
+
], fe);
|
|
696
|
+
const qe = {
|
|
712
697
|
registration: {
|
|
713
698
|
[V]: {
|
|
714
|
-
class:
|
|
699
|
+
class: fe,
|
|
715
700
|
singleton: !1
|
|
716
701
|
}
|
|
717
702
|
},
|
|
718
703
|
type: V,
|
|
719
704
|
predicate: b(V),
|
|
720
705
|
factory: v.Factory.create(V)
|
|
721
|
-
},
|
|
706
|
+
}, We = {
|
|
722
707
|
registration: {
|
|
723
|
-
[
|
|
724
|
-
class:
|
|
708
|
+
[F]: {
|
|
709
|
+
class: L,
|
|
725
710
|
singleton: !0
|
|
726
711
|
},
|
|
727
|
-
...
|
|
712
|
+
...qe.registration
|
|
728
713
|
},
|
|
729
|
-
type:
|
|
730
|
-
predicate: b(
|
|
714
|
+
type: F,
|
|
715
|
+
predicate: b(F),
|
|
731
716
|
factory: v.Singleton.create(
|
|
732
|
-
|
|
717
|
+
F
|
|
733
718
|
)
|
|
734
719
|
};
|
|
735
|
-
var
|
|
736
|
-
for (var i =
|
|
737
|
-
(n = e[
|
|
738
|
-
return
|
|
720
|
+
var nr = Object.defineProperty, or = Object.getOwnPropertyDescriptor, he = (e, t, r, a) => {
|
|
721
|
+
for (var i = a > 1 ? void 0 : a ? or(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
722
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
723
|
+
return a && i && nr(t, r, i), i;
|
|
739
724
|
};
|
|
740
|
-
const
|
|
725
|
+
const K = D.HolderContainer, dr = "/kos/insertion/insert/start", lr = "/kos/insertion/insert/complete", cr = "/kos/insertion/insert/update", pr = "/kos/insertion/remove", ur = "/kos/pumpEvent/replaceLine", gr = "/kos/handle/*";
|
|
741
726
|
let A = class {
|
|
742
727
|
constructor(e, t, r) {
|
|
743
728
|
o(this, "id");
|
|
744
729
|
o(this, "holders");
|
|
745
730
|
o(this, "logger");
|
|
746
|
-
this.id = e, this.holders = new
|
|
731
|
+
this.id = e, this.holders = new C({
|
|
747
732
|
indexMap: {
|
|
748
|
-
nozzle: (
|
|
733
|
+
nozzle: (a) => a.nozzlePaths,
|
|
749
734
|
group: "group"
|
|
750
735
|
},
|
|
751
736
|
parentId: e,
|
|
@@ -755,26 +740,26 @@ let A = class {
|
|
|
755
740
|
updateModel() {
|
|
756
741
|
}
|
|
757
742
|
handleHolderEvents(e) {
|
|
758
|
-
var r,
|
|
759
|
-
|
|
743
|
+
var r, a, i;
|
|
744
|
+
f.ifDebug(
|
|
760
745
|
() => this.logger.debug("Received holder change event", JSON.stringify(e))
|
|
761
746
|
);
|
|
762
747
|
const t = this.holders.getModel(e.path);
|
|
763
748
|
t && (this.logger.info(
|
|
764
749
|
`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 = (
|
|
750
|
+
), t.slice.currentVolMl = (r = e.slice) == null ? void 0 : r.currentVolMl, t.slice.maxVolMl = (a = e.slice) == null ? void 0 : a.maxVolMl, (i = e == null ? void 0 : e.container) != null && i.enjoyByDate ? t.enjoyByDate = new Date(e.container.enjoyByDate) : t.enjoyByDate = void 0);
|
|
766
751
|
}
|
|
767
752
|
handleInsertion(e) {
|
|
768
|
-
|
|
753
|
+
f.ifDebug(
|
|
769
754
|
() => this.logger.debug("Received insertion event", JSON.stringify(e))
|
|
770
755
|
), (Array.isArray(e) ? e : [e]).forEach((r) => {
|
|
771
|
-
|
|
772
|
-
var
|
|
773
|
-
const
|
|
756
|
+
h(() => {
|
|
757
|
+
var s, n, c;
|
|
758
|
+
const a = r.ingredientId, i = this.holders.getModel(r.path);
|
|
774
759
|
i && (this.logger.info(
|
|
775
760
|
`Received insertion event for holder ${i.path}`
|
|
776
|
-
), i.updateIngredient(
|
|
777
|
-
|
|
761
|
+
), i.updateIngredient(a), i.slice.currentVolMl = (s = r.slice) == null ? void 0 : s.currentVolMl, i.slice.maxVolMl = (n = r.slice) == null ? void 0 : n.maxVolMl, (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) => {
|
|
762
|
+
h(() => {
|
|
778
763
|
const p = i.pumps.getModel(l.path);
|
|
779
764
|
p && (p.ingredientId = l.ingredientId, p.inserted = l.inserted, p.prevIngredientId = l.prevIngredientId);
|
|
780
765
|
});
|
|
@@ -784,92 +769,92 @@ let A = class {
|
|
|
784
769
|
}
|
|
785
770
|
// -------------------ENTITY----------------------------
|
|
786
771
|
};
|
|
787
|
-
|
|
772
|
+
he([
|
|
788
773
|
M
|
|
789
774
|
], A.prototype, "holders", 2);
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
topic:
|
|
775
|
+
he([
|
|
776
|
+
W({
|
|
777
|
+
topic: gr,
|
|
793
778
|
websocket: !0,
|
|
794
779
|
condition: (e, t) => t.holders.getModel(e.path) !== void 0
|
|
795
780
|
})
|
|
796
781
|
], A.prototype, "handleHolderEvents", 1);
|
|
797
|
-
|
|
798
|
-
|
|
782
|
+
he([
|
|
783
|
+
W({
|
|
799
784
|
topic: [
|
|
785
|
+
dr,
|
|
786
|
+
lr,
|
|
787
|
+
cr,
|
|
800
788
|
pr,
|
|
801
|
-
ur
|
|
802
|
-
hr,
|
|
803
|
-
gr,
|
|
804
|
-
yr
|
|
789
|
+
ur
|
|
805
790
|
],
|
|
806
791
|
websocket: !0
|
|
807
792
|
})
|
|
808
793
|
], A.prototype, "handleInsertion", 1);
|
|
809
|
-
A =
|
|
810
|
-
I(
|
|
794
|
+
A = he([
|
|
795
|
+
I(K)
|
|
811
796
|
], A);
|
|
812
|
-
const
|
|
797
|
+
const Qe = {
|
|
813
798
|
registration: {
|
|
814
|
-
[
|
|
799
|
+
[K]: {
|
|
815
800
|
class: A,
|
|
816
801
|
singleton: !0
|
|
817
802
|
}
|
|
818
803
|
},
|
|
819
|
-
type:
|
|
820
|
-
predicate: b(
|
|
804
|
+
type: K,
|
|
805
|
+
predicate: b(K),
|
|
821
806
|
factory: v.Singleton.create(
|
|
822
|
-
|
|
807
|
+
K
|
|
823
808
|
)
|
|
824
|
-
},
|
|
825
|
-
const t = await
|
|
809
|
+
}, hr = f.createLogger({ name: "board-utils" }), yr = async (e) => {
|
|
810
|
+
const t = await T.executeDataMapperExtension({
|
|
826
811
|
extension: u.BoardMapper,
|
|
827
812
|
data: e,
|
|
828
813
|
contextData: {}
|
|
829
|
-
}), { type: r, name:
|
|
814
|
+
}), { type: r, name: a, path: i, linked: s, instanceId: n, ...c } = e, l = { ...c, ...t }, p = {
|
|
830
815
|
type: r,
|
|
831
|
-
name:
|
|
816
|
+
name: a,
|
|
832
817
|
path: i,
|
|
833
|
-
linked:
|
|
818
|
+
linked: s,
|
|
834
819
|
instanceId: n,
|
|
835
820
|
...l
|
|
836
|
-
}, y =
|
|
821
|
+
}, y = qe.factory(e.path)(p);
|
|
837
822
|
return y.updateModel(p), y;
|
|
838
|
-
},
|
|
839
|
-
|
|
840
|
-
const r = await
|
|
823
|
+
}, Ir = (e) => async (t) => {
|
|
824
|
+
hr.debug(`adding board ${t.name}`);
|
|
825
|
+
const r = await yr(t);
|
|
841
826
|
e.addModel(r);
|
|
842
827
|
};
|
|
843
828
|
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: `${
|
|
829
|
+
const { URL: Oe } = S("PUMP_SERVICE"), { postModel: mr, getOne: fr } = R.build({
|
|
830
|
+
basePath: `${Oe}/api/kos/holders`
|
|
846
831
|
});
|
|
847
|
-
|
|
832
|
+
f.createLogger({
|
|
848
833
|
name: "pump-service",
|
|
849
834
|
group: "Services"
|
|
850
835
|
});
|
|
851
|
-
const
|
|
836
|
+
const Pr = async ({
|
|
852
837
|
intent: e,
|
|
853
838
|
pumpId: t,
|
|
854
839
|
tracker: r
|
|
855
840
|
}) => {
|
|
856
|
-
const
|
|
857
|
-
return i != null && i.data &&
|
|
858
|
-
},
|
|
859
|
-
const r = `${
|
|
860
|
-
return
|
|
841
|
+
const a = `${Oe}/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/pour/${t}/${e}`, i = await mr({ model: {}, urlOverride: a, tracker: r });
|
|
842
|
+
return i != null && i.data && ce.initiateFuture(i.data), i;
|
|
843
|
+
}, vr = async (e, t) => {
|
|
844
|
+
const r = `${Oe}/api/ext/dispense/nozzle/nozzle/pipeline/ingredient/intent/${e}/${t}/volume`, a = await fr({ urlOverride: r });
|
|
845
|
+
return a != null && a.data ? a.data : { volume: -1 };
|
|
861
846
|
};
|
|
862
|
-
var
|
|
863
|
-
for (var i =
|
|
864
|
-
(n = e[
|
|
865
|
-
return
|
|
847
|
+
var br = Object.defineProperty, _r = Object.getOwnPropertyDescriptor, et = (e, t, r, a) => {
|
|
848
|
+
for (var i = a > 1 ? void 0 : a ? _r(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
849
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
850
|
+
return a && i && br(t, r, i), i;
|
|
866
851
|
};
|
|
867
852
|
const k = D.Pump;
|
|
868
|
-
|
|
853
|
+
g[be].register(
|
|
869
854
|
"pump",
|
|
870
|
-
|
|
855
|
+
rr
|
|
871
856
|
);
|
|
872
|
-
let
|
|
857
|
+
let oe = class {
|
|
873
858
|
constructor(e, t) {
|
|
874
859
|
o(this, "id");
|
|
875
860
|
o(this, "inserted");
|
|
@@ -883,50 +868,37 @@ let q = class {
|
|
|
883
868
|
o(this, "name");
|
|
884
869
|
o(this, "path");
|
|
885
870
|
o(this, "prevIngredientId");
|
|
886
|
-
o(this, "troubleContainer");
|
|
887
871
|
o(this, "futureHandler");
|
|
888
872
|
o(this, "currentState", d.IDLE);
|
|
889
873
|
this.id = e;
|
|
890
874
|
const {
|
|
891
875
|
inserted: r,
|
|
892
|
-
holderPath:
|
|
876
|
+
holderPath: a,
|
|
893
877
|
boardPath: i,
|
|
894
|
-
nozzlePath:
|
|
878
|
+
nozzlePath: s,
|
|
895
879
|
name: n,
|
|
896
880
|
path: c,
|
|
897
881
|
childPump: l,
|
|
898
882
|
virtual: p,
|
|
899
883
|
prevIngredientId: y,
|
|
900
|
-
...
|
|
884
|
+
...B
|
|
901
885
|
} = t;
|
|
902
|
-
this.inserted = r, this.type = t.type, this.ingredientId = t.ingredientId, this.holderPath =
|
|
886
|
+
this.inserted = r, this.type = t.type, this.ingredientId = t.ingredientId, this.holderPath = a, this.boardPath = i, this.nozzlePath = s, this.name = n, this.path = c, this.childPump = !!l, this.virtual = !!p, this.prevIngredientId = y, Object.assign(this, B), this.futureHandler = new xe(this);
|
|
903
887
|
}
|
|
904
888
|
updateModel(e) {
|
|
905
889
|
const {
|
|
906
890
|
inserted: t,
|
|
907
891
|
holderPath: r,
|
|
908
|
-
boardPath:
|
|
892
|
+
boardPath: a,
|
|
909
893
|
nozzlePath: i,
|
|
910
|
-
childPump:
|
|
894
|
+
childPump: s,
|
|
911
895
|
name: n,
|
|
912
896
|
path: c,
|
|
913
897
|
...l
|
|
914
898
|
} = e;
|
|
915
|
-
this.inserted = t, this.type = e.type, this.ingredientId = e.ingredientId, this.holderPath = r, this.boardPath =
|
|
899
|
+
this.inserted = t, this.type = e.type, this.ingredientId = e.ingredientId, this.holderPath = r, this.boardPath = a, this.nozzlePath = i, this.childPump = this.childPump ? this.childPump : !!s, this.name = n, this.path = c, this.prevIngredientId = e.prevIngredientId, Object.assign(this, l);
|
|
916
900
|
}
|
|
917
901
|
// -------------------LIFECYCLE----------------------------
|
|
918
|
-
get troubles() {
|
|
919
|
-
return this.troubleContainer.troubles.getIndexByKey("byIface", this.path).sort((e, t) => t.rank - e.rank);
|
|
920
|
-
}
|
|
921
|
-
get troubleStatus() {
|
|
922
|
-
return "";
|
|
923
|
-
}
|
|
924
|
-
get troublesByType() {
|
|
925
|
-
return this.troubles.reduce(
|
|
926
|
-
Ae,
|
|
927
|
-
{}
|
|
928
|
-
);
|
|
929
|
-
}
|
|
930
902
|
get pouringState() {
|
|
931
903
|
var e;
|
|
932
904
|
return ((e = this.future) == null ? void 0 : e.endState) || "";
|
|
@@ -939,21 +911,21 @@ let q = class {
|
|
|
939
911
|
return !!this.ingredientId && !this.isPouring;
|
|
940
912
|
}
|
|
941
913
|
onFutureUpdate(e) {
|
|
942
|
-
e.endState &&
|
|
914
|
+
e.endState && h(() => {
|
|
943
915
|
this.currentState = d.IDLE;
|
|
944
916
|
});
|
|
945
917
|
}
|
|
946
918
|
async cancelPour() {
|
|
947
919
|
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()),
|
|
920
|
+
this.currentState === d.POURING || this.currentState === d.POUR_STARTING ? (this.currentState = d.POUR_CANCELING, await ((e = this.future) == null ? void 0 : e.cancelFuture()), h(() => {
|
|
949
921
|
this.currentState = d.IDLE;
|
|
950
|
-
})) :
|
|
922
|
+
})) : f.warn(`Cannot cancel pour in state ${this.currentState}`);
|
|
951
923
|
}
|
|
952
924
|
get future() {
|
|
953
925
|
return this.futureHandler.future;
|
|
954
926
|
}
|
|
955
927
|
async resolveIntentVolume(e) {
|
|
956
|
-
return await
|
|
928
|
+
return await vr(this.path, e);
|
|
957
929
|
}
|
|
958
930
|
async performIntent(e, t) {
|
|
959
931
|
const r = typeof e == "string" ? e : e.intent;
|
|
@@ -963,43 +935,40 @@ let q = class {
|
|
|
963
935
|
if (this.currentState === d.IDLE) {
|
|
964
936
|
if (this.currentState = d.POUR_STARTING, !t)
|
|
965
937
|
throw new Error("No tracker provided");
|
|
966
|
-
const
|
|
938
|
+
const a = await Pr({
|
|
967
939
|
tracker: t,
|
|
968
940
|
intent: r,
|
|
969
941
|
pumpId: this.path
|
|
970
942
|
});
|
|
971
|
-
return this.currentState === d.POUR_STARTING &&
|
|
943
|
+
return this.currentState === d.POUR_STARTING && h(() => {
|
|
972
944
|
this.currentState = d.POURING;
|
|
973
|
-
}),
|
|
945
|
+
}), a == null ? void 0 : a.data;
|
|
974
946
|
} else
|
|
975
947
|
throw new Error(`Cannot pour in state ${this.currentState}`);
|
|
976
|
-
} catch (
|
|
977
|
-
throw
|
|
948
|
+
} catch (a) {
|
|
949
|
+
throw f.error(a), this.currentState = d.IDLE, a;
|
|
978
950
|
}
|
|
979
951
|
}
|
|
980
952
|
// -------------------ENTITY----------------------------
|
|
981
953
|
};
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
],
|
|
985
|
-
|
|
986
|
-
ue()
|
|
987
|
-
], q.prototype, "performIntent", 1);
|
|
988
|
-
q = we([
|
|
954
|
+
et([
|
|
955
|
+
pe()
|
|
956
|
+
], oe.prototype, "performIntent", 1);
|
|
957
|
+
oe = et([
|
|
989
958
|
I(k)
|
|
990
|
-
],
|
|
991
|
-
const
|
|
959
|
+
], oe);
|
|
960
|
+
const tt = {
|
|
992
961
|
registration: {
|
|
993
962
|
[k]: {
|
|
994
|
-
class:
|
|
963
|
+
class: oe,
|
|
995
964
|
singleton: !1
|
|
996
965
|
}
|
|
997
966
|
},
|
|
998
967
|
type: k,
|
|
999
968
|
predicate: b(k),
|
|
1000
969
|
factory: v.Factory.create(k)
|
|
1001
|
-
},
|
|
1002
|
-
const r = (t.pumps ?? []).length > 1,
|
|
970
|
+
}, Mr = f.createLogger({ name: "pump-utils" }), Or = (e, t) => {
|
|
971
|
+
const r = (t.pumps ?? []).length > 1, a = {
|
|
1003
972
|
boardPath: t.boardPath,
|
|
1004
973
|
holderPath: t.holderPath,
|
|
1005
974
|
ingredientId: t.ingredientId,
|
|
@@ -1011,30 +980,30 @@ const it = {
|
|
|
1011
980
|
type: t.type,
|
|
1012
981
|
nozzlePath: e,
|
|
1013
982
|
prevIngredientId: t.prevIngredientId
|
|
1014
|
-
}, i =
|
|
1015
|
-
return i.updateModel(
|
|
1016
|
-
},
|
|
983
|
+
}, i = tt.factory(t.path)(a);
|
|
984
|
+
return i.updateModel(a), i;
|
|
985
|
+
}, rt = (e) => (t) => (r) => (a) => {
|
|
1017
986
|
var c;
|
|
1018
|
-
|
|
1019
|
-
const i =
|
|
987
|
+
Mr.debug(`adding pump ${a.name}`);
|
|
988
|
+
const i = Or(r.path, a);
|
|
1020
989
|
e.addModel(i);
|
|
1021
|
-
const
|
|
1022
|
-
n == null || n.pumps.addModel(i), n != null && n.nozzlePaths.includes(r.path) || n == null || n.nozzlePaths.push(r.path), (c =
|
|
990
|
+
const s = i.holderPath, n = t.holders.getModel(s);
|
|
991
|
+
n == null || n.pumps.addModel(i), n != null && n.nozzlePaths.includes(r.path) || n == null || n.nozzlePaths.push(r.path), (c = a == null ? void 0 : a.pumps) == null || c.forEach((l) => {
|
|
1023
992
|
const p = i.holderPath, y = {
|
|
1024
993
|
...l,
|
|
1025
994
|
childPump: !0,
|
|
1026
995
|
holderPath: p,
|
|
1027
996
|
ingredientId: i.ingredientId
|
|
1028
997
|
};
|
|
1029
|
-
|
|
998
|
+
rt(e)(t)(r)(y);
|
|
1030
999
|
});
|
|
1031
1000
|
};
|
|
1032
|
-
var
|
|
1033
|
-
for (var i =
|
|
1034
|
-
(n = e[
|
|
1035
|
-
return
|
|
1001
|
+
var Er = Object.defineProperty, wr = Object.getOwnPropertyDescriptor, Q = (e, t, r, a) => {
|
|
1002
|
+
for (var i = a > 1 ? void 0 : a ? wr(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1003
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
1004
|
+
return a && i && Er(t, r, i), i;
|
|
1036
1005
|
};
|
|
1037
|
-
const
|
|
1006
|
+
const Y = "assembly-model", $r = "assembly-data", Sr = "assembly-raw-data";
|
|
1038
1007
|
let w = class {
|
|
1039
1008
|
constructor(e, t, r) {
|
|
1040
1009
|
o(this, "id");
|
|
@@ -1044,7 +1013,7 @@ let w = class {
|
|
|
1044
1013
|
o(this, "boardContainer");
|
|
1045
1014
|
o(this, "pumpContainer");
|
|
1046
1015
|
o(this, "logger");
|
|
1047
|
-
this.id = e, this.holderContainer =
|
|
1016
|
+
this.id = e, this.holderContainer = Qe.factory({}), this.boardContainer = We.factory({}), this.pumpContainer = Me.factory({}), this.logger = r.logger;
|
|
1048
1017
|
}
|
|
1049
1018
|
updateModel(e) {
|
|
1050
1019
|
}
|
|
@@ -1087,93 +1056,93 @@ let w = class {
|
|
|
1087
1056
|
}
|
|
1088
1057
|
async ready() {
|
|
1089
1058
|
var e;
|
|
1090
|
-
(e = this.troubleContainer) == null || e.troubles.increment(),
|
|
1059
|
+
(e = this.troubleContainer) == null || e.troubles.increment(), g[gt].execute(
|
|
1091
1060
|
u.AssemblyFeatureFlags,
|
|
1092
1061
|
this
|
|
1093
1062
|
);
|
|
1094
1063
|
}
|
|
1095
1064
|
async load(e) {
|
|
1096
1065
|
this.logger.debug(`loading assembly ${this.id}`);
|
|
1097
|
-
const t = await
|
|
1066
|
+
const t = await Ke();
|
|
1098
1067
|
if ((t == null ? void 0 : t.status) === 200) {
|
|
1099
|
-
const r = await
|
|
1068
|
+
const r = await T.executeDataMapperExtension({
|
|
1100
1069
|
extension: u.AssemblyMapper,
|
|
1101
1070
|
data: t.data,
|
|
1102
1071
|
contextData: {}
|
|
1103
1072
|
});
|
|
1104
|
-
e.set(
|
|
1105
|
-
|
|
1106
|
-
}), e.set(
|
|
1107
|
-
for await (const
|
|
1073
|
+
e.set($r, r), Object.assign(this, r), Object.entries(r).forEach(([a, i]) => {
|
|
1074
|
+
ht(i) && (this.logger.debug(`adding child model ${a} from extension data`), this[yt][a] = !0);
|
|
1075
|
+
}), e.set(Sr, t.data);
|
|
1076
|
+
for await (const a of t.data.assemblies) {
|
|
1108
1077
|
const {
|
|
1109
1078
|
boards: i = [],
|
|
1110
|
-
holders:
|
|
1079
|
+
holders: s = {},
|
|
1111
1080
|
nozzles: n = [],
|
|
1112
1081
|
core: c,
|
|
1113
1082
|
name: l,
|
|
1114
1083
|
path: p,
|
|
1115
1084
|
...y
|
|
1116
|
-
} =
|
|
1117
|
-
this.logger.debug(`adding assembly ${l}`), Object.keys(y).forEach((
|
|
1118
|
-
|
|
1085
|
+
} = a;
|
|
1086
|
+
this.logger.debug(`adding assembly ${l}`), Object.keys(y).forEach((m) => {
|
|
1087
|
+
It.enableFeature(m);
|
|
1119
1088
|
});
|
|
1120
|
-
for await (const
|
|
1121
|
-
this.logger.debug(`adding board ${
|
|
1122
|
-
for await (const [
|
|
1123
|
-
|
|
1089
|
+
for await (const m of i)
|
|
1090
|
+
this.logger.debug(`adding board ${m.name}`), await Ir(this.boardContainer)(m);
|
|
1091
|
+
for await (const [m, N] of Object.entries(
|
|
1092
|
+
s ?? {}
|
|
1124
1093
|
))
|
|
1125
|
-
for await (const
|
|
1126
|
-
this.logger.debug(`adding holder ${
|
|
1127
|
-
const
|
|
1128
|
-
this.holderContainer.holders.addModel(
|
|
1094
|
+
for await (const te of N) {
|
|
1095
|
+
this.logger.debug(`adding holder ${te.name}`);
|
|
1096
|
+
const $e = await Yt(m, te);
|
|
1097
|
+
this.holderContainer.holders.addModel($e);
|
|
1129
1098
|
}
|
|
1130
|
-
const
|
|
1099
|
+
const B = rt(this.pumpContainer)(
|
|
1131
1100
|
this.holderContainer
|
|
1132
1101
|
);
|
|
1133
|
-
n.forEach((
|
|
1134
|
-
this._nozzlePaths.add(
|
|
1135
|
-
const
|
|
1136
|
-
|
|
1102
|
+
n.forEach((m) => {
|
|
1103
|
+
this._nozzlePaths.add(m.path);
|
|
1104
|
+
const N = B(m);
|
|
1105
|
+
m.pumps.forEach(N);
|
|
1137
1106
|
});
|
|
1138
1107
|
}
|
|
1139
1108
|
}
|
|
1140
1109
|
}
|
|
1141
1110
|
};
|
|
1142
|
-
|
|
1143
|
-
|
|
1111
|
+
Q([
|
|
1112
|
+
ze({
|
|
1144
1113
|
modelType: "trouble-container-model"
|
|
1145
1114
|
})
|
|
1146
1115
|
], w.prototype, "troubleContainer", 2);
|
|
1147
|
-
|
|
1116
|
+
Q([
|
|
1148
1117
|
M
|
|
1149
1118
|
], w.prototype, "holderContainer", 2);
|
|
1150
|
-
|
|
1119
|
+
Q([
|
|
1151
1120
|
M
|
|
1152
1121
|
], w.prototype, "boardContainer", 2);
|
|
1153
|
-
|
|
1122
|
+
Q([
|
|
1154
1123
|
M
|
|
1155
1124
|
], w.prototype, "pumpContainer", 2);
|
|
1156
|
-
w =
|
|
1157
|
-
I(
|
|
1125
|
+
w = Q([
|
|
1126
|
+
I(Y)
|
|
1158
1127
|
], w);
|
|
1159
|
-
const
|
|
1128
|
+
const it = {
|
|
1160
1129
|
registration: {
|
|
1161
|
-
[
|
|
1130
|
+
[Y]: {
|
|
1162
1131
|
class: w,
|
|
1163
1132
|
singleton: !0
|
|
1164
1133
|
}
|
|
1165
1134
|
},
|
|
1166
|
-
type:
|
|
1167
|
-
predicate: b(
|
|
1168
|
-
factory: v.Singleton.create(
|
|
1135
|
+
type: Y,
|
|
1136
|
+
predicate: b(Y),
|
|
1137
|
+
factory: v.Singleton.create(Y)
|
|
1169
1138
|
};
|
|
1170
|
-
var
|
|
1171
|
-
for (var i =
|
|
1172
|
-
(n = e[
|
|
1173
|
-
return
|
|
1139
|
+
var Rr = Object.getOwnPropertyDescriptor, Cr = (e, t, r, a) => {
|
|
1140
|
+
for (var i = a > 1 ? void 0 : a ? Rr(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1141
|
+
(n = e[s]) && (i = n(i) || i);
|
|
1142
|
+
return i;
|
|
1174
1143
|
};
|
|
1175
|
-
const
|
|
1176
|
-
let
|
|
1144
|
+
const Z = D.Availability;
|
|
1145
|
+
let Pe = class {
|
|
1177
1146
|
constructor(e, t, r) {
|
|
1178
1147
|
o(this, "id");
|
|
1179
1148
|
o(this, "data");
|
|
@@ -1199,57 +1168,57 @@ let ve = class {
|
|
|
1199
1168
|
// -------------------LIFECYCLE----------------------------
|
|
1200
1169
|
// -------------------ENTITY----------------------------
|
|
1201
1170
|
};
|
|
1202
|
-
|
|
1171
|
+
Pe = Cr([
|
|
1203
1172
|
mt(),
|
|
1204
|
-
I(
|
|
1205
|
-
],
|
|
1206
|
-
const
|
|
1173
|
+
I(Z)
|
|
1174
|
+
], Pe);
|
|
1175
|
+
const ve = {
|
|
1207
1176
|
registration: {
|
|
1208
|
-
[
|
|
1209
|
-
class:
|
|
1177
|
+
[Z]: {
|
|
1178
|
+
class: Pe,
|
|
1210
1179
|
singleton: !1
|
|
1211
1180
|
}
|
|
1212
1181
|
},
|
|
1213
|
-
type:
|
|
1214
|
-
predicate: b(
|
|
1182
|
+
type: Z,
|
|
1183
|
+
predicate: b(Z),
|
|
1215
1184
|
factory: v.Factory.create(
|
|
1216
|
-
|
|
1185
|
+
Z
|
|
1217
1186
|
)
|
|
1218
|
-
}, { URL:
|
|
1219
|
-
basePath: `${
|
|
1220
|
-
}),
|
|
1221
|
-
const r = await
|
|
1187
|
+
}, { URL: x } = S("NOZZLE_SERVICE"), { postModel: Ee, deleteModel: Dr, getOne: Nr } = R.build({
|
|
1188
|
+
basePath: `${x}/api/nozzle`
|
|
1189
|
+
}), Tr = async (e, t) => {
|
|
1190
|
+
const r = await Ee({
|
|
1222
1191
|
model: {},
|
|
1223
|
-
urlOverride: `${
|
|
1192
|
+
urlOverride: `${x}/api/ext/dispense/nozzle/${e}/pipeline/beverage/pour`,
|
|
1224
1193
|
ordered: !0,
|
|
1225
1194
|
tracker: t
|
|
1226
1195
|
});
|
|
1227
|
-
return r != null && r.data &&
|
|
1228
|
-
},
|
|
1229
|
-
const
|
|
1196
|
+
return r != null && r.data && ce.initiateFuture(r.data), r;
|
|
1197
|
+
}, zr = async (e, t, r) => {
|
|
1198
|
+
const a = await Ee({
|
|
1230
1199
|
model: {},
|
|
1231
|
-
urlOverride: `${
|
|
1200
|
+
urlOverride: `${x}/api/ext/dispense/nozzle/${t}/pipeline/beverage/fixed/${e}`,
|
|
1232
1201
|
ordered: !0,
|
|
1233
1202
|
tracker: r
|
|
1234
1203
|
});
|
|
1235
|
-
return
|
|
1236
|
-
},
|
|
1237
|
-
urlOverride: `${
|
|
1238
|
-
}),
|
|
1204
|
+
return a != null && a.data && ce.initiateFuture(a.data), a;
|
|
1205
|
+
}, Lr = async (e) => await Nr({
|
|
1206
|
+
urlOverride: `${x}${e}/pipeline/beverage/availability`
|
|
1207
|
+
}), Ar = async (e, t) => await Ee({
|
|
1239
1208
|
model: t,
|
|
1240
|
-
urlOverride: `${
|
|
1241
|
-
}),
|
|
1209
|
+
urlOverride: `${x}/api/ext/dispense/nozzle/${e}/pipeline/beverage/select`
|
|
1210
|
+
}), xr = async (e) => await Dr({
|
|
1242
1211
|
id: e,
|
|
1243
|
-
urlOverride: `${
|
|
1212
|
+
urlOverride: `${x}/api/ext/dispense/nozzle/${e}/pipeline/beverage/select`
|
|
1244
1213
|
});
|
|
1245
|
-
var
|
|
1246
|
-
for (var i =
|
|
1247
|
-
(n = e[
|
|
1248
|
-
return
|
|
1214
|
+
var Br = Object.defineProperty, Ur = Object.getOwnPropertyDescriptor, ee = (e, t, r, a) => {
|
|
1215
|
+
for (var i = a > 1 ? void 0 : a ? Ur(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1216
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
1217
|
+
return a && i && Br(t, r, i), i;
|
|
1249
1218
|
};
|
|
1250
|
-
const
|
|
1219
|
+
const X = D.Nozzle, Gr = ft(
|
|
1251
1220
|
"beverageTopicPrefix"
|
|
1252
|
-
),
|
|
1221
|
+
), re = (e) => e.onPourStart !== void 0 && e.onPourCancel !== void 0 && e.onPourProgress !== void 0, De = "/kos/nozzle/pour/started", jr = "/kos/nozzle/pour/progress", ye = "/kos/nozzle/pour/cancel";
|
|
1253
1222
|
let $ = class {
|
|
1254
1223
|
constructor(e, t, r) {
|
|
1255
1224
|
/** the unique identifier for this nozzle.*/
|
|
@@ -1266,7 +1235,7 @@ let $ = class {
|
|
|
1266
1235
|
o(this, "beverageTopicPrefix");
|
|
1267
1236
|
o(this, "topicPrefix");
|
|
1268
1237
|
o(this, "urlPrefix");
|
|
1269
|
-
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
|
|
1238
|
+
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 C({
|
|
1270
1239
|
indexMap: {
|
|
1271
1240
|
byGroup: "groupId",
|
|
1272
1241
|
byParent: "parentId"
|
|
@@ -1358,7 +1327,7 @@ let $ = class {
|
|
|
1358
1327
|
context: r
|
|
1359
1328
|
}) {
|
|
1360
1329
|
if (!e) {
|
|
1361
|
-
const c = await
|
|
1330
|
+
const c = await xr(this.name);
|
|
1362
1331
|
if ((c == null ? void 0 : c.status) !== 200)
|
|
1363
1332
|
throw new Error("Failed to clear pourable");
|
|
1364
1333
|
this._selectedBeverage = void 0;
|
|
@@ -1369,7 +1338,7 @@ let $ = class {
|
|
|
1369
1338
|
return;
|
|
1370
1339
|
}
|
|
1371
1340
|
this._selectedBeverage = e, this._additionalItems = t;
|
|
1372
|
-
let
|
|
1341
|
+
let a = await g.dataMapper.executeMapper(
|
|
1373
1342
|
u.SelectedPourableMapper,
|
|
1374
1343
|
{
|
|
1375
1344
|
beverage: e,
|
|
@@ -1380,10 +1349,10 @@ let $ = class {
|
|
|
1380
1349
|
const i = {
|
|
1381
1350
|
bevId: e.rawId
|
|
1382
1351
|
};
|
|
1383
|
-
(!
|
|
1352
|
+
(!a || Object.keys(a).length === 0) && (this.logger.info(
|
|
1384
1353
|
`No selected pourable mapper defined, using the default payload ${i}`
|
|
1385
|
-
),
|
|
1386
|
-
const
|
|
1354
|
+
), a = i);
|
|
1355
|
+
const s = a ?? i, n = await Ar(this.name, s);
|
|
1387
1356
|
if ((n == null ? void 0 : n.status) !== 200)
|
|
1388
1357
|
throw new Error("Failed to select pourable");
|
|
1389
1358
|
}
|
|
@@ -1418,13 +1387,13 @@ let $ = class {
|
|
|
1418
1387
|
);
|
|
1419
1388
|
}
|
|
1420
1389
|
updateIfCurrent(e, t) {
|
|
1421
|
-
this.currentState === e &&
|
|
1390
|
+
this.currentState === e && h(() => {
|
|
1422
1391
|
this.currentState = t;
|
|
1423
1392
|
});
|
|
1424
1393
|
}
|
|
1425
1394
|
onFutureUpdate(e) {
|
|
1426
|
-
E(this).forEach((
|
|
1427
|
-
|
|
1395
|
+
E(this).forEach((a) => {
|
|
1396
|
+
re(a) && a.onPourProgress(e);
|
|
1428
1397
|
});
|
|
1429
1398
|
const r = {
|
|
1430
1399
|
nozzleId: this.id,
|
|
@@ -1437,7 +1406,7 @@ let $ = class {
|
|
|
1437
1406
|
reason: e.reason,
|
|
1438
1407
|
timeRemaining: e.timeRemaining
|
|
1439
1408
|
};
|
|
1440
|
-
_.publish(
|
|
1409
|
+
_.publish(jr, r), e.endState && h(() => {
|
|
1441
1410
|
this.currentState = d.IDLE;
|
|
1442
1411
|
});
|
|
1443
1412
|
}
|
|
@@ -1447,21 +1416,21 @@ let $ = class {
|
|
|
1447
1416
|
if (this.currentState === d.IDLE) {
|
|
1448
1417
|
if (this.updateIfCurrent(d.IDLE, d.POUR_STARTING), !e)
|
|
1449
1418
|
throw new Error("No tracker provided");
|
|
1450
|
-
const r = await
|
|
1419
|
+
const r = await Tr(this.name, e);
|
|
1451
1420
|
this.updateIfCurrent(d.POUR_STARTING, d.POURING), E(this).forEach((i) => {
|
|
1452
|
-
var
|
|
1453
|
-
|
|
1421
|
+
var s;
|
|
1422
|
+
re(i) && ((s = i.onPourStart) == null || s.call(i));
|
|
1454
1423
|
});
|
|
1455
|
-
const
|
|
1424
|
+
const a = {
|
|
1456
1425
|
nozzleId: this.id,
|
|
1457
1426
|
type: "free"
|
|
1458
1427
|
};
|
|
1459
|
-
if (_.publish(
|
|
1428
|
+
if (_.publish(De, a), (t = r == null ? void 0 : r.data) != null && t.endState) {
|
|
1460
1429
|
this.updateIfCurrent(d.POURING, d.IDLE);
|
|
1461
1430
|
const i = {
|
|
1462
1431
|
nozzleId: this.id
|
|
1463
1432
|
};
|
|
1464
|
-
_.publish(
|
|
1433
|
+
_.publish(ye, i);
|
|
1465
1434
|
}
|
|
1466
1435
|
return r;
|
|
1467
1436
|
} else
|
|
@@ -1476,29 +1445,29 @@ let $ = class {
|
|
|
1476
1445
|
if (this.currentState === d.IDLE) {
|
|
1477
1446
|
if (this.currentState = d.POUR_STARTING, !t)
|
|
1478
1447
|
throw new Error("No tracker provided");
|
|
1479
|
-
const
|
|
1480
|
-
this.currentState === d.POUR_STARTING &&
|
|
1448
|
+
const a = await zr(e, this.name, t);
|
|
1449
|
+
this.currentState === d.POUR_STARTING && h(() => {
|
|
1481
1450
|
this.currentState = d.POURING;
|
|
1482
|
-
}), E(this).forEach((
|
|
1451
|
+
}), E(this).forEach((s) => {
|
|
1483
1452
|
var n;
|
|
1484
|
-
|
|
1453
|
+
re(s) && ((n = s.onPourStart) == null || n.call(s));
|
|
1485
1454
|
});
|
|
1486
1455
|
const i = {
|
|
1487
1456
|
nozzleId: this.id,
|
|
1488
1457
|
type: "fixed"
|
|
1489
1458
|
};
|
|
1490
|
-
if (_.publish(
|
|
1459
|
+
if (_.publish(De, i), (r = a == null ? void 0 : a.data) != null && r.endState) {
|
|
1491
1460
|
this.updateIfCurrent(d.POURING, d.IDLE);
|
|
1492
|
-
const
|
|
1461
|
+
const s = {
|
|
1493
1462
|
nozzleId: this.id
|
|
1494
1463
|
};
|
|
1495
|
-
_.publish(
|
|
1464
|
+
_.publish(ye, s);
|
|
1496
1465
|
}
|
|
1497
|
-
return
|
|
1466
|
+
return a;
|
|
1498
1467
|
} else
|
|
1499
1468
|
throw new Error(`Cannot pour in state ${this.currentState}`);
|
|
1500
|
-
} catch (
|
|
1501
|
-
throw this.logger.error(
|
|
1469
|
+
} catch (a) {
|
|
1470
|
+
throw this.logger.error(a), this.currentState = d.IDLE, a;
|
|
1502
1471
|
}
|
|
1503
1472
|
}
|
|
1504
1473
|
/**
|
|
@@ -1507,119 +1476,119 @@ let $ = class {
|
|
|
1507
1476
|
async cancelPour() {
|
|
1508
1477
|
var e;
|
|
1509
1478
|
if (this.currentState === d.POURING || this.currentState === d.POUR_STARTING) {
|
|
1510
|
-
this.currentState = d.POUR_CANCELING, await ((e = this.futureHandler.getFuture()) == null ? void 0 : e.cancelFuture()),
|
|
1479
|
+
this.currentState = d.POUR_CANCELING, await ((e = this.futureHandler.getFuture()) == null ? void 0 : e.cancelFuture()), h(() => {
|
|
1511
1480
|
this.currentState = d.IDLE;
|
|
1512
1481
|
}), E(this).forEach((r) => {
|
|
1513
|
-
var
|
|
1514
|
-
|
|
1482
|
+
var a;
|
|
1483
|
+
re(r) && ((a = r.onPourCancel) == null || a.call(r));
|
|
1515
1484
|
});
|
|
1516
1485
|
const t = {
|
|
1517
1486
|
nozzleId: this.id
|
|
1518
1487
|
};
|
|
1519
|
-
_.publish(
|
|
1488
|
+
_.publish(ye, t);
|
|
1520
1489
|
} else
|
|
1521
1490
|
this.logger.warn(`Cannot cancel pour in state ${this.currentState}`);
|
|
1522
1491
|
}
|
|
1523
1492
|
updateGroupMembers() {
|
|
1524
1493
|
this._availabilityItems.data.forEach((e) => {
|
|
1525
1494
|
(e.taggedIds || []).forEach((r) => {
|
|
1526
|
-
const
|
|
1495
|
+
const a = this._availabilityItems.data.find(
|
|
1527
1496
|
(i) => i.rawId === r
|
|
1528
1497
|
);
|
|
1529
|
-
|
|
1498
|
+
a && a.parentId !== e.id && (a.parentId = e.id, this._availabilityItems.updateModel(a));
|
|
1530
1499
|
});
|
|
1531
1500
|
});
|
|
1532
1501
|
}
|
|
1533
1502
|
/** @internal */
|
|
1534
1503
|
async load(e) {
|
|
1535
|
-
var
|
|
1504
|
+
var a, i;
|
|
1536
1505
|
this.logger.debug(`loading nozzle ${this.id}`);
|
|
1537
|
-
const t = await
|
|
1506
|
+
const t = await Lr(this.urlPrefix);
|
|
1538
1507
|
if ((t == null ? void 0 : t.status) !== 200)
|
|
1539
1508
|
throw new Error("Failed to load nozzle availability");
|
|
1540
|
-
const r = await
|
|
1509
|
+
const r = await g.loader.executeLoader(
|
|
1541
1510
|
u.AvailabilityLoader,
|
|
1542
1511
|
{}
|
|
1543
1512
|
);
|
|
1544
|
-
e == null || e.set(u.AvailabilityLoader, r), e == null || e.set(
|
|
1545
|
-
for (const
|
|
1546
|
-
for (const n of ((i = t.data) == null ? void 0 : i.groups[
|
|
1547
|
-
const c = await
|
|
1513
|
+
e == null || e.set(u.AvailabilityLoader, r), e == null || e.set(we.type, this);
|
|
1514
|
+
for (const s of Object.keys((a = t.data) == null ? void 0 : a.groups) || [])
|
|
1515
|
+
for (const n of ((i = t.data) == null ? void 0 : i.groups[s]) || []) {
|
|
1516
|
+
const c = await g.dataMapper.executeMapper(
|
|
1548
1517
|
u.AvailabilityMapper,
|
|
1549
|
-
{ ...n, groupId:
|
|
1518
|
+
{ ...n, groupId: s },
|
|
1550
1519
|
r
|
|
1551
1520
|
), l = {
|
|
1552
1521
|
...n,
|
|
1553
1522
|
note: n.note ?? void 0,
|
|
1554
1523
|
kosParentId: this.id,
|
|
1555
1524
|
rawId: n.id,
|
|
1556
|
-
groupId:
|
|
1525
|
+
groupId: s,
|
|
1557
1526
|
data: c,
|
|
1558
1527
|
properties: n.properties || {}
|
|
1559
|
-
}, p =
|
|
1560
|
-
`${this.id}-${
|
|
1528
|
+
}, p = ve.factory(
|
|
1529
|
+
`${this.id}-${s}-${n.id}`
|
|
1561
1530
|
)(l);
|
|
1562
1531
|
this._availabilityItems.addModel(p);
|
|
1563
1532
|
}
|
|
1564
1533
|
this.updateGroupMembers();
|
|
1565
1534
|
}
|
|
1566
1535
|
async updateAvailability(e) {
|
|
1567
|
-
const t =
|
|
1536
|
+
const t = bt.getContext(this.id), r = (t == null ? void 0 : t.get(u.AvailabilityLoader)) || {};
|
|
1568
1537
|
if (e.rebuild)
|
|
1569
|
-
for (const
|
|
1570
|
-
this._availabilityItems.getIndexByKey("group",
|
|
1571
|
-
(
|
|
1572
|
-
(n) => `${this.id}-${
|
|
1538
|
+
for (const a of Object.keys(e == null ? void 0 : e.groups) || []) {
|
|
1539
|
+
this._availabilityItems.getIndexByKey("group", a).filter(
|
|
1540
|
+
(s) => !e.groups[a].find(
|
|
1541
|
+
(n) => `${this.id}-${a}-${n.id}` === s.id
|
|
1573
1542
|
)
|
|
1574
|
-
).forEach((
|
|
1575
|
-
this._availabilityItems.removeModel(
|
|
1543
|
+
).forEach((s) => {
|
|
1544
|
+
this._availabilityItems.removeModel(s.id), _t(s);
|
|
1576
1545
|
});
|
|
1577
|
-
for (const
|
|
1578
|
-
const n = await
|
|
1546
|
+
for (const s of (e == null ? void 0 : e.groups[a]) || []) {
|
|
1547
|
+
const n = await g.dataMapper.executeMapper(
|
|
1579
1548
|
u.AvailabilityMapper,
|
|
1580
|
-
{ ...
|
|
1549
|
+
{ ...s, groupId: a },
|
|
1581
1550
|
r
|
|
1582
1551
|
), c = {
|
|
1583
|
-
...
|
|
1584
|
-
note:
|
|
1552
|
+
...s,
|
|
1553
|
+
note: s.note ?? void 0,
|
|
1585
1554
|
kosParentId: this.id,
|
|
1586
|
-
groupId:
|
|
1587
|
-
rawId:
|
|
1555
|
+
groupId: a,
|
|
1556
|
+
rawId: s.id,
|
|
1588
1557
|
data: n,
|
|
1589
|
-
taggedIds:
|
|
1590
|
-
properties:
|
|
1558
|
+
taggedIds: s.taggedIds,
|
|
1559
|
+
properties: s.properties || {}
|
|
1591
1560
|
}, l = this._availabilityItems.getModel(
|
|
1592
|
-
`${this.id}-${
|
|
1561
|
+
`${this.id}-${a}-${s.id}`
|
|
1593
1562
|
);
|
|
1594
1563
|
if (l)
|
|
1595
1564
|
l.updateModel(c);
|
|
1596
1565
|
else {
|
|
1597
|
-
const p =
|
|
1598
|
-
`${this.id}-${
|
|
1566
|
+
const p = ve.factory(
|
|
1567
|
+
`${this.id}-${a}-${s.id}`
|
|
1599
1568
|
)(c);
|
|
1600
1569
|
this._availabilityItems.addModel(p);
|
|
1601
1570
|
}
|
|
1602
1571
|
}
|
|
1603
1572
|
}
|
|
1604
1573
|
else
|
|
1605
|
-
for (const
|
|
1606
|
-
for (const i of (e == null ? void 0 : e.groups[
|
|
1607
|
-
const
|
|
1574
|
+
for (const a of Object.keys(e == null ? void 0 : e.groups) || [])
|
|
1575
|
+
for (const i of (e == null ? void 0 : e.groups[a]) || []) {
|
|
1576
|
+
const s = await g.dataMapper.executeMapper(
|
|
1608
1577
|
u.AvailabilityMapper,
|
|
1609
|
-
{ ...i, groupId:
|
|
1578
|
+
{ ...i, groupId: a },
|
|
1610
1579
|
r
|
|
1611
1580
|
), n = {
|
|
1612
1581
|
...i,
|
|
1613
1582
|
note: i.note ?? void 0,
|
|
1614
1583
|
kosParentId: this.id,
|
|
1615
|
-
groupId:
|
|
1584
|
+
groupId: a,
|
|
1616
1585
|
rawId: i.id,
|
|
1617
|
-
data:
|
|
1586
|
+
data: s,
|
|
1618
1587
|
type: i.type,
|
|
1619
1588
|
taggedIds: i.taggedIds,
|
|
1620
1589
|
properties: i.properties || {}
|
|
1621
1590
|
}, c = this._availabilityItems.getModel(
|
|
1622
|
-
`${this.id}-${
|
|
1591
|
+
`${this.id}-${a}-${i.id}`
|
|
1623
1592
|
);
|
|
1624
1593
|
c && c.updateModel(n);
|
|
1625
1594
|
}
|
|
@@ -1627,47 +1596,47 @@ let $ = class {
|
|
|
1627
1596
|
}
|
|
1628
1597
|
// -------------------ENTITY----------------------------
|
|
1629
1598
|
};
|
|
1630
|
-
|
|
1599
|
+
ee([
|
|
1631
1600
|
M
|
|
1632
1601
|
], $.prototype, "_availabilityItems", 2);
|
|
1633
|
-
|
|
1634
|
-
|
|
1602
|
+
ee([
|
|
1603
|
+
pe()
|
|
1635
1604
|
], $.prototype, "pour", 1);
|
|
1636
|
-
|
|
1637
|
-
|
|
1605
|
+
ee([
|
|
1606
|
+
pe()
|
|
1638
1607
|
], $.prototype, "fixedPour", 1);
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
topic: `${
|
|
1608
|
+
ee([
|
|
1609
|
+
W({
|
|
1610
|
+
topic: `${Gr}/availability`,
|
|
1642
1611
|
websocket: !0
|
|
1643
1612
|
})
|
|
1644
1613
|
], $.prototype, "updateAvailability", 1);
|
|
1645
|
-
$ =
|
|
1646
|
-
I(
|
|
1614
|
+
$ = ee([
|
|
1615
|
+
I(X)
|
|
1647
1616
|
], $);
|
|
1648
|
-
const
|
|
1617
|
+
const we = {
|
|
1649
1618
|
registration: {
|
|
1650
|
-
[
|
|
1619
|
+
[X]: {
|
|
1651
1620
|
class: $,
|
|
1652
1621
|
singleton: !1
|
|
1653
1622
|
}
|
|
1654
1623
|
},
|
|
1655
|
-
type:
|
|
1656
|
-
predicate: b(
|
|
1657
|
-
factory: v.Factory.create(
|
|
1624
|
+
type: X,
|
|
1625
|
+
predicate: b(X),
|
|
1626
|
+
factory: v.Factory.create(X)
|
|
1658
1627
|
};
|
|
1659
|
-
var
|
|
1660
|
-
for (var i =
|
|
1661
|
-
(n = e[
|
|
1662
|
-
return
|
|
1628
|
+
var Fr = Object.defineProperty, Hr = Object.getOwnPropertyDescriptor, at = (e, t, r, a) => {
|
|
1629
|
+
for (var i = a > 1 ? void 0 : a ? Hr(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1630
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
1631
|
+
return a && i && Fr(t, r, i), i;
|
|
1663
1632
|
};
|
|
1664
|
-
const
|
|
1633
|
+
const st = "device-assembly-model";
|
|
1665
1634
|
let de = class {
|
|
1666
1635
|
constructor(e, t, r) {
|
|
1667
1636
|
o(this, "id");
|
|
1668
1637
|
o(this, "deviceNozzles");
|
|
1669
1638
|
o(this, "logger");
|
|
1670
|
-
this.id = e, this.logger = r.logger, this.deviceNozzles = new
|
|
1639
|
+
this.id = e, this.logger = r.logger, this.deviceNozzles = new C();
|
|
1671
1640
|
}
|
|
1672
1641
|
// -------------------LIFECYCLE----------------------------
|
|
1673
1642
|
async init() {
|
|
@@ -1681,46 +1650,46 @@ let de = class {
|
|
|
1681
1650
|
}
|
|
1682
1651
|
async load() {
|
|
1683
1652
|
this.logger.debug(`loading device-assembly ${this.id}`);
|
|
1684
|
-
const e = await
|
|
1653
|
+
const e = await Ke();
|
|
1685
1654
|
(e == null ? void 0 : e.status) === 200 && e.data.assemblies.map((r) => r.nozzles ?? []).flat().forEach((r) => {
|
|
1686
1655
|
var n;
|
|
1687
|
-
const
|
|
1656
|
+
const a = r.path, i = ((n = r.pipelines.find((c) => c.name === "beverage")) == null ? void 0 : n.topicPrefix) || "", s = we.factory(a)({
|
|
1688
1657
|
path: r.path,
|
|
1689
1658
|
name: r.name,
|
|
1690
1659
|
urlPrefix: r.urlPrefix,
|
|
1691
1660
|
topicPrefix: r.topicPrefix,
|
|
1692
1661
|
beverageTopicPrefix: i
|
|
1693
1662
|
});
|
|
1694
|
-
this.deviceNozzles.addModel(
|
|
1663
|
+
this.deviceNozzles.addModel(s);
|
|
1695
1664
|
});
|
|
1696
1665
|
}
|
|
1697
1666
|
};
|
|
1698
|
-
|
|
1667
|
+
at([
|
|
1699
1668
|
M
|
|
1700
1669
|
], de.prototype, "deviceNozzles", 2);
|
|
1701
|
-
de =
|
|
1702
|
-
I(
|
|
1670
|
+
de = at([
|
|
1671
|
+
I(st)
|
|
1703
1672
|
], de);
|
|
1704
|
-
const
|
|
1673
|
+
const Vr = new Mt({
|
|
1705
1674
|
class: de,
|
|
1706
|
-
type:
|
|
1707
|
-
}), { URL:
|
|
1708
|
-
basePath: `${
|
|
1709
|
-
}),
|
|
1710
|
-
const r = await
|
|
1675
|
+
type: st
|
|
1676
|
+
}), { URL: nt } = S("GENERIC_POUR_SERVICE"), { postModel: Kr } = R.build({
|
|
1677
|
+
basePath: `${nt}/api/nozzle`
|
|
1678
|
+
}), kr = async (e, t) => {
|
|
1679
|
+
const r = await Kr({
|
|
1711
1680
|
model: {},
|
|
1712
|
-
urlOverride: `${
|
|
1681
|
+
urlOverride: `${nt}${e}`,
|
|
1713
1682
|
ordered: !0,
|
|
1714
1683
|
tracker: t
|
|
1715
1684
|
});
|
|
1716
|
-
return r != null && r.data &&
|
|
1685
|
+
return r != null && r.data && ce.initiateFuture(r.data), r;
|
|
1717
1686
|
};
|
|
1718
|
-
var
|
|
1719
|
-
for (var i =
|
|
1720
|
-
(n = e[
|
|
1721
|
-
return
|
|
1687
|
+
var Yr = Object.defineProperty, Zr = Object.getOwnPropertyDescriptor, ot = (e, t, r, a) => {
|
|
1688
|
+
for (var i = a > 1 ? void 0 : a ? Zr(t, r) : t, s = e.length - 1, n; s >= 0; s--)
|
|
1689
|
+
(n = e[s]) && (i = (a ? n(t, r, i) : n(i)) || i);
|
|
1690
|
+
return a && i && Yr(t, r, i), i;
|
|
1722
1691
|
};
|
|
1723
|
-
const
|
|
1692
|
+
const dt = "generic-pour-model", Xr = "/kos/generic/pour/started", Jr = "/kos/generic/pour/progress", Ne = "/kos/generic/pour/cancel", Ie = (e) => e.onPourStart !== void 0 && e.onPourCancel !== void 0 && e.onPourProgress !== void 0;
|
|
1724
1693
|
let le = class {
|
|
1725
1694
|
constructor(e, t, r) {
|
|
1726
1695
|
o(this, "id");
|
|
@@ -1730,7 +1699,7 @@ let le = class {
|
|
|
1730
1699
|
o(this, "logger");
|
|
1731
1700
|
o(this, "futureHandler");
|
|
1732
1701
|
o(this, "selectedId");
|
|
1733
|
-
this.id = e, this.logger = r.logger, this.futureHandler = new
|
|
1702
|
+
this.id = e, this.logger = r.logger, this.futureHandler = new xe(this), this.servicePathFactory = t.servicePathFactory, this.pourType = t.pourType || "free", this.selectedId = t.selectedId;
|
|
1734
1703
|
}
|
|
1735
1704
|
get servicePath() {
|
|
1736
1705
|
return this.selectedId ? this.servicePathFactory(this.selectedId) : "";
|
|
@@ -1741,21 +1710,21 @@ let le = class {
|
|
|
1741
1710
|
if (this.currentState === d.IDLE) {
|
|
1742
1711
|
if (this.updateIfCurrent(d.IDLE, d.POUR_STARTING), !e)
|
|
1743
1712
|
throw new Error("No tracker provided");
|
|
1744
|
-
const r = await
|
|
1713
|
+
const r = await kr(this.servicePath, e);
|
|
1745
1714
|
this.updateIfCurrent(d.POUR_STARTING, d.POURING), E(this).forEach((i) => {
|
|
1746
|
-
var
|
|
1747
|
-
|
|
1715
|
+
var s;
|
|
1716
|
+
Ie(i) && ((s = i.onPourStart) == null || s.call(i));
|
|
1748
1717
|
});
|
|
1749
|
-
const
|
|
1718
|
+
const a = {
|
|
1750
1719
|
pourTarget: this.id,
|
|
1751
1720
|
type: this.pourType
|
|
1752
1721
|
};
|
|
1753
|
-
if (_.publish(
|
|
1722
|
+
if (_.publish(Xr, a), (t = r == null ? void 0 : r.data) != null && t.endState) {
|
|
1754
1723
|
this.updateIfCurrent(d.POURING, d.IDLE);
|
|
1755
1724
|
const i = {
|
|
1756
1725
|
pourTarget: this.id
|
|
1757
1726
|
};
|
|
1758
|
-
_.publish(
|
|
1727
|
+
_.publish(Ne, i);
|
|
1759
1728
|
}
|
|
1760
1729
|
return r;
|
|
1761
1730
|
} else
|
|
@@ -1767,21 +1736,21 @@ let le = class {
|
|
|
1767
1736
|
async cancelPour() {
|
|
1768
1737
|
var e;
|
|
1769
1738
|
if (this.currentState === d.POURING || this.currentState === d.POUR_STARTING) {
|
|
1770
|
-
this.currentState = d.POUR_CANCELING, await ((e = this.futureHandler.getFuture()) == null ? void 0 : e.cancelFuture()),
|
|
1739
|
+
this.currentState = d.POUR_CANCELING, await ((e = this.futureHandler.getFuture()) == null ? void 0 : e.cancelFuture()), h(() => {
|
|
1771
1740
|
this.currentState = d.IDLE;
|
|
1772
1741
|
}), E(this).forEach((r) => {
|
|
1773
|
-
var
|
|
1774
|
-
|
|
1742
|
+
var a;
|
|
1743
|
+
Ie(r) && ((a = r.onPourCancel) == null || a.call(r));
|
|
1775
1744
|
});
|
|
1776
1745
|
const t = {
|
|
1777
1746
|
pourTarget: this.id
|
|
1778
1747
|
};
|
|
1779
|
-
_.publish(
|
|
1748
|
+
_.publish(Ne, t);
|
|
1780
1749
|
}
|
|
1781
1750
|
this.currentState === d.IDLE ? this.logger.info("Pour already idle, nothing to cancel.") : this.logger.warn(`Cannot cancel pour in state ${this.currentState}`);
|
|
1782
1751
|
}
|
|
1783
1752
|
updateIfCurrent(e, t) {
|
|
1784
|
-
this.currentState === e &&
|
|
1753
|
+
this.currentState === e && h(() => {
|
|
1785
1754
|
this.currentState = t;
|
|
1786
1755
|
});
|
|
1787
1756
|
}
|
|
@@ -1813,7 +1782,7 @@ let le = class {
|
|
|
1813
1782
|
}
|
|
1814
1783
|
onFutureUpdate(e) {
|
|
1815
1784
|
E(this).forEach((r) => {
|
|
1816
|
-
|
|
1785
|
+
Ie(r) && r.onPourProgress(e);
|
|
1817
1786
|
});
|
|
1818
1787
|
const t = {
|
|
1819
1788
|
pourTarget: this.id,
|
|
@@ -1826,7 +1795,7 @@ let le = class {
|
|
|
1826
1795
|
reason: e.reason,
|
|
1827
1796
|
timeRemaining: e.timeRemaining
|
|
1828
1797
|
};
|
|
1829
|
-
_.publish(
|
|
1798
|
+
_.publish(Jr, t), e.endState && h(() => {
|
|
1830
1799
|
this.currentState = d.IDLE;
|
|
1831
1800
|
});
|
|
1832
1801
|
}
|
|
@@ -1838,40 +1807,40 @@ let le = class {
|
|
|
1838
1807
|
this.logger.debug(`loading generic-pour ${this.id}`);
|
|
1839
1808
|
}
|
|
1840
1809
|
};
|
|
1841
|
-
|
|
1842
|
-
|
|
1810
|
+
ot([
|
|
1811
|
+
pe()
|
|
1843
1812
|
], le.prototype, "pour", 1);
|
|
1844
|
-
le =
|
|
1845
|
-
I(
|
|
1813
|
+
le = ot([
|
|
1814
|
+
I(dt)
|
|
1846
1815
|
], le);
|
|
1847
|
-
const
|
|
1816
|
+
const si = new Ot({
|
|
1848
1817
|
class: le,
|
|
1849
|
-
type:
|
|
1850
|
-
}),
|
|
1851
|
-
...Ke.registration,
|
|
1818
|
+
type: dt
|
|
1819
|
+
}), Te = {
|
|
1852
1820
|
...je.registration,
|
|
1853
|
-
...
|
|
1854
|
-
...
|
|
1855
|
-
...
|
|
1821
|
+
...Be.registration,
|
|
1822
|
+
...Qe.registration,
|
|
1823
|
+
...Ve.registration,
|
|
1824
|
+
...we.registration,
|
|
1825
|
+
...tt.registration,
|
|
1826
|
+
...Me.registration,
|
|
1827
|
+
...ve.registration,
|
|
1856
1828
|
...it.registration,
|
|
1857
|
-
...
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
}
|
|
1862
|
-
const r = Le[t];
|
|
1863
|
-
St(e)(t, r);
|
|
1864
|
-
}), h[W].register(
|
|
1829
|
+
...We.registration
|
|
1830
|
+
}, qr = (e) => () => (wt(e)(), Vr.register(), Object.keys(Te).forEach((t) => {
|
|
1831
|
+
const r = Te[t];
|
|
1832
|
+
$t(e)(t, r);
|
|
1833
|
+
}), g[q].register(
|
|
1865
1834
|
"FirmwareUpdateInProgressTrouble",
|
|
1866
1835
|
async (t) => {
|
|
1867
1836
|
var r;
|
|
1868
1837
|
if ((r = t.data) != null && r.deviceId) {
|
|
1869
|
-
const { model:
|
|
1870
|
-
|
|
1838
|
+
const { model: a } = z(
|
|
1839
|
+
it.type
|
|
1871
1840
|
);
|
|
1872
|
-
if (
|
|
1873
|
-
const i =
|
|
1874
|
-
(
|
|
1841
|
+
if (a) {
|
|
1842
|
+
const i = a.boards.find(
|
|
1843
|
+
(s) => s.id === t.data.deviceId
|
|
1875
1844
|
) ? z(t.data.deviceId).model : void 0;
|
|
1876
1845
|
return {
|
|
1877
1846
|
devices: i ? i.name : ""
|
|
@@ -1886,59 +1855,59 @@ const li = new Et({
|
|
|
1886
1855
|
companion: O.companion.register(e),
|
|
1887
1856
|
legacy: O.model.registerLegacyModel(e)
|
|
1888
1857
|
}), P = {
|
|
1889
|
-
...
|
|
1858
|
+
...Et
|
|
1890
1859
|
};
|
|
1891
1860
|
P.dispense = {
|
|
1892
|
-
models:
|
|
1861
|
+
models: qr(P)
|
|
1893
1862
|
};
|
|
1894
1863
|
P.preload = O.model.preloadModel(P);
|
|
1895
1864
|
P.model = O.model.register(P);
|
|
1896
1865
|
P.companion = O.companion.register(P);
|
|
1897
1866
|
P.legacy = O.model.registerLegacyModel(P);
|
|
1898
|
-
const
|
|
1867
|
+
const ni = P;
|
|
1899
1868
|
export {
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1869
|
+
it as A,
|
|
1870
|
+
L as B,
|
|
1871
|
+
$r as C,
|
|
1903
1872
|
D,
|
|
1904
1873
|
u as E,
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1874
|
+
Lr as F,
|
|
1875
|
+
si as G,
|
|
1876
|
+
Ve as H,
|
|
1877
|
+
Be as I,
|
|
1878
|
+
zr as J,
|
|
1879
|
+
ni as K,
|
|
1880
|
+
Tr as L,
|
|
1881
|
+
Ar as M,
|
|
1882
|
+
we as N,
|
|
1883
|
+
kr as O,
|
|
1884
|
+
tt as P,
|
|
1885
|
+
ke as T,
|
|
1886
|
+
Sr as a,
|
|
1887
|
+
ve as b,
|
|
1888
|
+
Ye as c,
|
|
1889
|
+
We as d,
|
|
1890
|
+
qe as e,
|
|
1891
|
+
Vr as f,
|
|
1892
|
+
Qe as g,
|
|
1893
|
+
je as h,
|
|
1894
|
+
Me as i,
|
|
1895
|
+
Xe as j,
|
|
1896
|
+
Te as k,
|
|
1928
1897
|
d as l,
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1898
|
+
Dt as m,
|
|
1899
|
+
ii as n,
|
|
1900
|
+
Bt as o,
|
|
1901
|
+
ai as p,
|
|
1902
|
+
ri as q,
|
|
1903
|
+
qr as r,
|
|
1904
|
+
ti as s,
|
|
1905
|
+
Gt as t,
|
|
1906
|
+
Ht as u,
|
|
1907
|
+
Ut as v,
|
|
1908
|
+
Ke as w,
|
|
1909
|
+
vr as x,
|
|
1910
|
+
Pr as y,
|
|
1911
|
+
xr as z
|
|
1943
1912
|
};
|
|
1944
|
-
//# sourceMappingURL=dispense-registration-manager-
|
|
1913
|
+
//# sourceMappingURL=dispense-registration-manager-pB5e_YT1.js.map
|