@kosdev-code/kos-freestyle-sdk 2.0.7 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{extension-utils-uYGl3TGm.js → extension-utils-DFxANOxc.js} +2 -2
- package/{extension-utils-uYGl3TGm.js.map → extension-utils-DFxANOxc.js.map} +1 -1
- package/{extension-utils-D_CXSnlW.cjs → extension-utils-DLH4Qofz.cjs} +2 -2
- package/{extension-utils-D_CXSnlW.cjs.map → extension-utils-DLH4Qofz.cjs.map} +1 -1
- package/freestyle-registration-manager-B46wED9t.cjs +2 -0
- package/{freestyle-registration-manager-yxRMbjlE.cjs.map → freestyle-registration-manager-B46wED9t.cjs.map} +1 -1
- package/{freestyle-registration-manager-pbtzJUqS.js → freestyle-registration-manager-DkqzBO2O.js} +230 -214
- package/{freestyle-registration-manager-pbtzJUqS.js.map → freestyle-registration-manager-DkqzBO2O.js.map} +1 -1
- package/index.cjs +1 -1
- package/index.js +3 -3
- package/models/models/agitation-required-trouble/agitation-required-trouble-model.d.ts +3 -1
- package/models/models/agitation-required-trouble/agitation-required-trouble-model.d.ts.map +1 -1
- package/models.cjs +1 -1
- package/models.js +2 -2
- package/package.json +4 -4
- package/ui.cjs +1 -1
- package/ui.js +2 -2
- package/{use-nutrition-info-D-wbfIlj.js → use-nutrition-info-BQrtsdMz.js} +2 -2
- package/{use-nutrition-info-D-wbfIlj.js.map → use-nutrition-info-BQrtsdMz.js.map} +1 -1
- package/{use-nutrition-info-CGrmEGIR.cjs → use-nutrition-info-ho4aniKd.cjs} +2 -2
- package/{use-nutrition-info-CGrmEGIR.cjs.map → use-nutrition-info-ho4aniKd.cjs.map} +1 -1
- package/freestyle-registration-manager-yxRMbjlE.cjs +0 -2
package/{freestyle-registration-manager-pbtzJUqS.js → freestyle-registration-manager-DkqzBO2O.js}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var i = (e, t, r) => (
|
|
4
|
-
import {
|
|
5
|
-
import { kosModel as f, KosModelRegistrationFactory as m, KosModelContainer as
|
|
6
|
-
var
|
|
7
|
-
for (var s = o > 1 ? void 0 : o ?
|
|
1
|
+
var he = Object.defineProperty;
|
|
2
|
+
var ye = (e, t, r) => t in e ? he(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var i = (e, t, r) => (ye(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import { Assembly as Z, KosModelRegistry as fe, registerDispenseModels as me, Nozzle as be, Pump as _e, Holder as ve, PumpContainer as Pe, PumpIndex as Ie } from "@kosdev-code/kos-dispense-sdk";
|
|
5
|
+
import { kosModel as f, KosModelRegistrationFactory as m, KosModelContainer as Ae, kosChild as $e, resolveServiceUrl as E, ServiceFactory as M, createPropKey as Oe, kosStateProp as Ee, kosFuture as Me, FutureHandler as Te, kosEffect as Ce, EventBus as K, SingletonKosModelRegistrationFactory as Q, KosFeatureFlags as U, KosContextManager as we, KosLog as T, FutureManager as ze, kosParentAware as De, kosAutoEffect as Se, kosAction as X, FetchError as Re, kosConfigProperty as p, KOS_MODEL_ID as y, kosTopicHandler as Fe, modelTypeEventTopicFactory as Le, DependencyLifecycle as je, getKosModelSync as _, RegistrationManager as d, registerCoreModels as Ne, Trouble as Be, ExtensionManager as w, EXTENSION_TROUBLE_DATA_MAPPER as z } from "@kosdev-code/kos-ui-sdk";
|
|
6
|
+
var xe = Object.defineProperty, He = Object.getOwnPropertyDescriptor, Ge = (e, t, r, o) => {
|
|
7
|
+
for (var s = o > 1 ? void 0 : o ? He(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
8
8
|
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
9
|
-
return o && s &&
|
|
9
|
+
return o && s && xe(t, r, s), s;
|
|
10
10
|
};
|
|
11
|
-
const
|
|
11
|
+
const J = "carb-agitator-model";
|
|
12
12
|
let S = class {
|
|
13
13
|
constructor(e, t, r) {
|
|
14
14
|
i(this, "id");
|
|
@@ -25,25 +25,25 @@ let S = class {
|
|
|
25
25
|
this.logger.debug(`loading carb-agitator ${this.id}`);
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
|
-
S =
|
|
29
|
-
f(
|
|
28
|
+
S = Ge([
|
|
29
|
+
f(J)
|
|
30
30
|
], S);
|
|
31
|
-
const
|
|
31
|
+
const k = new m({
|
|
32
32
|
class: S,
|
|
33
|
-
type:
|
|
33
|
+
type: J
|
|
34
34
|
});
|
|
35
|
-
var
|
|
36
|
-
for (var s = o > 1 ? void 0 : o ?
|
|
35
|
+
var Ke = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, ee = (e, t, r, o) => {
|
|
36
|
+
for (var s = o > 1 ? void 0 : o ? Ue(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
37
37
|
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
38
|
-
return o && s &&
|
|
38
|
+
return o && s && Ke(t, r, s), s;
|
|
39
39
|
};
|
|
40
|
-
const
|
|
41
|
-
let
|
|
40
|
+
const te = "cartridge-agitator-container-model";
|
|
41
|
+
let $ = class {
|
|
42
42
|
constructor(e, t, r) {
|
|
43
43
|
i(this, "id");
|
|
44
44
|
i(this, "logger");
|
|
45
45
|
i(this, "_models");
|
|
46
|
-
this.id = e, this.logger = r.logger, this._models = new
|
|
46
|
+
this.id = e, this.logger = r.logger, this._models = new Ae({
|
|
47
47
|
parentId: e
|
|
48
48
|
});
|
|
49
49
|
}
|
|
@@ -74,35 +74,35 @@ let I = class {
|
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
|
-
|
|
77
|
+
ee([
|
|
78
78
|
$e
|
|
79
|
-
],
|
|
80
|
-
|
|
81
|
-
f(
|
|
82
|
-
],
|
|
83
|
-
const { URL:
|
|
84
|
-
basePath: `${
|
|
85
|
-
}),
|
|
86
|
-
const r = await
|
|
79
|
+
], $.prototype, "_models", 2);
|
|
80
|
+
$ = ee([
|
|
81
|
+
f(te)
|
|
82
|
+
], $);
|
|
83
|
+
const { URL: re } = E("CARTRIDGE_AGITATOR_SERVICE"), { postModel: qe } = M.build({
|
|
84
|
+
basePath: `${re}/api/ext/freestyle/freestyle/ice`
|
|
85
|
+
}), Ye = async (e, t) => {
|
|
86
|
+
const r = await qe({
|
|
87
87
|
model: {},
|
|
88
88
|
tracker: t,
|
|
89
|
-
urlOverride: `${
|
|
89
|
+
urlOverride: `${re}/api/handle/${e}/test`
|
|
90
90
|
});
|
|
91
91
|
if (!(r != null && r.data))
|
|
92
92
|
throw new Error("No response from server");
|
|
93
93
|
return r.data;
|
|
94
94
|
};
|
|
95
|
-
var
|
|
96
|
-
for (var s = o > 1 ? void 0 : o ?
|
|
95
|
+
var Ve = Object.defineProperty, We = Object.getOwnPropertyDescriptor, B = (e, t, r, o) => {
|
|
96
|
+
for (var s = o > 1 ? void 0 : o ? We(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
97
97
|
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
98
|
-
return o && s &&
|
|
98
|
+
return o && s && Ve(t, r, s), s;
|
|
99
99
|
};
|
|
100
|
-
const
|
|
101
|
-
class
|
|
100
|
+
const se = "cartridge-agitator-model";
|
|
101
|
+
class O {
|
|
102
102
|
}
|
|
103
|
-
i(
|
|
104
|
-
const
|
|
105
|
-
let
|
|
103
|
+
i(O, "TOPIC_AGITATION_STARTED", "/kos/events/ddk/agitation-started"), i(O, "TOPIC_AGITATION_ENDED", "/kos/events/ddk/agitation-ended");
|
|
104
|
+
const Ze = Oe("statePath");
|
|
105
|
+
let v = class {
|
|
106
106
|
constructor(e, t, r) {
|
|
107
107
|
i(this, "id");
|
|
108
108
|
i(this, "futureHandler");
|
|
@@ -112,7 +112,7 @@ let _ = class {
|
|
|
112
112
|
i(this, "path");
|
|
113
113
|
i(this, "statePath");
|
|
114
114
|
i(this, "name");
|
|
115
|
-
this.id = e, this.logger = r.logger, this.futureHandler = new
|
|
115
|
+
this.id = e, this.logger = r.logger, this.futureHandler = new Te(this), this.path = t.path, this.name = t.name, this.statePath = t.statePath;
|
|
116
116
|
}
|
|
117
117
|
get isAgitating() {
|
|
118
118
|
return !!this.agitating.value;
|
|
@@ -123,7 +123,7 @@ let _ = class {
|
|
|
123
123
|
async testAgitate(e) {
|
|
124
124
|
if (!e)
|
|
125
125
|
throw new Error("No tracker provided");
|
|
126
|
-
return this.logger.info(`agitating cartridge-agitator ${this.id}`),
|
|
126
|
+
return this.logger.info(`agitating cartridge-agitator ${this.id}`), Ye(this.path, e);
|
|
127
127
|
}
|
|
128
128
|
// -------------------LIFECYCLE----------------------------
|
|
129
129
|
async init() {
|
|
@@ -134,14 +134,14 @@ let _ = class {
|
|
|
134
134
|
(e = this.disposer) == null || e.call(this);
|
|
135
135
|
}
|
|
136
136
|
async load() {
|
|
137
|
-
this.logger.debug(`loading cartridge-agitator ${this.id}`), this.disposer =
|
|
137
|
+
this.logger.debug(`loading cartridge-agitator ${this.id}`), this.disposer = Ce(
|
|
138
138
|
() => this.isAgitating,
|
|
139
139
|
() => {
|
|
140
140
|
var e;
|
|
141
|
-
this.isAgitating ? (this.logger.info(`agitating cartridge-agitator ${this.id}`), K.publish(
|
|
141
|
+
this.isAgitating ? (this.logger.info(`agitating cartridge-agitator ${this.id}`), K.publish(O.TOPIC_AGITATION_STARTED, {
|
|
142
142
|
path: this.path,
|
|
143
143
|
futureId: (e = this.futureHandler.future) == null ? void 0 : e.futureId
|
|
144
|
-
})) : K.publish(
|
|
144
|
+
})) : K.publish(O.TOPIC_AGITATION_ENDED, {
|
|
145
145
|
path: this.path
|
|
146
146
|
});
|
|
147
147
|
},
|
|
@@ -150,28 +150,28 @@ let _ = class {
|
|
|
150
150
|
}
|
|
151
151
|
};
|
|
152
152
|
B([
|
|
153
|
-
Ee({ path:
|
|
154
|
-
],
|
|
153
|
+
Ee({ path: Ze, attribute: "agitating" })
|
|
154
|
+
], v.prototype, "agitating", 2);
|
|
155
155
|
B([
|
|
156
156
|
Me()
|
|
157
|
-
],
|
|
158
|
-
|
|
159
|
-
f(
|
|
160
|
-
],
|
|
161
|
-
const
|
|
162
|
-
class:
|
|
157
|
+
], v.prototype, "testAgitate", 1);
|
|
158
|
+
v = B([
|
|
159
|
+
f(se)
|
|
160
|
+
], v);
|
|
161
|
+
const oe = new m({
|
|
162
|
+
class: v,
|
|
163
|
+
type: se
|
|
164
|
+
}), x = new Q({
|
|
165
|
+
class: $,
|
|
163
166
|
type: te
|
|
164
|
-
}), x = new W({
|
|
165
|
-
class: I,
|
|
166
|
-
type: k
|
|
167
167
|
});
|
|
168
|
-
x.addRelatedModel(
|
|
169
|
-
var
|
|
170
|
-
for (var s = o > 1 ? void 0 : o ?
|
|
168
|
+
x.addRelatedModel(oe);
|
|
169
|
+
var Qe = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, Je = (e, t, r, o) => {
|
|
170
|
+
for (var s = o > 1 ? void 0 : o ? Xe(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
171
171
|
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
172
|
-
return o && s &&
|
|
172
|
+
return o && s && Qe(t, r, s), s;
|
|
173
173
|
};
|
|
174
|
-
const
|
|
174
|
+
const ie = "freestyle-assembly-model", ke = "iceAgitator", et = "carbAgitator";
|
|
175
175
|
let R = class {
|
|
176
176
|
constructor(e, t, r) {
|
|
177
177
|
i(this, "id");
|
|
@@ -226,10 +226,10 @@ let R = class {
|
|
|
226
226
|
}
|
|
227
227
|
// -------------------LIFECYCLE----------------------------
|
|
228
228
|
get supportsIce() {
|
|
229
|
-
return U.isFeatureEnabled(
|
|
229
|
+
return U.isFeatureEnabled(ke);
|
|
230
230
|
}
|
|
231
231
|
get supportsCarb() {
|
|
232
|
-
return U.isFeatureEnabled(
|
|
232
|
+
return U.isFeatureEnabled(et);
|
|
233
233
|
}
|
|
234
234
|
async init() {
|
|
235
235
|
this.logger.debug(`initializing freestyle-assembly ${this.id}`);
|
|
@@ -238,37 +238,37 @@ let R = class {
|
|
|
238
238
|
this.logger.debug(`loading freestyle-assembly ${this.id}`);
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
|
-
R =
|
|
242
|
-
f(
|
|
241
|
+
R = Je([
|
|
242
|
+
f(ie)
|
|
243
243
|
], R);
|
|
244
|
-
const F = new
|
|
244
|
+
const F = new Q({
|
|
245
245
|
class: R,
|
|
246
|
-
type:
|
|
246
|
+
type: ie
|
|
247
247
|
});
|
|
248
|
-
var
|
|
249
|
-
for (var s = o > 1 ? void 0 : o ?
|
|
248
|
+
var tt = Object.defineProperty, rt = Object.getOwnPropertyDescriptor, st = (e, t, r, o) => {
|
|
249
|
+
for (var s = o > 1 ? void 0 : o ? rt(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
250
250
|
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
251
|
-
return o && s &&
|
|
251
|
+
return o && s && tt(t, r, s), s;
|
|
252
252
|
};
|
|
253
|
-
const
|
|
254
|
-
function
|
|
253
|
+
const ae = "freestyle-holder-model";
|
|
254
|
+
function ot(e) {
|
|
255
255
|
const t = we.getContext(e), r = t == null ? void 0 : t.get(
|
|
256
256
|
F.type
|
|
257
257
|
);
|
|
258
258
|
if (!r) {
|
|
259
|
-
|
|
259
|
+
T.error("Freestyle assembly not found");
|
|
260
260
|
return;
|
|
261
261
|
}
|
|
262
262
|
return r;
|
|
263
263
|
}
|
|
264
|
-
async function
|
|
264
|
+
async function it(e, t) {
|
|
265
265
|
if (!e || !t)
|
|
266
266
|
return;
|
|
267
267
|
const r = await e[t]();
|
|
268
268
|
if (r != null && r.tracker)
|
|
269
269
|
return ze.getFuture(r.tracker);
|
|
270
270
|
}
|
|
271
|
-
let
|
|
271
|
+
let L = class {
|
|
272
272
|
constructor(e, t, r) {
|
|
273
273
|
i(this, "id");
|
|
274
274
|
i(this, "logger");
|
|
@@ -283,14 +283,14 @@ let j = class {
|
|
|
283
283
|
if (!this.holder.data.agitated)
|
|
284
284
|
return;
|
|
285
285
|
this.future = void 0;
|
|
286
|
-
const e =
|
|
286
|
+
const e = ot(this.id);
|
|
287
287
|
if (!e)
|
|
288
288
|
return;
|
|
289
289
|
if (!e.defaultCartridgeAgitator) {
|
|
290
290
|
this.logger.error("Agitator not found");
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
|
-
return this.future = await
|
|
293
|
+
return this.future = await it(
|
|
294
294
|
e.defaultCartridgeAgitator,
|
|
295
295
|
"testAgitate"
|
|
296
296
|
), this.future;
|
|
@@ -303,51 +303,51 @@ let j = class {
|
|
|
303
303
|
this.logger.debug(`loading freestyle-holder ${this.id}`);
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
|
-
|
|
307
|
-
f(
|
|
308
|
-
],
|
|
309
|
-
const
|
|
310
|
-
class:
|
|
311
|
-
type:
|
|
312
|
-
}), { URL:
|
|
313
|
-
basePath: `${
|
|
314
|
-
}),
|
|
306
|
+
L = st([
|
|
307
|
+
f(ae)
|
|
308
|
+
], L);
|
|
309
|
+
const q = new m({
|
|
310
|
+
class: L,
|
|
311
|
+
type: ae
|
|
312
|
+
}), { URL: at } = E("FREESTYLE-NOZZLE_SERVICE"), { getOne: nt } = M.build({
|
|
313
|
+
basePath: `${at}/api/freestyle-nozzle`
|
|
314
|
+
}), A = T.createLogger({
|
|
315
315
|
name: "freestyle-nozzle-service",
|
|
316
316
|
group: "Services"
|
|
317
317
|
});
|
|
318
|
-
class
|
|
318
|
+
class lt extends Error {
|
|
319
319
|
constructor(t) {
|
|
320
320
|
super(t), this.name = "NutritionInfoError";
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
class
|
|
323
|
+
class Y extends Error {
|
|
324
324
|
constructor(t) {
|
|
325
325
|
super(t), this.name = "InvalidRequestError";
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
330
|
-
throw
|
|
328
|
+
const dt = async (e, t, r, o = "http://localhost:8081") => {
|
|
329
|
+
if (A.debug("sending GET for freestyle-nozzle"), !t)
|
|
330
|
+
throw A.error("Invalid freestyle-nozzle request: beverageId is required"), new Y("No beverageId provided");
|
|
331
331
|
if (!r || r.length === 0)
|
|
332
|
-
throw
|
|
333
|
-
const s = await
|
|
332
|
+
throw A.error("Invalid freestyle-nozzle request: volumes are required"), new Y("No volumes provided");
|
|
333
|
+
const s = await nt({
|
|
334
334
|
urlOverride: `${o}${e}/pipeline/beverage/engine/nutrition/${t}?volumes=${r.join(
|
|
335
335
|
","
|
|
336
336
|
)}`
|
|
337
337
|
});
|
|
338
338
|
if (!(s != null && s.data))
|
|
339
|
-
throw
|
|
339
|
+
throw A.error("Failed to retrieve freestyle-nozzle data"), new Error("Failed to retrieve freestyle-nozzle data");
|
|
340
340
|
if (s.data.error)
|
|
341
|
-
throw new
|
|
341
|
+
throw new lt(s.data.error);
|
|
342
342
|
return s.data;
|
|
343
343
|
};
|
|
344
|
-
var
|
|
345
|
-
for (var s = o > 1 ? void 0 : o ?
|
|
344
|
+
var ct = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, ut = (e, t, r, o) => {
|
|
345
|
+
for (var s = o > 1 ? void 0 : o ? gt(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
346
346
|
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
347
|
-
return o && s &&
|
|
347
|
+
return o && s && ct(t, r, s), s;
|
|
348
348
|
};
|
|
349
|
-
const
|
|
350
|
-
let
|
|
349
|
+
const ne = "freestyle-nozzle-model";
|
|
350
|
+
let j = class {
|
|
351
351
|
constructor(e, t, r) {
|
|
352
352
|
i(this, "id");
|
|
353
353
|
i(this, "logger");
|
|
@@ -372,12 +372,12 @@ let L = class {
|
|
|
372
372
|
);
|
|
373
373
|
const e = this.nozzleModel.selectedPourable.beverage.rawId, t = this.nozzleModel.urlPrefix;
|
|
374
374
|
try {
|
|
375
|
-
const r = await
|
|
375
|
+
const r = await dt(
|
|
376
376
|
t,
|
|
377
377
|
e,
|
|
378
378
|
this._cupSizes
|
|
379
379
|
);
|
|
380
|
-
|
|
380
|
+
X(() => {
|
|
381
381
|
this._nutritionInfo = r;
|
|
382
382
|
});
|
|
383
383
|
} catch (r) {
|
|
@@ -393,27 +393,27 @@ let L = class {
|
|
|
393
393
|
this.logger.debug(`loading freestyle-nozzle ${this.id}`);
|
|
394
394
|
}
|
|
395
395
|
};
|
|
396
|
-
|
|
396
|
+
j = ut([
|
|
397
397
|
De(),
|
|
398
|
-
f(
|
|
399
|
-
],
|
|
400
|
-
const
|
|
401
|
-
class:
|
|
402
|
-
type:
|
|
403
|
-
}), { URL:
|
|
404
|
-
basePath: `${
|
|
405
|
-
}), D =
|
|
398
|
+
f(ne)
|
|
399
|
+
], j);
|
|
400
|
+
const V = new m({
|
|
401
|
+
class: j,
|
|
402
|
+
type: ne
|
|
403
|
+
}), { URL: le } = E("PUMP_SERVICE"), { postModel: pt } = M.build({
|
|
404
|
+
basePath: `${le}/api/ext/freestyle/microCalibration`
|
|
405
|
+
}), D = T.createLogger({
|
|
406
406
|
name: "freestyle-pump-service",
|
|
407
407
|
group: "Services"
|
|
408
|
-
}),
|
|
408
|
+
}), ht = async (e, t) => {
|
|
409
409
|
var r, o, s, a, n;
|
|
410
410
|
D.debug(
|
|
411
411
|
`replacePump - sending POST request to /api/ext/freestyle/microCalibration/cal/${e}/code/${t}`
|
|
412
412
|
);
|
|
413
413
|
try {
|
|
414
|
-
const l = await
|
|
414
|
+
const l = await pt({
|
|
415
415
|
model: {},
|
|
416
|
-
urlOverride: `${
|
|
416
|
+
urlOverride: `${le}/api/ext/freestyle/microCalibration/cal/${e}/code/${t}`
|
|
417
417
|
});
|
|
418
418
|
return D.debug("replacePump - response:", l), ((l == null ? void 0 : l.status) === 200 || (l == null ? void 0 : l.status) === 499) && ((r = l.data) != null && r.error) ? [l.data.error || "unknownError", l.data] : [void 0, l == null ? void 0 : l.data];
|
|
419
419
|
} catch (l) {
|
|
@@ -421,18 +421,18 @@ const Y = new m({
|
|
|
421
421
|
`replacePump - sending POST request to /api/cal/${e}/code/${t}`,
|
|
422
422
|
l
|
|
423
423
|
), l instanceof Re) {
|
|
424
|
-
const
|
|
425
|
-
return [
|
|
424
|
+
const g = ((s = (o = l.payload) == null ? void 0 : o.data) == null ? void 0 : s.error) || ((a = l.payload) == null ? void 0 : a.error) || "unknownError";
|
|
425
|
+
return [g, ((n = l.payload) == null ? void 0 : n.data) || { error: g }];
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
428
|
return ["unknownError", { error: "unknownError" }];
|
|
429
429
|
};
|
|
430
|
-
var
|
|
431
|
-
for (var s = o > 1 ? void 0 : o ?
|
|
430
|
+
var yt = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, mt = (e, t, r, o) => {
|
|
431
|
+
for (var s = o > 1 ? void 0 : o ? ft(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
432
432
|
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
433
|
-
return o && s &&
|
|
433
|
+
return o && s && yt(t, r, s), s;
|
|
434
434
|
};
|
|
435
|
-
const
|
|
435
|
+
const de = "freestyle-pump-model";
|
|
436
436
|
let N = class {
|
|
437
437
|
constructor(e, t, r) {
|
|
438
438
|
i(this, "id");
|
|
@@ -442,35 +442,35 @@ let N = class {
|
|
|
442
442
|
}
|
|
443
443
|
// -------------------LIFECYCLE----------------------------
|
|
444
444
|
async replacePump(e) {
|
|
445
|
-
const [t, r] = await
|
|
445
|
+
const [t, r] = await ht(this.pump.path, e);
|
|
446
446
|
return t && this.logger.error(`Failed to replace the pump, ${this.pump.id}`, t), [t, r];
|
|
447
447
|
}
|
|
448
448
|
};
|
|
449
|
-
N =
|
|
450
|
-
f(
|
|
449
|
+
N = mt([
|
|
450
|
+
f(de)
|
|
451
451
|
], N);
|
|
452
|
-
const
|
|
452
|
+
const W = new m({
|
|
453
453
|
class: N,
|
|
454
|
-
type:
|
|
455
|
-
}), { URL:
|
|
456
|
-
basePath: `${
|
|
457
|
-
}), ge =
|
|
454
|
+
type: de
|
|
455
|
+
}), { URL: C } = E("ICE_AGITATOR_SERVICE"), { getAll: ce, postModel: bt } = M.build({
|
|
456
|
+
basePath: `${C}/api/ext/freestyle/freestyle/ice`
|
|
457
|
+
}), ge = T.createLogger({
|
|
458
458
|
name: "ice-agitator-service",
|
|
459
459
|
group: "Services"
|
|
460
|
-
}),
|
|
461
|
-
urlOverride: `${
|
|
462
|
-
})),
|
|
463
|
-
urlOverride: `${
|
|
460
|
+
}), _t = async () => (ge.debug("sending GET for ice types"), await ce({
|
|
461
|
+
urlOverride: `${C}/api/ext/freestyle/freestyle/ice/types`
|
|
462
|
+
})), vt = async (e, t) => (ge.debug("sending POST for ice types"), await bt({
|
|
463
|
+
urlOverride: `${C}/api/ext/freestyle/freestyle/ice/type/${e}/${t}`,
|
|
464
464
|
model: {}
|
|
465
|
-
})),
|
|
466
|
-
urlOverride: `${
|
|
465
|
+
})), Pt = async () => await ce({
|
|
466
|
+
urlOverride: `${C}/api/kos/config/details/assembly.core.board:macro.iceAgitator/4`
|
|
467
467
|
});
|
|
468
|
-
var
|
|
469
|
-
for (var s = o > 1 ? void 0 : o ?
|
|
468
|
+
var It = Object.defineProperty, At = Object.getOwnPropertyDescriptor, h = (e, t, r, o) => {
|
|
469
|
+
for (var s = o > 1 ? void 0 : o ? At(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
470
470
|
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
471
|
-
return o && s &&
|
|
471
|
+
return o && s && It(t, r, s), s;
|
|
472
472
|
};
|
|
473
|
-
const
|
|
473
|
+
const ue = "ice-agitator-model";
|
|
474
474
|
let c = class {
|
|
475
475
|
constructor(e, t, r) {
|
|
476
476
|
i(this, "id");
|
|
@@ -488,7 +488,7 @@ let c = class {
|
|
|
488
488
|
i(this, "inactivitySec");
|
|
489
489
|
i(this, "_allIceTypes");
|
|
490
490
|
i(this, "logger");
|
|
491
|
-
i(this, "resetDefaultValues", async () => await
|
|
491
|
+
i(this, "resetDefaultValues", async () => await Pt());
|
|
492
492
|
this.id = e, this.name = t.name, this.path = t.path, this._allIceTypes = [], this.logger = r.logger;
|
|
493
493
|
}
|
|
494
494
|
get iceTypes() {
|
|
@@ -496,15 +496,15 @@ let c = class {
|
|
|
496
496
|
}
|
|
497
497
|
// -------------------LIFECYCLE----------------------------
|
|
498
498
|
async updateIceType(e) {
|
|
499
|
-
await
|
|
499
|
+
await vt(this.id, e);
|
|
500
500
|
}
|
|
501
501
|
async init() {
|
|
502
502
|
this.logger.debug(`initializing ice-agitator ${this.id}`);
|
|
503
503
|
}
|
|
504
504
|
async load() {
|
|
505
505
|
this.logger.debug(`loading ice-agitator ${this.id}`);
|
|
506
|
-
const e = await
|
|
507
|
-
(e == null ? void 0 : e.status) === 200 &&
|
|
506
|
+
const e = await _t();
|
|
507
|
+
(e == null ? void 0 : e.status) === 200 && X(() => {
|
|
508
508
|
this._allIceTypes = e.data || [];
|
|
509
509
|
});
|
|
510
510
|
}
|
|
@@ -576,27 +576,28 @@ h([
|
|
|
576
576
|
})
|
|
577
577
|
], c.prototype, "inactivitySec", 2);
|
|
578
578
|
c = h([
|
|
579
|
-
f(
|
|
579
|
+
f(ue)
|
|
580
580
|
], c);
|
|
581
|
-
const
|
|
581
|
+
const pe = new m({
|
|
582
582
|
class: c,
|
|
583
|
-
type:
|
|
583
|
+
type: ue
|
|
584
584
|
});
|
|
585
|
-
var
|
|
586
|
-
for (var s = o > 1 ? void 0 : o ?
|
|
585
|
+
var $t = Object.defineProperty, Ot = Object.getOwnPropertyDescriptor, H = (e, t, r, o) => {
|
|
586
|
+
for (var s = o > 1 ? void 0 : o ? Ot(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
587
587
|
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
588
|
-
return o && s &&
|
|
588
|
+
return o && s && $t(t, r, s), s;
|
|
589
589
|
};
|
|
590
|
-
const G = "agitation-required-trouble-model",
|
|
590
|
+
const G = "agitation-required-trouble-model", Et = (e) => {
|
|
591
591
|
if (e.data.agitationRequired)
|
|
592
592
|
return G;
|
|
593
|
-
},
|
|
594
|
-
let
|
|
593
|
+
}, Mt = "InsufficientAgitationTrouble";
|
|
594
|
+
let P = class {
|
|
595
595
|
constructor(e, t, r) {
|
|
596
596
|
i(this, "id");
|
|
597
597
|
i(this, "logger");
|
|
598
598
|
i(this, "trouble");
|
|
599
599
|
i(this, "_deferred");
|
|
600
|
+
i(this, "_holdersLoaded", !1);
|
|
600
601
|
i(this, "agitateBeforePour");
|
|
601
602
|
this.id = e, this.logger = r.logger, this._deferred = !1, this.trouble = t.companionParent;
|
|
602
603
|
}
|
|
@@ -604,12 +605,21 @@ let O = class {
|
|
|
604
605
|
return this.trouble.resolve();
|
|
605
606
|
}
|
|
606
607
|
get holder() {
|
|
607
|
-
const e = this.trouble.data.holderPaths[0], t =
|
|
608
|
-
|
|
608
|
+
const e = this.trouble.data.holderPaths[0], t = _(e);
|
|
609
|
+
if (!(!this._holdersLoaded && !t.model))
|
|
610
|
+
return t == null ? void 0 : t.model;
|
|
611
|
+
}
|
|
612
|
+
updateHolder() {
|
|
613
|
+
if (!this._holdersLoaded) {
|
|
614
|
+
const e = this.trouble.data.holderPaths[0];
|
|
615
|
+
_(e).model && (this._holdersLoaded = !0);
|
|
616
|
+
}
|
|
609
617
|
}
|
|
610
618
|
get shouldDefer() {
|
|
611
619
|
var o, s;
|
|
612
|
-
|
|
620
|
+
if (!this.holder)
|
|
621
|
+
return !0;
|
|
622
|
+
const t = (((o = this.holder) == null ? void 0 : o.troublesByType[Mt]) || []).length > 0;
|
|
613
623
|
return !!((s = this.agitateBeforePour) != null && s.value) && t;
|
|
614
624
|
}
|
|
615
625
|
get deferred() {
|
|
@@ -622,41 +632,47 @@ let O = class {
|
|
|
622
632
|
this._deferred = !1;
|
|
623
633
|
}
|
|
624
634
|
};
|
|
625
|
-
|
|
635
|
+
H([
|
|
626
636
|
p({
|
|
627
637
|
path: "app:kosdev.ddk:app",
|
|
628
638
|
attribute: "ncui.agitateBeforePour"
|
|
629
639
|
})
|
|
630
|
-
],
|
|
631
|
-
|
|
640
|
+
], P.prototype, "agitateBeforePour", 2);
|
|
641
|
+
H([
|
|
642
|
+
Fe({
|
|
643
|
+
topic: Le(Z.type),
|
|
644
|
+
lifecycle: je.INIT
|
|
645
|
+
})
|
|
646
|
+
], P.prototype, "updateHolder", 1);
|
|
647
|
+
P = H([
|
|
632
648
|
f(G)
|
|
633
|
-
],
|
|
634
|
-
const
|
|
635
|
-
class:
|
|
649
|
+
], P);
|
|
650
|
+
const Tt = new m({
|
|
651
|
+
class: P,
|
|
636
652
|
type: G
|
|
637
|
-
}),
|
|
638
|
-
iceAgitator:
|
|
639
|
-
carbAgitator:
|
|
640
|
-
},
|
|
653
|
+
}), Ct = ["iceAgitator", "carbAgitator"], wt = {
|
|
654
|
+
iceAgitator: pe.factory,
|
|
655
|
+
carbAgitator: k.factory
|
|
656
|
+
}, Ft = async (e) => {
|
|
641
657
|
const t = x.instance().options({}).build(), r = e.assemblies.reduce((a, n) => {
|
|
642
658
|
var l;
|
|
643
|
-
return
|
|
644
|
-
const b = n[
|
|
659
|
+
return Ct.forEach((g) => {
|
|
660
|
+
const b = n[g];
|
|
645
661
|
if (b) {
|
|
646
|
-
const
|
|
647
|
-
a[
|
|
662
|
+
const I = wt[g](b.path);
|
|
663
|
+
a[g] = I({
|
|
648
664
|
name: b.name,
|
|
649
665
|
path: b.path
|
|
650
666
|
});
|
|
651
667
|
}
|
|
652
|
-
}), (l = n.cartridgeAgitators) == null || l.forEach((
|
|
653
|
-
var
|
|
654
|
-
const b =
|
|
655
|
-
|
|
668
|
+
}), (l = n.cartridgeAgitators) == null || l.forEach((g) => {
|
|
669
|
+
var I;
|
|
670
|
+
const b = oe.instance(
|
|
671
|
+
g.path
|
|
656
672
|
).options({
|
|
657
|
-
name:
|
|
658
|
-
path:
|
|
659
|
-
statePath: ((
|
|
673
|
+
name: g.name,
|
|
674
|
+
path: g.path,
|
|
675
|
+
statePath: ((I = g.state) == null ? void 0 : I.path) || ""
|
|
660
676
|
}).build();
|
|
661
677
|
t.addModel(b);
|
|
662
678
|
}), a;
|
|
@@ -667,18 +683,18 @@ const Ot = new m({
|
|
|
667
683
|
supportsCarb: s,
|
|
668
684
|
supportsIce: o
|
|
669
685
|
};
|
|
670
|
-
},
|
|
671
|
-
me.type,
|
|
672
|
-
Y.type
|
|
673
|
-
), g.companion.register(e)(
|
|
686
|
+
}, zt = (e) => () => (Ne(e)(), me(e)(), V.register(), F.register(), pe.register(), k.register(), x.register(), W.register(), q.register(), d.companion.register(e)(
|
|
674
687
|
be.type,
|
|
688
|
+
V.type
|
|
689
|
+
), d.companion.register(e)(
|
|
690
|
+
Z.type,
|
|
675
691
|
F.type
|
|
676
|
-
),
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
),
|
|
692
|
+
), Tt.register(), d.companion.register(e)(
|
|
693
|
+
Be.type,
|
|
694
|
+
Et
|
|
695
|
+
), d.companion.register(e)(_e.type, W.type), d.companion.register(e)(
|
|
680
696
|
ve.type,
|
|
681
|
-
|
|
697
|
+
q.type
|
|
682
698
|
), w[z].register(
|
|
683
699
|
"EnjoyByTrouble",
|
|
684
700
|
async (t) => {
|
|
@@ -696,12 +712,12 @@ const Ot = new m({
|
|
|
696
712
|
"SuperPumpRequiredTrouble",
|
|
697
713
|
// This is the trouble type
|
|
698
714
|
async (t) => {
|
|
699
|
-
const { model: r } =
|
|
715
|
+
const { model: r } = _(
|
|
700
716
|
Pe.type
|
|
701
717
|
);
|
|
702
718
|
return r ? {
|
|
703
719
|
superPumps: r.models.getIndexByKey(
|
|
704
|
-
|
|
720
|
+
Ie.byType,
|
|
705
721
|
"microSuper"
|
|
706
722
|
).map((a) => a.name).join(", ")
|
|
707
723
|
} : {};
|
|
@@ -712,11 +728,11 @@ const Ot = new m({
|
|
|
712
728
|
if (t.ifaces.includes("container"))
|
|
713
729
|
return {};
|
|
714
730
|
if (t.data.pumpPath) {
|
|
715
|
-
const { model: r } =
|
|
731
|
+
const { model: r } = _(
|
|
716
732
|
t.data.pumpPath
|
|
717
733
|
);
|
|
718
734
|
if (r) {
|
|
719
|
-
const o = r.ingredientId ?
|
|
735
|
+
const o = r.ingredientId ? _(r.ingredientId).model : void 0;
|
|
720
736
|
return {
|
|
721
737
|
ingredientId: r.ingredientId,
|
|
722
738
|
ingredientName: (o == null ? void 0 : o.name) || ""
|
|
@@ -726,40 +742,40 @@ const Ot = new m({
|
|
|
726
742
|
return {};
|
|
727
743
|
}
|
|
728
744
|
), {
|
|
729
|
-
preload:
|
|
730
|
-
model:
|
|
731
|
-
companion:
|
|
732
|
-
legacy:
|
|
745
|
+
preload: d.model.preloadModel(e),
|
|
746
|
+
model: d.model.register(e),
|
|
747
|
+
companion: d.companion.register(e),
|
|
748
|
+
legacy: d.model.registerLegacyModel(e)
|
|
733
749
|
}), u = {
|
|
734
|
-
...
|
|
750
|
+
...fe
|
|
735
751
|
};
|
|
736
752
|
u.freestyle = {
|
|
737
|
-
models:
|
|
753
|
+
models: zt(u)
|
|
738
754
|
};
|
|
739
|
-
u.preload =
|
|
740
|
-
u.model =
|
|
741
|
-
u.companion =
|
|
742
|
-
u.legacy =
|
|
743
|
-
const
|
|
755
|
+
u.preload = d.model.preloadModel(u);
|
|
756
|
+
u.model = d.model.register(u);
|
|
757
|
+
u.companion = d.companion.register(u);
|
|
758
|
+
u.legacy = d.model.registerLegacyModel(u);
|
|
759
|
+
const Lt = u;
|
|
744
760
|
export {
|
|
745
|
-
|
|
746
|
-
|
|
761
|
+
Mt as A,
|
|
762
|
+
k as C,
|
|
747
763
|
F,
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
764
|
+
pe as I,
|
|
765
|
+
Lt as K,
|
|
766
|
+
lt as N,
|
|
751
767
|
x as a,
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
768
|
+
O as b,
|
|
769
|
+
oe as c,
|
|
770
|
+
q as d,
|
|
771
|
+
V as e,
|
|
772
|
+
W as f,
|
|
773
|
+
Tt as g,
|
|
774
|
+
Y as h,
|
|
775
|
+
dt as i,
|
|
776
|
+
ht as j,
|
|
777
|
+
Ft as k,
|
|
778
|
+
ke as l,
|
|
779
|
+
zt as r
|
|
764
780
|
};
|
|
765
|
-
//# sourceMappingURL=freestyle-registration-manager-
|
|
781
|
+
//# sourceMappingURL=freestyle-registration-manager-DkqzBO2O.js.map
|